Fix NM dispatcher script for dhcpd to support arbitrary interface names
This commit is contained in:
parent
2f1515e529
commit
cc2eb946a1
32
12-dhcpd
32
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
|
||||
|
@ -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 <jpopelka@redhat.com> - 12:4.2.1-6.P1
|
||||
- Fix NetworkManager dispatcher script for dhcpd to support arbitrary interface names
|
||||
|
||||
* Wed Apr 06 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.1-5.P1
|
||||
- Better fix for CVE-2011-0997: making domain-name check more lenient (#694005)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user