diff --git a/ajaxterm/index.cgi b/ajaxterm/index.cgi index 478355c1c..bc3ffd8f8 100755 --- a/ajaxterm/index.cgi +++ b/ajaxterm/index.cgi @@ -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);