diff --git a/shell/acl_security.pl b/shell/acl_security.pl index 593802afe..5f2108ea9 100755 --- a/shell/acl_security.pl +++ b/shell/acl_security.pl @@ -9,6 +9,9 @@ print &ui_table_row($text{'acl_user'}, &ui_opt_textbox("user", $_[0]->{'user'}, 20, $text{'acl_user_def'})." ". &user_chooser_button("user")); +print &ui_table_row($text{'acl_shellenv'}, + &ui_yesno_radio("shellenv", $_[0]->{'shellenv'})); + print &ui_table_row($text{'acl_chroot'}, &ui_filebox("chroot", $_[0]->{'chroot'}, 30, 0, 0, undef, 1)); } @@ -19,5 +22,6 @@ sub acl_security_save { $_[0]->{'user'} = $in{'user_def'} ? undef : $in{'user'}; $_[0]->{'chroot'} = $in{'chroot'}; +$_[0]->{'shellenv'} = $in{'shellenv'}; } diff --git a/shell/defaultacl b/shell/defaultacl index 8775f00f2..758859301 100644 --- a/shell/defaultacl +++ b/shell/defaultacl @@ -1,2 +1,3 @@ user=root chroot=/ +shellenv=1 diff --git a/shell/index.cgi b/shell/index.cgi index 6111243a6..32335edd4 100755 --- a/shell/index.cgi +++ b/shell/index.cgi @@ -85,7 +85,9 @@ if (!$in{'clear'}) { # programs get the right # module, not this one! if (&supports_users() && $user ne "root") { - $cmd = &command_as_user($user, 2, "cd $pwd ; $cmd"); + $cmd = &command_as_user( + $user, $access{'shellenv'} ? 2 : 0, + "cd $pwd && $cmd"); @uinfo = getpwnam($user); } else { diff --git a/shell/lang/en b/shell/lang/en index 0f19658a9..73a4e0e7d 100644 --- a/shell/lang/en +++ b/shell/lang/en @@ -11,6 +11,8 @@ index_timedout=Command was terminated after running for $1 seconds. acl_user=Execute commands as user acl_user_def=Current Webmin user +acl_shellenv=Use selected user's environment? +acl_chroot=Chroot to directory log_run=Ran command $1 log_clear=Cleared command history