https://bugs.winehq.org/show_bug.cgi?id=40952
Bug ID: 40952 Summary: improper escaping of quotes in command line Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: programmerjake@gmail.com Distribution: ---
invalid quoted argument generation from argv in build_command_line
doesn't double backslashes before the closing quote.
https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/process.c#L752
demo (from bash): wine cmd /c echo ' ' wine cmd /c echo ' \' wine cmd /c echo ' \' wine cmd /c echo ' "' wine cmd /c echo ' \"' wine cmd /c echo ' \"' outputs: " " " \" " \" " \"" " \\"" " \\\"" should output: " \" " \\" " \\\" " \"" " \\"" " \\\""
https://bugs.winehq.org/show_bug.cgi?id=40952
programmerjake@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |programmerjake@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=40952
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #1 from winetest@luukku.com --- Can you provide a patch for correct behaviour?
https://bugs.winehq.org/show_bug.cgi?id=40952
--- Comment #2 from programmerjake@gmail.com --- Created attachment 57027 --> https://bugs.winehq.org/attachment.cgi?id=57027 fix command line argument escaping in build_command_line
https://bugs.winehq.org/show_bug.cgi?id=40952
--- Comment #3 from winetest@luukku.com --- (In reply to programmerjake from comment #2)
Created attachment 57027 [details] fix command line argument escaping in build_command_line
The last step would be to send it over wine-patches list for merging.
You need to use full real name.
https://wiki.winehq.org/Submitting_Patches
If it's good then it might get merged even today and would benefit all wine users.
https://bugs.winehq.org/show_bug.cgi?id=40952
--- Comment #4 from Vincent Povirk madewokherd@gmail.com --- Created attachment 57210 --> https://bugs.winehq.org/attachment.cgi?id=57210 test program to show how command line is unescaped
Since I've been asked to review the patch, I made a test program to see how CommandLineToArgvW, which is supposed to be the inverse operation, behaves.
https://bugs.winehq.org/show_bug.cgi?id=40952
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=40952
programmerjake@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #57027|0 |1 is obsolete| |
--- Comment #5 from programmerjake@gmail.com --- Created attachment 57211 --> https://bugs.winehq.org/attachment.cgi?id=57211 fixed patch
I fixed the patch to correctly handle tabs. I didn't check for them in the previous patch.
https://bugs.winehq.org/show_bug.cgi?id=40952
programmerjake@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #57211|0 |1 is obsolete| |
--- Comment #6 from programmerjake@gmail.com --- Created attachment 57232 --> https://bugs.winehq.org/attachment.cgi?id=57232 fix
https://bugs.winehq.org/show_bug.cgi?id=40952
--- Comment #7 from programmerjake@gmail.com --- Created attachment 57233 --> https://bugs.winehq.org/attachment.cgi?id=57233 test for patch as c++11 program
added a test of fixed code
https://bugs.winehq.org/show_bug.cgi?id=40952
fjfrackiewicz@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fjfrackiewicz@gmail.com
--- Comment #8 from fjfrackiewicz@gmail.com --- Looks like the patch got committed: http://source.winehq.org/git/wine.git/commit/c7ad47e9b29971509d8ea76e918b6f6...
https://bugs.winehq.org/show_bug.cgi?id=40952
programmerjake@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #9 from programmerjake@gmail.com --- patch committed: http://source.winehq.org/git/wine.git/commit/c7ad47e9b29971509d8ea76e918b6f6...
https://bugs.winehq.org/show_bug.cgi?id=40952
programmerjake@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |c7ad47e9b29971509d8ea76e918 | |b6f623ca52a17
https://bugs.winehq.org/show_bug.cgi?id=40952
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.2.
https://bugs.winehq.org/show_bug.cgi?id=40952
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=40952
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #11 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.1.