summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpq
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/ntpq')
-rw-r--r--contrib/ntp/ntpq/Makefile.in4
-rw-r--r--contrib/ntp/ntpq/invoke-ntpq.texi4
-rw-r--r--contrib/ntp/ntpq/libntpq.h2
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.c14
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.h6
-rw-r--r--contrib/ntp/ntpq/ntpq-subs.c16
-rw-r--r--contrib/ntp/ntpq/ntpq.1ntpqman6
-rw-r--r--contrib/ntp/ntpq/ntpq.1ntpqmdoc4
-rw-r--r--contrib/ntp/ntpq/ntpq.c24
-rw-r--r--contrib/ntp/ntpq/ntpq.html4
-rw-r--r--contrib/ntp/ntpq/ntpq.man.in6
-rw-r--r--contrib/ntp/ntpq/ntpq.mdoc.in4
12 files changed, 51 insertions, 43 deletions
diff --git a/contrib/ntp/ntpq/Makefile.in b/contrib/ntp/ntpq/Makefile.in
index 39b1b65..c93c677 100644
--- a/contrib/ntp/ntpq/Makefile.in
+++ b/contrib/ntp/ntpq/Makefile.in
@@ -124,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -277,6 +278,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -285,6 +287,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -346,6 +349,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/ntpq/invoke-ntpq.texi b/contrib/ntp/ntpq/invoke-ntpq.texi
index 7c28d92..fa0f5d7 100644
--- a/contrib/ntp/ntpq/invoke-ntpq.texi
+++ b/contrib/ntp/ntpq/invoke-ntpq.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:31:39 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:39:27 PM by AutoGen 5.18.5
# From the definitions ntpq-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -847,7 +847,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpq - standard NTP query program - Ver. 4.2.8p3
+ntpq - standard NTP query program - Ver. 4.2.8p4
Usage: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpq/libntpq.h b/contrib/ntp/ntpq/libntpq.h
index 82a8740..84a622b 100644
--- a/contrib/ntp/ntpq/libntpq.h
+++ b/contrib/ntp/ntpq/libntpq.h
@@ -36,7 +36,7 @@
#define NTP_STATUS_INVALID 0
#define NTP_STATUS_FALSETICKER 1
#define NTP_STATUS_EXCESS 2
-#define NTP_STATUS_OUTLYER 3
+#define NTP_STATUS_OUTLIER 3
#define NTP_STATUS_CANDIDATE 4
#define NTP_STATUS_SELECTED 5
#define NTP_STATUS_SYSPEER 6
diff --git a/contrib/ntp/ntpq/ntpq-opts.c b/contrib/ntp/ntpq/ntpq-opts.c
index 798a0cd..2232928 100644
--- a/contrib/ntp/ntpq/ntpq-opts.c
+++ b/contrib/ntp/ntpq/ntpq-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:31:10 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:00 PM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -69,7 +69,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpq options
*/
static char const ntpq_opt_strs[1925] =
-/* 0 */ "ntpq 4.2.8p3\n"
+/* 0 */ "ntpq 4.2.8p4\n"
"Copyright (C) 1992-2015 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"
@@ -129,13 +129,13 @@ static char const ntpq_opt_strs[1925] =
/* 1723 */ "no-load-opts\0"
/* 1736 */ "no\0"
/* 1739 */ "NTPQ\0"
-/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p3\n"
+/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1863 */ "$HOME\0"
/* 1869 */ ".\0"
/* 1871 */ ".ntprc\0"
/* 1878 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/* 1912 */ "ntpq 4.2.8p3";
+/* 1912 */ "ntpq 4.2.8p4";
/**
* ipv4 option description with
@@ -786,7 +786,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpqOptions.pzCopyright */
- puts(_("ntpq 4.2.8p3\n\
+ puts(_("ntpq 4.2.8p4\n\
Copyright (C) 1992-2015 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\
@@ -852,11 +852,11 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpqOptions.pzUsageTitle */
- puts(_("ntpq - standard NTP query program - Ver. 4.2.8p3\n\
+ puts(_("ntpq - standard NTP query program - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpqOptions.pzFullVersion */
- puts(_("ntpq 4.2.8p3"));
+ puts(_("ntpq 4.2.8p4"));
/* referenced via ntpqOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpq/ntpq-opts.h b/contrib/ntp/ntpq/ntpq-opts.h
index fecb970..f82ccae 100644
--- a/contrib/ntp/ntpq/ntpq-opts.h
+++ b/contrib/ntp/ntpq/ntpq-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:31:10 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:00 PM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpq */
#define OPTION_CT 15
/** ntpq version */
-#define NTPQ_VERSION "4.2.8p3"
+#define NTPQ_VERSION "4.2.8p4"
/** Full ntpq version text */
-#define NTPQ_FULL_VERSION "ntpq 4.2.8p3"
+#define NTPQ_FULL_VERSION "ntpq 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpq/ntpq-subs.c b/contrib/ntp/ntpq/ntpq-subs.c
index c647870..78143b3 100644
--- a/contrib/ntp/ntpq/ntpq-subs.c
+++ b/contrib/ntp/ntpq/ntpq-subs.c
@@ -1202,7 +1202,7 @@ printassoc(
break;
case CTL_PST_SEL_SELCAND:
- condition = "outlyer";
+ condition = "outlier";
break;
case CTL_PST_SEL_SYNCCAND:
@@ -2387,7 +2387,7 @@ add_mru(
}
UNLINK_DLIST(mon, mlink);
UNLINK_SLIST(unlinked, hash_table[hash], mon, hlink, mru);
- NTP_INSIST(unlinked == mon);
+ INSIST(unlinked == mon);
mru_dupes++;
TRACE(2, ("(updated from %08x.%08x) ", mon->last.l_ui,
mon->last.l_uf));
@@ -2482,7 +2482,7 @@ collect_mru_list(
mru_count = 0;
INIT_DLIST(mru_list, mlink);
cb = NTP_HASH_SIZE * sizeof(*hash_table);
- NTP_INSIST(NULL == hash_table);
+ INSIST(NULL == hash_table);
hash_table = emalloc_zero(cb);
c_mru_l_rc = FALSE;
@@ -2526,7 +2526,7 @@ collect_mru_list(
ri);
while (ri--) {
recent = HEAD_DLIST(mru_list, mlink);
- NTP_INSIST(recent != NULL);
+ INSIST(recent != NULL);
if (debug)
fprintf(stderr,
"tossing prior entry %s to resync\n",
@@ -2535,7 +2535,7 @@ collect_mru_list(
hash = NTP_HASH_ADDR(&recent->addr);
UNLINK_SLIST(unlinked, hash_table[hash],
recent, hlink, mru);
- NTP_INSIST(unlinked == recent);
+ INSIST(unlinked == recent);
free(recent);
mru_count--;
}
@@ -2777,7 +2777,7 @@ collect_mru_list(
if (have_now)
list_complete = TRUE;
if (list_complete) {
- NTP_INSIST(0 == ri || have_addr_older);
+ INSIST(0 == ri || have_addr_older);
}
if (mrulist_interrupted) {
printf("mrulist retrieval interrupted by operator.\n"
@@ -3145,13 +3145,13 @@ mrulist(
ppentry = sorted;
if (MRUSORT_R_DEF != order) {
ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
- NTP_INSIST(ppentry < sorted + mru_count);
+ INSIST(ppentry < sorted + mru_count);
*ppentry = recent;
ppentry++;
ITER_DLIST_END()
} else {
REV_ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
- NTP_INSIST(ppentry < sorted + mru_count);
+ INSIST(ppentry < sorted + mru_count);
*ppentry = recent;
ppentry++;
REV_ITER_DLIST_END()
diff --git a/contrib/ntp/ntpq/ntpq.1ntpqman b/contrib/ntp/ntpq/ntpq.1ntpqman
index afdd8cb..b4e45b2 100644
--- a/contrib/ntp/ntpq/ntpq.1ntpqman
+++ b/contrib/ntp/ntpq/ntpq.1ntpqman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpq 1ntpqman "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpq 1ntpqman "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6GaipG/ag-fHaaoG)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-joa4fN/ag-voaWeN)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:32 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:23 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpq/ntpq.1ntpqmdoc b/contrib/ntp/ntpq/ntpq.1ntpqmdoc
index 4ed69cf..8239434 100644
--- a/contrib/ntp/ntpq/ntpq.1ntpqmdoc
+++ b/contrib/ntp/ntpq/ntpq.1ntpqmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPQ 1ntpqmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:29 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c
index af5f681..c8d5ece 100644
--- a/contrib/ntp/ntpq/ntpq.c
+++ b/contrib/ntp/ntpq/ntpq.c
@@ -405,7 +405,7 @@ FILE *current_output;
*/
extern struct xcmd opcmds[];
-char *progname;
+char const *progname;
#ifdef NO_MAIN_ALLOWED
#ifndef BUILD_AS_LIB
@@ -489,7 +489,7 @@ ntpqmain(
builtins[icmd].desc[0] = "md5";
fmt = "set key type to use for authenticated requests (%s)";
#endif
- msg = malloc(strlen(fmt) + strlen(list) - strlen("%s") +1);
+ msg = emalloc(strlen(fmt) + strlen(list) - strlen("%s") +1);
sprintf(msg, fmt, list);
builtins[icmd].comment = msg;
free(list);
@@ -3206,7 +3206,6 @@ tstflags(
register const char *sep;
sep = "";
- i = 0;
s = cp = circ_buf[nextcb];
if (++nextcb >= NUMCB)
nextcb = 0;
@@ -3362,12 +3361,17 @@ cookedprint(
}
if (output_raw != 0) {
+ /* TALOS-CAN-0063: avoid buffer overrun */
atoascii(name, MAXVARLEN, bn, sizeof(bn));
- atoascii(value, MAXVALLEN, bv, sizeof(bv));
if (output_raw != '*') {
+ atoascii(value, MAXVALLEN,
+ bv, sizeof(bv) - 1);
len = strlen(bv);
bv[len] = output_raw;
bv[len+1] = '\0';
+ } else {
+ atoascii(value, MAXVALLEN,
+ bv, sizeof(bv));
}
output(fp, bn, bv);
}
@@ -3503,7 +3507,7 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *
if (!strcmp(*seen, name))
return;
n = (seen - hstate->seen) + 2;
- hstate->seen = realloc(hstate->seen, n * sizeof(*seen));
+ hstate->seen = erealloc(hstate->seen, n * sizeof(*seen));
hstate->seen[n-2] = name;
hstate->seen[n-1] = NULL;
@@ -3521,10 +3525,10 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *
len += (hstate->idx >= K_PER_LINE)? strlen(K_NL_PFX_STR): strlen(K_DELIM_STR);
if (hstate->list == NULL) {
- hstate->list = (char *)malloc(len);
+ hstate->list = (char *)emalloc(len);
hstate->list[0] = '\0';
} else
- hstate->list = (char *)realloc(hstate->list, len);
+ hstate->list = (char *)erealloc(hstate->list, len);
sprintf(hstate->list + strlen(hstate->list), "%s%s",
((hstate->idx >= K_PER_LINE)? K_NL_PFX_STR : K_DELIM_STR),
@@ -3545,18 +3549,18 @@ static char *list_digest_names(void)
# ifdef HAVE_EVP_MD_DO_ALL_SORTED
struct hstate hstate = { NULL, NULL, K_PER_LINE+1 };
- hstate.seen = (const char **)calloc(1, sizeof( const char * ));
+ hstate.seen = (const char **) emalloc_zero(1*sizeof( const char * )); // replaces -> calloc(1, sizeof( const char * ));
INIT_SSL();
EVP_MD_do_all_sorted(list_md_fn, &hstate);
list = hstate.list;
free(hstate.seen);
# else
- list = (char *)malloc(sizeof("md5, others (upgrade to OpenSSL-1.0 for full list)"));
+ list = (char *)emalloc(sizeof("md5, others (upgrade to OpenSSL-1.0 for full list)"));
strcpy(list, "md5, others (upgrade to OpenSSL-1.0 for full list)");
# endif
#else
- list = (char *)malloc(sizeof("md5"));
+ list = (char *)emalloc(sizeof("md5"));
strcpy(list, "md5");
#endif
diff --git a/contrib/ntp/ntpq/ntpq.html b/contrib/ntp/ntpq/ntpq.html
index e567419..e2c3740 100644
--- a/contrib/ntp/ntpq/ntpq.html
+++ b/contrib/ntp/ntpq/ntpq.html
@@ -44,7 +44,7 @@ monitor the operational status
and determine the performance of
<code>ntpd</code>, the NTP daemon.
- <p>This document applies to version 4.2.8p3 of <code>ntpq</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntpq</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpq-Description">ntpq Description</a>
@@ -769,7 +769,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p3-RC3
+<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p4-sec-RC2
Usage: ntpq [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpq/ntpq.man.in b/contrib/ntp/ntpq/ntpq.man.in
index 7d5dcd3..0c0af5b 100644
--- a/contrib/ntp/ntpq/ntpq.man.in
+++ b/contrib/ntp/ntpq/ntpq.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpq @NTPQ_MS@ "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpq @NTPQ_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6GaipG/ag-fHaaoG)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-joa4fN/ag-voaWeN)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:32 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:23 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpq/ntpq.mdoc.in b/contrib/ntp/ntpq/ntpq.mdoc.in
index 69c28e4..2b20ddc 100644
--- a/contrib/ntp/ntpq/ntpq.mdoc.in
+++ b/contrib/ntp/ntpq/ntpq.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPQ @NTPQ_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:29 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
OpenPOWER on IntegriCloud