Browse Source

rebase patches

OPENBSD_6_1
Brent Cook 8 years ago
parent
commit
d6fff63cbb
12 changed files with 71 additions and 60 deletions
  1. +3
    -3
      patches/0001-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch
  2. +3
    -3
      patches/0002-EAI_NODATA-does-not-exist-everywhere.patch
  3. +3
    -3
      patches/0003-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch
  4. +24
    -4
      patches/0004-check-if-rdomain-support-is-available.patch
  5. +3
    -3
      patches/0005-update-ntpd.conf-to-indicate-OS-dependent-options.patch
  6. +7
    -7
      patches/0006-allow-overriding-default-user-and-file-locations.patch
  7. +9
    -18
      patches/0007-add-p-option-to-create-a-pid-file.patch
  8. +4
    -4
      patches/0008-initialize-setproctitle-where-needed.patch
  9. +4
    -4
      patches/0009-Notify-the-user-when-constraint-support-is-disabled.patch
  10. +4
    -4
      patches/0010-add-a-method-for-updating-the-realtime-clock-on-sync.patch
  11. +3
    -3
      patches/0011-Deal-with-missing-SO_TIMESTAMP.patch
  12. +4
    -4
      patches/0012-check-result-of-ftello-ftruncate.patch

+ 3
- 3
patches/0001-Handle-IPv6-DNS-records-on-IPv4-networks-more-libera.patch View File

@ -1,7 +1,7 @@
From ca2ca2f4b7f46c366fde7c4f1b7fc4522d49e142 Mon Sep 17 00:00:00 2001
From edf77031dabb3d96d8f093d6ea9f46d74b44f5d9 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:10:22 -0600
Subject: [PATCH 01/13] Handle IPv6 DNS records on IPv4 networks more liberally
Subject: [PATCH 01/12] 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.
@ -37,5 +37,5 @@ index a92382b..7ce3b38 100644
if (connect(p->query->fd, sa, SA_LEN(sa)) == -1) {
if (errno == ECONNREFUSED || errno == ENETUNREACH ||
--
2.8.1
2.9.2

+ 3
- 3
patches/0002-EAI_NODATA-does-not-exist-everywhere.patch View File

@ -1,7 +1,7 @@
From f9a6fc9728565773c01d0e2f9cfb6f52a5035dae Mon Sep 17 00:00:00 2001
From 45fbc8bdd01d276c3c64bc74dd4980da1164947a Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:04:08 -0600
Subject: [PATCH 02/13] EAI_NODATA does not exist everywhere
Subject: [PATCH 02/12] EAI_NODATA does not exist everywhere
FreeBSD says it is deprecated #ifdef's it out.
@ -36,5 +36,5 @@ index b2f688e..c0a99b1 100644
log_warnx("could not parse \"%s\": %s", s,
gai_strerror(error));
--
2.8.1
2.9.2

+ 3
- 3
patches/0003-conditionally-fill-in-sin_len-sin6_len-if-they-exist.patch View File

@ -1,7 +1,7 @@
From 56cce5db3e98b241cbd0b6fb589a0ee0472fb1d5 Mon Sep 17 00:00:00 2001
From da848b619bd7721ecc5a17877d87333318d79bf9 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:02:50 -0600
Subject: [PATCH 03/13] conditionally fill in sin_len/sin6_len if they exist
Subject: [PATCH 03/12] conditionally fill in sin_len/sin6_len if they exist
---
src/usr.sbin/ntpd/config.c | 8 ++++++++
@ -49,5 +49,5 @@ index c0a99b1..87de17a 100644
res->ai_addr)->sin6_addr, sizeof(struct in6_addr));
}
--
2.8.1
2.9.2

+ 24
- 4
patches/0004-check-if-rdomain-support-is-available.patch View File

