From 38410ea793770e72f1e2bc59d2c264902cf3a788 Mon Sep 17 00:00:00 2001 From: akdengi Date: Wed, 31 Jul 2013 23:22:01 +0400 Subject: [PATCH] 4.2.5 P1 --- .abf.yml | 5 +- dhclient.tmpfiles | 1 + dhcp-4.1.1-missing-ipv6-not-fatal.patch | 51 -- dhcp-4.1.1-useless-wait.patch | 17 - dhcp-4.2.0-add_timeout_when_NULL.patch | 14 + dhcp-4.2.0-default-requested-options.patch | 44 ++ dhcp-4.2.1-P1-CVE-2011-2748,2749.diff | 59 -- dhcp-4.2.1-P1-CVE-2011-4539.diff | 25 - dhcp-4.2.1-P1.tar.gz.sha512.asc | 11 - ...atch => dhcp-4.2.2-fix-format-errors.patch | 34 +- ...-4.1.1-ifup.patch => dhcp-4.2.2-ifup.patch | 38 +- dhcp-4.2.2-missing-ipv6-not-fatal.patch | 40 ++ dhcp-4.2.2-xen-checksum.patch | 249 +++++++ dhcp-4.2.4-64_bit_lease_parse.patch | 84 +++ dhcp-4.2.5-P1-man.patch | 22 + dhcp.spec | 621 ++++++++++++++---- dhcpd.conf | 2 +- dhcpd.init | 120 ---- dhcpd.service | 13 + dhcpd.tmpfiles | 1 + dhcpd6.service | 13 + dhcrelay.init | 103 --- dhcrelay.service | 10 + dhcrelay.tmpfiles | 1 + update_dhcp.pl | 45 -- 25 files changed, 1043 insertions(+), 580 deletions(-) create mode 100644 dhclient.tmpfiles delete mode 100644 dhcp-4.1.1-missing-ipv6-not-fatal.patch delete mode 100644 dhcp-4.1.1-useless-wait.patch create mode 100644 dhcp-4.2.0-add_timeout_when_NULL.patch create mode 100644 dhcp-4.2.0-default-requested-options.patch delete mode 100644 dhcp-4.2.1-P1-CVE-2011-2748,2749.diff delete mode 100644 dhcp-4.2.1-P1-CVE-2011-4539.diff delete mode 100644 dhcp-4.2.1-P1.tar.gz.sha512.asc rename dhcp-4.1.1-format_not_a_string_literal_and_no_format_arguments.patch => dhcp-4.2.2-fix-format-errors.patch (58%) rename dhcp-4.1.1-ifup.patch => dhcp-4.2.2-ifup.patch (86%) create mode 100644 dhcp-4.2.2-missing-ipv6-not-fatal.patch create mode 100644 dhcp-4.2.2-xen-checksum.patch create mode 100644 dhcp-4.2.4-64_bit_lease_parse.patch create mode 100644 dhcp-4.2.5-P1-man.patch delete mode 100644 dhcpd.init create mode 100644 dhcpd.service create mode 100644 dhcpd.tmpfiles create mode 100644 dhcpd6.service delete mode 100644 dhcrelay.init create mode 100644 dhcrelay.service create mode 100644 dhcrelay.tmpfiles delete mode 100644 update_dhcp.pl diff --git a/.abf.yml b/.abf.yml index 92cc6d3..3037190 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,3 +1,4 @@ sources: - "dhcp-4.2.1-P1.tar.gz": 7767019313b4128357054a1eb053c66799831dd6 - "dhcp-dynamic-dns-examples.tar.bz2": d33980aad3e0380fc89f8346ab37786d39157696 + dhcp-4.2.5-P1.tar.gz: 120b6e476b2ac0d35e1dc8dee53752c42449b925 + dhcp-4.2.5-P1.tar.gz.sha512.asc: d43248ba82d8a2f393f2f6c283ea06fb2df38d18 + dhcp-dynamic-dns-examples.tar.bz2: d33980aad3e0380fc89f8346ab37786d39157696 diff --git a/dhclient.tmpfiles b/dhclient.tmpfiles new file mode 100644 index 0000000..c93db9c --- /dev/null +++ b/dhclient.tmpfiles @@ -0,0 +1 @@ +d /run/dhclient 755 root root diff --git a/dhcp-4.1.1-missing-ipv6-not-fatal.patch b/dhcp-4.1.1-missing-ipv6-not-fatal.patch deleted file mode 100644 index 8758e43..0000000 --- a/dhcp-4.1.1-missing-ipv6-not-fatal.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -p -up dhcp-4.1.1/common/discover.c.ipv6_not_fatal dhcp-4.1.1/common/discover.c ---- dhcp-4.1.1/common/discover.c.ipv6_not_fatal 2009-09-29 16:44:49.000000000 -0300 -+++ dhcp-4.1.1/common/discover.c 2010-02-25 11:35:34.000000000 -0300 -@@ -444,15 +444,19 @@ begin_iface_scan(struct iface_conf_list - - #ifdef DHCPv6 - if (local_family == AF_INET6) { -- ifaces->fp6 = fopen("/proc/net/if_inet6", "r"); -- if (ifaces->fp6 == NULL) { -- log_error("Error opening '/proc/net/if_inet6' to " -- "list IPv6 interfaces; %m"); -- close(ifaces->sock); -- ifaces->sock = -1; -- fclose(ifaces->fp); -- ifaces->fp = NULL; -- return 0; -+ if (!access("/proc/net/if_inet6", R_OK)) { -+ ifaces->fp6 = fopen("/proc/net/if_inet6", "r"); -+ if (ifaces->fp6 == NULL) { -+ log_error("Error opening '/proc/net/if_inet6' to " -+ "list IPv6 interfaces; %m"); -+ close(ifaces->sock); -+ ifaces->sock = -1; -+ fclose(ifaces->fp); -+ ifaces->fp = NULL; -+ return 0; -+ } -+ } else { -+ ifaces->fp6 = NULL; - } - } - #endif -@@ -721,7 +725,7 @@ next_iface(struct iface_info *info, int - return 1; - } - #ifdef DHCPv6 -- if (!(*err)) { -+ if (!(*err) && ifaces->fp6) { - if (local_family == AF_INET6) - return next_iface6(info, err, ifaces); - } -@@ -740,7 +744,8 @@ end_iface_scan(struct iface_conf_list *i - ifaces->sock = -1; - #ifdef DHCPv6 - if (local_family == AF_INET6) { -- fclose(ifaces->fp6); -+ if (ifaces->fp6) -+ fclose(ifaces->fp6); - ifaces->fp6 = NULL; - } - #endif diff --git a/dhcp-4.1.1-useless-wait.patch b/dhcp-4.1.1-useless-wait.patch deleted file mode 100644 index 88bbd16..0000000 --- a/dhcp-4.1.1-useless-wait.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- client/dhclient.c 2010/04/28 19:13:43 1.1 -+++ client/dhclient.c 2010/04/28 19:17:01 -@@ -594,9 +594,12 @@ - else { - client->state = S_INIT; - /* Set up a timeout to start the -- * initialization process. -+ * initialization process, -+ * _immediately_, as agreed but never -+ * applied by the ISC upstream -+ https://lists.isc.org/mailman/htdig/dhcp-users/2006-June/thread.html#928 - */ -- tv.tv_sec = cur_time + random() % 5; -+ tv.tv_sec = cur_time - 1; - tv.tv_usec = 0; - add_timeout(&tv, state_reboot, - client, 0, 0); diff --git a/dhcp-4.2.0-add_timeout_when_NULL.patch b/dhcp-4.2.0-add_timeout_when_NULL.patch new file mode 100644 index 0000000..4784d5a --- /dev/null +++ b/dhcp-4.2.0-add_timeout_when_NULL.patch @@ -0,0 +1,14 @@ +diff -up dhcp-4.2.0/common/dispatch.c.dracut dhcp-4.2.0/common/dispatch.c +--- dhcp-4.2.0/common/dispatch.c.dracut 2010-06-01 19:29:59.000000000 +0200 ++++ dhcp-4.2.0/common/dispatch.c 2010-07-21 16:10:09.000000000 +0200 +@@ -189,6 +189,10 @@ void add_timeout (when, where, what, ref + isc_interval_t interval; + isc_time_t expires; + ++ if (when == NULL) { ++ return; ++ } ++ + /* See if this timeout supersedes an existing timeout. */ + t = (struct timeout *)0; + for (q = timeouts; q; q = q->next) { diff --git a/dhcp-4.2.0-default-requested-options.patch b/dhcp-4.2.0-default-requested-options.patch new file mode 100644 index 0000000..fea8a4b --- /dev/null +++ b/dhcp-4.2.0-default-requested-options.patch @@ -0,0 +1,44 @@ +diff -up dhcp-4.2.0/client/clparse.c.requested dhcp-4.2.0/client/clparse.c +--- dhcp-4.2.0/client/clparse.c.requested 2010-07-21 13:29:05.000000000 +0200 ++++ dhcp-4.2.0/client/clparse.c 2010-07-21 13:50:29.000000000 +0200 +@@ -37,7 +37,7 @@ + + struct client_config top_level_config; + +-#define NUM_DEFAULT_REQUESTED_OPTS 9 ++#define NUM_DEFAULT_REQUESTED_OPTS 14 + struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1]; + + static void parse_client_default_duid(struct parse *cfile); +@@ -111,6 +111,31 @@ isc_result_t read_client_conf () + option_code_hash_lookup(&default_requested_options[8], + dhcpv6_universe.code_hash, &code, 0, MDL); + ++ /* 10 */ ++ code = DHO_NIS_DOMAIN; ++ option_code_hash_lookup(&default_requested_options[9], ++ dhcp_universe.code_hash, &code, 0, MDL); ++ ++ /* 11 */ ++ code = DHO_NIS_SERVERS; ++ option_code_hash_lookup(&default_requested_options[10], ++ dhcp_universe.code_hash, &code, 0, MDL); ++ ++ /* 12 */ ++ code = DHO_NTP_SERVERS; ++ option_code_hash_lookup(&default_requested_options[11], ++ dhcp_universe.code_hash, &code, 0, MDL); ++ ++ /* 13 */ ++ code = DHO_INTERFACE_MTU; ++ option_code_hash_lookup(&default_requested_options[12], ++ dhcp_universe.code_hash, &code, 0, MDL); ++ ++ /* 14 */ ++ code = DHO_DOMAIN_SEARCH; ++ option_code_hash_lookup(&default_requested_options[13], ++ dhcp_universe.code_hash, &code, 0, MDL); ++ + for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) { + if (default_requested_options[code] == NULL) + log_fatal("Unable to find option definition for " diff --git a/dhcp-4.2.1-P1-CVE-2011-2748,2749.diff b/dhcp-4.2.1-P1-CVE-2011-2748,2749.diff deleted file mode 100644 index dffbbd6..0000000 --- a/dhcp-4.2.1-P1-CVE-2011-2748,2749.diff +++ /dev/null @@ -1,59 +0,0 @@ -diff -Naurp dhcp-4.2.1-P1/common/discover.c dhcp-4.2.1-P1.oden/common/discover.c ---- dhcp-4.2.1-P1/common/discover.c 2011-08-18 12:58:40.883411562 +0200 -+++ dhcp-4.2.1-P1.oden/common/discover.c 2011-08-18 12:55:47.002338724 +0200 -@@ -1391,12 +1391,16 @@ isc_result_t got_one (h) - if (result == 0) - return ISC_R_UNEXPECTED; - -- /* If we didn't at least get the fixed portion of the BOOTP -- packet, drop the packet. We're allowing packets with no -- sname or filename, because we're aware of at least one -- client that sends such packets, but this definitely falls -- into the category of being forgiving. */ -- if (result < DHCP_FIXED_NON_UDP - DHCP_SNAME_LEN - DHCP_FILE_LEN) -+ /* -+ * If we didn't at least get the fixed portion of the BOOTP -+ * packet, drop the packet. -+ * Previously we allowed packets with no sname or filename -+ * as we were aware of at least one client that did. But -+ * a bug caused short packets to not work and nobody has -+ * complained, it seems rational to tighten up that -+ * restriction. -+ */ -+ if (result < DHCP_FIXED_NON_UDP) - return ISC_R_UNEXPECTED; - - if (bootp_packet_handler) { -diff -Naurp dhcp-4.2.1-P1/common/options.c dhcp-4.2.1-P1.oden/common/options.c ---- dhcp-4.2.1-P1/common/options.c 2011-03-24 22:57:13.000000000 +0100 -+++ dhcp-4.2.1-P1.oden/common/options.c 2011-08-18 12:55:47.003338734 +0200 -@@ -592,8 +592,8 @@ cons_options(struct packet *inpacket, st - } else if (bootpp) { - mb_size = 64; - if (inpacket != NULL && -- (inpacket->packet_length - DHCP_FIXED_LEN >= 64)) -- mb_size = inpacket->packet_length - DHCP_FIXED_LEN; -+ (inpacket->packet_length >= 64 + DHCP_FIXED_NON_UDP)) -+ mb_size = inpacket->packet_length - DHCP_FIXED_NON_UDP; - } else - mb_size = DHCP_MIN_OPTION_LEN; - -diff -Naurp dhcp-4.2.1-P1/server/dhcp.c dhcp-4.2.1-P1.oden/server/dhcp.c ---- dhcp-4.2.1-P1/server/dhcp.c 2010-09-09 08:52:37.000000000 +0200 -+++ dhcp-4.2.1-P1.oden/server/dhcp.c 2011-08-18 12:57:53.156117387 +0200 -@@ -2336,6 +2336,7 @@ void ack_lease (packet, lease, offer, wh - * giaddr. - */ - if (!packet->agent_options_stashed && -+ (packet->options != NULL) && - packet->options->universe_count > agent_universe.index && - packet->options->universes[agent_universe.index] != NULL) { - oc = lookup_option (&server_universe, state -> options, -@@ -4429,6 +4430,7 @@ maybe_return_agent_options(struct packet - * by the user into the new state, not just give up. - */ - if (!packet->agent_options_stashed && -+ (packet->options != NULL) && - packet->options->universe_count > agent_universe.index && - packet->options->universes[agent_universe.index] != NULL && - (options->universe_count <= agent_universe.index || diff --git a/dhcp-4.2.1-P1-CVE-2011-4539.diff b/dhcp-4.2.1-P1-CVE-2011-4539.diff deleted file mode 100644 index cf50347..0000000 --- a/dhcp-4.2.1-P1-CVE-2011-4539.diff +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naurp dhcp-4.2.1-P1/common/dhcp-eval.5 dhcp-4.2.1-P1.oden/common/dhcp-eval.5 ---- dhcp-4.2.1-P1/common/dhcp-eval.5 2010-07-06 19:03:11.000000000 +0000 -+++ dhcp-4.2.1-P1.oden/common/dhcp-eval.5 2011-12-08 11:31:44.000000000 +0000 -@@ -133,8 +133,8 @@ extended regex(7) matching of the values - true if \fIdata-expression-1\fR matches against the regular expression - evaluated by \fIdata-expression-2\fR, or false if it does not match or - encounters some error. If either the left-hand side or the right-hand side --are null, the result is also false. The \fB~~\fR operator differs from the --\fB~=\fR operator in that it is case-insensitive. -+are null or empty strings, the result is also false. The \fB~~\fR operator -+differs from the \fB~=\fR operator in that it is case-insensitive. - .RE - .PP - .I boolean-expression-1 \fBand\fR \fIboolean-expression-2\fR -diff -Naurp dhcp-4.2.1-P1/common/tree.c dhcp-4.2.1-P1.oden/common/tree.c ---- dhcp-4.2.1-P1/common/tree.c 2009-11-20 01:49:01.000000000 +0000 -+++ dhcp-4.2.1-P1.oden/common/tree.c 2011-12-08 11:31:38.000000000 +0000 -@@ -1120,6 +1120,7 @@ int evaluate_boolean_expression (result, - *result = 0; - memset(&re, 0, sizeof(re)); - if (bleft && bright && -+ (left.data != NULL) && (right.data != NULL) && - (regcomp(&re, (char *)right.data, regflags) == 0) && - (regexec(&re, (char *)left.data, (size_t)0, NULL, 0) == 0)) - *result = 1; diff --git a/dhcp-4.2.1-P1.tar.gz.sha512.asc b/dhcp-4.2.1-P1.tar.gz.sha512.asc deleted file mode 100644 index 6d53584..0000000 --- a/dhcp-4.2.1-P1.tar.gz.sha512.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.9 (GNU/Linux) - -iQEVAwUATZoM/dgRtT8Le64AAQoHqQf/dRI18soyGYHZwP868cMk4mZsTThTPCul -8WRfxQNjC93fRSrCeANdBeUOEjKnGbDyeAMS4gJHP4MnRywWDKvlKNjEhFNvoD4B -bKRAXTsvYjR19IwMmbjwexI7XAUbD208FiNvynvvjfKbnkiDnb4bJMzea2y/RGYO -RfNJm4SR4P4u4csuY9uG4CaD4z+3CZkCKX00l3oN3SHlkLfntPm/VUbpILtt77wQ -KH/nYaiglyt+SkFEevDMjvW6+04ZQ//tDYuSIOK0LZJBrkspAOMW8lWProZPl2oX -fOI+OLQHAavei1qber2A1Tqj1JC3BRftX6stuMbfTWGj4RYZmhHMNw== -=cijx ------END PGP SIGNATURE----- diff --git a/dhcp-4.1.1-format_not_a_string_literal_and_no_format_arguments.patch b/dhcp-4.2.2-fix-format-errors.patch similarity index 58% rename from dhcp-4.1.1-format_not_a_string_literal_and_no_format_arguments.patch rename to dhcp-4.2.2-fix-format-errors.patch index 0c7fca4..04c70dc 100644 --- a/dhcp-4.1.1-format_not_a_string_literal_and_no_format_arguments.patch +++ b/dhcp-4.2.2-fix-format-errors.patch @@ -1,7 +1,7 @@ -diff -p -up dhcp-4.1.1/client/dhclient.c.not_a_string dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.not_a_string 2010-01-07 19:47:40.000000000 -0200 -+++ dhcp-4.1.1/client/dhclient.c 2010-02-25 11:30:19.000000000 -0300 -@@ -381,9 +381,9 @@ main(int argc, char **argv) { +diff -Naur -x '*.orig' dhcp-4.2.2/client/dhclient.c dhcp-4.2.2-fix-format-errors/client/dhclient.c +--- dhcp-4.2.2/client/dhclient.c 2011-07-01 13:58:53.000000000 +0200 ++++ dhcp-4.2.2-fix-format-errors/client/dhclient.c 2011-08-29 19:08:55.560183457 +0200 +@@ -420,9 +420,9 @@ if (!quiet) { log_info("%s %s", message, PACKAGE_VERSION); @@ -14,7 +14,7 @@ diff -p -up dhcp-4.1.1/client/dhclient.c.not_a_string dhcp-4.1.1/client/dhclient log_info("%s", ""); } else { log_perror = 0; -@@ -647,9 +647,9 @@ main(int argc, char **argv) { +@@ -701,9 +701,9 @@ static void usage() { log_info("%s %s", message, PACKAGE_VERSION); @@ -25,12 +25,12 @@ diff -p -up dhcp-4.1.1/client/dhclient.c.not_a_string dhcp-4.1.1/client/dhclient + log_info("%s", arr); + log_info("%s", url); - log_error("Usage: dhclient %s %s", - #ifdef DHCPv6 -diff -p -up dhcp-4.1.1/relay/dhcrelay.c.not_a_string dhcp-4.1.1/relay/dhcrelay.c ---- dhcp-4.1.1/relay/dhcrelay.c.not_a_string 2010-01-07 19:48:02.000000000 -0200 -+++ dhcp-4.1.1/relay/dhcrelay.c 2010-02-25 11:30:22.000000000 -0300 -@@ -403,9 +403,9 @@ main(int argc, char **argv) { + + log_fatal("Usage: dhclient " +diff -Naur -x '*.orig' dhcp-4.2.2/relay/dhcrelay.c dhcp-4.2.2-fix-format-errors/relay/dhcrelay.c +--- dhcp-4.2.2/relay/dhcrelay.c 2011-05-10 15:07:37.000000000 +0200 ++++ dhcp-4.2.2-fix-format-errors/relay/dhcrelay.c 2011-08-29 19:08:55.561183444 +0200 +@@ -428,9 +428,9 @@ if (!quiet) { log_info("%s %s", message, PACKAGE_VERSION); @@ -43,10 +43,10 @@ diff -p -up dhcp-4.1.1/relay/dhcrelay.c.not_a_string dhcp-4.1.1/relay/dhcrelay.c } else { quiet = 0; log_perror = 0; -diff -p -up dhcp-4.1.1/server/dhcpd.c.not_a_string dhcp-4.1.1/server/dhcpd.c ---- dhcp-4.1.1/server/dhcpd.c.not_a_string 2010-02-25 11:29:56.000000000 -0300 -+++ dhcp-4.1.1/server/dhcpd.c 2010-02-25 11:30:22.000000000 -0300 -@@ -459,9 +459,9 @@ main(int argc, char **argv) { +diff -Naur -x '*.orig' dhcp-4.2.2/server/dhcpd.c dhcp-4.2.2-fix-format-errors/server/dhcpd.c +--- dhcp-4.2.2/server/dhcpd.c 2011-04-21 16:08:15.000000000 +0200 ++++ dhcp-4.2.2-fix-format-errors/server/dhcpd.c 2011-08-29 19:08:55.563183419 +0200 +@@ -474,9 +474,9 @@ if (!quiet) { log_info("%s %s", message, PACKAGE_VERSION); @@ -59,7 +59,7 @@ diff -p -up dhcp-4.1.1/server/dhcpd.c.not_a_string dhcp-4.1.1/server/dhcpd.c } else { quiet = 0; log_perror = 0; -@@ -1061,9 +1061,9 @@ void postconf_initialization (int quiet) +@@ -1096,9 +1096,9 @@ log_perror = 0; log_info("%s %s", message, PACKAGE_VERSION); @@ -72,7 +72,7 @@ diff -p -up dhcp-4.1.1/server/dhcpd.c.not_a_string dhcp-4.1.1/server/dhcpd.c log_perror = tmp; } } else -@@ -1170,8 +1170,8 @@ void postdb_startup (void) +@@ -1205,8 +1205,8 @@ static void usage(void) { log_info("%s %s", message, PACKAGE_VERSION); diff --git a/dhcp-4.1.1-ifup.patch b/dhcp-4.2.2-ifup.patch similarity index 86% rename from dhcp-4.1.1-ifup.patch rename to dhcp-4.2.2-ifup.patch index 2eb6cf6..0050468 100644 --- a/dhcp-4.1.1-ifup.patch +++ b/dhcp-4.2.2-ifup.patch @@ -1,6 +1,6 @@ -diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux ---- dhcp-4.1.1/client/scripts/linux.ifup 2009-04-21 11:21:09.000000000 -0300 -+++ dhcp-4.1.1/client/scripts/linux 2010-02-25 11:26:32.000000000 -0300 +diff -Naur -x '*~' -x '*.orig' -x '*.rej' dhcp-4.2.2/client/scripts/linux dhcp-4.2.2-ifup/client/scripts/linux +--- dhcp-4.2.2/client/scripts/linux 2011-05-18 22:01:54.000000000 +0200 ++++ dhcp-4.2.2-ifup/client/scripts/linux 2011-08-29 19:07:58.722894019 +0200 @@ -1,8 +1,11 @@ #!/bin/bash -# dhclient-script for Linux. Dan Halbert, March, 1997. @@ -17,7 +17,7 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux # Notes: -@@ -26,35 +29,46 @@ +@@ -26,28 +29,35 @@ ip=/sbin/ip make_resolv_conf() { @@ -54,7 +54,7 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux elif [ "x${new_dhcp6_name_servers}" != x ] ; then - cat /dev/null > /etc/resolv.conf.dhclient6 - chmod 644 /etc/resolv.conf.dhclient6 - +- - if [ "x${new_dhcp6_domain_search}" != x ] ; then - echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 + if [ -n "$DOMAIN" ]; then @@ -63,21 +63,25 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux + elif [ "x${new_dhcp6_domain_search}" != x ] ; then + d="search ${new_dhcp6_domain_search}" fi + shopt -s nocasematch for nameserver in ${new_dhcp6_name_servers} ; do -- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 -+ ns="$ns"$'\n'"nameserver ${nameserver}" +@@ -59,11 +69,13 @@ + else + zone_id= + fi +- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 ++ ns="$ns"$'\n'"nameserver ${nameserver}$zone_id" done + shopt -u nocasematch + fi - mv /etc/resolv.conf.dhclient6 /etc/resolv.conf + if [ -n "$d" -o -n "$ns" ]; then + change_resolv_conf "$d" "$ns" fi -+ } - # Must be used on exit. Invokes the local dhcp client exit hooks, if any. -@@ -78,6 +92,25 @@ if [ -f /etc/dhclient-enter-hooks ]; the +@@ -88,6 +100,25 @@ fi fi @@ -103,7 +107,7 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux ### ### DHCPv4 Handlers ### -@@ -128,15 +161,6 @@ fi +@@ -138,15 +169,6 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then @@ -119,7 +123,7 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \ [ x$alias_ip_address != x$old_ip_address ]; then -@@ -155,12 +179,14 @@ if [ x$reason = xBOUND ] || [ x$reason = +@@ -165,12 +187,14 @@ ifconfig $interface inet $new_ip_address $new_subnet_arg \ $new_broadcast_arg $mtu_arg # Add a network route to the computed network address. @@ -131,10 +135,10 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux route add default gw $router $metric_arg dev $interface done + fi - fi - if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; - then -@@ -168,7 +194,25 @@ if [ x$reason = xBOUND ] || [ x$reason = + else + # we haven't changed the address, have we changed other options + # that we wish to update? +@@ -193,7 +217,25 @@ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg route add -host $alias_ip_address $interface:0 fi @@ -161,7 +165,7 @@ diff -p -up dhcp-4.1.1/client/scripts/linux.ifup dhcp-4.1.1/client/scripts/linux exit_with_hooks 0 fi -@@ -202,13 +246,17 @@ if [ x$reason = xTIMEOUT ]; then +@@ -227,13 +269,17 @@ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg route add -host $alias_ip_address dev $interface:0 fi diff --git a/dhcp-4.2.2-missing-ipv6-not-fatal.patch b/dhcp-4.2.2-missing-ipv6-not-fatal.patch new file mode 100644 index 0000000..3e94311 --- /dev/null +++ b/dhcp-4.2.2-missing-ipv6-not-fatal.patch @@ -0,0 +1,40 @@ +diff -Naur -x '*~' -x '*.rej' -x '*.orig' dhcp-4.2.2/common/discover.c dhcp-4.2.2-missing-ipv6-not-fatal/common/discover.c +--- dhcp-4.2.2/common/discover.c 2011-07-20 00:22:48.000000000 +0200 ++++ dhcp-4.2.2-missing-ipv6-not-fatal/common/discover.c 2011-09-12 13:33:04.300509236 +0200 +@@ -455,7 +455,7 @@ + } + + #ifdef DHCPv6 +- if (local_family == AF_INET6) { ++ if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) { + ifaces->fp6 = fopen("/proc/net/if_inet6", "r"); + if (ifaces->fp6 == NULL) { + log_error("Error opening '/proc/net/if_inet6' to " +@@ -466,6 +466,8 @@ + ifaces->fp = NULL; + return 0; + } ++ } else { ++ ifaces->fp6 = NULL; + } + #endif + +@@ -733,7 +735,7 @@ + return 1; + } + #ifdef DHCPv6 +- if (!(*err)) { ++ if (!(*err) && ifaces->fp6) { + if (local_family == AF_INET6) + return next_iface6(info, err, ifaces); + } +@@ -752,7 +754,8 @@ + ifaces->sock = -1; + #ifdef DHCPv6 + if (local_family == AF_INET6) { +- fclose(ifaces->fp6); ++ if (ifaces->fp6) ++ fclose(ifaces->fp6); + ifaces->fp6 = NULL; + } + #endif diff --git a/dhcp-4.2.2-xen-checksum.patch b/dhcp-4.2.2-xen-checksum.patch new file mode 100644 index 0000000..038d346 --- /dev/null +++ b/dhcp-4.2.2-xen-checksum.patch @@ -0,0 +1,249 @@ +diff -up dhcp-4.2.2b1/common/bpf.c.xen dhcp-4.2.2b1/common/bpf.c +--- dhcp-4.2.2b1/common/bpf.c.xen 2009-11-20 02:48:59.000000000 +0100 ++++ dhcp-4.2.2b1/common/bpf.c 2011-07-01 14:00:16.936959001 +0200 +@@ -485,7 +485,7 @@ ssize_t receive_packet (interface, buf, + offset = decode_udp_ip_header (interface, + interface -> rbuf, + interface -> rbuf_offset, +- from, hdr.bh_caplen, &paylen); ++ from, hdr.bh_caplen, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) { +diff -up dhcp-4.2.2b1/common/dlpi.c.xen dhcp-4.2.2b1/common/dlpi.c +--- dhcp-4.2.2b1/common/dlpi.c.xen 2011-05-11 16:20:59.000000000 +0200 ++++ dhcp-4.2.2b1/common/dlpi.c 2011-07-01 14:00:16.937958997 +0200 +@@ -693,7 +693,7 @@ ssize_t receive_packet (interface, buf, + length -= offset; + #endif + offset = decode_udp_ip_header (interface, dbuf, bufix, +- from, length, &paylen); ++ from, length, &paylen, 0); + + /* + * If the IP or UDP checksum was bad, skip the packet... +diff -up dhcp-4.2.2b1/common/lpf.c.xen dhcp-4.2.2b1/common/lpf.c +--- dhcp-4.2.2b1/common/lpf.c.xen 2011-05-10 16:38:58.000000000 +0200 ++++ dhcp-4.2.2b1/common/lpf.c 2011-07-01 14:11:24.725748028 +0200 +@@ -29,19 +29,33 @@ + #include "dhcpd.h" + #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) + #include ++#include + #include + #include + + #include + #include + #include ++#include + #include +-#include + #include "includes/netinet/ip.h" + #include "includes/netinet/udp.h" + #include "includes/netinet/if_ether.h" + #include + ++#ifndef PACKET_AUXDATA ++#define PACKET_AUXDATA 8 ++ ++struct tpacket_auxdata ++{ ++ __u32 tp_status; ++ __u32 tp_len; ++ __u32 tp_snaplen; ++ __u16 tp_mac; ++ __u16 tp_net; ++}; ++#endif ++ + /* Reinitializes the specified interface after an address change. This + is not required for packet-filter APIs. */ + +@@ -67,10 +81,14 @@ int if_register_lpf (info) + struct interface_info *info; + { + int sock; +- struct sockaddr sa; ++ union { ++ struct sockaddr_ll ll; ++ struct sockaddr common; ++ } sa; ++ struct ifreq ifr; + + /* Make an LPF socket. */ +- if ((sock = socket(PF_PACKET, SOCK_PACKET, ++ if ((sock = socket(PF_PACKET, SOCK_RAW, + htons((short)ETH_P_ALL))) < 0) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || +@@ -85,11 +103,17 @@ int if_register_lpf (info) + log_fatal ("Open a socket for LPF: %m"); + } + ++ memset (&ifr, 0, sizeof ifr); ++ strncpy (ifr.ifr_name, (const char *)info -> ifp, sizeof ifr.ifr_name); ++ ifr.ifr_name[IFNAMSIZ-1] = '\0'; ++ if (ioctl (sock, SIOCGIFINDEX, &ifr)) ++ log_fatal ("Failed to get interface index: %m"); ++ + /* Bind to the interface name */ + memset (&sa, 0, sizeof sa); +- sa.sa_family = AF_PACKET; +- strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data); +- if (bind (sock, &sa, sizeof sa)) { ++ sa.ll.sll_family = AF_PACKET; ++ sa.ll.sll_ifindex = ifr.ifr_ifindex; ++ if (bind (sock, &sa.common, sizeof sa)) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || + errno == EAFNOSUPPORT || errno == EINVAL) { +@@ -171,9 +195,18 @@ static void lpf_gen_filter_setup (struct + void if_register_receive (info) + struct interface_info *info; + { ++ int val; ++ + /* Open a LPF device and hang it on this interface... */ + info -> rfdesc = if_register_lpf (info); + ++ val = 1; ++ if (setsockopt (info -> rfdesc, SOL_PACKET, PACKET_AUXDATA, &val, ++ sizeof val) < 0) { ++ if (errno != ENOPROTOOPT) ++ log_fatal ("Failed to set auxiliary packet data: %m"); ++ } ++ + #if defined (HAVE_TR_SUPPORT) + if (info -> hw_address.hbuf [0] == HTYPE_IEEE802) + lpf_tr_filter_setup (info); +@@ -295,7 +328,6 @@ ssize_t send_packet (interface, packet, + double hh [16]; + double ih [1536 / sizeof (double)]; + unsigned char *buf = (unsigned char *)ih; +- struct sockaddr_pkt sa; + int result; + int fudge; + +@@ -316,17 +348,7 @@ ssize_t send_packet (interface, packet, + (unsigned char *)raw, len); + memcpy (buf + ibufp, raw, len); + +- /* For some reason, SOCK_PACKET sockets can't be connected, +- so we have to do a sentdo every time. */ +- memset (&sa, 0, sizeof sa); +- sa.spkt_family = AF_PACKET; +- strncpy ((char *)sa.spkt_device, +- (const char *)interface -> ifp, sizeof sa.spkt_device); +- sa.spkt_protocol = htons(ETH_P_IP); +- +- result = sendto (interface -> wfdesc, +- buf + fudge, ibufp + len - fudge, 0, +- (const struct sockaddr *)&sa, sizeof sa); ++ result = write (interface -> wfdesc, buf + fudge, ibufp + len - fudge); + if (result < 0) + log_error ("send_packet: %m"); + return result; +@@ -343,14 +365,35 @@ ssize_t receive_packet (interface, buf, + { + int length = 0; + int offset = 0; ++ int nocsum = 0; + unsigned char ibuf [1536]; + unsigned bufix = 0; + unsigned paylen; ++ unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))]; ++ struct iovec iov = { ++ .iov_base = ibuf, ++ .iov_len = sizeof ibuf, ++ }; ++ struct msghdr msg = { ++ .msg_iov = &iov, ++ .msg_iovlen = 1, ++ .msg_control = cmsgbuf, ++ .msg_controllen = sizeof(cmsgbuf), ++ }; ++ struct cmsghdr *cmsg; + +- length = read (interface -> rfdesc, ibuf, sizeof ibuf); ++ length = recvmsg (interface -> rfdesc, &msg, 0); + if (length <= 0) + return length; + ++ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { ++ if (cmsg->cmsg_level == SOL_PACKET && ++ cmsg->cmsg_type == PACKET_AUXDATA) { ++ struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg); ++ nocsum = aux->tp_status & TP_STATUS_CSUMNOTREADY; ++ } ++ } ++ + bufix = 0; + /* Decode the physical header... */ + offset = decode_hw_header (interface, ibuf, bufix, hfrom); +@@ -367,7 +410,7 @@ ssize_t receive_packet (interface, buf, + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, from, +- (unsigned)length, &paylen); ++ (unsigned)length, &paylen, nocsum); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) +diff -up dhcp-4.2.2b1/common/nit.c.xen dhcp-4.2.2b1/common/nit.c +--- dhcp-4.2.2b1/common/nit.c.xen 2009-11-20 02:49:01.000000000 +0100 ++++ dhcp-4.2.2b1/common/nit.c 2011-07-01 14:00:16.939958989 +0200 +@@ -369,7 +369,7 @@ ssize_t receive_packet (interface, buf, + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, +- from, length, &paylen); ++ from, length, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) +diff -up dhcp-4.2.2b1/common/packet.c.xen dhcp-4.2.2b1/common/packet.c +--- dhcp-4.2.2b1/common/packet.c.xen 2009-07-23 20:52:20.000000000 +0200 ++++ dhcp-4.2.2b1/common/packet.c 2011-07-01 14:00:16.939958989 +0200 +@@ -211,7 +211,7 @@ ssize_t + decode_udp_ip_header(struct interface_info *interface, + unsigned char *buf, unsigned bufix, + struct sockaddr_in *from, unsigned buflen, +- unsigned *rbuflen) ++ unsigned *rbuflen, int nocsum) + { + unsigned char *data; + struct ip ip; +@@ -322,7 +322,7 @@ decode_udp_ip_header(struct interface_in + 8, IPPROTO_UDP + ulen)))); + + udp_packets_seen++; +- if (usum && usum != sum) { ++ if (!nocsum && usum && usum != sum) { + udp_packets_bad_checksum++; + if (udp_packets_seen > 4 && + (udp_packets_seen / udp_packets_bad_checksum) < 2) { +diff -up dhcp-4.2.2b1/common/upf.c.xen dhcp-4.2.2b1/common/upf.c +--- dhcp-4.2.2b1/common/upf.c.xen 2009-11-20 02:49:01.000000000 +0100 ++++ dhcp-4.2.2b1/common/upf.c 2011-07-01 14:00:16.940958986 +0200 +@@ -320,7 +320,7 @@ ssize_t receive_packet (interface, buf, + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, +- from, length, &paylen); ++ from, length, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) +diff -up dhcp-4.2.2b1/includes/dhcpd.h.xen dhcp-4.2.2b1/includes/dhcpd.h +--- dhcp-4.2.2b1/includes/dhcpd.h.xen 2011-07-01 14:00:16.000000000 +0200 ++++ dhcp-4.2.2b1/includes/dhcpd.h 2011-07-01 14:12:18.069642470 +0200 +@@ -2796,7 +2796,7 @@ ssize_t decode_hw_header (struct interfa + unsigned, struct hardware *); + ssize_t decode_udp_ip_header (struct interface_info *, unsigned char *, + unsigned, struct sockaddr_in *, +- unsigned, unsigned *); ++ unsigned, unsigned *, int); + + /* ethernet.c */ + void assemble_ethernet_header (struct interface_info *, unsigned char *, diff --git a/dhcp-4.2.4-64_bit_lease_parse.patch b/dhcp-4.2.4-64_bit_lease_parse.patch new file mode 100644 index 0000000..c1b978b --- /dev/null +++ b/dhcp-4.2.4-64_bit_lease_parse.patch @@ -0,0 +1,84 @@ +diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/parse.c +--- dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse 2012-03-09 12:28:10.000000000 +0100 ++++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:30:55.867045149 +0200 +@@ -906,8 +906,8 @@ TIME + parse_date_core(cfile) + struct parse *cfile; + { +- int guess; +- int tzoff, year, mon, mday, hour, min, sec; ++ TIME guess; ++ long int tzoff, year, mon, mday, hour, min, sec; + const char *val; + enum dhcp_token token; + static int months[11] = { 31, 59, 90, 120, 151, 181, +@@ -933,7 +933,7 @@ parse_date_core(cfile) + } + + token = next_token(&val, NULL, cfile); /* consume number */ +- guess = atoi(val); ++ guess = atol(val); + + return((TIME)guess); + } +@@ -961,7 +961,7 @@ parse_date_core(cfile) + somebody invents a time machine, I think we can safely disregard + it. This actually works around a stupid Y2K bug that was present + in a very early beta release of dhcpd. */ +- year = atoi(val); ++ year = atol(val); + if (year > 1900) + year -= 1900; + +@@ -985,7 +985,7 @@ parse_date_core(cfile) + return((TIME)0); + } + token = next_token(&val, NULL, cfile); /* consume month */ +- mon = atoi(val) - 1; ++ mon = atol(val) - 1; + + /* Slash separating month from day... */ + token = peek_token(&val, NULL, cfile); +@@ -1007,7 +1007,7 @@ parse_date_core(cfile) + return((TIME)0); + } + token = next_token(&val, NULL, cfile); /* consume day of month */ +- mday = atoi(val); ++ mday = atol(val); + + /* Hour... */ + token = peek_token(&val, NULL, cfile); +@@ -1018,7 +1018,7 @@ parse_date_core(cfile) + return((TIME)0); + } + token = next_token(&val, NULL, cfile); /* consume hour */ +- hour = atoi(val); ++ hour = atol(val); + + /* Colon separating hour from minute... */ + token = peek_token(&val, NULL, cfile); +@@ -1040,7 +1040,7 @@ parse_date_core(cfile) + return((TIME)0); + } + token = next_token(&val, NULL, cfile); /* consume minute */ +- min = atoi(val); ++ min = atol(val); + + /* Colon separating minute from second... */ + token = peek_token(&val, NULL, cfile); +@@ -1062,13 +1062,13 @@ parse_date_core(cfile) + return((TIME)0); + } + token = next_token(&val, NULL, cfile); /* consume second */ +- sec = atoi(val); ++ sec = atol(val); + + tzoff = 0; + token = peek_token(&val, NULL, cfile); + if (token == NUMBER) { + token = next_token(&val, NULL, cfile); /* consume tzoff */ +- tzoff = atoi(val); ++ tzoff = atol(val); + } else if (token != SEMI) { + token = next_token(&val, NULL, cfile); + parse_warn(cfile, diff --git a/dhcp-4.2.5-P1-man.patch b/dhcp-4.2.5-P1-man.patch new file mode 100644 index 0000000..84bb383 --- /dev/null +++ b/dhcp-4.2.5-P1-man.patch @@ -0,0 +1,22 @@ +diff -Naur dhcp-4.2.5-P1/client/dhclient.conf.5 dhcp-4.2.5-P1.oden/client/dhclient.conf.5 +--- dhcp-4.2.5-P1/client/dhclient.conf.5 2013-03-05 19:26:51.000000000 +0100 ++++ dhcp-4.2.5-P1.oden/client/dhclient.conf.5 2013-03-28 11:55:37.131387053 +0100 +@@ -202,7 +202,8 @@ + options. Only the option names should be specified in the request + statement - not option parameters. By default, the DHCPv4 client + requests the subnet-mask, broadcast-address, time-offset, routers, +-domain-name, domain-name-servers and host-name options while the DHCPv6 ++domain-search, domain-name, domain-name-servers, host-name, nis-domain, ++nis-servers, ntp-servers and interface-mtu options while the DHCPv6 + client requests the dhcp6 name-servers and domain-search options. Note + that if you enter a \'request\' statement, you over-ride these defaults + and these options will not be requested. +@@ -713,7 +714,7 @@ + supersede domain-search "fugue.com", "rc.vix.com", "home.vix.com"; + prepend domain-name-servers 127.0.0.1; + request subnet-mask, broadcast-address, time-offset, routers, +- domain-name, domain-name-servers, host-name; ++ domain-search, domain-name, domain-name-servers, host-name; + require subnet-mask, domain-name-servers; + script "CLIENTBINDIR/dhclient-script"; + media "media 10baseT/UTP", "media 10base2/BNC"; diff --git a/dhcp.spec b/dhcp.spec index 9bc6d2e..72d6a70 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -1,43 +1,47 @@ %define _catdir /var/cache/man -%define pver P1 -Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client +%define major_version 4.2.5 +%define patch_version P1 + Name: dhcp Epoch: 3 -Version: 4.2.1 -%define subrel 1 -Release: %mkrel 0.%{pver}.2 +Version: %{major_version}%{patch_version} +Release: 1 +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client License: Distributable Group: System/Servers -URL: https://www.isc.org/software/dhcp -Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}-%{pver}.tar.gz -Source1: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}-%{pver}.tar.gz.sha512.asc +URL: http://www.isc.org/software/dhcp +Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz +Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz.sha512.asc Source2: dhcpd.conf -Source3: dhcpd.init Source4: dhcp-dynamic-dns-examples.tar.bz2 -Source5: dhcrelay.init -Source6: update_dhcp.pl Source7: dhcpreport.pl Source8: dhcpd-chroot.sh # (eugeni) dhclient-exit-hooks script Source9: dhclient-exit-hooks -Source12: draft-ietf-dhc-ldap-schema-01.txt -# customize ifup script -Patch0: dhcp-4.1.1-ifup.patch -Patch5: dhcp-4.1.1-format_not_a_string_literal_and_no_format_arguments.patch -# (fc) 4.1.0-3mdv no IPv6 is no longer fatal for dhclient -Patch6: dhcp-4.1.1-missing-ipv6-not-fatal.patch +Source10: draft-ietf-dhc-ldap-schema-01.txt +Source12: dhcpd.service +Source14: dhcpd6.service +Source16: dhcrelay.service +Source17: dhcpd.tmpfiles +Source18: dhclient.tmpfiles +Source19: dhcrelay.tmpfiles +# mageia patches +Patch100: dhcp-4.2.2-ifup.patch +Patch101: dhcp-4.2.2-fix-format-errors.patch # prevents needless deassociation, working around mdv bug #43441 -Patch7: dhcp-4.1.1-prevent_wireless_deassociation.patch -# redhat bug #587070 -Patch9: dhcp-4.1.1-useless-wait.patch -Patch10: dhcp-4.2.1-P1-CVE-2011-2748,2749.diff -Patch11: dhcp-4.2.1-P1-CVE-2011-4539.diff -BuildRequires: perl groff-for-man +Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch +Patch103: dhcp-4.2.5-P1-man.patch +# fedora patches +Patch7: dhcp-4.2.0-default-requested-options.patch +Patch8: dhcp-4.2.2-xen-checksum.patch +Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch +Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch +Patch18: dhcp-4.2.4-64_bit_lease_parse.patch +BuildRequires: groff-for-man BuildRequires: openldap-devel -Provides: dhcpd -Obsoletes: dhcpd < 3.0.6 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Requires(post): rpm-helper >= 0.24.8-1 +Requires(preun): rpm-helper >= 0.24.8-1 %description DHCP (Dynamic Host Configuration Protocol) is a protocol which allows @@ -87,10 +91,9 @@ DHCP server and a DHCP relay agent. Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server Group: System/Servers Requires: dhcp-common = %{epoch}:%{version}-%{release} -Requires(post): rpm-helper -Requires(preun): rpm-helper -Obsoletes: dhcp < 3.0.6 -Provides: dhcp +Requires(post): systemd >= %{systemd_required_version} +Requires(post): rpm-helper >= 0.24.8-1 +Requires(preun): rpm-helper >= 0.24.8-1 %description server DHCP server is the Internet Software Consortium (ISC) DHCP server for various @@ -104,6 +107,7 @@ network. You will also need to install the base dhcp package. Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client Group: System/Servers Requires: dhcp-common = %{epoch}:%{version}-%{release} +Requires(post): systemd >= %{systemd_required_version} %description client DHCP client is the Internet Software Consortium (ISC) DHCP client for various @@ -118,8 +122,9 @@ install the base dhcp package. Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay Group: System/Servers Requires: dhcp-common = %{epoch}:%{version}-%{release} -Requires(post): rpm-helper -Requires(preun): rpm-helper +Requires(post): systemd >= %{systemd_required_version} +Requires(post): rpm-helper >= 0.24.8-1 +Requires(preun): rpm-helper >= 0.24.8-1 %description relay DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP @@ -140,60 +145,71 @@ DHCP devel contains all of the libraries and headers for developing with the Internet Software Consortium (ISC) dhcpctl API. %prep +%setup -q -n %{name}-%{major_version}-%{patch_version} +%patch100 -p1 -b .ifup +%patch101 -p1 -b .format_not_a_string_literal_and_no_format_arguments +%patch102 -p1 -b .prevent_wireless_deassociation +%patch103 -p1 -b .man -%setup -q -n %{name}-%{version}-%{pver} -a4 -%patch0 -p1 -b .ifup -%patch5 -p1 -b .format_not_a_string_literal_and_no_format_arguments -%patch6 -p1 -b .noipv6nonfatal -%patch7 -p1 -b .prevent_wireless_deassociation -%patch9 -p0 -b .useless_wait -%patch10 -p1 -b .CVE-2011-2748,2749 -%patch11 -p1 -b .CVE-2011-4539 +# Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search +# to the list of default requested DHCP options +%patch7 -p1 -b .requested +# Handle Xen partial UDP checksums +%patch8 -p1 -b .xen +# If the ipv6 kernel module is missing, do not segfault +# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367]) +%patch15 -p1 -b .noipv6 +# Handle cases in add_timeout() where the function is called with a NULL +# value for the 'when' parameter +%patch17 -p1 -b .dracut +# Ensure 64-bit platforms parse lease file dates & times correctly +%patch18 -p1 -b .64-bit_lease_parse -install -m0644 %{SOURCE12} doc +install -m0644 %{SOURCE10} doc %build %serverbuild %configure2_5x --enable-paranoia --enable-early-chroot \ --with-ldapcrypto \ - --with-srv-lease-file=%{_var}/lib/dhcp/dhcpd.leases \ - --with-srv6-lease-file=%{_var}/lib/dhcp/dhcpd6.leases \ - --with-cli-lease-file=%{_var}/lib/dhcp/dhclient.leases \ - --with-cli6-lease-file=%{_var}/lib/dhcp/dhclient6.leases \ + --with-srv-lease-file=%{_var}/lib/dhcpd/dhcpd.leases \ + --with-srv6-lease-file=%{_var}/lib/dhcpd/dhcpd6.leases \ + --with-cli-lease-file=%{_var}/lib/dhclient/dhclient.leases \ + --with-cli6-lease-file=%{_var}/lib/dhclient/dhclient6.leases \ --with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \ --with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \ - --with-cli-pid-file=%{_var}/run/dhclient.pid \ - --with-cli6-pid-file=%{_var}/run/dhclient6.pid \ - --with-relay-pid-file=%{_var}/run/dhcrelay.pid - + --with-cli-pid-file=%{_var}/run/dhclient/dhclient.pid \ + --with-cli6-pid-file=%{_var}/run/dhclient/dhclient6.pid \ + --with-relay-pid-file=%{_var}/run/dhcrelay/dhcrelay.pid \ + --disable-static %make %install rm -rf %{buildroot} -install -d %{buildroot}%{_bindir} -install -d %{buildroot}%{_sysconfdir}/sysconfig -install -d %{buildroot}%{_initrddir} -install -d %{buildroot}%{_var}/lib/dhcp -install -d %{buildroot}%{_var}/run/dhcpd - %makeinstall_std # Install correct dhclient-script -%{__mkdir} -p %{buildroot}/sbin -%{__mv} %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient -%{__install} -p -m 0755 client/scripts/linux %{buildroot}/sbin/dhclient-script +install -d %{buildroot}/sbin +mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient +install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script +install -d %{buildroot}%{_unitdir} +install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service +install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service +install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service -install -m0755 %{SOURCE3} %{buildroot}%{_initrddir}/dhcpd -install -m0755 %{SOURCE5} %{buildroot}%{_initrddir}/dhcrelay -install -m0755 %{SOURCE6} %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}/ -install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ -install -m0755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir}/ +install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf +install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf +install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf + +install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir} +install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir} +install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir} # install exit-hooks script to /etc/ -install -m0755 %{SOURCE9} %{buildroot}%{_sysconfdir}/ +install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir} +install -d %{buildroot}%{_sysconfdir}/sysconfig cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay </dev/null 2>&1 -fi - %post relay %_post_service dhcrelay +%_tmpfilescreate dhcrelay %preun relay %_preun_service dhcrelay -%postun relay -if [ "$1" -ge "1" ]; then - /sbin/service dhcrelay condrestart >/dev/null 2>&1 -fi - %post client -touch /var/lib/dhcp/dhclient.leases +touch %{_var}/lib/dhclient/dhclient.leases +%_tmpfilescreate dhclient %postun client -rm -rf /var/lib/dhcp/dhclient.leases - -%clean -rm -rf %{buildroot} +rm -rf %{_var}/lib/dhclient/dhclient.leases %files common -%defattr(-,root,root) %doc README contrib/ldap/README.ldap RELNOTES %doc contrib/3.0b1-lease-convert -%dir %{_var}/lib/dhcp %{_mandir}/man5/dhcp-options.5* %files doc -%defattr(-,root,root) %doc doc/* %files server -%defattr(-,root,root) -%doc server/dhcpd.conf tests/failover contrib/ldap/dhcp.schema -%{_initrddir}/dhcpd +%doc server/dhcpd.conf.example tests/failover contrib/ldap/dhcp.schema +%{_unitdir}/dhcpd.service +%{_unitdir}/dhcpd6.service +%{_tmpfilesdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhclient-exit-hooks %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd -%config(noreplace) %ghost %{_var}/lib/dhcp/dhcpd.leases %{_sbindir}/dhcpd -%{_sbindir}/update_dhcp.pl %{_sbindir}/dhcpreport.pl %{_sbindir}/dhcpd-conf-to-ldap %{_sbindir}/dhcpd-chroot.sh @@ -314,30 +313,428 @@ rm -rf %{buildroot} %{_mandir}/man5/dhcpd.leases.5* %{_mandir}/man5/dhcp-eval.5* %{_mandir}/man8/dhcpd.8* -%dir %{_var}/run/dhcpd +%dir %{_var}/lib/dhcpd +%config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd.leases %files relay -%defattr(-,root,root) -%{_initrddir}/dhcrelay +%{_unitdir}/dhcrelay.service +%{_tmpfilesdir}/dhcrelay.conf %config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay %{_sbindir}/dhcrelay %{_mandir}/man8/dhcrelay.8* %files client -%defattr(-,root,root) -%doc client/dhclient.conf -%config(noreplace) %ghost %{_var}/lib/dhcp/dhclient.leases +%doc client/dhclient.conf.example %attr (0755,root,root) /sbin/dhclient-script +%{_tmpfilesdir}/dhclient.conf /sbin/dhclient %{_mandir}/man5/dhclient.conf.5* %{_mandir}/man5/dhclient.leases.5* %{_mandir}/man8/dhclient.8* %{_mandir}/man8/dhclient-script.8* +%dir %{_var}/lib/dhclient +%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases %files devel -%defattr(-,root,root) %{_includedir}/* -%{_libdir}/*.a -%{_mandir}/man3/dhcpctl.3* +%{_mandir}/man3/* +%changelog + +* Thu Mar 28 2013 oden 3:4.2.5P1-1.mga3 ++ Revision: 405980 +- P103: rediff +- 4.2.5-P1 (fixes CVE-2013-2494) +- drop bogus br on bind-devel +- Make sure ldap service is started before dhcpd (neoclust) + +* Sun Mar 24 2013 colin 3:4.2.4P2-5.mga3 ++ Revision: 405136 +- Use tmpfiles macros and add system version to requires (mga#9302) + +* Fri Jan 11 2013 umeabot 3:4.2.4P2-4.mga3 ++ Revision: 348757 +- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild + +* Wed Dec 26 2012 guillomovitch 3:4.2.4P2-3.mga3 ++ Revision: 335360 +- add fedora patch adding requesting more options by default + +* Mon Dec 17 2012 guillomovitch 3:4.2.4P2-2.mga3 ++ Revision: 332185 +- drop static libs +- use /run instead of /var/run for pid files +- switch to tmpfs for /run subdirectories +- use distinct state directories for client and server, as in fedora + +* Thu Sep 13 2012 luigiwalser 3:4.2.4P2-1.mga3 ++ Revision: 293669 +- 4.2.4-P2 (fixes CVE-2012-3955) + +* Tue Jul 31 2012 guillomovitch 3:4.2.4P1-1.mga3 ++ Revision: 276555 +- drop sysinit support +- new version + +* Sat Apr 28 2012 tmb 3:4.2.3P2-6.mga2 ++ Revision: 233666 +- Require rpm-helper >= 0.24.8-1 for systemd support +- rebuild for versioned rpm-helper requires + +* Wed Mar 14 2012 stewb 3:4.2.3P2-4.mga2 ++ Revision: 223343 +- Get rid of mandrakesoft in dhcpd.conf (mageia bug #3353) + +* Mon Mar 12 2012 colin 3:4.2.3P2-3.mga2 ++ Revision: 223169 +- Fix systemd units to report correct status on startup (mga#4892) + +* Tue Jan 31 2012 dmorgan 3:4.2.3P2-2.mga2 ++ Revision: 203651 +- Add dhcpd user +- Fix service files extension + +* Sun Jan 15 2012 fwang 3:4.2.3_P2-1.mga2 ++ Revision: 196496 +- new version 4.2.3p2 + +* Fri Dec 30 2011 anssi 3:4.2.3_P1-1.mga2 ++ Revision: 188952 +- new version 4.2.3-P1 (fixes CVE-2011-4539) + +* Sun Nov 20 2011 zezinho 3:4.2.3-1.mga2 ++ Revision: 169838 +- new version + +* Mon Sep 12 2011 guillomovitch 3:4.2.2-3.mga2 ++ Revision: 142670 +- resync ipv6-not-fatal patch with fedora +- add 3 new fedora patches + * dhcp-4.2.0-add_timeout_when_NULL.patch + * dhcp-4.2.1-64_bit_lease_parse.patch + * dhcp-4.2.2-xen-checksum.patch (attempt to fix #1243) + +* Tue Sep 06 2011 guillomovitch 3:4.2.2-2.mga2 ++ Revision: 139289 +- sync init scripts with fedora (lsb headers, mostly) +- ship systemd service files + +* Tue Aug 30 2011 guillomovitch 3:4.2.2-1.mga2 ++ Revision: 136450 +- add missing LSB header +- new version +- rediff ifup and format-errors patches +- drop wait patch, merged upstream (according to fedora) +- drop prehistoric dhcp 2 -> 3 upgrade script +- spec cleanup + + + tv + - add missing LSB keywords + +* Sun May 15 2011 pterjan 3:4.2.1-0.P1.3.mga1 ++ Revision: 98933 +- Rebuild for fixed find-requires + +* Thu Apr 14 2011 pterjan 3:4.2.1-0.P1.2.mga1 ++ Revision: 84812 +- Re-upload after upload bug + +* Wed Apr 13 2011 tv 3:4.2.1-0.P1.1.mga1 ++ Revision: 84559 +- 4.2.1-P1 +- drop upstream added patch 8 +- Added sample dhclient-exit-hooks, initially handling + rfc3442_classless_static_routes (suggested in #62242). + + + dmorgan + - imported package dhcp + + +* Thu Jan 06 2011 Oden Eriksson 3:4.2.0-0.P2.1mdv2011.0 ++ Revision: 629100 +- 4.2.0-P2 +- bump release +- 4.2.0-P1 + +* Mon Aug 30 2010 Olivier Blin 2:4.2.0-1mdv2011.0 ++ Revision: 574440 +- do not define again _GNU_SOURCE, now defined in default configure script +- 4.2.0 +- LDAP patch merged upstream + +* Mon Jul 12 2010 Eugeni Dodonov 2:4.1.1-7mdv2011.0 ++ Revision: 551267 +- Get rid of some useless wait (rh bug #587070) + +* Fri Jun 11 2010 Oden Eriksson 2:4.1.1-6mdv2010.1 ++ Revision: 547867 +- 4.1.1-P1 + +* Tue Apr 06 2010 Funda Wang 2:4.1.1-5mdv2010.1 ++ Revision: 531983 +- rebuild for new openssl + +* Fri Mar 12 2010 Götz Waschk 2:4.1.1-4mdv2010.1 ++ Revision: 518419 +- remove debug files from devel package + +* Tue Mar 09 2010 Guillaume Rousse 2:4.1.1-3mdv2010.1 ++ Revision: 517076 +- set explicit runlevels in init script + +* Fri Feb 26 2010 Oden Eriksson 2:4.1.1-2mdv2010.1 ++ Revision: 511559 +- rebuilt against openssl-0.9.8m + +* Thu Feb 25 2010 Eugeni Dodonov 2:4.1.1-1mdv2010.1 ++ Revision: 511131 +- Updated to 4.1.1. + Rediff P0, P5, P6, P7. + Drop P9 (merged upstream). + Drop P10 (no longer needed). + +* Wed Feb 17 2010 Eugeni Dodonov 2:4.1.0p1-4mdv2010.1 ++ Revision: 507051 +- Updated ldap patch to use correct variables (#56028). + +* Tue Jan 26 2010 Eugeni Dodonov 2:4.1.0p1-3mdv2010.1 ++ Revision: 496733 +- Allow setting MTU if specified by the server (#57260). + +* Wed Sep 23 2009 Oden Eriksson 2:4.1.0p1-2mdv2010.0 ++ Revision: 447689 +- P9: security fix for CVE-2009-1892 + +* Wed Jul 15 2009 Oden Eriksson 2:4.1.0p1-1mdv2010.0 ++ Revision: 396413 +- 4.1.0p1 + +* Fri Jun 19 2009 Wanderlei Cavassin 2:4.1.0-6mdv2010.0 ++ Revision: 387320 +- fixed lease file parsing for tokens never and epoch (closes mdv #50194) + + + Götz Waschk + - fix URL + +* Wed Mar 04 2009 Gustavo De Nardin 2:4.1.0-5mdv2009.1 ++ Revision: 348205 +- added Patch7, as suggested by Andrey Borzenkov, which prevents + dhclient-script from bringing interfaces down needlessly, which in turn + works around bug #43441 (deassociation going unnoticed by wpa_supplicant, + in the end causing the interface to not get an IP address) + +* Thu Feb 19 2009 Frederic Crozat 2:4.1.0-4mdv2009.1 ++ Revision: 342950 +- Update patch6 with Fedora version which has been submitted upstream for inclusion + +* Fri Jan 09 2009 Frederic Crozat 2:4.1.0-3mdv2009.1 ++ Revision: 327771 +- Patch6: no IPv6 is no longer a fatal error for dhclient + +* Thu Jan 08 2009 Frederic Crozat 2:4.1.0-2mdv2009.1 ++ Revision: 327169 +- Update patch0 to correctly work with resolvconf + +* Thu Jan 08 2009 Frederic Crozat 2:4.1.0-1mdv2009.1 ++ Revision: 327047 +- Release 4.1.0 (Mdv bug #46804) +- Remove detection of 64bits host at buildtime, configure is smart enough now +- Enable IPv6 support +- Regenerate patches 0, 5 +- Remove patches 2 (merged upstream), 4 (useless) +- Patch1 (LDAP support) is now taked from Fedora, as well as source 9, 10, 11, 12 + +* Sat Dec 20 2008 Oden Eriksson 2:3.0.7-2mdv2009.1 ++ Revision: 316549 +- rediffed one fuzzy patch +- fix build with -Werror=format-security (P5) + +* Sun Jul 13 2008 Tomasz Pawel Gajc 2:3.0.7-1mdv2009.0 ++ Revision: 234269 +- update to new version 3.0.7 +- Patch1: new version +- use %%_var instead of %%_localstatedir +- spec file clean + +* Mon Jun 16 2008 Thierry Vignaud 2:3.0.6-6mdv2009.0 ++ Revision: 220615 +- rebuild + + + Pixel + - adapt to %%_localstatedir now being /var instead of /var/lib (#22312) + +* Wed Mar 26 2008 Oden Eriksson 2:3.0.6-5mdv2008.1 ++ Revision: 190309 +- don't start it per default + +* Wed Jan 23 2008 Thierry Vignaud 2:3.0.6-4mdv2008.1 ++ Revision: 157246 +- rebuild with fixed %%serverbuild macro + +* Mon Dec 24 2007 Oden Eriksson 2:3.0.6-3mdv2008.1 ++ Revision: 137459 +- rebuilt against openldap-2.4.7 libs + + + Olivier Blin + - restore BuildRoot + - fix typo in doc description + + + Thierry Vignaud + - kill re-definition of %%buildroot on Pixel's request + +* Wed Dec 12 2007 Olivier Blin 2:3.0.6-2mdv2008.1 ++ Revision: 119077 +- move rpm-helper requirements in post/preun instead of pre/postun when needed + +* Tue Jul 10 2007 Tomasz Pawel Gajc 2:3.0.6-1mdv2008.0 ++ Revision: 50797 +- new version + +* Wed Jul 04 2007 Andreas Hasenack 2:3.0.5-8mdv2008.0 ++ Revision: 48227 +- use serverbuild macro (-fstack-protector-all) + + +* Wed Mar 28 2007 Olivier Blin 3.0.5-7mdv2007.1 ++ Revision: 149230 +- dhcpcd should start ldap (Daggett) + +* Fri Mar 16 2007 Olivier Blin 2:3.0.5-6mdv2007.1 ++ Revision: 144641 +- drop useless perl(Win32API::Registry) requires exception +- move RFC/API/protocol doc in a dhcp-doc sub-package + +* Sat Mar 10 2007 Olivier Blin 2:3.0.5-5mdv2007.1 ++ Revision: 140432 +- PEERGATEWAY support (#20806) + +* Sat Mar 10 2007 Olivier Blin 2:3.0.5-4mdv2007.1 ++ Revision: 140295 +- default to NEEDHOSTNAME=no, as described in initscripts documentation + +* Thu Jan 11 2007 Olivier Blin 2:3.0.5-3mdv2007.1 ++ Revision: 107599 +- make dhclient-script set DEVICE variable when no ifcfg file is present (to call resolvconf correctly) + +* Tue Jan 02 2007 Olivier Blin 2:3.0.5-2mdv2007.1 ++ Revision: 103318 +- bump release +- do not call unknown /sbin/update-resolvrdv in dhclient-script +- set metric before creating resolv.conf (useful for resolvconf) + +* Thu Nov 16 2006 Guillaume Rousse 2:3.0.5-1mdv2007.1 ++ Revision: 84730 +- new version + install configuration file under real name, not as sample + +* Fri Sep 01 2006 Olivier Blin 2:3.0.4-2mdv2007.0 ++ Revision: 59227 +- add METRIC support in dhclient-script (from Fabrice Facorat, #23164) +- bunzip sources and patches +- Import dhcp + +* Mon May 22 2006 Oden Eriksson 3.0.4-1mdk +- 3.0.4 +- added new rediffed ldap patch (P1) + +* Mon Feb 06 2006 Olivier Blin 3.0.4-0.b2.8mdk +- use $'\n' in dhclient-script (required for initscripts >= 7.66, + since change_resolv_conf doesn't use "echo -e" anymore) + +* Mon Jan 09 2006 Olivier Blin 3.0.4-0.b2.7mdk +- fix requires post and preun +- fix typo in initscript + +* Mon Jan 09 2006 Olivier Blin 3.0.4-0.b2.6mdk +- convert parallel init to LSB + +* Mon Jan 02 2006 Olivier Blin 3.0.4-0.b2.5mdk +- parallel init support + +* Tue Dec 06 2005 Frederic Lepied 3.0.4-0.b2.4mdk +- use change_resolv_conf in dhclient-scripts to be able to do the right +thing wrt nscd. + +* Tue Nov 29 2005 Thierry Vignaud 3.0.4-0.b2.3mdk +- fix build on x86_64 + +* Thu Nov 24 2005 Oden Eriksson 3.0.4-0.b2.2mdk +- exclude debug files in the -devel package, temporary solution + +* Mon Nov 14 2005 Oden Eriksson 3.0.4-0.b2.1mdk +- 3.0.4b2 +- pass "-DLDAP_DEPRECATED" to the CFLAGS +- updated rediffed P1 (dhcp-3.0.3-ldap-patch) +- fix the chroot script so it won't touch the /etc/dhcpd.conf file + +* Wed Aug 31 2005 Oden Eriksson 3.0.3-3mdk +- rebuilt against new openldap-2.3.6 libs + +* Sat Aug 06 2005 Michael Scherer 3.0.3-2mdk +- fill a default config file + +* Mon Aug 01 2005 Oden Eriksson 3.0.3-1mdk +- 3.0.3 +- fix deps +- drop the gcc343 patch (P3), it's fixed upstream +- use the %%mkrel macro + +* Sat Apr 23 2005 Olivier Blin 3.0.2-2mdk +- do not make dhclient-script fail and return DENY return code when no + config file for the interface is found (update and re-indent Patch0) + +* Thu Feb 24 2005 Oden Eriksson 3.0.2-1mdk +- 3.0.2 + +* Fri Feb 04 2005 Buchan Milne 3.0.1-9mdk +- rebuild for ldap2.2_7 + +* Wed Feb 02 2005 Frederic Lepied 3.0.1-8mdk +- back to standard 60 seconds timeout. + +* Wed Feb 02 2005 Frederic Lepied 3.0.1-7mdk +- default timeout to 5 seconds + +* Fri Dec 24 2004 Oden Eriksson 3.0.1-6mdk +- new ldap patch +- renumber sources and patches +- bzip sources +- added P2 that allows us to run it chroot +- added S8 that makes it easier to chroot the server +- fixed S3 to make use of P2 & S8 +- fix pid file location for the dhcpd daemon +- added P3 to make it build with latest cooker gcc (rock linux) +- misc spec file fixes + +* Sat Jul 31 2004 Frederic Lepied 3.0.1-5mdk +- by default hostname is set + +* Sat Jul 31 2004 Frederic Lepied 3.0.1-4mdk +- assign default gateway by interface (updated patch1) + +* Fri Jul 30 2004 Frederic Lepied 3.0.1-3mdk +- only change the hostname if NEEDHOSTNAME=yes (updated patch1) + +* Thu Jul 29 2004 Buchan Milne 3.0.1-2mdk +- update ldap patch + +* Thu Jul 29 2004 Per Øyvind Karlsen 3.0.1-1mdk +- 3.0.1 + +* Thu Jul 01 2004 Florin 3.0-1.rc14.2mdk +- bring back the ldap patch and buildrequires + +* Tue Jun 29 2004 Florin 3.0-1.rc14.1mdk +- rebuild for cooker + +* Tue Jun 22 2004 Vincent Danen 3.0-1.rc14.0.1.100mdk +- 3.0.1rc14 +- security fixes for CAN-2004-0460 (VU#317350) and CAN-2004-0461 (VU#654390) + +* Wed May 05 2004 Per Øyvind Karlsen 3.0-1.rc13.6mdk +- fix buildrequires + +* Sat Apr 24 2004 Florin 3.0-1.rc13.5mdk +- add the dhcp-ldap support + diff --git a/dhcpd.conf b/dhcpd.conf index 56371db..6afd09e 100644 --- a/dhcpd.conf +++ b/dhcpd.conf @@ -16,7 +16,7 @@ subnet 192.168.0.0 netmask 255.255.255.0 { # we want the nameserver to appear at a fixed address host ns { - next-server fixed.mandrakesoft.com; + next-server fixed.domain.org; hardware ethernet 12:34:56:78:AB:CD; fixed-address 192.168.0.10; } diff --git a/dhcpd.init b/dhcpd.init deleted file mode 100644 index 3bd545d..0000000 --- a/dhcpd.init +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# -# dhcpd This shell script takes care of starting and stopping -# dhcpd. -# -# chkconfig: 345 65 35 -# description: dhcpd provides the Dynamic Host Configuration Protocol service. -# -# processname: dhcpd -# config: /etc/dhcpd.conf -# pidfile: /var/run/dhcpd/dhcpd.pid -# -### BEGIN INIT INFO -# Provides: dhcpd -# Required-Start: $network -# Should-Start: ldap -# Required-Stop: $network -# Should-Stop: ldap -# Short-Description: The dhcpd daemon -# Description: dhcpd provides the Dynamic Host Configuration Protocol service. -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -x /usr/sbin/dhcpd ] || exit 0 - -# The following variables should be set in the file -# /etc/sysconfig/dhcpd. - -# Which configuration file to use. -CONFIGFILE="/etc/dhcpd.conf" -# Where to store the lease state information. -LEASEFILE="/var/lib/dhcp/dhcpd.leases" -# Define INTERFACES to limit which network interfaces dhcpd listens on. -# The default null value causes dhcpd to listen on all interfaces. -INTERFACES="" -# Define OPTIONS with any other options to pass to the dhcpd server. -OPTIONS="-q" - -# Source dhcpd configuration. Values specified in this file override -# the defaults above. -[ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd - -# If null values were specified, use defaults so we don't get a syntax -# error below. -[ "${CONFIGFILE}" = "" ] && CONFIGFILE="/etc/dhcpd.conf" -[ "${LEASEFILE}" = "" ] && LEASEFILE="/var/lib/dhcp/dhcpd.leases" - -[ -f $CONFIGFILE ] || exit 0 -[ -f $LEASEFILE ] || exit 0 - -RETVAL=0 - -start() { - # Start daemons. - echo -n "Starting dhcpd: " - if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then - OPTIONS="${OPTIONS} -chroot ${ROOTDIR}" - fi - daemon /usr/sbin/dhcpd -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n "Shutting down dhcpd: " - if [ -r ${ROOTDIR}/var/run/dhcpd/dhcpd.pid ]; then - kill -TERM `cat ${ROOTDIR}/var/run/dhcpd/dhcpd.pid` - RETVAL=$? - [ "$RETVAL" = 0 ] && success "stop" || failure "stop" - else - success "already stopped" - RETVAL=0 - fi - [ $RETVAL -eq 0 ] && rm -f ${ROOTDIR}/var/run/dhcpd/dhcpd.pid - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/dhcpd - echo - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/dhcpd ]; then - stop - start - RETVAL=$? - fi - ;; - status) - status dhcpd - RETVAL=$? - ;; - *) - echo "Usage: dhcpd {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL diff --git a/dhcpd.service b/dhcpd.service new file mode 100644 index 0000000..4cb5a58 --- /dev/null +++ b/dhcpd.service @@ -0,0 +1,13 @@ +[Unit] +Description=DHCPv4 Server Daemon +After=syslog.target network.target ldap.service + +[Service] +Environment=CONFIGFILE=/etc/dhcpd.conf LEASEFILE=/var/lib/dhcpd/dhcpd.leases +EnvironmentFile=-/etc/sysconfig/dhcpd +Type=forking +PIDFile=/run/dhcpd/dhcpd.pid +ExecStart=/usr/sbin/dhcpd -pf /run/dhcpd/dhcpd.pid -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES + +[Install] +WantedBy=multi-user.target diff --git a/dhcpd.tmpfiles b/dhcpd.tmpfiles new file mode 100644 index 0000000..d545ce8 --- /dev/null +++ b/dhcpd.tmpfiles @@ -0,0 +1 @@ +d /run/dhcpd 755 root root diff --git a/dhcpd6.service b/dhcpd6.service new file mode 100644 index 0000000..bd1fac4 --- /dev/null +++ b/dhcpd6.service @@ -0,0 +1,13 @@ +[Unit] +Description=DHCPv6 Server Daemon +After=syslog.target network.target + +[Service] +Environment=CONFIGFILE=/etc/dhcpd6.conf LEASEFILE=/var/lib/dhcp/dhcpd6.leases +EnvironmentFile=-/etc/sysconfig/dhcpd6 +Type=forking +PIDFile=/var/run/dhcpd6.pid +ExecStart=/usr/sbin/dhcpd -6 -pf /var/run/dhcpd6.pid -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES + +[Install] +WantedBy=multi-user.target diff --git a/dhcrelay.init b/dhcrelay.init deleted file mode 100644 index 7787993..0000000 --- a/dhcrelay.init +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -# -# dhcrelay This shell script takes care of starting and stopping -# dhcrelay. -# -# chkconfig: 2345 65 35 -# description: dhcrelay provides the DHCP Relay service. -# -# processname: dhcrelay -# pidfile: /var/run/dhcrelay.pid -# -### BEGIN INIT INFO -# Provides: dhcrelay -# Required-Start: $network -# Required-Stop: $network -# Default-Start: 2 3 4 5 -# Short-Description: The dhcrelay daemon -# Description: dhcrelay provides the DHCP Relay service. -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -[ -x /usr/sbin/dhcrelay ] || exit 0 - -# The following variables can be set in the file -# /etc/sysconfig/dhcrelay. - -# Define SERVERS with a list of one or more DHCP servers where -# DHCP packets are to be relayed to and from. This is mandatory. -#SERVERS="10.11.12.13 10.9.8.7" -SERVERS="" - -# Define OPTIONS with any other options to pass to the dhcrelay server. -# See dhcrelay(8) for available options and syntax. -#OPTIONS="-q -i eth0 -i eth1" -OPTIONS="-q" - -# Source dhcrelay configuration. Values specified in this file override -# the defaults above. -[ -f /etc/sysconfig/dhcrelay ] && . /etc/sysconfig/dhcrelay - -# Check that at least one DHCP server to relay to was specified. -[ "${SERVERS}" = "" ] && exit 0 - -RETVAL=0 - -start() { - # Start daemons. - echo -n "Starting dhcrelay: " - daemon /usr/sbin/dhcrelay $OPTIONS $SERVERS - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay - return $RETVAL -} - -stop() { - # Stop daemons. - echo -n "Shutting down dhcrelay: " - killproc dhcrelay - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/dhcrelay ]; then - stop - start - RETVAL=$? - fi - ;; - status) - status dhcrelay - RETVAL=$? - ;; - *) - echo "Usage: dhcrelay {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL diff --git a/dhcrelay.service b/dhcrelay.service new file mode 100644 index 0000000..7992a26 --- /dev/null +++ b/dhcrelay.service @@ -0,0 +1,10 @@ +[Unit] +Description=DHCP Relay Agent Daemon +After=syslog.target network.target + +[Service] +EnvironmentFile=/etc/sysconfig/dhcrelay +ExecStart=/usr/sbin/dhcrelay -d --no-pid $DHCRELAYARGS + +[Install] +WantedBy=multi-user.target diff --git a/dhcrelay.tmpfiles b/dhcrelay.tmpfiles new file mode 100644 index 0000000..b302d8c --- /dev/null +++ b/dhcrelay.tmpfiles @@ -0,0 +1 @@ +d /run/dhcrelay 755 root root diff --git a/update_dhcp.pl b/update_dhcp.pl deleted file mode 100644 index 5ea3163..0000000 --- a/update_dhcp.pl +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl -W - -#---------------------------------------------------------------------- -# copyright (C) 2001 Florin Grad -# -# This is a really silly program that is supposed to allow an update of -# a dhcp-2* server to a dhcp-3* server -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------ - -#search for a ddns-update-style entry in /etc/dhcpd.conf file -my $conf_file = "/etc/dhcpd.conf"; #$ARGV[0]; -my $conf_file_orig = "/etc/dhcpd.conf.orig"; -my $i=0; -open (DHCPCONF, "< $conf_file") or die "Can't open the $conf_file file for reading"; -while () { - if (/ddns-update-style/) { - $i++; - }; -}; -close (DHCPCONF); - -if ($i == 0) { #we are on a dhcp-2 - rename("$conf_file","$conf_file_orig") || die "Can't rename $conf_file: $!"; - open (DHCPCONF, "> $conf_file") or die "Can't open the $conf_file file for writing"; - print DHCPCONF "ddns-update-style none;\n"; - open (DHCPCONF_ORIG, "< $conf_file_orig") or die "Can't open the $conf_file_orig file for reading"; - while () { - print DHCPCONF "$_"; - }; - close (DHCPCONF_ORIG); - close (DHCPCONF); -}