From c209a4e2a8fcd3d71d593b09d33ac78966ee78a3 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 27 Oct 2013 14:39:05 -0700 Subject: [PATCH] Fix error that caused stderr to be lost --- shell/index.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/index.cgi b/shell/index.cgi index 55bb4d398..4d8f25408 100755 --- a/shell/index.cgi +++ b/shell/index.cgi @@ -64,13 +64,13 @@ if (!$in{'clear'}) { delete($ENV{'SCRIPT_NAME'}); # So that called Webmin # programs get the right # module, not this one! - if (&supports_users()) { - $cmd = &command_as_user($user, 0, $cmd)." 2>&1"; + if (&supports_users() && $user ne "root") { + $cmd = &command_as_user($user, 0, $cmd); } else { - $cmd = "($cmd) 2>&1"; + $cmd = "($cmd)"; } - $pid = &open_execute_command(OUTPUT, $cmd, 1, 0); + $pid = &open_execute_command(OUTPUT, $cmd, 2, 0); $out = ""; $trunc = 0; $total = 0;