[Top][All Lists]

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

bug#6784: 24.0.50; cmdproxy incosistency with command pathnames

From: Laimonas Vėbra
Subject: bug#6784: 24.0.50; cmdproxy incosistency with command pathnames
Date: Tue, 03 Aug 2010 23:57:16 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100701 SeaMonkey/2.0.6

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.

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

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.

reply via email to

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