From 6ff0bb786c43ac3348dec6a977feb36af8bc4bcf Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 22 Jun 2020 11:44:09 +0200 Subject: [PATCH] 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 --- 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 974ef6b1278..804985da4d7 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,