From 132ece510b0b4e47751e78012660aa41c8251b4b Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Fri, 2 Jan 2015 08:47:19 -0600 Subject: [PATCH] resync patch set --- ...lude-time.h-for-strftime-clock_gettime.patch} | 6 ++++-- ...-libevent-header-and-structures-in-ntp.patch} | 6 ++++-- patches/0003-remove-unused-dns_pid.patch | 4 +++- ...MAX-macro-used-in-a-few-places-in-ntpd.patch} | 6 ++++-- ...n-socket-to-avoid-a-variable-called-su.patch} | 7 ++++--- ...re-verbose-when-logging-privsep-errors.patch} | 4 ++-- ...w-privsep-user-to-be-a-privileged-user.patch} | 4 ++-- ...S-records-on-IPv4-networks-more-libera.patch} | 4 ++-- patches/0009-Fix-DNS-timeout-lookup.patch | 2 +- ...0-EAI_NODATA-does-not-exist-everywhere.patch} | 16 +++++++++++----- ...ch => 0011-Use-LOG_NTP-syslog-facility.patch} | 4 ++-- ...fill-in-sin_len-sin6_len-if-they-exist.patch} | 14 ++++++-------- ...3-check-if-rdomain-support-is-available.patch | 2 +- ...d.conf-to-indicate-OS-dependent-options.patch | 2 +- ...rriding-default-user-and-file-locations.patch | 2 +- ...-p-option-to-create-a-pid-file.patch.disabled | 2 +- 16 files changed, 49 insertions(+), 36 deletions(-) rename patches/{0001-include-time.h-for-clock_gettime.patch => 0001-include-time.h-for-strftime-clock_gettime.patch} (78%) rename patches/{0002-removed-unused-libevent-header-and-structures.patch => 0002-removed-unused-libevent-header-and-structures-in-ntp.patch} (83%) rename patches/{0004-add-MAX-macro.patch => 0004-add-MAX-macro-used-in-a-few-places-in-ntpd.patch} (70%) rename patches/{0008-rename-socket-to-avoid-a-variable-called-sun.patch => 0005-rename-the-s_un-socket-to-avoid-a-variable-called-su.patch} (92%) rename patches/{0005-be-more-verbose-when-logging-privsep-errors.patch => 0006-be-more-verbose-when-logging-privsep-errors.patch} (89%) rename patches/{0006-do-not-allow-privsep-user-to-be-a-privileged-user.patch => 0007-do-not-allow-privsep-user-to-be-a-privileged-user.patch} (87%) rename patches/{0007-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch => 0008-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch} (90%) rename patches/{0012-EAI_NODATA-does-not-exist-everywhere.patch => 0010-EAI_NODATA-does-not-exist-everywhere.patch} (60%) rename patches/{0010-Use-LOG_NTP-syslog-facility.patch => 0011-Use-LOG_NTP-syslog-facility.patch} (86%) rename patches/{0011-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch => 0012-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch} (81%) diff --git a/patches/0001-include-time.h-for-clock_gettime.patch b/patches/0001-include-time.h-for-strftime-clock_gettime.patch similarity index 78% rename from patches/0001-include-time.h-for-clock_gettime.patch rename to patches/0001-include-time.h-for-strftime-clock_gettime.patch index 02d986b..8564f5d 100644 --- a/patches/0001-include-time.h-for-clock_gettime.patch +++ b/patches/0001-include-time.h-for-strftime-clock_gettime.patch @@ -1,8 +1,10 @@ -From 53006c85af7c8b69afa3847e12107588c1460c5a Mon Sep 17 00:00:00 2001 +From 27f9b15fed29f671606ce6f5322c6407c0456615 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 08:58:26 -0600 -Subject: [PATCH 01/16] include time.h for clock_gettime +Subject: [PATCH 01/16] include time.h for strftime, clock_gettime +Add a missing include for time.h to get the definitions of +clock_gettime and strftime. --- src/usr.sbin/ntpd/ntpd.c | 1 + src/usr.sbin/ntpd/util.c | 2 ++ diff --git a/patches/0002-removed-unused-libevent-header-and-structures.patch b/patches/0002-removed-unused-libevent-header-and-structures-in-ntp.patch similarity index 83% rename from patches/0002-removed-unused-libevent-header-and-structures.patch rename to patches/0002-removed-unused-libevent-header-and-structures-in-ntp.patch index 2979948..54d69eb 100644 --- a/patches/0002-removed-unused-libevent-header-and-structures.patch +++ b/patches/0002-removed-unused-libevent-header-and-structures-in-ntp.patch @@ -1,8 +1,10 @@ -From da6f7a99e25c9fa0fca75576eaf29f0e8fe67441 Mon Sep 17 00:00:00 2001 +From 0d94976a5b804c445cb8c34d2d0665c379e86ee5 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 08:59:19 -0600 -Subject: [PATCH 02/16] removed unused libevent header and structures +Subject: [PATCH 02/16] removed unused libevent header and structures in ntpd.h +It does not appear anything actually uses libevent in ntpd, so remove +the libevent-using structures from ntpd.h --- src/usr.sbin/ntpd/ntpd.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/patches/0003-remove-unused-dns_pid.patch b/patches/0003-remove-unused-dns_pid.patch index 4b6cbdd..9e8c4c9 100644 --- a/patches/0003-remove-unused-dns_pid.patch +++ b/patches/0003-remove-unused-dns_pid.patch @@ -1,8 +1,10 @@ -From be678b846a8bbeede06d66a630a64a19c589c45f Mon Sep 17 00:00:00 2001 +From 8d9e3d91cfb94f11873d9bed1d7e877572bb5579 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:01:57 -0600 Subject: [PATCH 03/16] remove unused dns_pid +dns_pid is returned, but nothing is done with it. Was then intent to do +some extra error handling here? --- src/usr.sbin/ntpd/ntp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/0004-add-MAX-macro.patch b/patches/0004-add-MAX-macro-used-in-a-few-places-in-ntpd.patch similarity index 70% rename from patches/0004-add-MAX-macro.patch rename to patches/0004-add-MAX-macro-used-in-a-few-places-in-ntpd.patch index 933bbae..e1c3148 100644 --- a/patches/0004-add-MAX-macro.patch +++ b/patches/0004-add-MAX-macro-used-in-a-few-places-in-ntpd.patch @@ -1,8 +1,10 @@ -From 06c8339b3a1bde6f71d437d792ae01d118832fb4 Mon Sep 17 00:00:00 2001 +From a74e51f0e68d0d437c340a197ef7fcba8ab3b3aa Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 31 Dec 2014 22:39:58 -0600 -Subject: [PATCH 04/16] add MAX macro +Subject: [PATCH 04/16] add MAX macro, used in a few places in ntpd +Do not assume that the system #includes happen to include a MAX macro +somewhere along the way. --- src/usr.sbin/ntpd/ntpd.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patches/0008-rename-socket-to-avoid-a-variable-called-sun.patch b/patches/0005-rename-the-s_un-socket-to-avoid-a-variable-called-su.patch similarity index 92% rename from patches/0008-rename-socket-to-avoid-a-variable-called-sun.patch rename to patches/0005-rename-the-s_un-socket-to-avoid-a-variable-called-su.patch index 98d2a59..562400d 100644 --- a/patches/0008-rename-socket-to-avoid-a-variable-called-sun.patch +++ b/patches/0005-rename-the-s_un-socket-to-avoid-a-variable-called-su.patch @@ -1,9 +1,10 @@ -From 8c872d895d50214a23aad90a7cb31a7a51a08e29 Mon Sep 17 00:00:00 2001 +From 0a52220f114d2134d0e6180aa1c9fccdb6050700 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 31 Dec 2014 22:08:09 -0600 -Subject: [PATCH 08/16] rename socket to avoid a variable called 'sun' +Subject: [PATCH 05/16] rename the s_un socket to avoid a variable called 'sun' -Solaris defines 'sun' as a constant. +Solaris build environments seem to define 'sun' as a constant. +Hilarity ensues. --- src/usr.sbin/ntpd/control.c | 18 +++++++++--------- src/usr.sbin/ntpd/ntpd.c | 12 ++++++------ diff --git a/patches/0005-be-more-verbose-when-logging-privsep-errors.patch b/patches/0006-be-more-verbose-when-logging-privsep-errors.patch similarity index 89% rename from patches/0005-be-more-verbose-when-logging-privsep-errors.patch rename to patches/0006-be-more-verbose-when-logging-privsep-errors.patch index ae3271d..c065903 100644 --- a/patches/0005-be-more-verbose-when-logging-privsep-errors.patch +++ b/patches/0006-be-more-verbose-when-logging-privsep-errors.patch @@ -1,7 +1,7 @@ -From b0d68d365d6b4512a5a07d14e56f0c51cdeae0c3 Mon Sep 17 00:00:00 2001 +From 0b2940a2ba2e04fe876b7e8828d05e2d6b750797 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 1 Jan 2015 13:06:38 -0600 -Subject: [PATCH 05/16] be more verbose when logging privsep errors +Subject: [PATCH 06/16] be more verbose when logging privsep errors Make it easy for a sysadmin to diagnose a privilege separation path problem without looking at the source code. diff --git a/patches/0006-do-not-allow-privsep-user-to-be-a-privileged-user.patch b/patches/0007-do-not-allow-privsep-user-to-be-a-privileged-user.patch similarity index 87% rename from patches/0006-do-not-allow-privsep-user-to-be-a-privileged-user.patch rename to patches/0007-do-not-allow-privsep-user-to-be-a-privileged-user.patch index fec226e..11bd1ce 100644 --- a/patches/0006-do-not-allow-privsep-user-to-be-a-privileged-user.patch +++ b/patches/0007-do-not-allow-privsep-user-to-be-a-privileged-user.patch @@ -1,7 +1,7 @@ -From 555e4346d4a441e2385b91c3188edbe9b093cfd5 Mon Sep 17 00:00:00 2001 +From f478e7be28896cd6e42622a72c691b0f56b01aa9 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 1 Jan 2015 13:26:29 -0600 -Subject: [PATCH 06/16] do not allow privsep user to be a privileged user +Subject: [PATCH 07/16] do not allow privsep user to be a privileged user This may need to be a function call for different platforms with different capability / privilege mechanisms. diff --git a/patches/0007-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch b/patches/0008-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch similarity index 90% rename from patches/0007-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch rename to patches/0008-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch index 10bc53e..b27aaac 100644 --- a/patches/0007-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch +++ b/patches/0008-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch @@ -1,7 +1,7 @@ -From 42535b62e78e5869fd6fef0f075eb17fb0148559 Mon Sep 17 00:00:00 2001 +From abc0fb186de14dae5cacae4d1a8352c7f78106f6 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:10:22 -0600 -Subject: [PATCH 07/16] Handle IPv6 DNS records on IPv4 networks more liberally +Subject: [PATCH 08/16] Handle IPv6 DNS records on IPv4 networks more liberally Rather than fail on IPv4 only networks when seeing an IPv6 DNS record, just give a warning. diff --git a/patches/0009-Fix-DNS-timeout-lookup.patch b/patches/0009-Fix-DNS-timeout-lookup.patch index a61b975..3a723bd 100644 --- a/patches/0009-Fix-DNS-timeout-lookup.patch +++ b/patches/0009-Fix-DNS-timeout-lookup.patch @@ -1,4 +1,4 @@ -From b3c2b2c8c9c4e59ad3518d10d3765cf35934d76c Mon Sep 17 00:00:00 2001 +From e181bffce739affc7261ddd4c659311e09858fe2 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 31 Dec 2014 08:31:20 -0600 Subject: [PATCH 09/16] Fix DNS timeout lookup diff --git a/patches/0012-EAI_NODATA-does-not-exist-everywhere.patch b/patches/0010-EAI_NODATA-does-not-exist-everywhere.patch similarity index 60% rename from patches/0012-EAI_NODATA-does-not-exist-everywhere.patch rename to patches/0010-EAI_NODATA-does-not-exist-everywhere.patch index f006f62..89cccdf 100644 --- a/patches/0012-EAI_NODATA-does-not-exist-everywhere.patch +++ b/patches/0010-EAI_NODATA-does-not-exist-everywhere.patch @@ -1,18 +1,24 @@ -From d874a2d6c44f3656289437b49002ba0f19ca63a2 Mon Sep 17 00:00:00 2001 +From 9404e4f538cde156e08393f7a88a62c631a5ab42 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:04:08 -0600 -Subject: [PATCH 12/16] EAI_NODATA does not exist everywhere +Subject: [PATCH 10/16] EAI_NODATA does not exist everywhere -FreeBSD says it is deprecated and should be removed. +FreeBSD says it is deprecated #ifdef's it out. + +Linux glibc hides it and many other return codes behind __USE_GNU. + What is that supposed to mean? + +It seems the only effect of 'deprecating' this value has been that all +portable software now has to have a special check instead. --- src/usr.sbin/ntpd/config.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c -index b651c62..d571dd7 100644 +index d660750..22b692b 100644 --- a/src/usr.sbin/ntpd/config.c +++ b/src/usr.sbin/ntpd/config.c -@@ -128,8 +128,14 @@ host_dns(const char *s, struct ntp_addr **hn) +@@ -124,8 +124,14 @@ host_dns(const char *s, struct ntp_addr **hn) hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ error = getaddrinfo(s, NULL, &hints, &res0); diff --git a/patches/0010-Use-LOG_NTP-syslog-facility.patch b/patches/0011-Use-LOG_NTP-syslog-facility.patch similarity index 86% rename from patches/0010-Use-LOG_NTP-syslog-facility.patch rename to patches/0011-Use-LOG_NTP-syslog-facility.patch index 306ad5c..1010d18 100644 --- a/patches/0010-Use-LOG_NTP-syslog-facility.patch +++ b/patches/0011-Use-LOG_NTP-syslog-facility.patch @@ -1,7 +1,7 @@ -From 204f212fd5905b8af28f22c49254be4a29923c94 Mon Sep 17 00:00:00 2001 +From 48f06e1fee38cd2dafffe55bd94d14f23863c4ef Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:00:12 -0600 -Subject: [PATCH 10/16] Use LOG_NTP syslog facility. +Subject: [PATCH 11/16] Use LOG_NTP syslog facility. FreeBSD PR: 114191 Submitted by: Robert Archer diff --git a/patches/0011-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch b/patches/0012-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch similarity index 81% rename from patches/0011-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch rename to patches/0012-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch index 9c330ed..46be660 100644 --- a/patches/0011-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch +++ b/patches/0012-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch @@ -1,23 +1,21 @@ -From e6c8f113fb20f3768e3c35b2f23c694a61c7c5f2 Mon Sep 17 00:00:00 2001 +From 48574bd8957c1f824a03f866c448dd9b19e060ea Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:02:50 -0600 -Subject: [PATCH 11/16] conditionally fill in sin_len/sin6_len if they exist +Subject: [PATCH 12/16] conditionally fill in sin_len/sin6_len if they exist -Should we even be setting these at all? Does anything really rely in -this anymore? --- src/usr.sbin/ntpd/config.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c -index d660750..b651c62 100644 +index 22b692b..c01df83 100644 --- a/src/usr.sbin/ntpd/config.c +++ b/src/usr.sbin/ntpd/config.c @@ -75,7 +75,9 @@ host_v4(const char *s) if ((h = calloc(1, sizeof(struct ntp_addr))) == NULL) fatal(NULL); sa_in = (struct sockaddr_in *)&h->ss; -+#ifdef SIN_LEN ++#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sa_in->sin_len = sizeof(struct sockaddr_in); +#endif sa_in->sin_family = AF_INET; @@ -33,11 +31,11 @@ index d660750..b651c62 100644 sa_in6->sin6_family = AF_INET6; memcpy(&sa_in6->sin6_addr, &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr, -@@ -141,12 +145,16 @@ host_dns(const char *s, struct ntp_addr **hn) +@@ -147,12 +151,16 @@ host_dns(const char *s, struct ntp_addr **hn) h->ss.ss_family = res->ai_family; if (res->ai_family == AF_INET) { sa_in = (struct sockaddr_in *)&h->ss; -+#ifdef SIN_LEN ++#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sa_in->sin_len = sizeof(struct sockaddr_in); +#endif sa_in->sin_addr.s_addr = ((struct sockaddr_in *) diff --git a/patches/0013-check-if-rdomain-support-is-available.patch b/patches/0013-check-if-rdomain-support-is-available.patch index fa613cb..ae3f39a 100644 --- a/patches/0013-check-if-rdomain-support-is-available.patch +++ b/patches/0013-check-if-rdomain-support-is-available.patch @@ -1,4 +1,4 @@ -From 7774d16dece25b907809a2cba3ede6195798a641 Mon Sep 17 00:00:00 2001 +From fb2f9a8e680d63de0c2e389522e31d0592836a0b Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:05:46 -0600 Subject: [PATCH 13/16] check if rdomain support is available diff --git a/patches/0014-update-ntpd.conf-to-indicate-OS-dependent-options.patch b/patches/0014-update-ntpd.conf-to-indicate-OS-dependent-options.patch index 3e8d7d0..e8aa6a6 100644 --- a/patches/0014-update-ntpd.conf-to-indicate-OS-dependent-options.patch +++ b/patches/0014-update-ntpd.conf-to-indicate-OS-dependent-options.patch @@ -1,4 +1,4 @@ -From edb43d28257d62671d7b364a55375bcf1332a1b9 Mon Sep 17 00:00:00 2001 +From d11c0ce3878fdc86624c1ee6b0e45764c8915dab Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 30 Dec 2014 09:20:03 -0600 Subject: [PATCH 14/16] update ntpd.conf to indicate OS-dependent options diff --git a/patches/0015-allow-overriding-default-user-and-file-locations.patch b/patches/0015-allow-overriding-default-user-and-file-locations.patch index d8a5f81..e1b1c92 100644 --- a/patches/0015-allow-overriding-default-user-and-file-locations.patch +++ b/patches/0015-allow-overriding-default-user-and-file-locations.patch @@ -1,4 +1,4 @@ -From 6f9277a636cdd1c1a69d609f99b5c6ce00f1581b Mon Sep 17 00:00:00 2001 +From e76ff433a73cf9a6dc1f24db3500c5139e031601 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 1 Jan 2015 07:18:11 -0600 Subject: [PATCH 15/16] allow overriding default user and file locations diff --git a/patches/0016-add-p-option-to-create-a-pid-file.patch.disabled b/patches/0016-add-p-option-to-create-a-pid-file.patch.disabled index 511ba5c..ed7390b 100644 --- a/patches/0016-add-p-option-to-create-a-pid-file.patch.disabled +++ b/patches/0016-add-p-option-to-create-a-pid-file.patch.disabled @@ -1,4 +1,4 @@ -From 4bf1b65f3ca244e47e9a7d6f0c475f402aea0d44 Mon Sep 17 00:00:00 2001 +From 510fd86ed75868a82be55f3b16040ea02fb06fc4 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 31 Dec 2014 08:26:41 -0600 Subject: [PATCH 16/16] add -p option to create a pid file