mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Support using remote user
This commit is contained in:
20
xterm/acl_security.pl
Normal file
20
xterm/acl_security.pl
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
require 'xterm-lib.pl';
|
||||
|
||||
# acl_security_form(&options)
|
||||
# Output HTML for editing security options for the xterm module
|
||||
sub acl_security_form
|
||||
{
|
||||
my ($o) = @_;
|
||||
|
||||
print &ui_table_row($text{'acl_user'},
|
||||
&ui_opt_textbox("user", $o->{'user'} eq '*' ? undef : $o->{'user'},
|
||||
20, $text{'acl_sameuser'}));
|
||||
}
|
||||
|
||||
sub acl_security_save
|
||||
{
|
||||
my ($o) = @_;
|
||||
|
||||
$o->{'user'} = $in{'user_def'} ? '*' : $in{'user'};
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
# XXX don't grant to new users
|
||||
# XXX ACL to run as remote user
|
||||
# XXX Virtualmin integration?
|
||||
# XXX how to launch a login shell?
|
||||
|
||||
require './xterm-lib.pl';
|
||||
|
||||
@@ -46,6 +47,10 @@ if (!-r $shellserver_cmd) {
|
||||
&cron::create_wrapper($shellserver_cmd, $module_name, "shellserver.pl");
|
||||
}
|
||||
my $user = $access{'user'};
|
||||
if ($user eq "*") {
|
||||
$user = $remote_user;
|
||||
}
|
||||
getpwnam($user) || &error(&text('index_euser', $user));
|
||||
my $tmpdir = &tempname_dir();
|
||||
$ENV{'SESSION_ID'} = $main::session_id;
|
||||
&system_logged("$shellserver_cmd $port $user >$tmpdir/ws-$port.out 2>&1 </dev/null &");
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
index_title=Interactive Shell
|
||||
index_cpan=The Perl module <tt>$1</tt> needed to accept Websockets connections is not available, but you can install it automatically using Webmin's <a href='$2'>Perl Modules</a> module.
|
||||
index_euser=User $1 to run the shell as does not exist!
|
||||
|
||||
acl_user=Run shell as Unix user
|
||||
acl_sameuser=Same as Webmin login
|
||||
|
||||
Reference in New Issue
Block a user