winpr: add cwd support in CreateProcess*

This commit is contained in:
Bernhard Miklautz 2014-02-13 14:26:26 +01:00
parent 909800eca0
commit 24c67267a3

View File

@ -251,6 +251,10 @@ BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags,
if (token->UserId)
setuid((uid_t) token->UserId);
/* TODO: add better cwd handling and error checking */
if (lpCurrentDirectory && strlen(lpCurrentDirectory) > 0)
chdir(lpCurrentDirectory);
}
if (execve(filename, pArgs, envp) < 0)