On Wed, Feb 6, 2013 at 1:52 PM, Richard Hipp <d...@sqlite.org> wrote:

>
>
> On Wed, Feb 6, 2013 at 3:39 PM, Matt Welland <estifo...@gmail.com> wrote:
>
>>
>> On Wed, Feb 6, 2013 at 12:27 PM, Richard Hipp <d...@sqlite.org> wrote:
>>
>>>
>>>
>>> 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?
>>>
>>
>> Agreed! Also, this may or may not even fix the problem. Now that you
>> describe this I realize I was assuming the problem was on the remote side.
>> If it was the remote side then the popen call will have nothing to do with
>> it since the /bin/sh is happening on the local side.
>>
>> The layers should be ....
>>
>> Local side:  /bin/sh -> ssh
>> Remote side: /bin/tcsh -> fossil
>>
>
> The command:
>
>    ssh -e none user@host /bin/sh
>
> should cause /bin/sh to be run on the remote side, without a pseudo-tty.
> So, I'm not sure where tcsh even comes into play here.  Maybe if you try
> changing the initialization command to:
>
>   ssh -e none user@host exec /bin/sh
>
> Does that make a difference?
>

Yes. The following patch appears to fix the problem:

$ fsl diff
Index: src/http_transport.c
==================================================================
--- src/http_transport.c
+++ src/http_transport.c
@@ -222,10 +222,12 @@
       zHost = mprintf("%s", g.urlName);
     }
     blob_append(&zCmd, " ", 1);
     shell_escape(&zCmd, zHost);
     fossil_print(" %s\n", zHost);  /* Show the conclusion of the SSH
command */
+    blob_append(&zCmd, " exec /bin/sh", -1);
+    fossil_print(" ==> %s\n",blob_str(&zCmd));
     free(zHost);
     popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
     if( sshPid==0 ){
       fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
     }
@@ -248,10 +250,11 @@
   int rc = 0;
   if( transport.isOpen==0 ){
     if( g.urlIsSsh ){
       Blob cmd;
       blob_zero(&cmd);
+      /* blob_append(&cmd, "exec ", -1); */
       shell_escape(&cmd, g.urlFossil);
       blob_append(&cmd, " test-http ", -1);
       shell_escape(&cmd, g.urlPath);
       /* printf("%s\n", blob_str(&cmd)); fflush(stdout); */
       fprintf(sshOut, "%s\n", blob_str(&cmd));



>
> --
> 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
>
>
_______________________________________________
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