From cc2eb946a13e8679ead7d72a6b7123a32e753158 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Apr 27 2011 15:17:31 +0000 Subject: Fix NM dispatcher script for dhcpd to support arbitrary interface names --- diff --git a/12-dhcpd b/12-dhcpd index fad6f4b..e72e8cd 100644 --- a/12-dhcpd +++ b/12-dhcpd @@ -5,17 +5,27 @@ export LC_ALL=C # restart dhcpd whenever $1 interface is brought up by NM (rhbz #565921) if [ "$2" = "up" ]; then - # exit if the service is not configured to be started in the current runlevel - /bin/systemctl is-enabled dhcpd.service || exit 0 + # exit if the service is not configured to be started in the current runlevel + /bin/systemctl is-enabled dhcpd.service || exit 0 - # exit if dhcpd is not defined to listen on $1 - # i.e. if there are interfaces defined in DHCPDARGS and $1 is not among them - if [ -n "${DHCPDARGS}" ] && - [[ "${DHCPDARGS}" == *eth* ]] && - [[ "${DHCPDARGS}" != *$1* ]]; then - exit 0 - fi + ifaces="" # interfaces defined in DHCPDARGS + net=$(ls /sys/class/net) # all interfaces on system - # restart service - /bin/systemctl restart dhcpd.service || : + if [ -n "${DHCPDARGS}" ]; then + for iface in ${net}; do + for arg in ${DHCPDARGS}; do + [ $arg == $iface ] && ifaces="$ifaces $iface" + done + done + fi + + # exit if dhcpd is not defined to listen on $1 + # i.e. if there are interfaces defined in DHCPDARGS and $1 is not among them + if [ -n "${ifaces}" ] && + [[ "${ifaces}" != *$1* ]]; then + exit 0 + fi + + # restart service + /bin/systemctl restart dhcpd.service || : fi diff --git a/dhcp.spec b/dhcp.spec index 0b0702f..fcd814d 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -16,7 +16,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.2.1 -Release: 5.%{patchver}%{?dist} +Release: 6.%{patchver}%{?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. @@ -634,6 +634,9 @@ fi %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz %changelog +* Wed Apr 27 2011 Jiri Popelka - 12:4.2.1-6.P1 +- Fix NetworkManager dispatcher script for dhcpd to support arbitrary interface names + * Wed Apr 06 2011 Jiri Popelka - 12:4.2.1-5.P1 - Better fix for CVE-2011-0997: making domain-name check more lenient (#694005)