1 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/common/conflex.c dhcp-4.2.5-P1/common/conflex.c
2 --- dhcp-4.2.5-P1.orig/common/conflex.c 2014-01-03 20:59:11.105475789 +0100
3 +++ dhcp-4.2.5-P1/common/conflex.c 2014-01-03 20:59:51.775476160 +0100
6 if (!strcasecmp (atom + 1, "s"))
8 + if (!strcasecmp (atom + 1, "gnore-client-uids"))
9 + return IGNORE_CLIENT_UIDS;
10 if (!strcasecmp (atom + 1, "gnore"))
13 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/includes/dhcpd.h dhcp-4.2.5-P1/includes/dhcpd.h
14 --- dhcp-4.2.5-P1.orig/includes/dhcpd.h 2014-01-03 20:59:11.115475790 +0100
15 +++ dhcp-4.2.5-P1/includes/dhcpd.h 2014-01-03 20:59:51.775476160 +0100
20 +#define SV_IGNORE_CLIENT_UIDS 78
22 #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
23 # define DEFAULT_DEFAULT_LEASE_TIME 43200
25 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/includes/dhctoken.h dhcp-4.2.5-P1/includes/dhctoken.h
26 --- dhcp-4.2.5-P1.orig/includes/dhctoken.h 2014-01-03 20:59:11.105475789 +0100
27 +++ dhcp-4.2.5-P1/includes/dhctoken.h 2014-01-03 21:00:27.588809818 +0100
31 TOKEN_INFINIBAND = 668,
32 - BOOTP_BROADCAST_ALWAYS = 669
33 + BOOTP_BROADCAST_ALWAYS = 669,
34 + IGNORE_CLIENT_UIDS = 670
37 #define is_identifier(x) ((x) >= FIRST_TOKEN && \
38 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/server/confpars.c dhcp-4.2.5-P1/server/confpars.c
39 --- dhcp-4.2.5-P1.orig/server/confpars.c 2013-03-04 19:35:09.000000000 +0100
40 +++ dhcp-4.2.5-P1/server/confpars.c 2014-01-03 20:59:51.775476160 +0100
42 | ONE_LEASE_PER_CLIENT boolean
43 | GET_LEASE_HOSTNAMES boolean
44 | USE_HOST_DECL_NAME boolean
45 + | IGNORE_CLIENT_UIDS boolean
46 | NEXT_SERVER ip-addr-or-hostname SEMI
48 | SERVER-IDENTIFIER ip-addr-or-hostname SEMI
49 @@ -4104,6 +4105,10 @@
53 + case IGNORE_CLIENT_UIDS:
54 + code = SV_IGNORE_CLIENT_UIDS;
58 parse_warn (cfile, "expecting allow/deny key");
60 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/server/dhcp.c dhcp-4.2.5-P1/server/dhcp.c
61 --- dhcp-4.2.5-P1.orig/server/dhcp.c 2014-01-03 20:59:11.112142457 +0100
62 +++ dhcp-4.2.5-P1/server/dhcp.c 2014-01-03 20:59:51.778809492 +0100
63 @@ -2337,31 +2337,42 @@
64 /* Update Client Last Transaction Time. */
67 - /* Record the uid, if given... */
68 - oc = lookup_option (&dhcp_universe, packet -> options,
69 - DHO_DHCP_CLIENT_IDENTIFIER);
71 - evaluate_option_cache (&d1, packet, lease,
72 + /* Only record the uid if we're not ignoring them */
73 + oc = lookup_option (&server_universe, state -> options,
74 + SV_IGNORE_CLIENT_UIDS);
76 + !evaluate_boolean_option_cache (&ignorep, packet, lease,
77 (struct client_state *)0,
78 packet -> options, state -> options,
79 &lease -> scope, oc, MDL)) {
80 - if (d1.len <= sizeof lt -> uid_buf) {
81 - memcpy (lt -> uid_buf, d1.data, d1.len);
82 - lt -> uid = lt -> uid_buf;
83 - lt -> uid_max = sizeof lt -> uid_buf;
84 - lt -> uid_len = d1.len;
86 - unsigned char *tuid;
87 - lt -> uid_max = d1.len;
88 - lt -> uid_len = d1.len;
89 - tuid = (unsigned char *)dmalloc (lt -> uid_max, MDL);
92 - log_fatal ("no memory for large uid.");
93 - memcpy (tuid, d1.data, lt -> uid_len);
95 + /* Record the uid, if given... */
96 + oc = lookup_option (&dhcp_universe, packet -> options,
97 + DHO_DHCP_CLIENT_IDENTIFIER);
99 + evaluate_option_cache (&d1, packet, lease,
100 + (struct client_state *)0,
103 + &lease -> scope, oc, MDL)) {
104 + if (d1.len <= sizeof lt -> uid_buf) {
105 + memcpy (lt -> uid_buf, d1.data, d1.len);
106 + lt -> uid = lt -> uid_buf;
107 + lt -> uid_max = sizeof lt -> uid_buf;
108 + lt -> uid_len = d1.len;
110 + unsigned char *tuid;
111 + lt -> uid_max = d1.len;
112 + lt -> uid_len = d1.len;
113 + tuid = (unsigned char *)
114 + dmalloc (lt -> uid_max, MDL);
115 + /* XXX inelegant */
117 + log_fatal ("no memory for large uid.");
118 + memcpy (tuid, d1.data, lt -> uid_len);
121 + data_string_forget (&d1, MDL);
123 - data_string_forget (&d1, MDL);
127 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/server/dhcpd.conf.5 dhcp-4.2.5-P1/server/dhcpd.conf.5
128 --- dhcp-4.2.5-P1.orig/server/dhcpd.conf.5 2014-01-03 20:59:11.118809123 +0100
129 +++ dhcp-4.2.5-P1/server/dhcpd.conf.5 2014-01-03 20:59:51.778809492 +0100
130 @@ -2338,6 +2338,20 @@
131 must be a constant value.
135 +.I ignore-client-uids
139 +.B ignore-client-uids \fIflag\fB;\fR
141 +If the \fIignore-client-uids\fR statement is present and has a value of
142 +\fItrue\fR or \fIon\fR, clients will be handled as though they provided no UID
143 +and the actual provided UID will not be recorded. If this statement is not
144 +present or has a value of \fIfalse\fR or \fIoff\fR, then client UIDs will be
145 +parsed and used as normal.
149 .I infinite-is-reserved
151 diff -dur -x '*~' -x '*.orig' dhcp-4.2.5-P1.orig/server/stables.c dhcp-4.2.5-P1/server/stables.c
152 --- dhcp-4.2.5-P1.orig/server/stables.c 2013-03-05 19:26:51.000000000 +0100
153 +++ dhcp-4.2.5-P1/server/stables.c 2014-01-03 20:59:51.778809492 +0100
155 { "ldap-tls-randfile", "t", &server_universe, 77, 1 },
156 #endif /* LDAP_USE_SSL */
157 #endif /* LDAP_CONFIGURATION */
158 + { "ignore-client-uids", "f", &server_universe, 78, 1 },
159 { NULL, NULL, NULL, 0, 0 }