fix cwd within sudo
authorMichael Wallner <mike@php.net>
Tue, 27 Feb 2018 13:32:23 +0000 (14:32 +0100)
committerMichael Wallner <mike@php.net>
Tue, 27 Feb 2018 13:32:23 +0000 (14:32 +0100)
src/pharext/ExecCmd.php

index 5a6ee81f6fdad1be6b6eb4756d3c5cf966de58ae..f16d105dd30c808d9ab0a18ee2f26255737ce34a 100644 (file)
@@ -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}");
                }