mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
cd to home directory before running shell
This commit is contained in:
@@ -38,6 +38,9 @@ if (!$pid) {
|
||||
untie(*STDERR); open(STDERR, ">$logfile");
|
||||
$shell = &has_command("bash") ||
|
||||
&has_command("sh") || "/bin/sh";
|
||||
@uinfo = getpwnam("root");
|
||||
$home = $uinfo[7] || "/";
|
||||
$shell = "$shell -c ".quotemeta("cd '$home' ; exec $shell");
|
||||
exec($python, "ajaxterm.py", "--port", $port, "--log",
|
||||
$config{'autologin'} ? ("--command", $shell) : ( ));
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user