[pkg-ntp-maintainers] Bug#778415: ntp: NetworkManager breaks dhcp hook

Helmut Grohne helmut at subdivi.de
Sat Feb 14 16:21:09 UTC 2015


Package: ntp
Version: 1:4.2.6.p5+dfsg-2+deb7u3
Severity: normal
Tags: patch

Usually, ntp obtains its servers via dhcp. As soon as network-manager is
installed, this is broken, because NetworkManager disables the dhcp
hooks. This issue is known for a long time and known as #537358. The
network-manager maintainers do not view this as a bug in NetworkManager,
and asked to fix this in the respective packages instead. ntp is one
such package.

This is broken in wheezy, jessie and sid.

I am attaching a patch against sid, that adds the relevant integration
into NetworkManager by reusing the dhcp hook.

Helmut
-------------- next part --------------
diff -Nru ntp-4.2.6.p5+dfsg/debian/changelog ntp-4.2.6.p5+dfsg/debian/changelog
--- ntp-4.2.6.p5+dfsg/debian/changelog	2015-02-07 12:20:56.000000000 +0100
+++ ntp-4.2.6.p5+dfsg/debian/changelog	2015-02-14 17:14:10.000000000 +0100
@@ -1,3 +1,10 @@
+ntp (1:4.2.6.p5+dfsg-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Hook into NetworkManager to update ntp servers from dhcp. (Closes: #-1)
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sat, 14 Feb 2015 17:13:48 +0100
+
 ntp (1:4.2.6.p5+dfsg-5) unstable; urgency=high
 
   * Add missing fix for CVE-2014-9297
diff -Nru ntp-4.2.6.p5+dfsg/debian/ntp.networkmanager ntp-4.2.6.p5+dfsg/debian/ntp.networkmanager
--- ntp-4.2.6.p5+dfsg/debian/ntp.networkmanager	1970-01-01 01:00:00.000000000 +0100
+++ ntp-4.2.6.p5+dfsg/debian/ntp.networkmanager	2015-02-14 17:12:56.000000000 +0100
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+old_ntp_servers="unknown and invalid"
+new_ntp_servers=$DHCP4_NTP_SERVERS
+case "$2" in
+	up|vpn-up) reason=BOUND; ;;
+	down|vpn-down) reason=RELEASE; ;;
+	*) exit 0; ;;
+esac
+
+test -f /etc/dhcp/dhclient-exit-hooks.d/ntp || exit 0
+. /etc/dhcp/dhclient-exit-hooks.d/ntp
diff -Nru ntp-4.2.6.p5+dfsg/debian/rules ntp-4.2.6.p5+dfsg/debian/rules
--- ntp-4.2.6.p5+dfsg/debian/rules	2014-07-16 18:49:08.000000000 +0200
+++ ntp-4.2.6.p5+dfsg/debian/rules	2015-02-14 17:13:45.000000000 +0100
@@ -60,6 +60,7 @@
 
 	install -D -m 0755 scripts/ntpsweep debian/ntp/usr/bin/ntpsweep
 	install -D -m 0644 debian/ntp.dhcp debian/ntp/etc/dhcp/dhclient-exit-hooks.d/ntp
+	install -D -m 0755 debian/ntp.networkmanager debian/ntp/etc/NetworkManager/dispatcher.d/ntp
 	install -D -m 0644 debian/ntpdate.dhcp debian/ntpdate/etc/dhcp/dhclient-exit-hooks.d/ntpdate
 	install -D -m 0755 debian/ntpdate-debian debian/ntpdate/usr/sbin/ntpdate-debian
 


More information about the pkg-ntp-maintainers mailing list