diff --git a/init/init-lib.pl b/init/init-lib.pl index 1c8e7c7b3..6567c136c 100755 --- a/init/init-lib.pl +++ b/init/init-lib.pl @@ -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 $cmd"),"

\n"; print "

";
+		&clean_environment();
 		&foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
+		&reset_environment();
 		print "
\n"; push(@selacts, $acts[$idx]); } diff --git a/init/start_stop.cgi b/init/start_stop.cgi index 131ebaff3..8131243d3 100755 --- a/init/start_stop.cgi +++ b/init/start_stop.cgi @@ -25,7 +25,9 @@ $SIG{'TERM'} = sub { }; # Run the command print &text('ss_exec', "$cmd"),"

\n"; print "

";
+&clean_environment();
 &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
+&reset_environment();
 print "
\n"; &webmin_log($action, 'action', $in{'name'});