net-misc/ntpsec: update unit file to avoid CVE-2015-5300
authorThomas Deutschmann <whissi@gentoo.org>
Sat, 26 Oct 2019 17:49:47 +0000 (19:49 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Sat, 26 Oct 2019 17:50:54 +0000 (19:50 +0200)
Bug: https://bugs.gentoo.org/697024
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
net-misc/ntpsec/files/ntpd-r1.service [new file with mode: 0644]
net-misc/ntpsec/ntpsec-1.1.7-r1.ebuild [moved from net-misc/ntpsec/ntpsec-1.1.7.ebuild with 98% similarity]
net-misc/ntpsec/ntpsec-9999.ebuild

diff --git a/net-misc/ntpsec/files/ntpd-r1.service b/net-misc/ntpsec/files/ntpd-r1.service
new file mode 100644 (file)
index 0000000..5da4738
--- /dev/null
@@ -0,0 +1,19 @@
+[Unit]
+Description=Network Time Service
+After=network.target nss-lookup.target
+Conflicts=systemd-timesyncd.service
+
+[Service]
+Type=forking
+PrivateTmp=true
+EnvironmentFile=-/etc/conf.d/ntp
+ExecStart=/usr/sbin/ntpd ${NTPD_OPTS}
+# Specifying -g on the command line allows ntpd to make large adjustments to
+# the clock on boot.  However, if Restart=yes is set, a malicious (or broken)
+# server could send the incorrect time, trip the panic threshold, and when
+# ntpd restarts, serve it the incorrect time (which would be accepted).
+Restart=no
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
similarity index 98%
rename from net-misc/ntpsec/ntpsec-1.1.7.ebuild
rename to net-misc/ntpsec/ntpsec-1.1.7-r1.ebuild
index e5bf13be3bed544d49232024ff0207bae7a5d9fe..d6b4b3054594caedb58cae28f5a05e0ca8b65ba5 100644 (file)
@@ -132,7 +132,7 @@ src_install() {
        newconfd "${FILESDIR}"/ntpd.confd ntp
 
        # Install the systemd unit file
-       systemd_newunit "${FILESDIR}"/ntpd.service ntpd.service
+       systemd_newunit "${FILESDIR}"/ntpd-r1.service ntpd.service
 
        # Prepare a directory for the ntp.drift file
        mkdir -pv "${ED}"/var/lib/ntp
index 7cc6f74f6d34f0c37be0d5c296bf24fd4ae80530..050f701b387dfb8b764bfb6de75145d8cdbdc6f8 100644 (file)
@@ -131,7 +131,7 @@ src_install() {
        newconfd "${FILESDIR}"/ntpd.confd ntp
 
        # Install the systemd unit file
-       systemd_newunit "${FILESDIR}"/ntpd.service ntpd.service
+       systemd_newunit "${FILESDIR}"/ntpd-r1.service ntpd.service
 
        # Prepare a directory for the ntp.drift file
        mkdir -pv "${ED}"/var/lib/ntp