[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: bug report ver 0.16, on windows

From: Christof Petig
Subject: Re: [Monotone-devel] Re: bug report ver 0.16, on windows
Date: Wed, 23 Feb 2005 14:05:51 +0100
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1

Jon Bright schrieb:
graydon hoare wrote:

Jon Bright wrote:

Where are fork() and wait() being used?  Should I maybe look at
adding a forkandexec() call (which is supported everywhere), since
Windows has no fork() ?  wait() could then be used with the result of

perhaps. we will need help with this, because it's used to implement
the execution of mergers and editors from lua. see "execute" in
std_hooks.lua. we used to call system(...), but this of course
permitted shell attacks by mangling shell scripts into filenames. joy.
so now we use fork+exec. something similar -- so long as it doesn't
call shell -- would be fine by me.

My basic idea would be to implement using CreateProcess() on Windows,
and just call down to fork/exec on Unix-like systems.  I don't *think*
calling CreateProcess() is abusable (other than maybe by getting a
trojan before the intended .exe in the PATH, but if the attacker can do
this, you've got bigger problems).

If you would be so kind to implement also a pipe+fork+exec function,
that would really help me getting cvssync and ssh support for windows.
It's hard work for me (looking up all the commands and types involved)
but maybe you are much more experienced with the Windows API and can do
it in several minutes.

[i.e. Combining CreatePipe and CreateProcess to get a file descriptor
which writes to the standard input of the command and reads from the
output of the other process]

Does Windows support one file descriptor for reading and writing to a
pipe instead of the pair which is needed on unix?

All I need is a way to do
  int fd=CreatePipeToCommand("ssh","somecomputer","command",0);
  int CreatePipeToCommand(std::vector<const char *> arguments);
  int CreatePipeToCommand(const char *command, va_list args);

(On unix you need to return a pair<int,int>)


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]