mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add extra check to make sure the sudo-capable user is actually capable
This commit is contained in:
@@ -19,7 +19,11 @@ $in{'email_def'} || $in{'email'} =~ /^\S+\@\S+$/ ||
|
||||
&error($text{'forgot_eemail'});
|
||||
my $unixuser;
|
||||
if (defined($in{'unix_def'}) && !$in{'unix_def'}) {
|
||||
&foreign_require("useradmin");
|
||||
getpwnam($in{'unix'}) || &error($text{'forgot_eunix'});
|
||||
my $sudo = &useradmin::can_user_sudo_root($in{'user'});
|
||||
&error($text{'forgot_enosudo'}) if ($sudo < 0);
|
||||
&error($text{'forgot_ecansudo'}) if (!$sudo);
|
||||
$unixuser = $in{'unix'};
|
||||
}
|
||||
|
||||
|
||||
@@ -531,5 +531,8 @@ forgot_adminmsg=You are receiving this email from the administrator of the Webmi
|
||||
forgot_sending=Sending password reset email for $2 to $1 ..
|
||||
forgot_sent=.. sent!
|
||||
forgot_link=The link below can be used to reset the Webmin password for $1 for the next $2 minutes :
|
||||
forgot_enosudo=Sudo is not available on this system!
|
||||
forgot_ecansudo=The user entered does not have sudo permissions
|
||||
forgot_eunix=The sudo-capable user entered does not exist!
|
||||
|
||||
__norefs=1
|
||||
|
||||
Reference in New Issue
Block a user