mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Clean environment variables before running init scripts
This commit is contained in:
@@ -1120,7 +1120,9 @@ if ($action_mode eq "init" || $action_mode eq "local") {
|
||||
if (!-x $fn) {
|
||||
return (0, "$fn does not exist");
|
||||
}
|
||||
&clean_environment();
|
||||
local $out = &backquote_logged("$fn start 2>&1 </dev/null");
|
||||
&reset_environment();
|
||||
local $ex = $?;
|
||||
return (!$ex, $out);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,9 @@ if ($start || $stop || $restart) {
|
||||
"stop");
|
||||
print &text('ss_exec', "<tt>$cmd</tt>"),"<p>\n";
|
||||
print "<pre>";
|
||||
&clean_environment();
|
||||
&foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
|
||||
&reset_environment();
|
||||
print "</pre>\n";
|
||||
push(@selacts, $acts[$idx]);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,9 @@ $SIG{'TERM'} = sub { };
|
||||
# Run the command
|
||||
print &text('ss_exec', "<tt>$cmd</tt>"),"<p>\n";
|
||||
print "<pre>";
|
||||
&clean_environment();
|
||||
&foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
|
||||
&reset_environment();
|
||||
print "</pre>\n";
|
||||
&webmin_log($action, 'action', $in{'name'});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user