---- ntp-4.2.8/html/ntpdate.html~ 2014-12-19 13:56:51.000000000 +0200
-+++ ntp-4.2.8/html/ntpdate.html 2015-01-02 10:27:05.538902307 +0200
-@@ -27,7 +27,7 @@
+diff -urNp -x '*.orig' ntp-4.2.8p12.org/html/ntpdate.html ntp-4.2.8p12/html/ntpdate.html
+--- ntp-4.2.8p12.org/html/ntpdate.html 2018-08-14 13:51:07.000000000 +0200
++++ ntp-4.2.8p12/html/ntpdate.html 2021-10-15 23:43:00.522149878 +0200
+@@ -27,7 +27,7 @@ href="ntpd.html"><tt>ntpd</tt> - Network
page and/or the <a href="sntp.html"><tt>sntp</tt> - Simple Network Time
Protocol (SNTP) Client</a> page. After a suitable period of mourning, the <tt>ntpdate</tt> program will be retired from this distribution.</p>
<h4>Synopsis</h4>
<h4>Description</h4>
<p><tt>ntpdate</tt> sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the <i>server</i> arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of <tt>ntpdate</tt> depends on the number of servers, the number of polls each time it is run and the interval between runs.</p>
<p><tt>ntpdate</tt> can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon <tt>ntpd</tt>. It is also possible to run <tt>ntpdate</tt> from a <tt>cron</tt> script. However, it is important to note that <tt>ntpdate</tt> with contrived <tt>cron</tt> scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since <tt>ntpdate</tt> does not discipline the host clock frequency as does <tt>ntpd</tt>, the accuracy using <tt>ntpdate</tt> is limited.</p>
-@@ -68,6 +68,11 @@
+@@ -68,6 +68,11 @@ Protocol (SNTP) Client</a> page. After
<dd>Direct <tt>ntpdate</tt> to use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronize with hosts beyond the firewall. Note that the <tt>-d</tt> option always uses unprivileged ports.
<dt><tt>-<i>v</i></tt></dt>
<dd>Be verbose. This option will cause <tt>ntpdate</tt>'s version identification string to be logged.</dd>
</dl>
<h4>Diagnostics</h4>
<tt>ntpdate</tt>'s exit status is zero if it finds a server and updates the clock, and nonzero otherwise.
-diff -up ntp-4.2.6p1/ntpdate/ntpdate.c.droproot ntp-4.2.6p1/ntpdate/ntpdate.c
---- ntp-4.2.6p1/ntpdate/ntpdate.c.droproot 2009-12-09 08:36:35.000000000 +0100
-+++ ntp-4.2.6p1/ntpdate/ntpdate.c 2010-03-03 15:33:06.000000000 +0100
+diff -urNp -x '*.orig' ntp-4.2.8p12.org/ntpdate/ntpdate.c ntp-4.2.8p12/ntpdate/ntpdate.c
+--- ntp-4.2.8p12.org/ntpdate/ntpdate.c 2021-10-15 23:43:00.362150298 +0200
++++ ntp-4.2.8p12/ntpdate/ntpdate.c 2021-10-15 23:43:00.522149878 +0200
@@ -48,6 +48,12 @@
#include <arpa/inet.h>
#ifdef SYS_VXWORKS
# include "ioLib.h"
# include "sockLib.h"
-@@ -152,6 +158,11 @@ int simple_query = 0;
+@@ -147,6 +153,11 @@ int simple_query = 0;
int unpriv_port = 0;
/*
+/*
* Program name.
*/
- char *progname;
-@@ -293,6 +304,88 @@ void clear_globals()
+ char const *progname;
+@@ -288,6 +299,88 @@ void clear_globals()
static ni_namelist *getnetinfoservers (void);
#endif
/*
* Main program. Initialize us and loop waiting for I/O and/or
* timer expiries.
-@@ -340,6 +433,8 @@ ntpdatemain (
+@@ -335,6 +428,8 @@ ntpdatemain (
init_lib(); /* sets up ipv4_works, ipv6_works */
/* Check to see if we have IPv6. Otherwise default to IPv4 */
if (!ipv6_works)
ai_fam_templ = AF_INET;
-@@ -351,7 +446,7 @@ ntpdatemain (
+@@ -346,7 +441,7 @@ ntpdatemain (
/*
* Decode argument list
*/
switch (c)
{
case '4':
-@@ -429,6 +524,14 @@ ntpdatemain (
+@@ -423,6 +518,14 @@ ntpdatemain (
case 'u':
unpriv_port = 1;
break;
case '?':
++errflg;
break;
-@@ -438,7 +541,7 @@ ntpdatemain (
-
+@@ -432,7 +535,7 @@ ntpdatemain (
+
if (errflg) {
(void) fprintf(stderr,
- "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n",
progname);
exit(2);
}
-@@ -544,6 +647,24 @@ ntpdatemain (
+@@ -546,6 +649,24 @@ ntpdatemain (
initializing = 0;
was_alarmed = 0;
-diff -up ntp-4.2.6p3/ntpd/ntp_io.c.rtnetlink ntp-4.2.6p3/ntpd/ntp_io.c
---- ntp-4.2.6p3/ntpd/ntp_io.c.rtnetlink 2011-01-05 16:03:19.328001089 +0100
-+++ ntp-4.2.6p3/ntpd/ntp_io.c 2011-01-05 16:03:19.349001911 +0100
-@@ -4549,10 +4549,7 @@ init_async_notifications()
+diff -urNp -x '*.orig' ntp-4.2.8p12.org/ntpd/ntp_io.c ntp-4.2.8p12/ntpd/ntp_io.c
+--- ntp-4.2.8p12.org/ntpd/ntp_io.c 2021-10-15 23:43:02.012145954 +0200
++++ ntp-4.2.8p12/ntpd/ntp_io.c 2021-10-15 23:43:02.175478857 +0200
+@@ -4832,10 +4832,7 @@ init_async_notifications()
#ifdef HAVE_RTNETLINK
- memset(&sa, 0, sizeof(sa));
+ ZERO(sa);
sa.nl_family = PF_NETLINK;
- sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR
- | RTMGRP_IPV6_IFADDR | RTMGRP_IPV4_ROUTE
diff -durN -x '*.orig' ntp-4.2.6p1.orig/ntpdate/ntpdate.c ntp-4.2.6p1/ntpdate/ntpdate.c
--- ntp-4.2.6p1.orig/ntpdate/ntpdate.c 2010-05-24 19:28:54.000000000 +0200
+++ ntp-4.2.6p1/ntpdate/ntpdate.c 2010-05-24 19:30:19.000000000 +0200
-@@ -1729,11 +1729,13 @@
+@@ -1729,9 +1729,11 @@
}
#ifdef IPV6_V6ONLY
/* Restricts AF_INET6 socket to IPv6 communications (see RFC 2553bis-03) */
+ if (res->ai_family == AF_INET6) {
+ int i = setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval));
+ if ( i < 0 && errno != ENOPROTOOPT ) {
- msyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m");
- exit(1);
- /*NOTREACHED*/
+ msyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m");
+ }
}
#endif
---- ntp-4.2.4p7/include/ntp_syscall.h
-+++ ntp-4.2.4p7/include/ntp_syscall.h
-@@ -14,5 +14,13 @@
+diff -urNp -x '*.orig' ntp-4.2.8p12.org/include/ntp_syscall.h ntp-4.2.8p12/include/ntp_syscall.h
+--- ntp-4.2.8p12.org/include/ntp_syscall.h 2011-03-26 03:03:33.000000000 +0100
++++ ntp-4.2.8p12/include/ntp_syscall.h 2021-10-15 23:43:00.115484280 +0200
+@@ -10,6 +10,14 @@
# include <sys/timex.h>
#endif
+#endif
+
#ifndef NTP_SYSCALLS_LIBC
- #ifdef NTP_SYSCALLS_STD
+ # ifdef NTP_SYSCALLS_STD
+ # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
Summary(pt_BR.UTF-8): Network Time Protocol versão 4
Name: ntp
-Version: 4.2.8p12
-Release: 8
+Version: 4.2.8p15
+Release: 1
License: distributable
Group: Networking/Daemons
Source0: https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
-# Source0-md5: 1522d66574bae14abb2622746dad2bdc
+# Source0-md5: e1e6b23d2fc75cced41801dbcd6c2561
Source1: %{name}.conf
Source2: %{name}.keys
Source3: %{name}d.init
Patch1: %{name}-no_libelf.patch
Patch2: %{name}-ipv6.patch
Patch3: %{name}-nano.patch
+Patch4: threadstack-sysconf.patch
# FC patches + 100
Patch101: %{name}-4.2.6p1-sleep.patch
Patch102: %{name}-4.2.6p1-droproot.patch
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
## FC patches
#%patch101 -p1
--- /dev/null
+--- ntp-4.2.8p15/libntp/work_thread.c~ 2018-08-14 13:51:06.000000000 +0200
++++ ntp-4.2.8p15/libntp/work_thread.c 2021-10-16 21:40:00.752349056 +0200
+@@ -41,12 +41,6 @@
+ #ifndef THREAD_MINSTACKSIZE
+ # define THREAD_MINSTACKSIZE (64U * 1024)
+ #endif
+-#ifndef __sun
+-#if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
+-# undef THREAD_MINSTACKSIZE
+-# define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN
+-#endif
+-#endif
+
+ #ifndef THREAD_MAXSTACKSIZE
+ # define THREAD_MAXSTACKSIZE (256U * 1024)
+@@ -594,8 +588,11 @@
+ "start_blocking_thread: pthread_attr_getstacksize() -> %s",
+ strerror(rc));
+ } else {
+- if (ostacksize < THREAD_MINSTACKSIZE)
+- nstacksize = THREAD_MINSTACKSIZE;
++ int minstack = THREAD_MINSTACKSIZE;
++ if (minstack < PTHREAD_STACK_MIN)
++ minstack = PTHREAD_STACK_MIN;
++ if (ostacksize < minstack)
++ nstacksize = minstack;
+ else if (ostacksize > THREAD_MAXSTACKSIZE)
+ nstacksize = THREAD_MAXSTACKSIZE;
+ else