Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 137708
Collapse All | Expand All

(-)openntpd-3.9p1/LICENCE.orig (+5 lines)
Lines 100-103 daemon.c, sys-queue.h: The Regents of th Link Here
100
 * SUCH DAMAGE.
100
 * SUCH DAMAGE.
101
 */
101
 */
102
102
103
Support for leap seconds ("right" timezones, as opposed to "posix" ones)
104
is an extension by Thorsten Glaser and covered by the MirOS licence, but
105
available to the OpenBSD project for use in rdate(8), ntpd(8) etc. under
106
the ISC licence.
107
103
$Id: openntpd-3.9p1-leapsecs.diff,v 1.2 2006/06/09 21:02:09 tg Exp $
108
$Id: openntpd-3.9p1-leapsecs.diff,v 1.2 2006/06/09 21:02:09 tg Exp $
(-)openntpd-3.9p1/Makefile.in.orig (-3 / +3 lines)
Lines 33-41 STRIP_OPT=@STRIP_OPT@ Link Here
33
PROG=	ntpd
33
PROG=	ntpd
34
LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
34
LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
35
SRCS=	ntpd.c buffer.c log.c imsg.c ntp.c ntp_msg.c config.c \
35
SRCS=	ntpd.c buffer.c log.c imsg.c ntp.c ntp_msg.c config.c \
36
	server.c client.c util.c y.tab.c
36
	server.c client.c util.c y.tab.c ntpleaps.c
37
OBJS=	ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o config.o \
37
OBJS=	ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o config.o \
38
	server.o client.o util.o y.tab.o
38
	server.o client.o util.o y.tab.o ntpleaps.o
39
YFLAGS=
39
YFLAGS=
40
MANPAGES_IN=	ntpd.8 ntpd.conf.5
40
MANPAGES_IN=	ntpd.8 ntpd.conf.5
41
MANPAGES=	ntpd.8.out ntpd.conf.5.out
41
MANPAGES=	ntpd.8.out ntpd.conf.5.out
Lines 64-70 catman-do: $(MANPAGES_IN) Link Here
64
	nroff -mandoc ntpd.conf.5 | cat -v | sed -e 's/.\^H//g' > ntpd.conf.0
64
	nroff -mandoc ntpd.conf.5 | cat -v | sed -e 's/.\^H//g' > ntpd.conf.0
65
65
66
ntpd:	ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o config.o \
66
ntpd:	ntpd.o buffer.o log.o imsg.o ntp.o ntp_msg.o config.o \
67
	server.o client.o util.o y.tab.o $(LIBCOMPAT)
67
	server.o client.o util.o y.tab.o ntpleaps.o $(LIBCOMPAT)
68
	$(CC) $(CFLAGS) $(LDFLAGS) -o ntpd $(OBJS) $(LIBCOMPAT) $(LIBS)
68
	$(CC) $(CFLAGS) $(LDFLAGS) -o ntpd $(OBJS) $(LIBCOMPAT) $(LIBS)
69
69
70
.c.o:
70
.c.o:
(-)openntpd-3.9p1/contrib/redhat/openntpd.spec.orig (-3 / +4 lines)
Lines 1-6 Link Here
1
Summary: NTP Time Synchronization Client 
1
Summary: NTP Time Synchronisation Client 
2
Name: openntpd
2
Name: openntpd
3
Version: 3.7p1
3
Version: 3.9p1
4
Release: 1
4
Release: 1
5
Copyright: BSD License
5
Copyright: BSD License
6
Group: Applications/System
6
Group: Applications/System
Lines 13-19 Requires: /sbin/chkconfig Link Here
13
#Patch1: openntpd-3.6p1-linux-adjtimex3.patch
13
#Patch1: openntpd-3.6p1-linux-adjtimex3.patch
14
14
15
%description
15
%description
16
NTP Time Synchronization Client - http://www.openntpd.org
16
NTP Time Synchronisation Client - http://www.openntpd.org
17
Enhanced by correct leap second support facility by MirOS
17
18
18
%prep
19
%prep
19
%setup -q -n %{name}-%{version}
20
%setup -q -n %{name}-%{version}
(-)openntpd-3.9p1/ntpd.0.orig (-5 / +6 lines)
Lines 1-4 Link Here
1
NTPD(8)                 OpenBSD System Manager's Manual                NTPD(8)
1
NTPD(8)			 BSD System Manager's Manual		       NTPD(8)
2
2
3
NAME
3
NAME
4
     ntpd - Network Time Protocol daemon
