[pkg-dhcp-devel] Bug#620279: isc-dhcp-server-ldap misspatched?

jaimeventura at ipp.pt jaimeventura at ipp.pt
Thu Mar 31 18:36:45 UTC 2011


Package: isc-dhcp-server
Version: 4.1.1-P1-15+squeeze

I've installed a "squeeze" system with isc-dhcp-server-ldap and migrated
configuration from a previous version of isc-dhcp-server + ldap patch.
It didn't work.
After some debugging I found major differences between the "official"
patch and the included on the debian pachage.
According to my search, those neither those changes or their purpose are
documented, and I cant understand why they are there.

-----dhcp-4.1.0-ldap-code.dpatch, lines 1765 to 1790
+#if defined(DEBUG_LDAP)
+  else
+    {
+      log_info ("Found LDAP entry '%s'", dn);
+    }
+#endif
+
+  if ((ret = ldap_search_s (ld, dn, LDAP_SCOPE_ONELEVEL,
"(!(|(|(objectClass=dhcpTSigKey)(objectClass=dhcpClass))
(objectClass=dhcpFailOverPeer)))",
+                            NULL, 0, &res)) != LDAP_SUCCESS)
+    {
+      ldap_memfree (dn);
+
+      ldap_stop();
+      return;
+    }
+
+  if ((ret = ldap_search_s (ld, dn, LDAP_SCOPE_ONELEVEL,
"(|(|(objectClass=dhcpTSigKey)(objectClass=dhcpClass))
(objectClass=dhcpFailOverPeer))",
+                            NULL, 0, &resfirst)) != LDAP_SUCCESS)
+    {
+      ldap_memfree (dn);
+      ldap_msgfree (res);
+
+      ldap_stop();
+      return;
+    }
+
-----------

------dhcp-4.1.0-ldap.dpatch lines 1604 to 1620 ----
+#if defined(DEBUG_LDAP)
+  if (dn != NULL)
+    log_info ("Found LDAP entry '%s'", dn);
+#endif
+
+  if (dn == NULL ||
+      (ret = ldap_search_ext_s (ld, dn, LDAP_SCOPE_ONELEVEL,
+                                "objectClass=*", NULL, 0, NULL, NULL,
+                                NULL, 0, &res)) != LDAP_SUCCESS)
+    {
+      if (dn)
+        ldap_memfree (dn);
+
+      ldap_stop();
+      return;
+    }
+
----

As you can see 2 completely different ldap searches are done on the first
(debian) patch that doesnt exits on the second (original) patch. Besides
the ldap search on the  second (original) patch doesnt exist on the first
either.
And so, isc-dhcp-server-ldap is unable to find ldap objects such as
subnets,...

By the way, a new patch has been released 4.1.1 (on
https://github.com/dcantrell/ldap-for-dhcp).
If you need any other info, im glad to give you.
Thanks.







More information about the pkg-dhcp-devel mailing list