[PATCH 7 of 7] cmdserver: add service that listens on unix domain socket and forks process

Yuya Nishihara yuya at tcha.org
Mon Oct 6 09:40:15 CDT 2014


On Sun, 5 Oct 2014 12:23:29 -0700, Idan Kamara wrote:
> On Sun, Oct 5, 2014 at 7:06 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> > On Sat, 4 Oct 2014 12:40:03 -0700, Idan Kamara wrote:
> >> It would be nice one day to also support TCP sockets so we
> >> have complete platform independence.
> >
> > TCP has no permission check, so it will need something like .Xauthority.
> > Another big issue on Windows is fork().
> 
> Maybe binding to 127.0.0.1 is enough as a start.

IMHO, it's dangerous to allow arbitrary code execution for everyone who
can connect to localhost.

> I assume plain hg serve works in Windows, so why is fork needed?

hgweb uses thread, but commandserver can't because it may chdir, swap stdio
temporarily, load extensions, fork worker processes, etc.

Regards,


More information about the Mercurial-devel mailing list