lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1569 - nss-pam-ldapd/nslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1569 - nss-pam-ldapd/nslcd



Author: arthur
Date: Sat Dec 10 23:17:33 2011
New Revision: 1569
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1569&view=revision

Log:
properly log failures to lookup DNS SRV records

Modified:
   nss-pam-ldapd/nslcd/cfg.c

Modified: nss-pam-ldapd/nslcd/cfg.c
==============================================================================
--- nss-pam-ldapd/nslcd/cfg.c   Sat Dec 10 23:17:02 2011        (r1568)
+++ nss-pam-ldapd/nslcd/cfg.c   Sat Dec 10 23:17:33 2011        (r1569)
@@ -192,7 +192,12 @@
   char buf[HOST_NAME_MAX+sizeof("ldap://";)];
   log_log(LOG_DEBUG,"query %s for SRV records",domain);
   rc=ldap_domain2hostlist(domain,&hostlist);
-  /* FIXME: have better error handling */
+  if (rc!=LDAP_SUCCESS)
+  {
+    log_log(LOG_ERR,"%s:%d: no servers found in DNS zone %s: %s",
+            filename,lnr,domain,ldap_err2string(rc));
+    exit(EXIT_FAILURE);
+  }
   if ((hostlist==NULL)||(*hostlist=='\0'))
   {
     log_log(LOG_ERR,"%s:%d: no servers found in DNS zone 
%s",filename,lnr,domain);
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/