diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2024-05-10 15:15:56 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2024-05-26 22:55:52 +0000 |
| commit | 1f833b3fc9968c3dd7ed79ccf0525ebf16c891ad (patch) | |
| tree | 85801af20e3b694584668aeb39ecec75ee71f72c /ntpq | |
| parent | ab1f1aa8333369a83ff284848fc3fc2e52d5f29f (diff) | |
ntp: Vendor import of ntp-4.2.8p18vendor/ntp/4.2.8p18vendor/ntp
Diffstat (limited to 'ntpq')
| -rw-r--r-- | ntpq/Makefile.in | 18 | ||||
| -rw-r--r-- | ntpq/invoke-ntpq.texi | 4 | ||||
| -rw-r--r-- | ntpq/ntpq-opts.c | 20 | ||||
| -rw-r--r-- | ntpq/ntpq-opts.h | 8 | ||||
| -rw-r--r-- | ntpq/ntpq-subs.c | 41 | ||||
| -rw-r--r-- | ntpq/ntpq.1ntpqman | 6 | ||||
| -rw-r--r-- | ntpq/ntpq.1ntpqmdoc | 6 | ||||
| -rw-r--r-- | ntpq/ntpq.c | 25 | ||||
| -rw-r--r-- | ntpq/ntpq.h | 1 | ||||
| -rw-r--r-- | ntpq/ntpq.html | 4 | ||||
| -rw-r--r-- | ntpq/ntpq.man.in | 6 | ||||
| -rw-r--r-- | ntpq/ntpq.mdoc.in | 6 |
12 files changed, 72 insertions, 73 deletions
diff --git a/ntpq/Makefile.in b/ntpq/Makefile.in index dd77e591e3d8..ecfefb4ef5f1 100644 --- a/ntpq/Makefile.in +++ b/ntpq/Makefile.in @@ -96,6 +96,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ EXTRA_PROGRAMS = ntpq$(EXEEXT) +@LIBNTP_SUBMAKES_TRUE@am__append_1 = check-libntp subdir = ntpq ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ @@ -442,6 +443,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@ +PATH_OPENSSL = @PATH_OPENSSL@ PATH_PERL = @PATH_PERL@ PATH_RUBY = @PATH_RUBY@ PATH_SEPARATOR = @PATH_SEPARATOR@ @@ -557,7 +559,7 @@ noinst_HEADERS = ntpq.h noinst_LIBRARIES = libntpq.a libntpq_a_CFLAGS = $(AM_CFLAGS) -DNO_MAIN_ALLOWED -DBUILD_AS_LIB libntpq_a_CPPFLAGS = $(AM_CPPFLAGS) -CLEANFILES = .version version.c check-libopts check-libntp .deps-ver +CLEANFILES = .version version.c check-libopts .deps-ver DISTCLEANFILES = config.log $(man_MANS) $(DEPDIR)/deps-ver ETAGS_ARGS = Makefile.am EXTRA_DIST = \ @@ -572,7 +574,7 @@ EXTRA_DIST = \ ntpq.texi \ $(NULL) -BUILT_SOURCES = ntpq-opts.c ntpq-opts.h check-libopts check-libntp \ +BUILT_SOURCES = ntpq-opts.c ntpq-opts.h check-libopts $(am__append_1) \ .deps-ver html_DATA = \ $(srcdir)/ntpq.html \ @@ -1295,18 +1297,16 @@ check-libopts: ../sntp/libopts/libopts.la ../sntp/libopts/libopts.la: -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la -check-libntp: $(top_builddir)/libntp/libntp.a - @: avoid default SCCS get by some make implementations +.PHONY: check-libntp -$(top_builddir)/libntp/libntp.a: - cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a +@LIBNTP_SUBMAKES_TRUE@check-libntp: +@LIBNTP_SUBMAKES_TRUE@ cd $(top_builddir)/libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a $(top_srcdir)/sntp/scm-rev: FRC.scm-rev $(AM_V_GEN)cd $(top_builddir)/sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev +.PHONY: FRC.scm-rev FRC.scm-rev: - @: FRC.scm-rev "force" depends on nothing and is not a file, so is \ - always out-of-date causing targets which depend on it to also \ - be outdated so their rules to fire each time they are built. + @: FRC.scm-rev is always out of date, triggering the check every make invocation. $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ diff --git a/ntpq/invoke-ntpq.texi b/ntpq/invoke-ntpq.texi index 715dbcba764e..cdb1453d5a24 100644 --- a/ntpq/invoke-ntpq.texi +++ b/ntpq/invoke-ntpq.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi) # -# It has been AutoGen-ed June 6, 2023 at 04:38:12 AM by AutoGen 5.18.16 +# It has been AutoGen-ed May 25, 2024 at 12:04:30 AM by AutoGen 5.18.16 # From the definitions ntpq-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -945,7 +945,7 @@ with a status code of 0. @exampleindent 0 @example -ntpq - standard NTP query program - Ver. 4.2.8p17 +ntpq - standard NTP query program - Ver. 4.2.8p18 Usage: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 name resolution diff --git a/ntpq/ntpq-opts.c b/ntpq/ntpq-opts.c index 3e176c057652..12042e4a1431 100644 --- a/ntpq/ntpq-opts.c +++ b/ntpq/ntpq-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.c) * - * It has been AutoGen-ed June 6, 2023 at 04:38:03 AM by AutoGen 5.18.16 + * It has been AutoGen-ed May 25, 2024 at 12:04:21 AM by AutoGen 5.18.16 * From the definitions ntpq-opts.def * and the template file options * @@ -18,7 +18,7 @@ * The ntpq program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -74,8 +74,8 @@ extern FILE * option_usage_fp; * static const strings for ntpq options */ static char const ntpq_opt_strs[2068] = -/* 0 */ "ntpq 4.2.8p17\n" - "Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n" +/* 0 */ "ntpq 4.2.8p18\n" + "Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the NTP License, copies of which\n" "can be seen at:\n" @@ -140,13 +140,13 @@ static char const ntpq_opt_strs[2068] = /* 1858 */ "no-load-opts\0" /* 1871 */ "no\0" /* 1874 */ "NTPQ\0" -/* 1879 */ "ntpq - standard NTP query program - Ver. 4.2.8p17\n" +/* 1879 */ "ntpq - standard NTP query program - Ver. 4.2.8p18\n" "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0" /* 1999 */ "$HOME\0" /* 2005 */ ".\0" /* 2007 */ ".ntprc\0" /* 2014 */ "https://bugs.ntp.org, bugs@ntp.org\0" -/* 2049 */ "ntpq 4.2.8p17\0" +/* 2049 */ "ntpq 4.2.8p18\0" /* 2063 */ "hash"; /** @@ -873,8 +873,8 @@ static void bogus_function(void) { translate option names. */ /* referenced via ntpqOptions.pzCopyright */ - puts(_("ntpq 4.2.8p17\n\ -Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved.\n\ + puts(_("ntpq 4.2.8p18\n\ +Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the NTP License, copies of which\n\ can be seen at:\n")); @@ -945,11 +945,11 @@ implied warranty.\n")); puts(_("load options from a config file")); /* referenced via ntpqOptions.pzUsageTitle */ - puts(_("ntpq - standard NTP query program - Ver. 4.2.8p17\n\ + puts(_("ntpq - standard NTP query program - Ver. 4.2.8p18\n\ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n")); /* referenced via ntpqOptions.pzFullVersion */ - puts(_("ntpq 4.2.8p17")); + puts(_("ntpq 4.2.8p18")); /* referenced via ntpqOptions.pzFullUsage */ puts(_("<<<NOT-FOUND>>>")); diff --git a/ntpq/ntpq-opts.h b/ntpq/ntpq-opts.h index 60d2ba1278c6..f1413deefcd1 100644 --- a/ntpq/ntpq-opts.h +++ b/ntpq/ntpq-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.h) * - * It has been AutoGen-ed June 6, 2023 at 04:38:02 AM by AutoGen 5.18.16 + * It has been AutoGen-ed May 25, 2024 at 12:04:21 AM by AutoGen 5.18.16 * From the definitions ntpq-opts.def * and the template file options * @@ -18,7 +18,7 @@ * The ntpq program is copyrighted and licensed * under the following terms: * - * Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation, all rights reserved. + * Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the NTP License, copies of which * can be seen at: @@ -93,9 +93,9 @@ typedef enum { /** count of all options for ntpq */ #define OPTION_CT 17 /** ntpq version */ -#define NTPQ_VERSION "4.2.8p17" +#define NTPQ_VERSION "4.2.8p18" /** Full ntpq version text */ -#define NTPQ_FULL_VERSION "ntpq 4.2.8p17" +#define NTPQ_FULL_VERSION "ntpq 4.2.8p18" /** * Interface defines for all options. Replace "n" with the UPPER_CASED diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c index 527be098b561..6aded4050c15 100644 --- a/ntpq/ntpq-subs.c +++ b/ntpq/ntpq-subs.c @@ -1495,7 +1495,7 @@ radiostatus( #endif /* UNUSED */ /* - * when - print how long its been since his last packet arrived + * when - return how long its been since his last packet arrived */ static long when( @@ -1691,6 +1691,7 @@ doprintpeers( u_int32 u32; const char *dstadr_refid = "0.0.0.0"; const char *serverlocal; + char *drbuf = NULL; size_t drlen; u_long stratum = 0; long ppoll = 0; @@ -1772,12 +1773,13 @@ doprintpeers( } else if (decodenetnum(value, &refidadr)) { if (SOCK_UNSPEC(&refidadr)) dstadr_refid = "0.0.0.0"; - else if (ISREFCLOCKADR(&refidadr)) + else if (ISREFCLOCKADR(&refidadr)) { dstadr_refid = refnumtoa(&refidadr); - else + } else { dstadr_refid = stoa(&refidadr); + } } else { have_da_rid = FALSE; } @@ -1796,19 +1798,25 @@ doprintpeers( } else if (decodenetnum(value, &refidadr)) { if (SOCK_UNSPEC(&refidadr)) dstadr_refid = "0.0.0.0"; - else if (ISREFCLOCKADR(&refidadr)) + else if (ISREFCLOCKADR(&refidadr)) { dstadr_refid = - refnumtoa(&refidadr); - else { - char *buf = emalloc(10); - int i = ntohl(refidadr.sa4.sin_addr.s_addr); - - snprintf(buf, 10, - "%0x", i); - dstadr_refid = buf; - //xprintf(stderr, "apeervarlist refid: value=<%x>\n", i); + refnumtoa(&refidadr); + if (pvl == apeervarlist) { + /* + * restrict refid to + * 8 chars [Bug 3850] + */ + dstadr_refid = + trunc_right( + dstadr_refid, + 8); + } + } else { + drbuf = emalloc(10); + snprintf(drbuf, 10, "%0x", + SRCADR(&refidadr)); + dstadr_refid = drbuf; } - //xprintf(stderr, "apeervarlist refid: value=<%s>\n", value); } else { have_da_rid = FALSE; } @@ -1843,7 +1851,7 @@ doprintpeers( if (!decodets(value, &reftime)) L_CLR(&reftime); } else if (!strcmp("flash", name)) { - decodeuint(value, &flash); + decodeuint(value, &flash); } else { // xprintf(stderr, "UNRECOGNIZED name=%s ", name); } @@ -1931,6 +1939,7 @@ doprintpeers( drlen = strlen(dstadr_refid); makeascii(drlen, dstadr_refid, fp); } + free(drbuf); if (pvl == apeervarlist) { while (drlen++ < 9) xputc(' ', fp); @@ -2452,7 +2461,7 @@ fetch_nonce( return FALSE; } - if ((size_t)rsize <= sizeof(nonce_eq) - 1 || + if (rsize <= sizeof(nonce_eq) - 1 || strncmp(rdata, nonce_eq, sizeof(nonce_eq) - 1)) { xprintf(stderr, "unexpected nonce response format: %.*s\n", (int)rsize, rdata); /* cast is wobbly */ diff --git a/ntpq/ntpq.1ntpqman b/ntpq/ntpq.1ntpqman index e4f93b336110..5578f8ef3acb 100644 --- a/ntpq/ntpq.1ntpqman +++ b/ntpq/ntpq.1ntpqman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpq 1ntpqman "06 Jun 2023" "4.2.8p17" "User Commands" +.TH ntpq 1ntpqman "25 May 2024" "4.2.8p18" "User Commands" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed June 6, 2023 at 04:38:15 AM by AutoGen 5.18.16 +.\" It has been AutoGen-ed May 25, 2024 at 12:04:33 AM by AutoGen 5.18.16 .\" From the definitions ntpq-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -1585,7 +1585,7 @@ it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH "BUGS" Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org diff --git a/ntpq/ntpq.1ntpqmdoc b/ntpq/ntpq.1ntpqmdoc index 9ce7db9484d3..bbb061bebf98 100644 --- a/ntpq/ntpq.1ntpqmdoc +++ b/ntpq/ntpq.1ntpqmdoc @@ -1,9 +1,9 @@ -.Dd June 6 2023 +.Dd May 25 2024 .Dt NTPQ 1ntpqmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed June 6, 2023 at 04:38:10 AM by AutoGen 5.18.16 +.\" It has been AutoGen-ed May 25, 2024 at 12:04:29 AM by AutoGen 5.18.16 .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -1051,7 +1051,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you. .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2023 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2024 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh "BUGS" Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 1a0e9b1a6867..56ff4e50e9eb 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -25,13 +25,9 @@ #include <isc/result.h> #include "ntpq.h" -#include "ntp_assert.h" -#include "ntp_stdlib.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ntp_select.h" -#include "ntp_assert.h" -#include "lib_strbuf.h" #include "ntp_lineedit.h" #include "ntp_debug.h" #ifdef OPENSSL @@ -3941,31 +3937,25 @@ list_md_fn(const EVP_MD *m, const char *from, const char *to, void *arg) size_t len, n; const char *name, **seen; struct hstate *hstate = arg; - const char *cp; /* m is MD obj, from is name or alias, to is base name for alias */ - if (!m || !from || to) + if (!m || !from || to) { return; /* Ignore aliases */ + } /* Discard MACs that NTP won't accept. */ /* Keep this consistent with keytype_from_text() in ssl_init.c. */ - if (EVP_MD_size(m) > (MAX_MAC_LEN - sizeof(keyid_t))) + if (EVP_MD_size(m) > MAX_MDG_LEN) { return; + } name = EVP_MD_name(m); - - /* Lowercase names aren't accepted by keytype_from_text in ssl_init.c */ - - for (cp = name; *cp; cp++) - if (islower((unsigned char)*cp)) - return; - - len = (cp - name) + 1; + len = strlen(name) + 1; /* There are duplicates. Discard if name has been seen. */ for (seen = hstate->seen; *seen; seen++) - if (!strcmp(*seen, name)) + if (!strcasecmp(*seen, name)) return; n = (seen - hstate->seen) + 2; @@ -4057,11 +4047,12 @@ insert_cmac(char *list) /* No - end of list */ if (!delim && !last_nl) { delim = list + len; - } else + } else { /* New line and no delim or before delim? */ if (last_nl && (!delim || last_nl < delim)) { delim = last_nl; } + } /* Found insertion point where CMAC before entry? */ if (strncmp(CMAC, point, delim - point) < 0) { diff --git a/ntpq/ntpq.h b/ntpq/ntpq.h index 53f76387ace0..ed200951d303 100644 --- a/ntpq/ntpq.h +++ b/ntpq/ntpq.h @@ -11,7 +11,6 @@ #include "ntp_malloc.h" #include "ntp_assert.h" #include "ntp_control.h" -#include "lib_strbuf.h" #include "ntpq-opts.h" diff --git a/ntpq/ntpq.html b/ntpq/ntpq.html index 1ca91e4f3cd4..03b654a33486 100644 --- a/ntpq/ntpq.html +++ b/ntpq/ntpq.html @@ -62,7 +62,7 @@ monitor the operational status and determine the performance of <code>ntpd</code>, the NTP daemon. </p> -<p>This document applies to version 4.2.8p17 of <code>ntpq</code>. +<p>This document applies to version 4.2.8p18 of <code>ntpq</code>. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#ntpq-Description" accesskey="1">ntpq Description</a></td><td> </td><td align="left" valign="top"> @@ -1274,7 +1274,7 @@ used to select the program, defaulting to <samp>more</samp>. Both will exit with a status code of 0. </p> <div class="example"> -<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p17 +<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p18 Usage: ntpq [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 name resolution diff --git a/ntpq/ntpq.man.in b/ntpq/ntpq.man.in index 12c085baf761..66ef65cad235 100644 --- a/ntpq/ntpq.man.in +++ b/ntpq/ntpq.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpq @NTPQ_MS@ "06 Jun 2023" "4.2.8p17" "User Commands" +.TH ntpq @NTPQ_MS@ "25 May 2024" "4.2.8p18" "User Commands" .\" .\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed June 6, 2023 at 04:38:15 AM by AutoGen 5.18.16 +.\" It has been AutoGen-ed May 25, 2024 at 12:04:33 AM by AutoGen 5.18.16 .\" From the definitions ntpq-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -1585,7 +1585,7 @@ it to autogen-users@lists.sourceforge.net. Thank you. .SH "AUTHORS" The University of Delaware and Network Time Foundation .SH "COPYRIGHT" -Copyright (C) 1992-2023 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .SH "BUGS" Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org diff --git a/ntpq/ntpq.mdoc.in b/ntpq/ntpq.mdoc.in index d5ace4c4fd43..3bb46622c6d0 100644 --- a/ntpq/ntpq.mdoc.in +++ b/ntpq/ntpq.mdoc.in @@ -1,9 +1,9 @@ -.Dd June 6 2023 +.Dd May 25 2024 .Dt NTPQ @NTPQ_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed June 6, 2023 at 04:38:10 AM by AutoGen 5.18.16 +.\" It has been AutoGen-ed May 25, 2024 at 12:04:29 AM by AutoGen 5.18.16 .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -1051,7 +1051,7 @@ it to autogen\-users@lists.sourceforge.net. Thank you. .Sh "AUTHORS" The University of Delaware and Network Time Foundation .Sh "COPYRIGHT" -Copyright (C) 1992\-2023 The University of Delaware and Network Time Foundation all rights reserved. +Copyright (C) 1992\-2024 The University of Delaware and Network Time Foundation all rights reserved. This program is released under the terms of the NTP license, <http://ntp.org/license>. .Sh "BUGS" Please send bug reports to: https://bugs.ntp.org, bugs@ntp.org |
