diff --git a/dhcp-4.0.0-garbage-chars.patch b/dhcp-4.0.0-garbage-chars.patch new file mode 100644 index 0000000..bdb0948 --- /dev/null +++ b/dhcp-4.0.0-garbage-chars.patch @@ -0,0 +1,12 @@ +diff -up dhcp-4.0.0//common/tables.c.garbage dhcp-4.0.0//common/tables.c +--- dhcp-4.0.0//common/tables.c.garbage 2007-12-03 09:10:19.000000000 -1000 ++++ dhcp-4.0.0//common/tables.c 2008-08-05 14:59:08.000000000 -1000 +@@ -201,7 +201,7 @@ static struct option dhcp_options[] = { + { "netinfo-server-tag", "t", &dhcp_universe, 113, 1 }, + { "default-url", "t", &dhcp_universe, 114, 1 }, + { "subnet-selection", "I", &dhcp_universe, 118, 1 }, +- { "domain-search", "Dc", &dhcp_universe, 119, 1 }, ++ { "domain-search", "D", &dhcp_universe, 119, 1 }, + { "vivco", "Evendor-class.", &dhcp_universe, 124, 1 }, + { "vivso", "Evendor.", &dhcp_universe, 125, 1 }, + #if 0 diff --git a/dhcp.spec b/dhcp.spec index e1eb9be..0f97ea7 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -4,7 +4,7 @@ Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent Name: dhcp Version: 4.0.0 -Release: 18%{?dist} +Release: 19%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -46,6 +46,7 @@ Patch16: %{name}-4.0.0-NetworkManager-crash.patch Patch17: %{name}-4.0.0-FD_CLOEXEC.patch Patch18: %{name}-4.0.0-libdhcp4client.patch Patch19: %{name}-4.0.0-inherit-leases.patch +Patch20: %{name}-4.0.0-garbage-chars.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf @@ -199,6 +200,9 @@ client library. # If we have an active lease, do not down the interface (#453982) %patch19 -p1 +# Fix 'garbage in format string' error (#450052) +%patch20 -p1 + # Copy in documentation and example scripts for LDAP patch to dhcpd %{__install} -p -m 0644 %{SOURCE5} . %{__install} -p -m 0644 %{SOURCE6} doc/ @@ -230,13 +234,13 @@ pushd __fedora_contrib popd # Filter false positive perl requires (all of them) -cat < %{name}-req +%{__cat} << EOF > %{name}-req #!/bin/sh %{__perl_requires} \ -| grep -v 'perl(' +| %{__grep} -v 'perl(' EOF %define __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req -chmod +x %{__perl_requires} +%{__chmod} +x %{__perl_requires} # Replace @PRODUCTNAME@ %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' common/dhcp-options.5 @@ -436,6 +440,11 @@ fi %{_libdir}/libdhcp4client.so %changelog +* Wed Aug 06 2008 David Cantrell - 12:4.0.0-19 +- Remove 'c' from the domain-search format string in common/tables.c +- Prevent \032 from appearing in resolv.conf search line (#450042) +- Restore SELinux context on saved /etc files (#451560) + * Sun Aug 03 2008 Tom "spot" Callaway - 12:4.0.0-18 - filter out false positive perl requires diff --git a/linux b/linux index 17e2e91..49e476d 100755 --- a/linux +++ b/linux @@ -29,6 +29,10 @@ function save_previous() { else echo ''> $1.predhclient.$interface fi + + if [ -x /sbin/restorecon ]; then + /sbin/restorecon $1.predhclient.$interface >/dev/null 2>&1 + fi } make_resolv_conf() { @@ -42,21 +46,19 @@ make_resolv_conf() { return fi - if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then - cp -fp /etc/resolv.conf /etc/resolv.conf.predhclient.$interface + if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ] || [ -n "$new_domain_search" ]; then + save_previous /etc/resolv.conf rscf=`mktemp /tmp/XXXXXX`; echo '; generated by /sbin/dhclient-script' > $rscf - if [ -z "$SEARCH" ]; then + if [ -n "$SEARCH" ]; then + echo "search $SEARCH" >> $rscf + else if [ -n "$new_domain_search" ]; then echo "search ${new_domain_search//\\032/ }" >> $rscf - else - if [ -n "$new_domain_name" ]; then - echo "search ${new_domain_name//\\032/ }" >> $rscf - fi + elif [ -n "$new_domain_name" ]; then + echo "search ${new_domain_name//\\032/ }" >> $rscf fi - else - echo "search $SEARCH" >> $rscf fi if [ -n "$RES_OPTIONS" ]; then @@ -409,6 +411,9 @@ function dhconfig() { elif [ -n "$new_ntp_servers" ] && [ -e /etc/ntp.conf ]; then save_previous /etc/ntp.conf /bin/egrep -v '^server .* # added by /sbin/dhclient-script$'< /etc/ntp.conf.predhclient.$interface > /etc/ntp.conf + if [ -x /sbin/restorecon ]; then + /sbin/restorecon /etc/ntp.conf >/dev/null 2>&1 + fi for s in $new_ntp_servers; do echo "server $s # added by /sbin/dhclient-script" >> /etc/ntp.conf