OpenBSD CVS Repository (original) (raw)
CVS Repository/src/usr.sbin/rdate/ rdate.c
OpenBSD release(s):
1.38 (79), 1.37 (78 77 76 75 74 73), 1.36 (72 71), 1.35 (70 69 68 67 66 65 64 63 62 61 60 59), 1.32 (58 57), 1.30 (56 55), 1.28 (54), 1.24 (53 52 51 50 49 48 47), 1.23 (46 45 44), 1.22 (43 42 41 40 39 38 37 36 35), 1.20 (34), 1.19 (33 32), 1.13 (31), 1.12 (30), 1.11 (29 28 27 26 25 24 23 22), 1.10 (21), 1.4 (20),
Tags:
1.1.1.1 (netbsd_1_1),
revision 1.39/(Download) -annotate -Tue, 28 Apr 2026 13:25:04 UTC by millert
Changes since 1.38: +6 -11(diff)
rdate: remove -c option, we don't install the "right" zone files
This option was non-functional since OpenBSD does not ship with the /usr/share/zoneinfo/right time zone files, which include leap seconds. OK dgl@
revision 1.38/(Download) -annotate -Fri, 27 Mar 2026 14:33:58 UTC by deraadt
OpenBSD release(s): 79
Changes since 1.37: +9 -23(diff)
after a report from 'K r' on bugs that the manual page section rfc868 '-o' option has incorrect dates, let's recognize that this is no longer a good way to get time information and only the ntp interface is needed. ok sthen florian henning
revision 1.37/(Download) -annotate -Wed, 04 Jan 2023 13:00:11 UTC by jsg
OpenBSD release(s): 78 77 76 75 74 73
Changes since 1.36: +1 -6(diff)
Christos Zoulas agreed to rescind clause 3 and 4 in NetBSD fsck.8 rev 1.35 fsutil.h rev 1.14 pathnames.h rev 1.2 netgroup_mkdb.8 rev 1.9 netgroup_mkdb.c rev 1.18 str.c rev 1.7 str.h rev 1.4 rdate.8 rev 1.11 rdate.c rev 1.19 extern.h rev 1.14 getnetgrent.c rev 1.41 netgroup.h rev 1.10 fparseln.3 rev 1.4 fparseln.c rev 1.10
our stringlist.c/stringlist.h are derived from getnetgrent.c rfc868time.c from rdate.c newfs/pathnames.h from fsck/pathnames.h
https://mail-index.netbsd.org/source-changes/2009/10/21/msg002182.html Not all files are covered as some had copyright assigned to TNF in 1998.
revision 1.36/(Download) -annotate -Mon, 15 Nov 2021 15:14:24 UTC by millert
OpenBSD release(s): 72 71
Changes since 1.35: +1 -2(diff)
No need to declare optind, optarg or opterr; unistd.h does this for us. From Jan Stary. OK deraadt@
revision 1.35/(Download) -annotate -Wed, 23 Dec 2015 19:13:52 UTC by deraadt
OpenBSD release(s): 70 69 68 67 66 65 64 63 62 61 60 59
Changes since 1.34: +2 -2(diff)
expand message between processes to 2048 bytes. Andre Smagin found a case where it can reach 637 bytes of output, so use almost 4x (he suggested 1024)
revision 1.34/(Download) -annotate -Sat, 31 Oct 2015 18:24:01 UTC by deraadt
Changes since 1.33: +2 -2(diff)
repair error message; spotted by Marcus Merighi
revision 1.33/(Download) -annotate -Thu, 29 Oct 2015 03:16:15 UTC by deraadt
Changes since 1.32: +69 -13(diff)
rdate is a classic "run as root, talk to internet for a while doing crazy packet parsing, then do something requiring privilege at the end" program. Simplistic pledge would be "stdio rpath wpath inet dns settime", which is not very useful. Imagine if it was exploited? It could still change your time backwards or write to your passwd file - game over. However the pledge "categorization" is educational, and quickly leads to a priv-sep solution of sorts.
Create a pipe and fork. child pledges "stdio inet dns", and talks the time protocols, then writes error message + timeinfo to the pipe. parent pledges "stdio rpath wpath settime" and reads error message/timeinfo from pipe. If error message, spit it out. Otherwise handle the time, then pledge "stdio rpath", and finally report how the time was adjusted.
A bit more complicated. Now observe that the pledges help test if it is right...
(Now that privsep processing is in place, the child could be modified to chroot + change to a different uid... problem is: which uid..) ok millert
revision 1.32/(Download) -annotate -Mon, 09 Feb 2015 23:00:14 UTC by deraadt
OpenBSD release(s): 58 57
Changes since 1.31: +6 -6(diff)
clean up flags++ instances around getopt() ok florian
revision 1.31/(Download) -annotate -Fri, 16 Jan 2015 06:40:20 UTC by deraadt
Changes since 1.30: +1 -2(diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
revision 1.30/(Download) -annotate -Tue, 12 Nov 2013 22:27:13 UTC by deraadt
OpenBSD release(s): 56 55
Changes since 1.29: +4 -3(diff)
ensure there are prototypes
revision 1.29/(Download) -annotate -Fri, 16 Aug 2013 19:47:43 UTC by guenther
Changes since 1.28: +3 -3(diff)
Use %lld and cast to (long long) when printing time_t values
otto@ millert@ lteo@ mikeb@ deraadt@
revision 1.28/(Download) -annotate -Sat, 20 Apr 2013 20:39:14 UTC by millert
OpenBSD release(s): 54
Changes since 1.27: +7 -17(diff)
Remove extra info from usage message; that's what the manual is for. OK jmc@
revision 1.27/(Download) -annotate -Sat, 20 Apr 2013 00:13:01 UTC by millert
Changes since 1.26: +4 -4(diff)
Add -o option to getopt string and usage.
revision 1.26/(Download) -annotate -Fri, 19 Apr 2013 19:14:46 UTC by millert
Changes since 1.25: +6 -2(diff)
Make -n the default and add -o flag for the old RFC 868 time protocol (which uses a 32-bit value for its wire protocol). OK deraadt@ ian@
revision 1.25/(Download) -annotate -Fri, 19 Apr 2013 16:38:47 UTC by deraadt
Changes since 1.24: +1 -2(diff)
comment incorrect; rdate has -n support now too
revision 1.24/(Download) -annotate -Tue, 27 Oct 2009 23:59:54 UTC by deraadt
OpenBSD release(s): 53 52 51 50 49 48 47
Changes since 1.23: +1 -8(diff)
rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
revision 1.23/(Download) -annotate -Wed, 09 Jul 2008 19:41:56 UTC by sobrado
OpenBSD release(s): 46 45 44
Changes since 1.22: +12 -11(diff)
documentation tweaks.
revision 1.22/(Download) -annotate -Wed, 18 Feb 2004 20:10:53 UTC by jmc
OpenBSD release(s): 43 42 41 40 39 38 37 36 35
Changes since 1.21: +7 -7(diff)
sort options and SYNOPSIS; sync usage();
revision 1.21/(Download) -annotate -Mon, 16 Feb 2004 21:25:41 UTC by jakob
Changes since 1.20: +19 -7(diff)
add IPv4/IPv6 transport selection. ok millert@ deraadt@
revision 1.20/(Download) -annotate -Thu, 26 Jun 2003 19:47:10 UTC by deraadt
OpenBSD release(s): 34
Changes since 1.19: +3 -3(diff)
strict proto cleanups
revision 1.19/(Download) -annotate -Sun, 08 Sep 2002 12:33:42 UTC by jakob
OpenBSD release(s): 33 32
Changes since 1.18: +11 -14(diff)
add leap second support for rfc868, from thorsten glaser
revision 1.18/(Download) -annotate -Sat, 10 Aug 2002 21:37:28 UTC by jakob
Changes since 1.17: +11 -5(diff)
style; from thorsten
revision 1.17/(Download) -annotate -Sat, 27 Jul 2002 20:11:34 UTC by jakob
Changes since 1.16: +11 -3(diff)
move leap seconds correction to -N option for now
revision 1.16/(Download) -annotate -Sat, 27 Jul 2002 09:29:50 UTC by jakob
Changes since 1.15: +10 -5(diff)
add verbose output option
revision 1.15/(Download) -annotate -Thu, 16 May 2002 11:00:53 UTC by deraadt
Changes since 1.14: +6 -8(diff)
bit more KNF
revision 1.14/(Download) -annotate -Thu, 16 May 2002 10:46:34 UTC by jakob
Changes since 1.13: +39 -69(diff)
add support for SNTP & split out RFC868 time support. ok deraadt@
revision 1.13/(Download) -annotate -Tue, 19 Feb 2002 19:39:40 UTC by millert
OpenBSD release(s): 31
Changes since 1.12: +2 -6(diff)
We live in an ANSI C world. Remove lots of gratuitous #ifdef STDC cruft.
revision 1.12/(Download) -annotate -Wed, 15 Aug 2001 19:39:09 UTC by stevesk
OpenBSD release(s): 30
Changes since 1.11: +11 -7(diff)
fix -pa to display properly initialized adjustment; ok beck@ pjanzen@
revision 1.11/(Download) -annotate -Fri, 25 Jul 1997 20:12:18 UTC by mickey
OpenBSD release(s): 29 28 27 26 25 24 23 22
Changes since 1.10: +3 -3(diff)
#if STDC --> #ifdef STDC
revision 1.10/(Download) -annotate -Sun, 27 Apr 1997 13:11:38 UTC by downsj
OpenBSD release(s): 21
Changes since 1.9: +4 -2(diff)
More includes for library prototypes.
revision 1.9/(Download) -annotate -Fri, 04 Apr 1997 08:59:41 UTC by deraadt
Changes since 1.8: +23 -20(diff)
wtmp repairs; netbsd
revision 1.8/(Download) -annotate -Thu, 06 Feb 1997 15:00:27 UTC by kstailey
Changes since 1.7: +3 -3(diff)
corrected to look even more like date(1)
revision 1.7/(Download) -annotate -Tue, 21 Jan 1997 19:29:08 UTC by kstailey
Changes since 1.6: +4 -4(diff)
make lint happier
revision 1.6/(Download) -annotate -Tue, 21 Jan 1997 17:44:05 UTC by kstailey
Changes since 1.5: +10 -3(diff)
make output look like that of date(1)
revision 1.5/(Download) -annotate -Tue, 10 Dec 1996 15:07:08 UTC by deraadt
Changes since 1.4: +1 -2(diff)
warnx
revision 1.4/(Download) -annotate -Sun, 21 Apr 1996 23:41:42 UTC by deraadt
OpenBSD release(s): 20
Changes since 1.3: +4 -4(diff)
sync to netbsd 960418
revision 1.3/(Download) -annotate -Mon, 25 Mar 1996 15:56:10 UTC by niklas
Changes since 1.2: +8 -3(diff)
From NetBSD: merge of 960317
revision 1.2/(Download) -annotate -Thu, 22 Feb 1996 00:17:06 UTC by niklas
Changes since 1.1: +48 -16(diff)
From NetBSD: fix pr/1226 from David Gluss: allow rdate to use adjtime(2)
revision 1.1/(Download) -annotate -Wed, 18 Oct 1995 08:48:04 UTC by deraadt
Branch point for:1.1.1.1
Initial revision
revision 1.1.1.1/(Download) -annotate -Wed, 18 Oct 1995 08:48:04 UTC by deraadt
Tags: netbsd_1_1
Changes since 1.1: None
initial import of NetBSD tree
