From 24f1f4bff36498b90d84cc81ee39daa7f8a79937 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 8 Aug 2024 07:24:59 -0500 Subject: [PATCH] Skip checking a password for the LDAP authentication module if not given. This fixes issue #2496. --- lib/WeBWorK/Authen/LDAP.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/WeBWorK/Authen/LDAP.pm b/lib/WeBWorK/Authen/LDAP.pm index a49dce3bd2..af2e5b83ef 100644 --- a/lib/WeBWorK/Authen/LDAP.pm +++ b/lib/WeBWorK/Authen/LDAP.pm @@ -29,6 +29,9 @@ sub checkPassword { debug("LDAP module is doing the password checking.\n"); + # Don't attempt to check a password if one wasn't entered. + return 0 unless $possibleClearPassword =~ /\S/; + # check against LDAP server my $ret = $self->ldap_authen_uid($userID, $possibleClearPassword); return 1 if ($ret == 1);