fix #8053: auth: accept "0" as password for pam and pve realms
Both plugins rejected the password with a plain boolean check, and in Perl the string "0" is false. So a user whose password is "0" could never log in, getting a generic authentication failure. Only reject undefined or empty passwords. Signed-off-by: Michal Fox <me@dualfroz.com>
This commit is contained in:
1 parent
4a5784c546
commit
7676330a5c
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ sub authenticate_user {
|
||||
my ($class, $config, $realm, $username, $password) = @_;
|
||||
|
||||
# user (www-data) need to be able to read /etc/passwd /etc/shadow
|
||||
die "no password\n" if !$password;
|
||||
die "no password\n" if !defined($password) || $password eq '';
|
||||
|
||||
# PAM modules may temporarily override $SIG{CHLD}, causing SIGCHLDs from
|
||||
# RESTEnvironment workers to be lost. Running the PAM interaction in a fork
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ sub options {
|
||||
sub authenticate_user {
|
||||
my ($class, $config, $realm, $username, $password) = @_;
|
||||
|
||||
die "no password\n" if !$password;
|
||||
die "no password\n" if !defined($password) || $password eq '';
|
||||
|
||||
my $shadow_cfg = cfs_read_file($shadowconfigfile);
|
||||
|
||||
|
||||
Reference in new issue
Block a user