add 'exec' to command call

This commit is contained in:
Uwe Steinmann 2021-03-25 15:42:28 +01:00
parent e480fb6c6f
commit 086a231b1f

View File

@ -79,7 +79,11 @@ class SeedDMS_Preview_Base {
$pipes = array();
$timeout += time();
$process = proc_open($cmd, $descriptorspec, $pipes);
// Putting an 'exec' before the command will not fork the command
// and therefore not create any child process. proc_terminate will
// then reliably terminate the cmd and not just shell. See notes of
// https://www.php.net/manual/de/function.proc-terminate.php
$process = proc_open('exec '.$cmd, $descriptorspec, $pipes);
if (!is_resource($process)) {
throw new Exception("proc_open failed on: " . $cmd);
}