Fix umounting filesystems mounted on paths with spaces.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57391
-- v4: ntdll: use __wine_unix_spawnvp() to invoke unmount command.
From: Michael Lelli toadking@toadking.com
Fix umounting filesystems mounted on paths with spaces.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57391 --- dlls/ntdll/unix/file.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 44adc4f4626..b1dda750c85 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -3976,22 +3976,21 @@ static NTSTATUS unmount_device( HANDLE handle ) if ((mount_point = get_device_mount_point( st.st_rdev ))) { #ifdef __APPLE__ - static const char umount[] = "diskutil unmount >/dev/null 2>&1 "; + static char diskutil[] = "diskutil"; + static char unmount[] = "unmount"; + char *argv[4] = {diskutil, unmount, mount_point, NULL}; #else - static const char umount[] = "umount >/dev/null 2>&1 "; + static char umount[] = "umount"; + char *argv[3] = {umount, mount_point, NULL}; #endif - char *cmd; - if (asprintf( &cmd, "%s%s", umount, mount_point ) != -1) - { - system( cmd ); - free( cmd ); + + __wine_unix_spawnvp( argv, TRUE ); + #ifdef linux - /* umount will fail to release the loop device since we still have - a handle to it, so we release it here */ - if (major(st.st_rdev) == LOOP_MAJOR) ioctl( unix_fd, 0x4c01 /*LOOP_CLR_FD*/, 0 ); + /* umount will fail to release the loop device since we still have + a handle to it, so we release it here */ + if (major(st.st_rdev) == LOOP_MAJOR) ioctl( unix_fd, 0x4c01 /*LOOP_CLR_FD*/, 0 ); #endif - } - free( mount_point ); } } if (needs_close) close( unix_fd );
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=149538
Your paranoid android.
=== debian11b (64 bit WoW report) ===
winmm: mci: Timeout