summaryrefslogtreecommitdiff
path: root/usr.sbin/rdate
AgeCommit message (Collapse)Author
2015-12-23expand message between processes to 2048 bytes. Andre Smagin foundTheo de Raadt
a case where it can reach 637 bytes of output, so use almost 4x (he suggested 1024)
2015-12-12Remove NULL-checks before free().mmcc
2015-10-31repair error message; spotted by Marcus MerighiTheo de Raadt
2015-10-29rdate is a classic "run as root, talk to internet for a while doingTheo de Raadt
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
2015-02-10Document that RFC 5905 (ie. NTP protocol) has a limit which will beTheo de Raadt
hit before Y2038.
2015-02-09clean up flags++ instances around getopt()Theo de Raadt
ok florian
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
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)
2014-10-29use poll() instead of select(), thereby removing the fd_set malloc/freeTheo de Raadt
dance which was used to avoid fd_set overflow with high file descriptor values. ok doug
2014-10-08use reallocarray(). BTW << 3 is a sloppy compared to * sizeof(u_int64_t)...Theo de Raadt
ok doug
2014-04-13remove a 'RCSId[]' which was missed in the rcsid[] removal from 2009.Jonathan Gray
2013-11-12ensure there are prototypesTheo de Raadt
2013-08-16Use %lld and cast to (long long) when printing time_t valuesPhilip Guenther
otto@ millert@ lteo@ mikeb@ deraadt@
2013-04-20Remove extra info from usage message; that's what the manual is for.Todd C. Miller
OK jmc@
2013-04-20spacingTheo de Raadt
2013-04-20remove irrelevant commentTheo de Raadt
2013-04-20Add -o option to getopt string and usage.Todd C. Miller
2013-04-19Make -n the default and add -o flag for the old RFC 868 time protocolTodd C. Miller
(which uses a 32-bit value for its wire protocol). OK deraadt@ ian@
2013-04-19comment incorrect; rdate has -n support now tooTheo de Raadt
2012-08-30rfc 5905 replaces rfc 2030; for now, the reference to 2030 in ntpd.confJason McIntyre
stays; ok henning
2011-12-28s/minum/minimum/ in commentStuart Henderson
2011-07-24oops! syncronizing -> synchronizing (we'll ignore the z thing...)Jason McIntyre
2011-07-24don't encourage use of -c; plus cleanup other goo in man pageTheo de Raadt
spotted by frantisek holop ok jmc
2011-07-08tweak previous;Jason McIntyre
2011-07-07timed's time is up. use ntpd(8). Even our own fossil developersTheo de Raadt
switched a while back. ok miod, kettenis
2010-08-16Fix another gcc4 mis-alignment, by using bcopy() rather thanKenneth R Westerback
(u_int64_t *)charptr = value. Problem reported by Daniel Ouellet, first diff from matthieu@, another from naddy@ equivalent to this one. ok millert@ dlg@ (for naddy's) deraadt@
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
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
2008-07-09documentation tweaks.Igor Sobrado
2007-11-26typos; ok jmc@Martynas Venckus
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
2007-11-25spelling fixes, from Martynas Venckus;Jason McIntyre
2007-05-31convert to new .Dd format;Jason McIntyre
2006-09-17Make rdate ignore ntp responses with ALARM status.Chris Kuethe
"yeah..." henning@
2006-03-14#ifdef DEBUG not #if DEBUGTheo de Raadt
2006-01-28simplify statics, remove stupid goto, plug a leak. ok moritzTed Unangst
2004-10-26make the ntp version check even better, use NTP_VERSION_MIN and _MAXHenning Brauer
2004-10-24accept replies with a NTP version number of 4 or lower, instead of only 4Henning Brauer
as before, we can handle all versions
2004-09-15KNFHenning Brauer
2004-09-15don't refuse packets with stratum=0, they are fineHenning Brauer
2004-07-14do not bail out if the server says its clock is unsynchronized.Henning Brauer
rdate is a simple client and doesn't have another server to query, and a server's idea of the time is better than the local clock's one in basically any case.
2004-07-09make date(1), rdate(8), ntpd(8), and timed(8) .Xr themselves;Jason McIntyre
mostly from Andreas Kahari (PR #3846);
2004-07-07add ntpd(8) to SEE ALSO;Jason McIntyre
2004-06-17err on calloc failure; ok henning@Alexander Guy
2004-06-09 * Bring rdate's SNTP support into compliance with SNTPv4 (RFC 2030).Alexander Guy
* More robust handling of NTP error conditions (e.g. host or service unreachable). * Improve the detection of stale and/or spoofed NTP responses from servers. * Add support for getaddrinfo(3)'s multiple host support if error conditions occur (e.g. round-robin DNS, and the first NTP server isn't responding, try the next host in line). * Minor formatting/code cleanup. ok henning@
2004-06-05Typo correction, and consistency changes.Alexander Guy
ok jakob@, henning@
2004-05-30insane spacingTheo de Raadt
2004-05-30verify that the server is confident in the result it is sending us; from ↵Jakob Schlyter
Alexander Guy
2004-05-26Send out a random 64-bit number as our transmit time. The NTPJakob Schlyter
server will copy said number into the originate field on the response that it sends us. This is totally legal per the SNTP spec. The impact of this is two fold: we no longer send out the current system time for the world to see (which may aid an attacker), and it gives us a (not very secure) way of knowing that we're not getting spoofed by an attacker that can't capture our traffic but can spoof packets from the NTP server we're communicating with. code by Alexander Guy. ok deraadt@
2004-05-25SNTP is RFC 2030Jakob Schlyter
2004-05-18sendto() return code fixes; from andreq matveevJakob Schlyter
ok deraadt@
2004-05-05simplify license. ok author.Jakob Schlyter
2004-02-18sort options and SYNOPSIS;Jason McIntyre
sync usage();