On Wed, Feb 6, 2013 at 2:18 PM, Matt Welland <estifo...@gmail.com> wrote:

> Hmmm...  your point about the remote login is curious. I assumed that
> fossil was doing something like this (I'm using faux code here):
>
> inport, outport = popen2("ssh", "-e", "none", "user@host", "fossil", ... )
>
> but it sounds like what is actually being done is (I have not grokked the
> code well enough to confirm yet) the following:
>
> inport, outport = popen2("ssh", "-e", "none", "user@host", "/bin/sh")
> ...
> print outport "fossil ... params"
>

Fossil needs to run multiple commands.  /bin/sh is convenient to do this.
If that is a really serious problem for the occasional csh system, then we
could, in theory, create a new fossil command to take care of that for us:
"fossil test-sh".  Then run:

    popen2("ssh", "-e", "none", "user@host", "fossil", "test-sh");

It seems silly to have to duplicate the functionality of /bin/sh inside of
Fossil though, doesn't it?




>
> and the hypothesis is that svn and hg use the first approach which
> bypasses whatever the issue is with tcsh?
>
>  Aside, I read the man page but don't understand why "/bin/sh" is in the
> call to execl twice. The second call seems to be running zCmd as a comand.
> Is this to deal with shell escaping hell?
>
> execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0);
>

That's the way execl() works.  First argument is the filename of the new
image.  Second argument is argv[0].  Third argument is argv[1].  And so
forth.  There is no good reason to have argv[0] different from the filename
of the new image - I think that capability is legacy.

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to