Alexandre Julliard : ntdll: Set the Unix current directory also in the exec process case.

Alexandre Julliard julliard at winehq.org
Mon Jun 22 15:55:57 CDT 2020


Module: wine
Branch: master
Commit: 6ff0bb786c43ac3348dec6a977feb36af8bc4bcf
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6ff0bb786c43ac3348dec6a977feb36af8bc4bcf

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 22 11:44:09 2020 +0200

ntdll: Set the Unix current directory also in the exec process case.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49425
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/process.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c
index 974ef6b127..804985da4d 100644
--- a/dlls/ntdll/unix/process.c
+++ b/dlls/ntdll/unix/process.c
@@ -589,7 +589,7 @@ NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTST
 {
     pe_image_info_t pe_info;
     BOOL is_child_64bit;
-    int socketfd[2];
+    int unixdir, socketfd[2];
     char **argv;
     HANDLE handle;
 
@@ -615,6 +615,8 @@ NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTST
         return status;
     }
 
+    unixdir = get_unix_curdir( NtCurrentTeb()->Peb->ProcessParameters );
+
     if (socketpair( PF_UNIX, SOCK_STREAM, 0, socketfd ) == -1) return STATUS_TOO_MANY_OPENED_FILES;
 #ifdef SO_PASSCRED
     else
@@ -637,6 +639,7 @@ NTSTATUS CDECL exec_process( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTST
     if (!status)
     {
         if (!(argv = build_argv( cmdline, 2 ))) return STATUS_NO_MEMORY;
+        fchdir( unixdir );
         do
         {
             status = exec_wineloader( argv, socketfd[0], is_child_64bit,




More information about the wine-cvs mailing list