4
     ntpd - Network Time Protocol daemon
Lines 9-17 SYNOPSIS Link Here
9
DESCRIPTION
9
DESCRIPTION
10
     The ntpd daemon synchronizes the local clock to one or more remote NTP
10
     The ntpd daemon synchronizes the local clock to one or more remote NTP
11
     servers, and can also act as an NTP server itself, redistributing the lo-
11
     servers, and can also act as an NTP server itself, redistributing the lo-
12
     cal time.  It implements the Simple Network Time Protocol version 4, as
12
     cal time. This version of the NTP daemon handles time zones with leap
13
     described in RFC 2030, and the Network Time Protocol version 3, as de-
13
     seconds correctly. It implements the Simple Network Time Protocol version
14
     scribed in RFC 1305.
14
     4, as described in RFC 2030, and the Network Time Protocol version 3, as
15
     described in RFC 1305.
15
16
16
     ntpd uses the adjtime(2) system call to correct the local system time
17
     ntpd uses the adjtime(2) system call to correct the local system time
17
     without causing time jumps.  Adjustments larger than 128ms are logged us-
18
     without causing time jumps.  Adjustments larger than 128ms are logged us-
Lines 51-54 SEE ALSO Link Here
51
HISTORY
52
HISTORY
52
     The ntpd program first appeared in OpenBSD 3.6.
53
     The ntpd program first appeared in OpenBSD 3.6.
53
54
54
OpenBSD 3.9                      July 9, 2004                                1
55
MirOS BSD #8			 July 9, 2004				     1
(-)openntpd-3.9p1/ntpd.8.orig (+1 lines)
Lines 32-37 The Link Here
32
daemon synchronizes the local clock to one or more remote NTP servers,
32
daemon synchronizes the local clock to one or more remote NTP servers,
33
and can also act as an NTP server itself,
33
and can also act as an NTP server itself,
34
redistributing the local time.
34
redistributing the local time.
35
This version of the NTP daemon handles time zones with leap seconds correctly.
35
It implements the Simple Network Time Protocol version 4,
36
It implements the Simple Network Time Protocol version 4,
36
as described in RFC 2030,
37
as described in RFC 2030,
37
and the Network Time Protocol version 3,
38
and the Network Time Protocol version 3,
(-)openntpd-3.9p1/ntpd.conf.orig (-2 / +3 lines)
Lines 3-10 Link Here
3
3
4
# Addresses to listen on (ntpd does not listen by default)
4
# Addresses to listen on (ntpd does not listen by default)
5
#listen on *
5
#listen on *
6
#listen on 127.0.0.1
6
# Use the lines below (IPv4, IPv6) since the above line does not work reliably
7
#listen on ::1
7
listen on 0.0.0.0
8
listen on ::
8
9
9
# sync to a single server
10
# sync to a single server
10
#server ntp.example.org
11
#server ntp.example.org
(-)openntpd-3.9p1/ntpleaps.c.orig (+111 lines)
Line 0 Link Here
1
/* $MirOS: src/usr.sbin/rdate/ntpleaps.c,v 1.6 2006/06/09 20:58:09 tg Exp $ */
2
3
/*-
4
 * Copyright (c) 2006
5
 *	Thorsten Glaser <tg@mirbsd.de>
6
 * Based upon code placed into the public domain by Dan J. Bernstein.
7
 *
8
 * Licensee is hereby permitted to deal in this work without restric-
9
 * tion, including unlimited rights to use, publicly perform, modify,
10
 * merge, distribute, sell, give away or sublicence, provided all co-
11
 * pyright notices above, these terms and the disclaimer are retained
12
 * in all redistributions or reproduced in accompanying documentation
13
 * or other materials provided with binary redistributions.
14
 *
15
 * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
16
 * express, or implied, to the maximum extent permitted by applicable
17
 * law, without malicious intent or gross negligence; in no event may
18
 * licensor, an author or contributor be held liable for any indirect
19
 * or other damage, or direct damage except proven a consequence of a
20
 * direct error of said person and intended use of this work, loss or
21
 * other issues arising in any way out of its use, even if advised of
22
 * the possibility of such damage or existence of a nontrivial bug.
23
 */
