summaryrefslogtreecommitdiff
path: root/net-misc/ntpsec/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /net-misc/ntpsec/files
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'net-misc/ntpsec/files')
-rw-r--r--net-misc/ntpsec/files/ntpd.rc-r323
-rw-r--r--net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch34
2 files changed, 57 insertions, 0 deletions
diff --git a/net-misc/ntpsec/files/ntpd.rc-r3 b/net-misc/ntpsec/files/ntpd.rc-r3
new file mode 100644
index 000000000000..68d07237455c
--- /dev/null
+++ b/net-misc/ntpsec/files/ntpd.rc-r3
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="ntpd - the network time protocol daemon"
+pidfile="/run/ntpd.pid"
+command="/usr/sbin/ntpd"
+command_args="${NTPD_OPTS}"
+command_args_background="-p ${pidfile}"
+command_args_foreground="-n"
+
+depend() {
+ use net dns logger
+ after ntp-client
+}
+
+start_pre() {
+ if [ ! -f /etc/ntp.conf ] ; then
+ eerror "Please create /etc/ntp.conf"
+ return 1
+ fi
+ return 0
+}
diff --git a/net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch b/net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch
new file mode 100644
index 000000000000..5b7a4e51374c
--- /dev/null
+++ b/net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch
@@ -0,0 +1,34 @@
+https://gitlab.com/NTPsec/ntpsec/-/commit/a49d53b7fe1d
+https://bugs.gentoo.org/851531
+
+From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
+Date: Sat, 11 Jun 2022 15:16:15 +0200
+Subject: [PATCH] ntpd/ntp_sandbox.c: allow readv() for glibc nscd
+ getaddrinfo() provider
+
+Otherwise, ntpd crashes from time to time with the following stack trace:
+#0 0x00007f5763bfac4d in readv () from /lib64/libc.so.6
+#1 0x00007f5763c48b4c in __readvall () from /lib64/libc.so.6
+#2 0x00007f5763c467ed in nscd_gethst_r () from /lib64/libc.so.6
+#3 0x00007f5763c46c0d in __nscd_gethostbyname2_r () from /lib64/libc.so.6
+#4 0x00007f5763c15a2a in gethostbyname2_r () from /lib64/libc.so.6
+#5 0x00007f5763bed3ca in gaih_inet.constprop () from /lib64/libc.so.6
+#6 0x00007f5763bee225 in getaddrinfo () from /lib64/libc.so.6
+#7 0x000055fcf0ad6544 in open_TCP_socket ()
+#8 0x000055fcf0ad79b4 in nts_probe ()
+#9 0x000055fcf0ac37c4 in dns_lookup ()
+#10 0x00007f5763b8205a in start_thread () from /lib64/libc.so.6
+#11 0x00007f5763c05d1c in clone3 () from /lib64/libc.so.6
+
+Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
+--- a/ntpd/ntp_sandbox.c
++++ b/ntpd/ntp_sandbox.c
+@@ -357,6 +357,7 @@ int scmp_sc[] = {
+ SCMP_SYS(poll),
+ SCMP_SYS(pselect6),
+ SCMP_SYS(read),
++ SCMP_SYS(readv), /* nscd getaddrinfo() provider */
+ SCMP_SYS(recvfrom), /* Comment this out for testing.
+ * It will die on the first reply.
+ * (Or maybe sooner if a request arrives.)
+GitLab