mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add option to not use user's shell
This commit is contained in:
@@ -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'};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
user=root
|
||||
chroot=/
|
||||
shellenv=1
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user