mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
baseuser is needed when validating a session
This commit is contained in:
11
miniserv.pl
11
miniserv.pl
@@ -2016,7 +2016,9 @@ if ($config{'userfile'}) {
|
||||
}
|
||||
if ($authuser) {
|
||||
# We got a session .. but does the user still exist?
|
||||
my $auser = &get_user_details($authuser);
|
||||
my @can = &can_user_login($authuser, undef, $host);
|
||||
$baseauthuser = $can[3] || $authuser;
|
||||
my $auser = &get_user_details($baseauthuser, $authuser);
|
||||
if (!$auser) {
|
||||
print STDERR "Session $session_id is for user ",
|
||||
"$authuser who does not exist\n";
|
||||
@@ -2162,8 +2164,10 @@ if ($config{'userfile'}) {
|
||||
}
|
||||
else {
|
||||
# Get the real Webmin username
|
||||
local @can = &can_user_login($authuser, undef, $host);
|
||||
$baseauthuser = $can[3] || $authuser;
|
||||
if (!$baseauthuser) {
|
||||
local @can = &can_user_login($authuser, undef, $host);
|
||||
$baseauthuser = $can[3] || $authuser;
|
||||
}
|
||||
|
||||
if ($config{'remoteuser'} && !$< && $validated) {
|
||||
# Switch to the UID of the remote user (if he exists)
|
||||
@@ -6344,7 +6348,6 @@ $token =~ s/\s+$//;
|
||||
$token || return "No two-factor token entered";
|
||||
$uinfo->{'twofactor_provider'} || return undef;
|
||||
pipe(TOKENr, TOKENw);
|
||||
print STDERR join(" ", $config{'twofactor_wrapper'}, $user, $uinfo->{'twofactor_provider'}, $uinfo->{'twofactor_id'}, $token, $uinfo->{'twofactor_apikey'}),"\n";
|
||||
my $pid = &execute_webmin_command($config{'twofactor_wrapper'},
|
||||
[ $user, $uinfo->{'twofactor_provider'}, $uinfo->{'twofactor_id'},
|
||||
$token, $uinfo->{'twofactor_apikey'} ],
|
||||
|
||||
Reference in New Issue
Block a user