nss-pam-ldapd commit: r1745 - nss-pam-ldapd/nslcd
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd commit: r1745 - nss-pam-ldapd/nslcd
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd commit: r1745 - nss-pam-ldapd/nslcd
- Date: Sat, 1 Sep 2012 22:17:24 +0200 (CEST)
Author: arthur
Date: Sat Sep 1 22:17:23 2012
New Revision: 1745
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1745&view=revision
Log:
provide an alternative do_rebind() for Netscape LDAP
Modified:
nss-pam-ldapd/nslcd/myldap.c
Modified: nss-pam-ldapd/nslcd/myldap.c
==============================================================================
--- nss-pam-ldapd/nslcd/myldap.c Sat Sep 1 22:14:35 2012 (r1744)
+++ nss-pam-ldapd/nslcd/myldap.c Sat Sep 1 22:17:23 2012 (r1745)
@@ -497,6 +497,7 @@
#ifdef HAVE_LDAP_SET_REBIND_PROC
/* This function is called by the LDAP library when chasing referrals.
It is configured with the ldap_set_rebind_proc() below. */
+#if defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000)
static int do_rebind(LDAP *ld,LDAP_CONST char *url,
ber_tag_t UNUSED(request),
ber_int_t UNUSED(msgid),void *arg)
@@ -505,6 +506,34 @@
log_log(LOG_DEBUG,"rebinding to %s",url);
return do_bind(ld,session->binddn,session->bindpw,url);
}
+#else /* not recent OpenLDAP */
+static int do_rebind(LDAP *ld,char **dnp,char **passwdp,int *authmethodp,
+ int freeit,void *arg)
+{
+ MYLDAP_SESSION *session=(MYLDAP_SESSION *)arg;
+ if (freeit)
+ {
+ free(*dnp);
+ memset(*passwdp,0,strlen(*passwdp));
+ free(*passwdp);
+ }
+ else
+ {
+ log_log(LOG_DEBUG,"rebinding");
+ *dnp=strdup(session->binddn);
+ *passwdp=strdup(session->bindpw);
+ *authmethodp=LDAP_AUTH_SIMPLE;
+ if ((*dnp==NULL)||(*passwdp==NULL))
+ {
+ if (*dnp!=NULL)
+ free(*dnp);
+ log_log(LOG_CRIT,"do_rebind(): strdup() failed to allocate memory");
+ return LDAP_NO_MEMORY;
+ }
+ }
+ return LDAP_SUCCESS;
+}
+#endif /* not recent OpenLDAP */
#endif /* HAVE_LDAP_SET_REBIND_PROC */
/* set a recieve and send timeout on a socket */
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/
- nss-pam-ldapd commit: r1745 - nss-pam-ldapd/nslcd,
Commits of the nss-pam-ldapd project