cd to home directory before running shell

This commit is contained in:
Jamie Cameron
2011-04-29 13:22:41 -07:00
parent 64e91993ed
commit 895886f7a3

View File

@@ -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);