mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Check for empty password in LDAP authentication
This commit is contained in:
parent
1ebfd06cf5
commit
d2b89fb7fc
10
src/auth.c
10
src/auth.c
@ -258,8 +258,14 @@ int auth_verify_password_ldap(LOGBOOK *lbs, const char *user, const char *passwo
|
|||||||
|
|
||||||
ldap_ld = NULL;
|
ldap_ld = NULL;
|
||||||
memset(&ldap_bindDN[0], 0, sizeof(ldap_bindDN));
|
memset(&ldap_bindDN[0], 0, sizeof(ldap_bindDN));
|
||||||
|
|
||||||
if(!ldap_init(lbs,error_str,error_size)) {
|
if (!strcmp(password, "")) {
|
||||||
|
strlcpy(error_str, "<b>LDAP authentication failed, no password provided</b>", error_size);
|
||||||
|
write_logfile(lbs, "LDAP authentication failed, no password provided");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ldap_init(lbs,error_str, error_size)) {
|
||||||
strlcpy(error_str, "<b>LDAP initialization error</b><br>", error_size);
|
strlcpy(error_str, "<b>LDAP initialization error</b><br>", error_size);
|
||||||
strlcat(error_str, "<br>Please check your LDAP configuration.", error_size);
|
strlcat(error_str, "<br>Please check your LDAP configuration.", error_size);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user