[PATCH] ssh: use shlex to parse command line

Steve Borho steve at borho.org
Sat Sep 8 19:59:20 CDT 2007


On Sun, 2007-09-09 at 00:11 +0200, Patrick Mézard wrote:
> Steve Borho a écrit :
> > On Sat, 2007-09-08 at 22:55 +0200, Patrick Mézard wrote:
> >> Steve Borho a écrit :
> >>> ... which looks pretty good.  It seems os.popen3() is successfully
> >>> parsing the ssh command name, but the rest of the argument parsing
> >>> (probably a function of the windows shell) is broken.
> >> What about the attached patch (against crew-stable) ?
> >>
> >> Tests pass under windows and macosx but they do not exercize it very 
> >> much and it's hard to build one not looking too kludgy. I think quoting 
> >> all arguments should be harmless under unix but I may be wrong.
> > 
> > Your patch looks pretty similar to mine, so I don't understand why it
> > would work when mine didn't.  What is your ssh command set to under
> > Windows?  Does it start with a quoted command name?
> 
> I just add bonus double-quotes around the whole command to make the 
> windows command processing happy, otherwise it's similar. I tested it 
> with "plink -C", ""c:\program files\plink\plink.exe" -C", and "ssh -C". 
> Maybe I am not testing the right issue, please give me more details if 
> it still fails for you.

Ah, you're right.  The outer quotes were just the "extra magic" needed
to make it work.  Your patch worked fine on my test machine.

-- 
Steve Borho (steve at borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C




More information about the Mercurial-devel mailing list