summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian A. Weber2023-06-22 15:43:58 +0200
committerChristian A. Weber2023-06-22 15:46:19 +0200
commit27507d2b3de7577bcbc5ab3b10fbc73a72152231 (patch)
tree264b3f1fc5e2efa2668fcc5a1031ebb9d35282f9
parent22c5038f6c2829917e9d8598cb8f6f418c2b8304 (diff)
downloaditools-27507d2b3de7577bcbc5ab3b10fbc73a72152231.tar.gz
itools-27507d2b3de7577bcbc5ab3b10fbc73a72152231.tar.bz2
itools-27507d2b3de7577bcbc5ab3b10fbc73a72152231.zip
quote it::exec() args, use timeout for gm convert to avoid checking for ultratimeout
-rw-r--r--it.class6
1 files changed, 2 insertions, 4 deletions
diff --git a/it.class b/it.class
index d55c5a7..0efe3b4 100644
--- a/it.class
+++ b/it.class
@@ -299,7 +299,7 @@ static function error($p = array(), $extra = null)
$body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : "";
$body .= $reqbody ? "\$reqbody: " . var_export($reqbody, true) . "\n\n" : "";
$body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : "";
- $body .= $_SERVER['REMOTE_ADDR'] ? "" : "Pstree:\n" . it::exec("pstree -als " . getmypid() . " | head -n -3") . "\n";
+ $body .= $_SERVER['REMOTE_ADDR'] ? "" : "Pstree:\n" . it::exec("pstree -als {pid} | head -n -3", ['pid' => getmypid()]) . "\n";
$body .= $_SERVER ? "\$_SERVER: " . var_export($_SERVER, true) . "\n\n" : "";
$body .= $_FILES ? "\$_FILES: " . var_export($_FILES, true) . "\n\n" : "";
$body .= "Processes:\n" . it::exec('ps auxf | egrep -v "rotatelogs|getbanner|logaction|httpd|systemd|sd-pam"|egrep "^www|^cron"') . "\n";
@@ -857,10 +857,8 @@ static function imageconvert($p)
if (!$p['keepalpha'])
$p['-opts'] = array_merge(array('-flatten' => true), $p['-opts']); # Option -flatten must be first
- $ultratimeout = file_exists("/opt/ultra/bin/ultratimeout") ? "/opt/ultra/bin/ultratimeout 30 " : "";
-
if (in_array($type, explode(',', $p['types']))) # Valid type?
- $cmdoutput = it::exec('( ' . $ultratimeout . 'gm convert -limit threads 2 +profile "*" 2>&1 {-opts} {in} {type}:{out} || echo "SHELL ERROR $?" ) | grep -Ev "( iCCP: | Invalid SOS parameters for sequential JPEG | profile matches .* but writing .* instead | inconsistent chromacities )"', $p);
+ $cmdoutput = it::exec('( timeout 30s gm convert -limit threads 2 +profile "*" 2>&1 {-opts} {in} {type}:{out} || echo "SHELL ERROR $?" ) | grep -Ev "( iCCP: | Invalid SOS parameters for sequential JPEG | profile matches .* but writing .* instead | inconsistent chromacities )"', $p);
if ($p['pngcrush'] && $p['type'] == "png")
it::exec('pngcrush.sh 2>/dev/null {out} {out}.tmp && mv {out}.tmp {out} || rm {out}.tmp', $p);