Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > f2c9a24e570f82c24fd7074143d03478 > files > 19

nss_ldap-253-42.el5.src.rpm

Don't leave the configuration half-usable if we had an error sorting it out.

diff -ru nss_ldap-254.orig/ldap-nss.c nss_ldap-254/ldap-nss.c
--- nss_ldap-254.orig/ldap-nss.c	2006-12-18 09:12:56.000000000 +0100
+++ nss_ldap-254/ldap-nss.c	2007-03-03 04:48:58.000000000 +0100
@@ -1247,11 +1247,16 @@
 	{
 	  /* Config was read but no host information specified; try DNS */
 	  stat = _nss_ldap_mergeconfigfromdns (__config, &configbufp, &configbuflen);
+	  if (stat != NSS_SUCCESS)
+	    {
+      	      syslog (LOG_ERR, "nss_ldap: could get LDAP server (neither from config nor through DNS)");
+	    }
 	}
 
       if (stat != NSS_SUCCESS)
 	{
 	  debug ("<== do_init (failed to read config)");
+	  __config = NULL;
 	  return NSS_UNAVAIL;
 	}
     }