Always log command run via execute_command
authorJamie Cameron <jcameron@webmin.com>
Thu, 1 Apr 2010 20:43:10 +0000 (13:43 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 1 Apr 2010 20:43:10 +0000 (13:43 -0700)
web-lib-funcs.pl

index 3d95f9c..71149a0 100755 (executable)
@@ -7764,6 +7764,7 @@ if (&is_readonly_mode() && !$safe) {
 $cmd = &translate_command($cmd);
 
 # Use ` operator where possible
+&webmin_debug_log('CMD', "cmd=$cmd") if ($gconfig{'debug_what_cmd'});
 if (!$stdin && ref($stdout) && !$stderr) {
        $cmd = "($cmd)" if ($gconfig{'os_type'} ne 'windows');
        $$stdout = `$cmd 2>$null_file`;
@@ -7778,7 +7779,6 @@ elsif (!$stdin && !$stdout && !$stderr) {
        $cmd = "($cmd)" if ($gconfig{'os_type'} ne 'windows');
        return system("$cmd >$null_file 2>$null_file <$null_file");
        }
-&webmin_debug_log('CMD', "cmd=$cmd") if ($gconfig{'debug_what_cmd'});
 
 # Setup pipes
 $| = 1;                # needed on some systems to flush before forking