GNU bug report logs -
#6784
24.0.50; cmdproxy incosistency with command pathnames
Previous Next
Reported by: Óscar Fuentes <ofv <at> wanadoo.es>
Date: Tue, 3 Aug 2010 15:57:01 UTC
Severity: normal
Found in version 24.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Laimonas Vėbra wrote:
> I guess, that CreateProcess(), in this case, internally processes
> command line args, i.e. program names/paths ('c:/cygwin/bin/ls',
> 'grep'), that it passes to cmd.exe and because command name/path is not
> correctly/appropriately constructed (should be backslashed), it (chain
> CreateProcess()->cmd.exe) fails.
Wrong. Actually it's cmd.exe that fails if command string contains pipe
and (subsequent slashed, not backslashed) program names are not quoted.
Works:
cmd.exe /c c:/cygwin/bin/ls | grep foo
cmd.exe /c c:/cygwin/bin/ls | C:\cygwin\bin\grep foo
cmd.exe /c c:/cygwin/bin/ls | "C:/cygwin/bin/grep" foo
cmd.exe /c "c:/cygwin/bin/ls" | "C:/cygwin/bin/grep" foo
Fails:
cmd.exe /c c:/cygwin/bin/ls | C:/cygwin/bin/grep foo
So it could be fixed in two ways:
1. using windows path naming rules when calling CreateProcess()
2. quoting program names (all or if it contains slashes '/', i.e. is not
backslashed) args when calling CreateProcess()
I'm not sure which one would be easier and more error prone.
This bug report was last modified 14 years and 198 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.