[Top][All Lists]

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

Re: Fixing Windows and DOS command line argument quoting

From: Daniel Colascione
Subject: Re: Fixing Windows and DOS command line argument quoting
Date: Mon, 25 Apr 2011 10:56:07 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20110303 Thunderbird/3.1.9

On 4/25/11 2:22 AM, Daniel Colascione wrote:
> CreateProcess supports 32kb of command line; cmd supports 8kb.  If the
> extra 24kb is important, then we can do what you suggest:
> shell-quote-argument would also to be further modified to only use level
> 2 metacharacters when strictly necessary.  Bear in mind that the new
> limit would apply only to *shell* commands explicitly, not to subprocess
> invocations in general, which would continue to be handled directly by
> the code in w32proc.  Besides, I think it's counter-intuitive for a
> shell pipeline to stop working merely because it contains more than one
> command.

After another reading of cmdproxy.c, I also see that the CreateProcess
path also doesn't expand environment %variable% references, and that
doesn't fall back to cmd if the command to be executed contains them.
While we could expand these variables, doing so would move us even
closer to reimplementing half of cmd.exe.

I'd like to remove this path in the trunk and see whether the new
8192-character length limitation is a problem in practice.  Direct
process execution will not be affected: "shell command" will just mean
"shell command", not "maybe run through the shell if we kinda guess you
really meant to use the shell".

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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