From: Michael Wallner Date: Tue, 27 Feb 2018 13:32:23 +0000 (+0100) Subject: fix cwd within sudo X-Git-Tag: v4.1.2~7 X-Git-Url: https://git.m6w6.name/?p=pharext%2Fpharext;a=commitdiff_plain;h=f604c0c0a18cd859ebf8237eb0c7bf2786c14302 fix cwd within sudo --- diff --git a/src/pharext/ExecCmd.php b/src/pharext/ExecCmd.php index 5a6ee81..f16d105 100644 --- a/src/pharext/ExecCmd.php +++ b/src/pharext/ExecCmd.php @@ -61,7 +61,7 @@ class ExecCmd * @return int exit status */ private function suExec($command, $verbose = null) { - if (!($proc = proc_open($command, [STDIN,["pipe","w"],["pipe","w"]], $pipes))) { + if (!($proc = proc_open($command, [STDIN,["pipe","w"],["pipe","w"]], $pipes, getcwd()))) { $this->status = -1; throw new Exception("Failed to run {$command}"); }