@ -1,13 +1,33 @@
From a59051f8fefda18ed49fb9d12022c6f799fb60c9 Mon Sep 17 00:00:00 2001
From d6bf1b5546df84737fb53939d82bd42d52aa749c Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:05:46 -0600
Subject: [PATCH 04/13] check if rdomain support is available.
Subject: [PATCH 04/12] check if rdomain support is available.
Handle FreeBSD's calling rdomain 'FIB'.
- from naddy@openbsd.org
---
src/usr.sbin/ntpd/ntpd.h | 6 ++++++
src/usr.sbin/ntpd/parse.y | 2 ++
src/usr.sbin/ntpd/server.c | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 3fddba8..94cc654 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -40,6 +40,12 @@
#define DRIFTFILE "/var/db/ntpd.drift"
#define CTLSOCKET "/var/run/ntpd.sock"
+#if defined(SO_SETFIB)
+#define SO_RTABLE SO_SETFIB
+#define SIOCGIFRDOMAIN SIOCGIFFIB
+#define ifr_rdomainid ifr_fib
+#endif
+
#define INTERVAL_QUERY_NORMAL 30 /* sync to peers every n secs */
#define INTERVAL_QUERY_PATHETIC 60
#define INTERVAL_QUERY_AGGRESSIVE 5
diff --git a/src/usr.sbin/ntpd/parse.y b/src/usr.sbin/ntpd/parse.y
index 6d50795..33fe13d 100644
--- a/src/usr.sbin/ntpd/parse.y
@ -92,5 +112,5 @@ index fb297d7..2e28b9b 100644
if (bind(la->fd, (struct sockaddr *)&la->sa,
SA_LEN((struct sockaddr *)&la->sa)) == -1) {
--
2.8.1
2.9.2

+ 3
- 3
patches/0005-update-ntpd.conf-to-indicate-OS-dependent-options.patch View File

@ -1,7 +1,7 @@
From 2a04ec132f9ac193e4cb52cc3dbe76ed03e4b624 Mon Sep 17 00:00:00 2001
From 2e648d55b95aebcf30208d13a6cd4ca56d3fb2ab Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:20:03 -0600
Subject: [PATCH 05/13] update ntpd.conf to indicate OS-dependent options
Subject: [PATCH 05/12] update ntpd.conf to indicate OS-dependent options
Also, clarify listening behavior based on a patch from
Dererk <dererk@debian.org>
@ -49,5 +49,5 @@ index af11a7e..87f94e8 100644
.Xr ntpd 8
will use each given sensor that actually exists.
--
2.8.1
2.9.2

+ 7
- 7
patches/0006-allow-overriding-default-user-and-file-locations.patch View File

@ -1,7 +1,7 @@
From 9df34babff002bddd4fadfb271b4226d45b007a2 Mon Sep 17 00:00:00 2001
From 7025f8e6993e9a491143fd3538d29bab170c2589 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Thu, 1 Jan 2015 07:18:11 -0600
Subject: [PATCH 06/13] allow overriding default user and file locations
Subject: [PATCH 06/12] allow overriding default user and file locations
Allow the build process to override the default ntpd file paths and
default user.
@ -10,7 +10,7 @@ default user.
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 3fddba8..9ee2e42 100644
index 94cc654..375edc1 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -35,10 +35,20 @@
@ -35,9 +35,9 @@ index 3fddba8..9ee2e42 100644
+#define DRIFTFILE LOCALSTATEDIR "/db/ntpd.drift"
+#define CTLSOCKET LOCALSTATEDIR "/run/ntpd.sock"
#define INTERVAL_QUERY_NORMAL 30 /* sync to peers every n secs */
#define INTERVAL_QUERY_PATHETIC 60
@@ -80,7 +90,9 @@
#if defined(SO_SETFIB)
#define SO_RTABLE SO_SETFIB
@@ -86,7 +96,9 @@
#define CONSTRAINT_PORT "443" /* HTTPS port */
#define CONSTRAINT_MAXHEADERLENGTH 8192
#define CONSTRAINT_PASSFD (STDERR_FILENO + 1)
@ -48,5 +48,5 @@ index 3fddba8..9ee2e42 100644
enum client_state {
STATE_NONE,
--
2.8.1
2.9.2

+ 9
- 18
patches/0007-add-p-option-to-create-a-pid-file.patch View File

@ -1,16 +1,16 @@
From 5c0b2ba4ef077a253a8ce0a11fb536b7f696ddbf Mon Sep 17 00:00:00 2001
From d7d30f3467758025c4aba9e0ff45bd3178d6ff15 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Wed, 31 Dec 2014 08:26:41 -0600
Subject: [PATCH 07/13] add -p option to create a pid file
Subject: [PATCH 07/12] add -p option to create a pid file
This is used in both the Gentoo and Debian ports.
Origin: https://bugs.gentoo.org/show_bug.cgi?id=493082
---
src/usr.sbin/ntpd/ntpd.8 | 4 ++++
src/usr.sbin/ntpd/ntpd.c | 35 +++++++++++++++++++++++++++++------
src/usr.sbin/ntpd/ntpd.c | 33 ++++++++++++++++++++++++++++-----
src/usr.sbin/ntpd/ntpd.h | 1 +
3 files changed, 34 insertions(+), 6 deletions(-)
3 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.8 b/src/usr.sbin/ntpd/ntpd.8
index dcfb6d2..1b885a1 100644
@ -35,7 +35,7 @@ index dcfb6d2..1b885a1 100644
Do not set the time immediately at startup.
This is the default.
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index 43486f0..f8727f6 100644
index 43486f0..2377d89 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -87,6 +87,18 @@ sighdlr(int sig)
@ -93,20 +93,11 @@ index 43486f0..f8727f6 100644
+ if (!lconf.debug) {
if (daemon(1, 0))
fatal("daemon");
+ writepid(&lconf);
+ }
+ writepid(&lconf);
} else
timeout = SETTIME_TIMEOUT * 1000;
@@ -230,7 +247,7 @@ main(int argc, char *argv[])
* Constraint processes are forked with certificates in memory,
* then privdrop into chroot before speaking to the outside world.
*/
-#if 0
+#if 0
if (pledge("stdio rpath inet settime proc id", NULL) == -1)
err(1, "pledge");
#endif
@@ -275,9 +292,11 @@ main(int argc, char *argv[])
log_verbose(lconf.verbose);
log_warnx("no reply received in time, skipping initial "
@ -143,10 +134,10 @@ index 43486f0..f8727f6 100644
timeout = INFTIM;
break;
diff --git a/src/usr.sbin/ntpd/ntpd.h b/src/usr.sbin/ntpd/ntpd.h
index 9ee2e42..d39628c 100644
index 375edc1..e40bf5e 100644
--- a/src/usr.sbin/ntpd/ntpd.h
+++ b/src/usr.sbin/ntpd/ntpd.h
@@ -237,6 +237,7 @@ struct ntpd_conf {
@@ -243,6 +243,7 @@ struct ntpd_conf {
u_int constraint_errors;
u_int8_t *ca;
size_t ca_len;
@ -155,5 +146,5 @@ index 9ee2e42..d39628c 100644
struct ctl_show_status {
--
2.8.1
2.9.2

+ 4
- 4
patches/0008-initialize-setproctitle-where-needed.patch View File

@ -1,7 +1,7 @@
From 71312c1ff3362948f6593577dfec6e6eded52642 Mon Sep 17 00:00:00 2001
From 5a77ca4ff85fcc7d0c1bb4efd2b979192a857f68 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 12 Jan 2015 06:18:31 -0600
Subject: [PATCH 08/13] initialize setproctitle where needed
Subject: [PATCH 08/12] initialize setproctitle where needed
We need to save a copy of argv and __progname to avoid setproctitle
clobbering them.
@ -10,7 +10,7 @@ clobbering them.
1 file changed, 19 insertions(+)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index f8727f6..cf3b4d9 100644
index 2377d89..ccd3a4d 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -117,6 +117,13 @@ usage(void)
@ -54,5 +54,5 @@ index f8727f6..cf3b4d9 100644
switch (ch) {
case 'd':
--
2.8.1
2.9.2

+ 4
- 4
patches/0009-Notify-the-user-when-constraint-support-is-disabled.patch View File

@ -1,7 +1,7 @@
From 58940edb034bf022031732e76d0481f737614eaf Mon Sep 17 00:00:00 2001
From 5a08f6539f3885f15f4245d04ba28a475937b4d7 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Fri, 27 Mar 2015 23:14:15 -0500
Subject: [PATCH 09/13] Notify the user when constraint support is disabled.
Subject: [PATCH 09/12] Notify the user when constraint support is disabled.
Update the manpage and make a constraint line a fatal error if it is
configured but ntpd is built without libtls present.
@ -27,7 +27,7 @@ index 87de17a..5a75030 100644
}
diff --git a/src/usr.sbin/ntpd/constraint.c b/src/usr.sbin/ntpd/constraint.c
index f259b08..46b96ee 100644
index 093f29a..008ab4d 100644
--- a/src/usr.sbin/ntpd/constraint.c
+++ b/src/usr.sbin/ntpd/constraint.c
@@ -292,12 +292,14 @@ priv_constraint_child(struct constraint *cstr, struct ntp_addr_msg *am,
@ -64,5 +64,5 @@ index 87f94e8..7f729d2 100644
.It Ic constraint from Ar url
Specify the URL, IP address or the hostname of an HTTPS server to
--
2.8.1
2.9.2

+ 4
- 4
patches/0010-add-a-method-for-updating-the-realtime-clock-on-sync.patch View File

@ -1,7 +1,7 @@
From 250b304b0dbd81de45d7f147a82fd89d78113a3f Mon Sep 17 00:00:00 2001
From b141c29386bb3ac6e969e868e585ceab3a8c039c Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Mon, 4 May 2015 04:27:29 -0500
Subject: [PATCH 10/13] add a method for updating the realtime clock on sync
Subject: [PATCH 10/12] add a method for updating the realtime clock on sync
from Christian Weisgerber
---
@ -9,7 +9,7 @@ from Christian Weisgerber
1 file changed, 2 insertions(+)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index cf3b4d9..b665000 100644
index ccd3a4d..dfddd89 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -55,6 +55,7 @@ const char *ctl_lookup_option(char *, const char **);
@ -29,5 +29,5 @@ index cf3b4d9..b665000 100644
}
--
2.8.1
2.9.2

+ 3
- 3
patches/0011-Deal-with-missing-SO_TIMESTAMP.patch View File

@ -1,7 +1,7 @@
From d489be05f5adf4c8c4954ef95808f748bf7878d5 Mon Sep 17 00:00:00 2001
From 53f3f7918ad752f9b25ff44531d78e6577eec8df Mon Sep 17 00:00:00 2001
From: Brent Cook <bcook@openbsd.org>
Date: Sun, 6 Dec 2015 22:35:38 -0600
Subject: [PATCH 11/13] Deal with missing SO_TIMESTAMP
Subject: [PATCH 11/12] Deal with missing SO_TIMESTAMP
from Paul B. Henson" <henson@acm.org>
@ -65,5 +65,5 @@ index 7ce3b38..edca87c 100644
if (T4 < JAN_1970) {
client_log_error(p, "recvmsg control format", EBADF);
--
2.8.1
2.9.2

+ 4
- 4
patches/0012-check-result-of-ftello-ftruncate.patch View File

@ -1,14 +1,14 @@
From 2bed8fd9ab9ad6016e45f91fd2de5de2a6c79fce Mon Sep 17 00:00:00 2001
From b7579f49e46fc09eecd07134c2df5b674699e522 Mon Sep 17 00:00:00 2001
From: Brent Cook <bcook@openbsd.org>
Date: Mon, 21 Dec 2015 05:53:20 -0600
Subject: [PATCH 12/13] check result of ftello/ftruncate
Subject: [PATCH 12/12] check result of ftello/ftruncate
---
src/usr.sbin/ntpd/ntpd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c
index b665000..18cc21d 100644
index dfddd89..0e8d1c2 100644
--- a/src/usr.sbin/ntpd/ntpd.c
+++ b/src/usr.sbin/ntpd/ntpd.c
@@ -600,6 +600,7 @@ writefreq(double d)
@ -33,5 +33,5 @@ index b665000..18cc21d 100644
}
--
2.8.1
2.9.2

Loading…
Cancel
Save