From 338841043cb656f4a5358f709b0cd0fdaa945894 Mon Sep 17 00:00:00 2001 From: ritt Date: Wed, 8 Feb 2023 08:42:08 +0100 Subject: [PATCH] Fixed issues with LDAP, made it compile again --- elog.spec.template | 2 +- src/auth.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/elog.spec.template b/elog.spec.template index b9b97f92..0e7f8abf 100644 --- a/elog.spec.template +++ b/elog.spec.template @@ -14,7 +14,7 @@ # Build options : # Read: If neither macro exists, then add the default definition. %{?_with_krb5: %define _with_krb5 USE_KRB5=1} -%{?_with_ldap: %define _with_ldap USE_LDAP=0} +%{?_with_ldap: %define _with_ldap USE_LDAP=1} %{?_with_pam: %define _with_pam USE_PAM=1} %{?_with_ssl: %define _with_ssl USE_SSL=1} # Default build options are with SSL diff --git a/src/auth.cxx b/src/auth.cxx index 9ac4e017..e0a47a48 100644 --- a/src/auth.cxx +++ b/src/auth.cxx @@ -34,6 +34,7 @@ #endif #ifdef HAVE_LDAP +#define LDAP_DEPRECATED 1 #include LDAP *ldap_ld; @@ -590,7 +591,7 @@ int auth_verify_password(LOGBOOK * lbs, const char *user, const char *password, // if user not in password file (external authentication!) and "LDAP register" is allowed (>0), // obtain user info from LDAP and add locally if (verified) { - if (get_user_line(lbs, user, NULL, NULL, NULL, NULL, NULL, NULL) == 2) { + if (get_user_line(lbs, (char *)user, NULL, NULL, NULL, NULL, NULL, NULL) == 2) { if (getcfg(lbs->name, "LDAP register", str, sizeof(str)) && atoi(str) > 0) ldap_adduser_file(lbs, user, password, error_str, error_size); }