From 44e2293a87f3e730d9b865927bfc5ff069ffed88 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 19 Dec 2011 16:44:20 -0800 Subject: [PATCH] Always run commands in sub-shell, to catch missing binaries --- web-lib-funcs.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 21f166ade..bbab6fece 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -5620,6 +5620,10 @@ $cmd =~ s/^\((.*)\)\s*$/$1/; $cmd .= $and; &additional_log('exec', undef, $cmd); &webmin_debug_log('CMD', "cmd=$cmd") if ($gconfig{'debug_what_cmd'}); +if ($realcmd !~ /;|\&\&|\|/) { + # Force run in shell, to get useful output if command doesn't exist + $realcmd = "($realcmd)"; + } return `$realcmd`; } @@ -5678,6 +5682,10 @@ if (&is_readonly_mode() && !$_[1]) { } my $realcmd = &translate_command($_[0]); &webmin_debug_log('CMD', "cmd=$realcmd") if ($gconfig{'debug_what_cmd'}); +if ($realcmd !~ /;|\&\&|\|/) { + # Force run in shell, to get useful output if command doesn't exist + $realcmd = "($realcmd)"; + } return `$realcmd`; }