change in handling quotes in cygwin package from 3.1.4-1 to 3.1.5-1
Josh Thompson
josh_thompson@ncsu.edu
Mon Jun 15 16:21:28 GMT 2020
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Cygwin community,
I'm a developer on the Apache VCL project which is a private cloud management
platform. We've used Cygwin for many years to allow VCL management systems to
ssh in to Windows nodes to manage them. We're very grateful for the Cygwin
project and how helpful it has been to us for many years. :)
We recently noticed a change in double quote (") handling that is causing a
command we issue to fail. The command is:
cmd.exe /c "mkdir \"C:/Cygwin/home/root/VCL\""
In 3.1.4-1 and previous versions, the command works as expected.
In 3.1.5-1, it returns this error:
The filename, directory name, or volume label syntax is incorrect.
The command is being issued to a bash shell that is opened over ssh. I really
don't know why it was decided to use cmd.exe to launch mkdir instead of just
using mkdir through bash, but that's how the VCL code currently is. The
command is in a utility function that can be passed various paths to create.
In the case listed above, the escaped quotes wouldn't be needed. However, if
the path passed in contained any spaces, the quotes become necessary.
I chatted with jturney and avih on IRC about this (thanks jturney and avih!).
jturney pointed out using echo instead of mkdir also illustrated the problem.
in 3.1.4:
$ cmd.exe /c "echo \"C:/Cygwin/home/root/VCL\""
"C:/Cygwin/home/root/VCL"
in 3.1.5:
$ cmd.exe /c "echo \"C:/Cygwin/home/root/VCL\""
\"C:/Cygwin/home/root/VCL\"
And, this can be simplified even more to just
3.1.4:
$ cmd.exe /c "echo \""
"
3.1.5:
$ cmd.exe /c "echo \""
\"
avih brought up a valid point that it may now be quoting the quotes since they
are part of the argument list. However, I can't come up with the proper
escaping of things to use mkdir to create a directory with a space in it with
the new behavior.
jturney asked if I would email this list about the issue.
Thanks for any help!
Josh Thompson
- --
- -------------------------------
Josh Thompson
VCL Developer
North Carolina State University
my GPG/PGP key can be found on pool.sks-keyservers.net
All electronic mail messages in connection with State business which
are sent to or received by this account are subject to the NC Public
Records Law and may be disclosed to third parties.
-----BEGIN PGP SIGNATURE-----
iF0EARECAB0WIQRMIdRtWXideTZDK31X8tBw1209AwUCXuegCAAKCRBX8tBw1209
A09tAJ0f2c3/9LaHdYxbprt6IRem8i90ogCfeUNV0SQJFKfIMo8klnr+EiX+oNE=
=Dzm0
-----END PGP SIGNATURE-----
More information about the Cygwin
mailing list