From aa9b69be57399f34828be083a913f71d4e8aad23 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 17 Jun 2014 16:24:23 +0400 Subject: [PATCH] Updated to 4.3.0 --- .abf.yml | 5 +- .gitignore | 1 - dhcp-4.2.0-default-requested-options.patch | 44 +++ dhcp-4.2.2-fix-format-errors.patch | 16 +- dhcp-4.2.2-xen-checksum.patch | 21 +- dhcp-4.2.5-P1-man.patch | 22 ++ ...tch => dhcp-4.3.0-64_bit_lease_parse.patch | 37 +- dhcp.spec | 233 ++++++------ dhcp.spec.diff | 8 + dhcp.spec.old | 342 ++++++++++++++++++ dhcpd.init | 118 ------ dhcpd.service | 9 +- dhcpd6.init | 117 ------ dhcpd6.service | 7 +- dhcrelay.init | 90 ----- 15 files changed, 587 insertions(+), 483 deletions(-) delete mode 100644 .gitignore create mode 100644 dhcp-4.2.0-default-requested-options.patch create mode 100644 dhcp-4.2.5-P1-man.patch rename dhcp-4.2.4-64_bit_lease_parse.patch => dhcp-4.3.0-64_bit_lease_parse.patch (57%) create mode 100644 dhcp.spec.diff create mode 100644 dhcp.spec.old delete mode 100644 dhcpd.init delete mode 100644 dhcpd6.init delete mode 100644 dhcrelay.init diff --git a/.abf.yml b/.abf.yml index 8aa4c95..d604231 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,6 +1,9 @@ +removed_sources: + dhcp-4.2.5.tar.gz: d029505509aee83ea28972d5d1c95dc4b5db99f1 sources: dhcp-4.2.5-P1.tar.gz: 120b6e476b2ac0d35e1dc8dee53752c42449b925 dhcp-4.2.5-P1.tar.gz.sha512.asc: d43248ba82d8a2f393f2f6c283ea06fb2df38d18 - dhcp-4.2.5.tar.gz: d029505509aee83ea28972d5d1c95dc4b5db99f1 dhcp-4.2.5.tar.gz.sha512.asc: ac49b30ef17acb36cc5603faa5d780e423aa0e06 + dhcp-4.3.0.tar.gz: deed72a4636461042b74de68c2825dc52623e1d1 + dhcp-4.3.0.tar.gz.sha512.asc: e05375f86430f0d92a371fe8f619aa73e65de19a dhcp-dynamic-dns-examples.tar.bz2: d33980aad3e0380fc89f8346ab37786d39157696 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d9f7081..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dhcp-*.tar.* 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.2-fix-format-errors.patch b/dhcp-4.2.2-fix-format-errors.patch index 04c70dc..ee518c7 100644 --- a/dhcp-4.2.2-fix-format-errors.patch +++ b/dhcp-4.2.2-fix-format-errors.patch @@ -40,9 +40,9 @@ diff -Naur -x '*.orig' dhcp-4.2.2/relay/dhcrelay.c dhcp-4.2.2-fix-format-errors/ + log_info("%s", copyright); + log_info("%s", arr); + log_info("%s", url); - } else { - quiet = 0; + } else log_perror = 0; + 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 @@ -63,12 +63,12 @@ diff -Naur -x '*.orig' dhcp-4.2.2/server/dhcpd.c dhcp-4.2.2-fix-format-errors/se log_perror = 0; log_info("%s %s", message, PACKAGE_VERSION); -- log_info (copyright); -- log_info (arr); -- log_info (url); -+ log_info ("%s", copyright); -+ log_info ("%s", arr); -+ log_info ("%s", url); +- log_info(copyright); +- log_info(arr); +- log_info(url); ++ log_info("%s", copyright); ++ log_info("%s", arr); ++ log_info("%s", url); log_perror = tmp; } } else diff --git a/dhcp-4.2.2-xen-checksum.patch b/dhcp-4.2.2-xen-checksum.patch index 038d346..2b56a9d 100644 --- a/dhcp-4.2.2-xen-checksum.patch +++ b/dhcp-4.2.2-xen-checksum.patch @@ -1,12 +1,12 @@ 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, +@@ -481,7 +481,7 @@ + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header(interface, interface->rbuf, + interface->rbuf_offset, - from, hdr.bh_caplen, &paylen); -+ from, hdr.bh_caplen, &paylen, 0); ++ from, hdr.bh_caplen, &paylen, 0); /* If the IP or UDP checksum was bad, skip the packet... */ if (offset < 0) { @@ -25,10 +25,10 @@ diff -up dhcp-4.2.2b1/common/dlpi.c.xen dhcp-4.2.2b1/common/dlpi.c 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 @@ +@@ -29,24 +29,38 @@ + #include "dhcpd.h" #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) - #include +#include #include #include @@ -42,7 +42,12 @@ diff -up dhcp-4.2.2b1/common/lpf.c.xen dhcp-4.2.2b1/common/lpf.c #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" + #endif + + #if defined (USE_LPF_RECEIVE) || defined (USE_LPF_HWADDR) + #include #include + #endif +#ifndef PACKET_AUXDATA +#define PACKET_AUXDATA 8 @@ -57,9 +62,9 @@ diff -up dhcp-4.2.2b1/common/lpf.c.xen dhcp-4.2.2b1/common/lpf.c +}; +#endif + + #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) /* 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; { 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-4.2.4-64_bit_lease_parse.patch b/dhcp-4.3.0-64_bit_lease_parse.patch similarity index 57% rename from dhcp-4.2.4-64_bit_lease_parse.patch rename to dhcp-4.3.0-64_bit_lease_parse.patch index c1b978b..29dc884 100644 --- a/dhcp-4.2.4-64_bit_lease_parse.patch +++ b/dhcp-4.3.0-64_bit_lease_parse.patch @@ -1,7 +1,6 @@ -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 +--- dhcp-4.3.0/common/parse.c.64-bit_lease_parse 2014-01-31 14:20:49.000000000 -0500 ++++ dhcp-4.3.0/common/parse.c 2014-06-15 11:48:48.559669323 -0400 +@@ -932,8 +932,8 @@ TIME parse_date_core(cfile) struct parse *cfile; { @@ -12,16 +11,16 @@ diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/pars 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) +@@ -959,7 +959,7 @@ parse_date_core(cfile) } - token = next_token(&val, NULL, cfile); /* consume number */ + skip_token(&val, NULL, cfile); /* consume number */ - guess = atoi(val); + guess = atol(val); return((TIME)guess); } -@@ -961,7 +961,7 @@ parse_date_core(cfile) +@@ -987,7 +987,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. */ @@ -30,55 +29,55 @@ diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/pars if (year > 1900) year -= 1900; -@@ -985,7 +985,7 @@ parse_date_core(cfile) +@@ -1011,7 +1011,7 @@ parse_date_core(cfile) return((TIME)0); } - token = next_token(&val, NULL, cfile); /* consume month */ + skip_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) +@@ -1033,7 +1033,7 @@ parse_date_core(cfile) return((TIME)0); } - token = next_token(&val, NULL, cfile); /* consume day of month */ + skip_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) +@@ -1044,7 +1044,7 @@ parse_date_core(cfile) return((TIME)0); } - token = next_token(&val, NULL, cfile); /* consume hour */ + skip_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) +@@ -1066,7 +1066,7 @@ parse_date_core(cfile) return((TIME)0); } - token = next_token(&val, NULL, cfile); /* consume minute */ + skip_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) +@@ -1088,13 +1088,13 @@ parse_date_core(cfile) return((TIME)0); } - token = next_token(&val, NULL, cfile); /* consume second */ + skip_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 */ + skip_token(&val, NULL, cfile); /* consume tzoff */ - tzoff = atoi(val); + tzoff = atol(val); } else if (token != SEMI) { - token = next_token(&val, NULL, cfile); + skip_token(&val, NULL, cfile); parse_warn(cfile, diff --git a/dhcp.spec b/dhcp.spec index 899937e..8d94519 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -1,15 +1,16 @@ -%define plevel P1 +%define major_version 4.3.0 +%define patch_version %{nil} -Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client Name: dhcp Epoch: 3 -Version: 4.2.5 -Release: 0.%{?plevel:%{plevel}}.5 +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: http://www.isc.org/software/dhcp -Source0: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz -Source1: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.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 Source4: dhcp-dynamic-dns-examples.tar.bz2 Source7: dhcpreport.pl @@ -17,11 +18,8 @@ Source8: dhcpd-chroot.sh # (eugeni) dhclient-exit-hooks script Source9: dhclient-exit-hooks Source10: draft-ietf-dhc-ldap-schema-01.txt -Source11: dhcpd.init Source12: dhcpd.service -Source13: dhcpd6.init Source14: dhcpd6.service -Source15: dhcrelay.init Source16: dhcrelay.service Source17: dhcpd.tmpfiles Source18: dhclient.tmpfiles @@ -31,23 +29,20 @@ Patch100: dhcp-4.2.2-ifup.patch Patch101: dhcp-4.2.2-fix-format-errors.patch # prevents needless deassociation, working around mdv bug #43441 Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch +Patch103: dhcp-4.2.5-P1-man.patch # fedora patches -# Handle Xen partial UDP checksums +Patch7: dhcp-4.2.0-default-requested-options.patch Patch8: dhcp-4.2.2-xen-checksum.patch -# If the ipv6 kernel module is missing, do not segfault -# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367]) Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch -# Handle cases in add_timeout() where the function is called with a NULL -# value for the 'when' parameter Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch -# Ensure 64-bit platforms parse lease file dates & times correctly -Patch18: dhcp-4.2.4-64_bit_lease_parse.patch - -BuildRequires: libtool -BuildRequires: groff-base -BuildRequires: systemd-units +Patch18: dhcp-4.3.0-64_bit_lease_parse.patch BuildRequires: bind-devel +BuildRequires: groff-base +BuildRequires: groff-for-man +BuildRequires: libtool BuildRequires: openldap-devel +BuildRequires: systemd-units +Requires(post,preun): rpm-helper %description DHCP (Dynamic Host Configuration Protocol) is a protocol which allows @@ -61,11 +56,11 @@ or pump or dhcpxd, which provides the DHCP client daemon, on client machines. If you want the DHCP server and/or relay, you will also need to install the dhcp-server and/or dhcp-relay packages. -%package common +%package common Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server Group: System/Servers -%description common +%description common DHCP (Dynamic Host Configuration Protocol) is a protocol which allows individual devices on an IP network to get their own network configuration information (IP address, subnetmask, broadcast address, @@ -78,11 +73,11 @@ dhcpxd, which provides the DHCP client daemon, on client machines. If you want the DHCP server and/or relay, you will also need to install the dhcp-server and/or dhcp-relay packages. -%package doc +%package doc Summary: Documentation about the ISC DHCP server/client Group: System/Servers -%description doc +%description doc This package contains RFC/API/protocol documentation about the ISC DHCP server and client. @@ -93,14 +88,14 @@ etc.) from a DHCP server. The overall purpose of DHCP is to make it easier to administer a large network. The dhcp package includes the DHCP server and a DHCP relay agent. -%package server +%package server Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server Group: System/Servers -Requires: dhcp-common >= %{EVRD} -Requires(post,preun): rpm-helper -Requires(post,postun): systemd-units +Requires: dhcp-common = %{EVRD} +Requires(post): systemd-units +Requires(post,preun): rpm-helper -%description server +%description server DHCP server is the Internet Software Consortium (ISC) DHCP server for various UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from the network. @@ -108,13 +103,13 @@ the network. You should install dhcp-server if you want to set up a DHCP server on your network. You will also need to install the base dhcp package. -%package client +%package client Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client Group: System/Servers -Requires: dhcp-common >= %{EVRD} -Provides: dhcp-client-daemon +Requires: dhcp-common = %{EVRD} +Requires(post): systemd-units -%description client +%description client DHCP client is the Internet Software Consortium (ISC) DHCP client for various UNIX operating systems. It allows a UNIX mac hine to obtain it's networking parameters from a DHCP server. @@ -123,113 +118,120 @@ You should install dhcp-client if you want to use the ISC DHCP client instead of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to install the base dhcp package. -%package relay +%package relay Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay Group: System/Servers -Requires: dhcp-common >= %{EVRD} -Requires(post,preun): rpm-helper +Requires: dhcp-common = %{EVRD} +Requires(post): systemd-units +Requires(post,preun): rpm-helper -%description relay +%description relay DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP packets. It is used on a subnet with DHCP clients to "relay" their requests to a subnet that has a DHCP server on it. Because DHCP packets can be broadcast, they will not be routed off of the local subnet. The DHCP relay takes care of this for the client. You will need to set the environment -variable SERVERS and optionally OPTIONS in %{_sysconfdir}/sysconfig/dhcrelay before +variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before starting the server. -%package devel +%package devel Summary: Development headers and libraries for the dhcpctl API Group: Development/Other -Requires: dhcp-common >= %{EVRD} +Requires: dhcp-common = %{EVRD} -%description devel +%description devel DHCP devel contains all of the libraries and headers for developing with the Internet Software Consortium (ISC) dhcpctl API. %prep -%setup -qn %{name}-%{version}%{?plevel:-%{plevel}} -%apply_patches -autoreconf -fi +%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 -# remove empty files -find -size 0 |grep ldap | xargs rm -rf +# 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 -cp %{SOURCE10} doc +install -m0644 %{SOURCE10} doc %build %serverbuild_hardened %configure2_5x \ - --enable-paranoia \ - --enable-early-chroot \ - --with-ldapcrypto \ - --with-srv-lease-file=%{_localstatedir}/lib/dhcp/dhcpd.leases \ - --with-srv6-lease-file=%{_localstatedir}/lib/dhcp/dhcpd6.leases \ - --with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \ - --with-cli6-lease-file=%{_localstatedir}/lib/dhcp/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 - + --enable-paranoia \ + --enable-early-chroot \ + --with-ldapcrypto \ + --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=/run/dhcpd/dhcpd.pid \ + --with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \ + --with-cli-pid-file=/run/dhclient/dhclient.pid \ + --with-cli6-pid-file=/run/dhclient/dhclient6.pid \ + --with-relay-pid-file=/run/dhcrelay/dhcrelay.pid \ + --disable-static %make %install + %makeinstall_std # Install correct dhclient-script -install -p -m755 client/scripts/linux -D %{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 -m644 %{SOURCE12} -D %{buildroot}%{_unitdir}/dhcpd.service -install -m644 %{SOURCE14} -D %{buildroot}%{_unitdir}/dhcpd6.service -install -m644 %{SOURCE16} -D %{buildroot}%{_unitdir}/dhcrelay.service +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 -D -p -m 644 %{SOURCE17} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcpd.conf -install -D -p -m 644 %{SOURCE18} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhclient.conf -install -D -p -m 644 %{SOURCE19} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcrelay.conf +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 -m755 %{SOURCE11} -D %{buildroot}%{_initrddir}/dhcpd -install -m755 %{SOURCE13} -D %{buildroot}%{_initrddir}/dhcpd6 -install -m755 %{SOURCE15} -D %{buildroot}%{_initrddir}/dhcrelay - -install -m755 %{SOURCE7} -D %{buildroot}%{_sbindir}/dhcpreport.pl -install -m755 %{SOURCE8} -D %{buildroot}%{_sbindir}/dhcpd-chroot.sh -install -m644 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/dhcpd.conf -install -m755 contrib/ldap/dhcpd-conf-to-ldap -D %{buildroot}%{_sbindir}/dhcpd-conf-to-ldap - -install -d %{buildroot}%{_var}/lib/dhclient -touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases +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 -m755 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/dhclient-exit-hooks +install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir} install -d %{buildroot}%{_sysconfdir}/sysconfig cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay < BuildRequires: groff-for-man +50a41,42 diff --git a/dhcp.spec.old b/dhcp.spec.old new file mode 100644 index 0000000..899937e --- /dev/null +++ b/dhcp.spec.old @@ -0,0 +1,342 @@ +%define plevel P1 + +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client +Name: dhcp +Epoch: 3 +Version: 4.2.5 +Release: 0.%{?plevel:%{plevel}}.5 +License: Distributable +Group: System/Servers +Url: http://www.isc.org/software/dhcp +Source0: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz +Source1: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz.sha512.asc +Source2: dhcpd.conf +Source4: dhcp-dynamic-dns-examples.tar.bz2 +Source7: dhcpreport.pl +Source8: dhcpd-chroot.sh +# (eugeni) dhclient-exit-hooks script +Source9: dhclient-exit-hooks +Source10: draft-ietf-dhc-ldap-schema-01.txt +Source11: dhcpd.init +Source12: dhcpd.service +Source13: dhcpd6.init +Source14: dhcpd6.service +Source15: dhcrelay.init +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 +Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch +# fedora patches +# Handle Xen partial UDP checksums +Patch8: dhcp-4.2.2-xen-checksum.patch +# If the ipv6 kernel module is missing, do not segfault +# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367]) +Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch +# Handle cases in add_timeout() where the function is called with a NULL +# value for the 'when' parameter +Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch +# Ensure 64-bit platforms parse lease file dates & times correctly +Patch18: dhcp-4.2.4-64_bit_lease_parse.patch + +BuildRequires: libtool +BuildRequires: groff-base +BuildRequires: systemd-units +BuildRequires: bind-devel +BuildRequires: openldap-devel + +%description +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows +individual devices on an IP network to get their own network configuration +information (IP address, subnetmask, broadcast address, etc.) from a DHCP +server. The overall purpose of DHCP is to make it easier to administer a +large network. The dhcp package includes the DHCP server and a DHCP relay +agent. You will also need to install the dhcp-client or dhcpcd package, +or pump or dhcpxd, which provides the DHCP client daemon, on client machines. + +If you want the DHCP server and/or relay, you will also need to install the +dhcp-server and/or dhcp-relay packages. + +%package common +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server +Group: System/Servers + +%description common +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows +individual devices on an IP network to get their own network +configuration information (IP address, subnetmask, broadcast address, +etc.) from a DHCP server. The overall purpose of DHCP is to make it +easier to administer a large network. The dhcp package includes the +DHCP server and a DHCP relay agent. + +You will also need to install the dhcp-client or dhcpcd package, or pump or +dhcpxd, which provides the DHCP client daemon, on client machines. If you +want the DHCP server and/or relay, you will also need to install the +dhcp-server and/or dhcp-relay packages. + +%package doc +Summary: Documentation about the ISC DHCP server/client +Group: System/Servers + +%description doc +This package contains RFC/API/protocol documentation about the ISC +DHCP server and client. + +DHCP (Dynamic Host Configuration Protocol) is a protocol which allows +individual devices on an IP network to get their own network +configuration information (IP address, subnetmask, broadcast address, +etc.) from a DHCP server. The overall purpose of DHCP is to make it +easier to administer a large network. The dhcp package includes the +DHCP server and a DHCP relay agent. + +%package server +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server +Group: System/Servers +Requires: dhcp-common >= %{EVRD} +Requires(post,preun): rpm-helper +Requires(post,postun): systemd-units + +%description server +DHCP server is the Internet Software Consortium (ISC) DHCP server for various +UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from +the network. + +You should install dhcp-server if you want to set up a DHCP server on your +network. You will also need to install the base dhcp package. + +%package client +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client +Group: System/Servers +Requires: dhcp-common >= %{EVRD} +Provides: dhcp-client-daemon + +%description client +DHCP client is the Internet Software Consortium (ISC) DHCP client for various +UNIX operating systems. It allows a UNIX mac hine to obtain it's networking +parameters from a DHCP server. + +You should install dhcp-client if you want to use the ISC DHCP client instead +of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to +install the base dhcp package. + +%package relay +Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay +Group: System/Servers +Requires: dhcp-common >= %{EVRD} +Requires(post,preun): rpm-helper + +%description relay +DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP +packets. It is used on a subnet with DHCP clients to "relay" their requests +to a subnet that has a DHCP server on it. Because DHCP packets can be +broadcast, they will not be routed off of the local subnet. The DHCP relay +takes care of this for the client. You will need to set the environment +variable SERVERS and optionally OPTIONS in %{_sysconfdir}/sysconfig/dhcrelay before +starting the server. + +%package devel +Summary: Development headers and libraries for the dhcpctl API +Group: Development/Other +Requires: dhcp-common >= %{EVRD} + +%description devel +DHCP devel contains all of the libraries and headers for developing with the +Internet Software Consortium (ISC) dhcpctl API. + +%prep +%setup -qn %{name}-%{version}%{?plevel:-%{plevel}} +%apply_patches +autoreconf -fi + +# remove empty files +find -size 0 |grep ldap | xargs rm -rf + +cp %{SOURCE10} doc + +%build +%serverbuild_hardened +%configure2_5x \ + --enable-paranoia \ + --enable-early-chroot \ + --with-ldapcrypto \ + --with-srv-lease-file=%{_localstatedir}/lib/dhcp/dhcpd.leases \ + --with-srv6-lease-file=%{_localstatedir}/lib/dhcp/dhcpd6.leases \ + --with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \ + --with-cli6-lease-file=%{_localstatedir}/lib/dhcp/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 + +%make + +%install +%makeinstall_std + +# Install correct dhclient-script +install -p -m755 client/scripts/linux -D %{buildroot}/sbin/dhclient-script +mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient + +install -m644 %{SOURCE12} -D %{buildroot}%{_unitdir}/dhcpd.service +install -m644 %{SOURCE14} -D %{buildroot}%{_unitdir}/dhcpd6.service +install -m644 %{SOURCE16} -D %{buildroot}%{_unitdir}/dhcrelay.service + +install -D -p -m 644 %{SOURCE17} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcpd.conf +install -D -p -m 644 %{SOURCE18} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhclient.conf +install -D -p -m 644 %{SOURCE19} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcrelay.conf + +install -m755 %{SOURCE11} -D %{buildroot}%{_initrddir}/dhcpd +install -m755 %{SOURCE13} -D %{buildroot}%{_initrddir}/dhcpd6 +install -m755 %{SOURCE15} -D %{buildroot}%{_initrddir}/dhcrelay + +install -m755 %{SOURCE7} -D %{buildroot}%{_sbindir}/dhcpreport.pl +install -m755 %{SOURCE8} -D %{buildroot}%{_sbindir}/dhcpd-chroot.sh +install -m644 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/dhcpd.conf +install -m755 contrib/ldap/dhcpd-conf-to-ldap -D %{buildroot}%{_sbindir}/dhcpd-conf-to-ldap + +install -d %{buildroot}%{_var}/lib/dhclient +touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases + +# install exit-hooks script to /etc/ +install -m755 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/dhclient-exit-hooks + +install -d %{buildroot}%{_sysconfdir}/sysconfig +cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <&2 - fi - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/dhcpd ]; then - stop - start - RETVAL=$? - fi - ;; - configtest) - configtest - ;; - 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 index e603d87..4cb5a58 100644 --- a/dhcpd.service +++ b/dhcpd.service @@ -1,10 +1,13 @@ [Unit] Description=DHCPv4 Server Daemon -After=syslog.target network.target +After=syslog.target network.target ldap.service [Service] -EnvironmentFile=/etc/sysconfig/dhcpd -ExecStart=/usr/sbin/dhcpd -d -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES +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/dhcpd6.init b/dhcpd6.init deleted file mode 100644 index ce2ac9c..0000000 --- a/dhcpd6.init +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: dhcpd -# Default-Start: -# Default-Stop: -# Should-Start: -# Required-Start: $network -# Required-Stop: -# Short-Description: Start and stop the DHCPv6 server -# Description: dhcpd provides the Dynamic Host Configuration Protocol (DHCPv6) -# server. -### END INIT INFO -# -# The fields below are left around for legacy tools (will remove later). -# -# chkconfig: - 65 35 -# description: dhcpd provides the Dynamic Host Configuration Protocol (DHCPv6) \ -# server -# processname: dhcpd -# config: /etc/dhcpd6.conf -# config: /var/lib/dhcpd/dhcpd6.leases -# pidfile: /var/run/dhcpd6.pid - -. /etc/rc.d/init.d/functions - -[ -x /usr/sbin/dhcpd ] || exit 0 - -# Which configuration file to use. -CONFIGFILE="/etc/dhcpd6.conf" -# Where to store the lease state information. -LEASEFILE="/var/lib/dhcp/dhcpd6.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" - -# Values specified in this file override the defaults above. -[ -f /etc/sysconfig/dhcpd6 ] && . /etc/sysconfig/dhcpd6 - -[ -f $CONFIGFILE ] || exit 0 -[ -f $LEASEFILE ] || exit 0 - -RETVAL=0 - -start() { - echo -n "Starting dhcpd (DHCPv6): " - if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then - OPTIONS="${OPTIONS} -chroot ${ROOTDIR}" - fi - daemon /usr/sbin/dhcpd -6 -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd6 - return $RETVAL -} - -stop() { - echo -n "Shutting down dhcpd (DHCPv6): " - if [ -r ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid ]; then - kill -TERM `cat ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid` - RETVAL=$? - [ "$RETVAL" = 0 ] && success "stop" || failure "stop" - else - success "already stopped" - RETVAL=0 - fi - [ $RETVAL -eq 0 ] && rm -f ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid - [ $RETVAL = 0 ] && rm -f /var/lock/subsys/dhcpd6 - echo - return $RETVAL -} - -configtest() { - /usr/sbin/dhcpd -q -t -6 -cf $CONFIGFILE - RETVAL=$? - if [ $RETVAL -eq 1 ]; then - /usr/sbin/dhcpd -t -6 -cf $CONFIGFILE - else - echo "Syntax: OK" >&2 - fi - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/dhcpd6 ]; then - stop - start - RETVAL=$? - fi - ;; - configtest) - configtest - ;; - status) - status dhcpd - RETVAL=$? - ;; - *) - echo "Usage: dhcpd6 {start|stop|restart|condrestart|status}" - exit 1 -esac - -exit $RETVAL diff --git a/dhcpd6.service b/dhcpd6.service index 3ff18c0..bd1fac4 100644 --- a/dhcpd6.service +++ b/dhcpd6.service @@ -3,8 +3,11 @@ Description=DHCPv6 Server Daemon After=syslog.target network.target [Service] -EnvironmentFile=/etc/sysconfig/dhcpd6 -ExecStart=/usr/sbin/dhcpd -d 6 -cf $CONFIGFILE -lf $LEASEFILE $INTERFACES +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 7a7039f..0000000 --- a/dhcrelay.init +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: dhcrelay -# Default-Start: 2 3 4 5 -# Default-Stop: -# Should-Start: -# Required-Start: $network -# Required-Stop: $network -# Short-Description: Start and stop the DHCP relay server -# Description: dhcrelay provides the Dynamic Host Configuration Protocol (DHCP) -# relay server. This is required when your DHCP server is on -# another network segment from the clients. -### END INIT INFO -# -# The fields below are left around for legacy tools (will remove later). -# -# chkconfig: - 65 35 -# description: dhcrelay provides a relay for Dynamic Host Control Protocol. -# processname: dhcrelay -# # pidfile: /var/run/dhcrelay.pid - -. /etc/rc.d/init.d/functions - -[ -x /usr/sbin/dhcrelay ] || exit 0 - -# 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="" -# Define OPTIONS with any other options to pass to the dhcrelay server. -OPTIONS="-q" - -# 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