diff -u isc-dhcp-4.1.ESV-R4/debian/changelog isc-dhcp-4.1.ESV-R4/debian/changelog --- isc-dhcp-4.1.ESV-R4/debian/changelog +++ isc-dhcp-4.1.ESV-R4/debian/changelog @@ -1,3 +1,10 @@ +isc-dhcp (4.1.ESV-R4-0ubuntu5.8) precise; urgency=low + + * debian/patches/add-option-ignore-client-uids.dpatch: + Add a new dhcpd.conf option 'ignore-client-uids'. (LP: #1069570) + + -- Adam Stokes Wed, 10 Apr 2013 18:57:01 -0400 + isc-dhcp (4.1.ESV-R4-0ubuntu5.7) precise; urgency=low * Allow dhcpd to read /etc/ldap/ldap.conf for isc-dhcp-server-ldap. diff -u isc-dhcp-4.1.ESV-R4/debian/apparmor-profile.dhcpd isc-dhcp-4.1.ESV-R4/debian/apparmor-profile.dhcpd --- isc-dhcp-4.1.ESV-R4/debian/apparmor-profile.dhcpd +++ isc-dhcp-4.1.ESV-R4/debian/apparmor-profile.dhcpd @@ -34,6 +34,9 @@ /var/log/** rw, /{,var/}run/{,dhcp-server/}dhcpd{,6}.pid rw, + # isc-dhcp-server-ldap + /etc/ldap/ldap.conf r, + # LTSP. See: # http://www.ltsp.org/~sbalneav/LTSPManual.html # https://wiki.edubuntu.org/ diff -u isc-dhcp-4.1.ESV-R4/debian/patches/00list isc-dhcp-4.1.ESV-R4/debian/patches/00list --- isc-dhcp-4.1.ESV-R4/debian/patches/00list +++ isc-dhcp-4.1.ESV-R4/debian/patches/00list @@ -30,6 +30,6 @@ +add-option-ignore-client-uids.dpatch #ldap backend for dhcp server (docs and code) #these get reverted during the build, so put non-ldap #patches earlier dhcp-4.1.0-ldap-docs dhcp-4.1.0-ldap-code -dhcpd-ldap-apparmor.dpatch reverted: --- isc-dhcp-4.1.ESV-R4/debian/patches/dhcpd-ldap-apparmor.dpatch +++ isc-dhcp-4.1.ESV-R4.orig/debian/patches/dhcpd-ldap-apparmor.dpatch @@ -1,18 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## Description: add some description -## Origin/Author: add some origin or author -## Bug: bug URL -@DPATCH@ -diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/debian/apparmor-profile.dhcpd isc-dhcp-4.1.ESV-R4/debian/apparmor-profile.dhcpd ---- isc-dhcp-4.1.ESV-R4~/debian/apparmor-profile.dhcpd 2013-01-31 16:39:20.000000000 -0600 -+++ isc-dhcp-4.1.ESV-R4/debian/apparmor-profile.dhcpd 2013-01-31 16:42:48.000000000 -0600 -@@ -34,6 +34,9 @@ - /var/log/** rw, - /{,var/}run/{,dhcp-server/}dhcpd{,6}.pid rw, - -+ # isc-dhcp-server-ldap -+ /etc/ldap/ldap.conf r, -+ - # LTSP. See: - # http://www.ltsp.org/~sbalneav/LTSPManual.html - # https://wiki.edubuntu.org/ only in patch2: unchanged: --- isc-dhcp-4.1.ESV-R4.orig/debian/patches/add-option-ignore-client-uids.dpatch +++ isc-dhcp-4.1.ESV-R4/debian/patches/add-option-ignore-client-uids.dpatch @@ -0,0 +1,171 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +## add-option-ignore-client-uids.dpatch by > +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/common/conflex.c isc-dhcp-4.1.ESV-R4/common/conflex.c +--- isc-dhcp-4.1.ESV-R4~/common/conflex.c 2011-05-11 11:02:09.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/common/conflex.c 2013-04-10 18:56:52.740944077 -0400 +@@ -1024,6 +1024,8 @@ + return IF; + if (!strcasecmp (atom + 1, "s")) + return IS; ++ if (!strcasecmp (atom + 1, "gnore-client-uids")) ++ return IGNORE_CLIENT_UIDS; + if (!strcasecmp (atom + 1, "gnore")) + return IGNORE; + break; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/includes/dhcpd.h isc-dhcp-4.1.ESV-R4/includes/dhcpd.h +--- isc-dhcp-4.1.ESV-R4~/includes/dhcpd.h 2011-07-01 07:47:59.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/includes/dhcpd.h 2013-04-10 18:56:52.740944077 -0400 +@@ -644,6 +644,8 @@ + # define DEFAULT_ACK_DELAY_USECS 250000 /* 1/4 of a second */ + #endif + ++#define SV_IGNORE_CLIENT_UIDS 78 ++ + #if !defined (DEFAULT_DEFAULT_LEASE_TIME) + # define DEFAULT_DEFAULT_LEASE_TIME 43200 + #endif +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/includes/dhctoken.h isc-dhcp-4.1.ESV-R4/includes/dhctoken.h +--- isc-dhcp-4.1.ESV-R4~/includes/dhctoken.h 2011-05-12 08:20:29.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/includes/dhctoken.h 2013-04-10 18:56:52.740944077 -0400 +@@ -358,7 +358,8 @@ + FIXED_PREFIX6 = 658, + CONFLICT_DONE = 660, + INITIAL_DELAY = 664, +- GETHOSTBYNAME = 665 ++ GETHOSTBYNAME = 665, ++ IGNORE_CLIENT_UIDS = 669 + }; + + #define is_identifier(x) ((x) >= FIRST_TOKEN && \ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/server/confpars.c isc-dhcp-4.1.ESV-R4/server/confpars.c +--- isc-dhcp-4.1.ESV-R4~/server/confpars.c 2011-07-01 07:47:59.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/server/confpars.c 2013-04-10 18:56:52.740944077 -0400 +@@ -318,6 +318,7 @@ + | ONE_LEASE_PER_CLIENT boolean + | GET_LEASE_HOSTNAMES boolean + | USE_HOST_DECL_NAME boolean ++ | IGNORE_CLIENT_UIDS boolean + | NEXT_SERVER ip-addr-or-hostname SEMI + | option_parameter + | SERVER-IDENTIFIER ip-addr-or-hostname SEMI +@@ -4095,6 +4096,10 @@ + code = SV_LEASEQUERY; + break; + ++ case IGNORE_CLIENT_UIDS: ++ code = SV_IGNORE_CLIENT_UIDS; ++ break; ++ + default: + parse_warn (cfile, "expecting allow/deny key"); + skip_to_semi (cfile); +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/server/dhcp.c isc-dhcp-4.1.ESV-R4/server/dhcp.c +--- isc-dhcp-4.1.ESV-R4~/server/dhcp.c 2011-07-19 18:27:56.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/server/dhcp.c 2013-04-10 18:56:52.740944077 -0400 +@@ -2287,31 +2287,42 @@ + /* Update Client Last Transaction Time. */ + lt->cltt = cur_time; + +- /* Record the uid, if given... */ +- oc = lookup_option (&dhcp_universe, packet -> options, +- DHO_DHCP_CLIENT_IDENTIFIER); +- if (oc && +- evaluate_option_cache (&d1, packet, lease, ++ /* Only record the uid if we're not ignoring them */ ++ oc = lookup_option (&server_universe, state -> options, ++ SV_IGNORE_CLIENT_UIDS); ++ if (!oc || ++ !evaluate_boolean_option_cache (&ignorep, packet, lease, + (struct client_state *)0, + packet -> options, state -> options, + &lease -> scope, oc, MDL)) { +- if (d1.len <= sizeof lt -> uid_buf) { +- memcpy (lt -> uid_buf, d1.data, d1.len); +- lt -> uid = lt -> uid_buf; +- lt -> uid_max = sizeof lt -> uid_buf; +- lt -> uid_len = d1.len; +- } else { +- unsigned char *tuid; +- lt -> uid_max = d1.len; +- lt -> uid_len = d1.len; +- tuid = (unsigned char *)dmalloc (lt -> uid_max, MDL); +- /* XXX inelegant */ +- if (!tuid) +- log_fatal ("no memory for large uid."); +- memcpy (tuid, d1.data, lt -> uid_len); +- lt -> uid = tuid; ++ /* Record the uid, if given... */ ++ oc = lookup_option (&dhcp_universe, packet -> options, ++ DHO_DHCP_CLIENT_IDENTIFIER); ++ if (oc && ++ evaluate_option_cache (&d1, packet, lease, ++ (struct client_state *)0, ++ packet -> options, ++ state -> options, ++ &lease -> scope, oc, MDL)) { ++ if (d1.len <= sizeof lt -> uid_buf) { ++ memcpy (lt -> uid_buf, d1.data, d1.len); ++ lt -> uid = lt -> uid_buf; ++ lt -> uid_max = sizeof lt -> uid_buf; ++ lt -> uid_len = d1.len; ++ } else { ++ unsigned char *tuid; ++ lt -> uid_max = d1.len; ++ lt -> uid_len = d1.len; ++ tuid = (unsigned char *) ++ dmalloc (lt -> uid_max, MDL); ++ /* XXX inelegant */ ++ if (!tuid) ++ log_fatal ("no memory for large uid."); ++ memcpy (tuid, d1.data, lt -> uid_len); ++ lt -> uid = tuid; ++ } ++ data_string_forget (&d1, MDL); + } +- data_string_forget (&d1, MDL); + } + + if (host) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/server/dhcpd.conf.5 isc-dhcp-4.1.ESV-R4/server/dhcpd.conf.5 +--- isc-dhcp-4.1.ESV-R4~/server/dhcpd.conf.5 2011-06-01 19:38:06.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/server/dhcpd.conf.5 2013-04-10 18:56:52.740944077 -0400 +@@ -2307,6 +2307,20 @@ + must be a constant value. + .RE + .PP ++The ++.I ignore-client-uids ++statement ++.RS 0.25i ++.PP ++.B ignore-client-uids \fIflag\fB;\fR ++.PP ++If the \fIignore-client-uids\fR statement is present and has a value of ++\fItrue\fR or \fIon\fR, clients will be handled as though they provided no UID ++and the actual provided UID will not be recorded. If this statement is not ++present or has a value of \fIfalse\fR or \fIoff\fR, then client UIDs will be ++parsed and used as normal. ++.RE ++.PP + The + .I infinite-is-reserved + statement +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' isc-dhcp-4.1.ESV-R4~/server/stables.c isc-dhcp-4.1.ESV-R4/server/stables.c +--- isc-dhcp-4.1.ESV-R4~/server/stables.c 2011-10-14 15:50:30.000000000 -0400 ++++ isc-dhcp-4.1.ESV-R4/server/stables.c 2013-04-10 18:56:52.740944077 -0400 +@@ -244,6 +244,7 @@ + { "delayed-ack", "S", &server_universe, 58, 1 }, + { "max-ack-delay", "L", &server_universe, 59, 1 }, + #endif ++ { "ignore-client-uids", "f", &server_universe, 78, 1 }, + { NULL, NULL, NULL, 0, 0 } + }; +