24
25
#include <sys/types.h>
26
#include <sys/time.h>
27
#include <inttypes.h>
28
#include <time.h>
29
30
#include "ntpleaps.h"
31
32
#ifndef __RCSID
33
#define	__RCSID(x)	static const char __rcsid[] __attribute__((used)) = (x)
34
#endif
35
36
__RCSID("$MirOS: src/usr.sbin/rdate/ntpleaps.c,v 1.6 2006/06/09 20:58:09 tg Exp $");
37
38
time_t
39
tick2utc(time_t kerneltick)
40
{
41
	static unsigned long times365[4] = {
42
		0, 365, 730, 1095
43
	};
44
	static unsigned long times36524[4] = {
45
		0, 36524UL, 73048UL, 109572UL
46
	};
47
	static unsigned long montab[12] = {
48
		0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337
49
	};
50
51
	struct tm *tm;
52
	int64_t utc, d = 1900;
53
	int m, y;
54
55
	tm = localtime(&kerneltick);
56
	d += tm->tm_year;
57
58
	if (d < 0)
59
		++d;
60
	y = (int)(d % 400LL);
61
	d = 146097LL * (d / 400) + tm->tm_mday - 678882LL;
62
	utc = tm->tm_sec - tm->tm_gmtoff + 60 * (tm->tm_min + 60 * tm->tm_hour);
63
64
	while (utc < 0L) {
65
		utc += 86400L;
66
		--d;
67
	}
68
	while (utc > 86400L) {
69
		utc -= 86400L;
70
		++d;
71
	}
72
73
	if ((m = tm->tm_mon) >= 2) {
74
		m -= 2;
75
	} else {
76
		m += 10;
77
		--y;
78
	}
79
80
	y += (m / 12);
81
	m %= 12;
82
	if (m < 0) {
83
		m += 12;
84
		--y;
85
	}
86
	d += montab[m];
87
88
	d += 146097LL * (y / 400LL);
89
	y %= 400;
90
	while (y < 0) {
91
		y += 400;
92
		d -= 146097LL;
93
	}
94
95
	d += times365[y & 3];
96
	y /= 4;
97
98
	d += 1461LL * (y % 25);
99
	y /= 25;
100
101
	d += times36524[y & 3];
102
103
	/*
104
	 * d now contains the date part of the MJD
105
	 * corresponding to tm / kerneltick; the
106
	 * second part is already stored in utc.
107
	 */
108
109
	utc += (d - 40587LL) * 86400LL;
110
	return (utc);
111
}
(-)openntpd-3.9p1/ntpleaps.h.orig (+10 lines)
Line 0 Link Here
1
/* $MirOS: src/usr.sbin/rdate/ntpleaps.h,v 1.5 2006/06/09 20:58:10 tg Exp $ */
2
3
/*
4
 * Converts a time_t measured in kernel ticks into a UTC time_t
5
 * using leap second information stored in /etc/localtime or an
6
 * equivalent indicator (e.g. the TZ environment variable).
7
 * If the kernel time is already measured in UTC instead of TAI
8
 * and a POSIX conformant time zone is set, this is a no-op.
9
 */
10
time_t tick2utc(time_t);
(-)openntpd-3.9p1/util.c.orig (-1 / +2 lines)
Lines 20-25 Link Here
20
#include <limits.h>
20
#include <limits.h>
21
21
22
#include "ntpd.h"
22
#include "ntpd.h"
23
#include "ntpleaps.h"
23
24
24
double
25
double
25
gettime(void)
26
gettime(void)
Lines 29-35 gettime(void) Link Here
29
	if (gettimeofday(&tv, NULL) == -1)
30
	if (gettimeofday(&tv, NULL) == -1)
30
		fatal("gettimeofday");
31
		fatal("gettimeofday");
31
32
32
	return (tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec);
33
	return (tick2utc(tv.tv_sec) + JAN_1970 + 1.0e-6 * tv.tv_usec);
33
}
34
}
34
35
35
36

Return to bug 137708