[Bug 40952] New: improper escaping of quotes in command line
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(a)winehq.org Reporter: programmerjake(a)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: " \\" " \\\\" " \\\\\\" " \\\"" " \\\\\"" " \\\\\\\"" -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 programmerjake(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |programmerjake(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest(a)luukku.com --- Comment #1 from winetest(a)luukku.com --- Can you provide a patch for correct behaviour? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 --- Comment #2 from programmerjake(a)gmail.com --- Created attachment 57027 --> https://bugs.winehq.org/attachment.cgi?id=57027 fix command line argument escaping in build_command_line -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 --- Comment #3 from winetest(a)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. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 --- Comment #4 from Vincent Povirk <madewokherd(a)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. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 Vincent Povirk <madewokherd(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 programmerjake(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57027|0 |1 is obsolete| | --- Comment #5 from programmerjake(a)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. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 programmerjake(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57211|0 |1 is obsolete| | --- Comment #6 from programmerjake(a)gmail.com --- Created attachment 57232 --> https://bugs.winehq.org/attachment.cgi?id=57232 fix -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 --- Comment #7 from programmerjake(a)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 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 fjfrackiewicz(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fjfrackiewicz(a)gmail.com --- Comment #8 from fjfrackiewicz(a)gmail.com --- Looks like the patch got committed: http://source.winehq.org/git/wine.git/commit/c7ad47e9b29971509d8ea76e918b6f6... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 programmerjake(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #9 from programmerjake(a)gmail.com --- patch committed: http://source.winehq.org/git/wine.git/commit/c7ad47e9b29971509d8ea76e918b6f6... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 programmerjake(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |c7ad47e9b29971509d8ea76e918 | |b6f623ca52a17 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #10 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 2.2. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 Michael Stefaniuc <mstefani(a)redhat.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40952 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |--- --- Comment #11 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 2.0.x milestone from bugs included in 2.0.1. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org