From 6f510f14b6e5e2531ba34e9c11f37198df8202f651f0a130f42c6c7d06232711 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 5 Dec 2007 22:58:38 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dhcp?expand=0&rev=12 --- dhcp-3.0.6-ldap-patch_hwaddr-icase.dif | 60 ++++++++++++++++++++++++++ dhcp.changes | 7 +++ dhcp.spec | 8 +++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 dhcp-3.0.6-ldap-patch_hwaddr-icase.dif diff --git a/dhcp-3.0.6-ldap-patch_hwaddr-icase.dif b/dhcp-3.0.6-ldap-patch_hwaddr-icase.dif new file mode 100644 index 0000000..da45012 --- /dev/null +++ b/dhcp-3.0.6-ldap-patch_hwaddr-icase.dif @@ -0,0 +1,60 @@ +--- server/ldap.c ++++ server/ldap.c 2007/12/04 10:16:56 +@@ -39,6 +39,7 @@ + + #include "dhcpd.h" + #include ++#include + + #if defined(LDAP_CONFIGURATION) + +@@ -87,6 +88,24 @@ + return strncat(dst, src, dst_size > len ? dst_size - len - 1: 0); + } + ++static char * ++x_strxform(char *dst, const char *src, size_t dst_size, ++ int (*xform)(int)) ++{ ++ if(dst && src && dst_size) ++ { ++ size_t len, pos; ++ ++ len = strlen(src); ++ for(pos=0; pos < len && pos + 1 < dst_size; pos++) ++ dst[pos] = xform((int)src[pos]); ++ dst[pos] = '\0'; ++ ++ return dst; ++ } ++ return NULL; ++} ++ + static void + ldap_parse_class (struct ldap_config_stack *item, struct parse *cfile) + { +@@ -1707,6 +1726,8 @@ + struct host_decl * host; + isc_result_t status; + ldap_dn_node *curr; ++ char up_hwaddr[20]; ++ char lo_hwaddr[20]; + int ret; + + if (ldap_method == LDAP_METHOD_STATIC) +@@ -1737,9 +1758,13 @@ + ** FIXME: It is not guaranteed, that the dhcpHWAddress attribute + ** contains _exactly_ "type addr" with one space between! + */ ++ snprintf(lo_hwaddr, sizeof(lo_hwaddr), "%s", ++ print_hw_addr (htype, hlen, haddr)); ++ x_strxform(up_hwaddr, lo_hwaddr, sizeof(up_hwaddr), toupper); ++ + snprintf (buf, sizeof (buf), +- "(&(objectClass=dhcpHost)(dhcpHWAddress=%s %s))", +- type_str, print_hw_addr (htype, hlen, haddr)); ++ "(&(objectClass=dhcpHost)(|(dhcpHWAddress=%s %s)(dhcpHWAddress=%s %s)))", ++ type_str, lo_hwaddr, type_str, up_hwaddr); + + res = ent = NULL; + for (curr = ldap_service_dn_head; diff --git a/dhcp.changes b/dhcp.changes index 1b32f64..d5f4d48 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Dec 4 11:02:45 CET 2007 - mt@suse.de + +- Bug #343069: Added dhcp-server compatibility workaround to search + for lower- and upper-case MAC addresses in the dhcpHWAddress LDAP + attributes. New patch: dhcp-3.0.6-ldap-patch_hwaddr-icase.dif + ------------------------------------------------------------------- Mon Nov 19 09:43:56 CET 2007 - mt@suse.de diff --git a/dhcp.spec b/dhcp.spec index d42637d..71bbefb 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -23,7 +23,7 @@ License: BSD 3-Clause Group: Productivity/Networking/Boot/Servers AutoReqProv: on Version: 3.0.6 -Release: 37 +Release: 41 Summary: Common Files Used by ISC DHCP Software Url: http://www.isc.org/isc/dhcp.html Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz @@ -73,6 +73,7 @@ Patch60: dhcp-3.0.5-ldap-patch.gz Patch61: dhcp-3.0.5-ldap-patch_object-order.dif Patch62: dhcp-3.0.5-ldap-patch_server_dn.dif Patch63: dhcp-3.0.5-ldap-patch_host_brace.dif +Patch64: dhcp-3.0.6-ldap-patch_hwaddr-icase.dif %endif %if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930 Patch70: dhcp-3.0.3b1-pie.dif @@ -202,6 +203,7 @@ Authors: %patch61 -p0 %patch62 -p0 %patch63 -p0 +%patch64 -p0 %endif %if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930 %patch70 @@ -481,6 +483,10 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %doc %{_mandir}/man3/dhcpctl.3.gz %changelog +* Tue Dec 04 2007 - mt@suse.de +- Bug #343069: Added dhcp-server compatibility workaround to search + for lower- and upper-case MAC addresses in the dhcpHWAddress LDAP + attributes. New patch: dhcp-3.0.6-ldap-patch_hwaddr-icase.dif * Mon Nov 19 2007 - mt@suse.de - Disabled script setting in the /etc/dhclient.conf, because it overrides the -sf command line option.