[Bug 57391] New: FSCTL_DISMOUNT_VOLUME does not work on drives with spaces in path
https://bugs.winehq.org/show_bug.cgi?id=57391 Bug ID: 57391 Summary: FSCTL_DISMOUNT_VOLUME does not work on drives with spaces in path Product: Wine Version: 9.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs(a)winehq.org Reporter: toadking(a)toadking.com Distribution: --- After investigating, it looks like the FSCTL_DISMOUNT_VOLUME ioctl is implemented by manually calling `umount` on the volume's mount path, but the program is invoked using `system` instead of via other methods. This means spaces in the volume path are not handled correctly and the volume is never actually unmounted. Reproduction: * Insert a DVD/Blu-ray and mount it at a path including a space. * Run `wine eject <drive letter>: Results: Drive is not ejected Expected: Drive is rejected Attached are strace calls on two paths (one with a space, one without) showing the issue. -- 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=57391 --- Comment #1 from Michael Lelli <toadking(a)toadking.com> --- Created attachment 77368 --> https://bugs.winehq.org/attachment.cgi?id=77368 strace of wine eject on a Blu-ray with space -- 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=57391 --- Comment #2 from Michael Lelli <toadking(a)toadking.com> --- Created attachment 77369 --> https://bugs.winehq.org/attachment.cgi?id=77369 strace of wine eject on a Blu-ray without space -- 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=57391 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4(a)web.de --- Comment #3 from Fabian Maurer <dark.shadow4(a)web.de> --- Created attachment 77371 --> https://bugs.winehq.org/attachment.cgi?id=77371 patch Not sure how that entire unmount is supposed to work, "wine eject" does nothing for me. Not sure how it would work, without admin rights. Anyways, I think I located the place, and added quotation, does this fix the issue? -- 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=57391 --- Comment #4 from Michael Lelli <toadking(a)toadking.com> --- Created attachment 77372 --> https://bugs.winehq.org/attachment.cgi?id=77372 fork/exec patch The quotes fix the issue partially, but the error would still appear if the mount path has quotation marks in it. Not common but they are allowed. I made an alternative patch that does a fork/exec to launch the program instead of system. That way there doesn't need to be any shell escaping. It works on my system with a disc mounted with udisks that includes a space in its label (which is how I hit the bug in the first place). strace after my patch: [pid 337484] clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLDstrace: Process 337485 attached , child_tidptr=0xf682a4e8) = 337485 [pid 337485] execve("/usr/local/sbin/umount", ["umount", "/run/media/michael/Untitled Project"], 0xffd258c4 /* 91 vars */) = -1 ENOENT (No such file or directory) [pid 337485] execve("/usr/local/bin/umount", ["umount", "/run/media/michael/Untitled Project"], 0xffd258c4 /* 91 vars */) = -1 ENOENT (No such file or directory) [pid 337485] execve("/usr/bin/umount", ["umount", "/run/media/michael/Untitled Project"], 0xffd258c4 /* 91 vars */) = 0 -- 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=57391 --- Comment #5 from Fabian Maurer <dark.shadow4(a)web.de> --- Right, I missed that. Not sure why "system" as used to begin with, but your approach seems sensible. Will you create a MR for that? -- 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=57391 --- Comment #6 from Michael Lelli <toadking(a)toadking.com> --- MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/6790 -- 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=57391 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |2b40756536ab9bdcbce8b6ea245 | |55f58e06c25ca Status|UNCONFIRMED |RESOLVED --- Comment #7 from Fabian Maurer <dark.shadow4(a)web.de> --- Fixed by https://gitlab.winehq.org/wine/wine/-/commit/2b40756536ab9bdcbce8b6ea24555f5... -- 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=57391 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #8 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 9.22. -- 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)
-
WineHQ Bugzilla