projects
/
webmin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64e9199
)
cd to home directory before running shell
author
Jamie Cameron
<jcameron@webmin.com>
Fri, 29 Apr 2011 20:22:41 +0000
(13:22 -0700)
committer
Jamie Cameron
<jcameron@webmin.com>
Fri, 29 Apr 2011 20:22:41 +0000
(13:22 -0700)
ajaxterm/index.cgi
patch
|
blob
|
history
diff --git
a/ajaxterm/index.cgi
b/ajaxterm/index.cgi
index
478355c
..
bc3ffd8
100755
(executable)
--- 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);