summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
AgeCommit message (Collapse)Author
2015-07-18Handle short writes and TLS_{READ,WRITE}_AGAIN around tls_write().Alexander Bluhm
input doug@; OK beck@
2015-07-18prevent the tls constraint state machine from getting hung on STATE_INVALIDBrent Cook
patch from Mikolaj Kucharski ok deraadt@
2015-07-18replace _PATH_DEVNULL with "/dev/null", assume it will not moveBrent Cook
ok deraadt@ phessler@ claudio@
2015-07-18replace bzero with memsetBrent Cook
ok phessler@ deraadt@
2015-05-28detect crashes from constraint sub-processes, instead of ignoring them.Theo de Raadt
if this happens, we want to tear down all of ntpd, so that people will report it, any such bug can be found, and fixed. ok bcook
2015-05-25only scan sensors if they are configuredTheo de Raadt
ok bcook
2015-05-21No need to call tzset() and log_init() in the forked constraintReyk Floeter
handler. It is run in a chroot, so tzset() wouldn't even succeed to open the zone file. Found with tame. OK deraadt@
2015-05-20Remove hotplug(4) sensor support: the code has been disabled byReyk Floeter
henning@ 9 years ago because of an issue with the /dev/hotplug device - it does not support multiple readers opening it. Nobody ever cared enough to fix it so it is time to sent the dead code to the Attic. OK henning@ (feeling sad about it), mpi@ and others
2015-05-19Get the rdomain from the newly exposed ifi_rdomain field in if_dataReyk Floeter
instead of calling the SIOCGIFRDOMAIN ioctl for every single address. OK deraadt@
2015-05-18Currently, after 4 failed constraint checks, we suspect the constraintReyk Floeter
of being wrong, not the NTP responses, reset it and query it from all the constraint servers all over again. This is turned out to be a bit aggressive because it could get triggered with just a few bad NTP peers in a larger pool. To avoid constant reconnections, scale the error margin with the number of resolved NTP peers using peer_cnt * 4. This way a single or a few outliers in a NTP pool cannot trigger reconnecting to the constraint servers immediately. More NTP peers, less reason to mistrust the constraint. Found by dtucker@ OK deraadt@
2015-05-18Simplify example constraints URL to reduce load on the server side.Darren Tucker
ok henning@, reyk@
2015-05-17When resolving the "constraint" (singular), store all returned IPReyk Floeter
addresses and try one after another until the connection succeeded - based on the existing mechanism of "server". "constraint" previously only tried to connect to the first returned address, aborted and skipped the constraint on failure. In difference to "constraints" (plural), it still only connects to one address at a time and not to all of them at once. Pointed out by rpe@ OK rpe@ deraadt@
2015-04-21fix a memory leak if tls_read() fails. ok henning@Jonathan Gray
2015-03-28Avoid overflow on 32-bit time_t systems converting timeval to NTP time.Brent Cook
Original fix from Romuald Delavergne. ok henning@
2015-03-26do not encourage random uppercasing;Jason McIntyre
2015-03-24instead of routing SIGHUP thru sighdlr_dns() which then ignores it,Henning Brauer
ignore it directly. no functional change. Rafael Neves rafaelneves at gmail
2015-03-14remove unused 'cause' string when checking child statusBrent Cook
ok deraadt@
2015-03-14mention TLS HTTPS here also; ok bcookTheo de Raadt
2015-03-11-s is not optional, sadly;Jason McIntyre
while here i've reformatted the page to stop kidding that -s is 4 options; original issue kind of spotted by adam thompson, though note i am not fixing the issue he complained about (i'll address that mail in a minute);
2015-03-02remove unused variableBrent Cook
ok reyk@
2015-02-22Rename tls_config_insecure_noverifyhost() toJoel Sing
tls_config_insecure_noverifyname(), so that it is more accurate and keeps inline with the distinction between DNS hostname and server name. Requested by tedu@ during s2k15.
2015-02-22Set the TLS ciphers to "compat" mode, restoring the previous behaviour.Joel Sing
2015-02-17Fix library ordering on the link line for the sake of static arches. It's, inMiod Vallat
that order, tls, crypto, ssl.
2015-02-16some fixes from max fillinger, tweaked a little by myself;Jason McIntyre
ok reyk
2015-02-16Fix example, syntax is "constraint from www.example.com" (with "from").Reyk Floeter
Reported by Stefan Wollny.
2015-02-12Allow constraints URL without leading path (eg. "https://www.openbsd.org").Reyk Floeter
Fixes segfault on configuration load time, as reported by Donovan Watteau.
2015-02-12Use ntpd's deferred DNS resolving for constraints as well. ThisReyk Floeter
allows to get constraint addresses even if network/DNS is not available at startup (or system boot). thumbs up & OK henning@
2015-02-11Remove dead code (IMSG_HOST_DNS has been moved from the parent toReyk Floeter
ntp_dns some years ago). OK henning@
2015-02-10Be less chatty on constraint errors.Reyk Floeter
OK deraadt@
2015-02-10tweak previous;Jason McIntyre
2015-02-10spacingReyk Floeter
2015-02-10After successfully getting a constraint from an HTTPS server, there isReyk Floeter
no need to request it ever again. The only exception is the escalation of failed constraint checks that might lead into re-requesting the constraint time from all servers. Adjust the states accordingly. OK henning@
2015-02-10Don't show the subseconds when displaying the constraint offset.Reyk Floeter
OK henning@ deraadt@
2015-02-10Move the constraints in a new section and add a preamble to explainReyk Floeter
the functionality. Requested by henning@ OK beck@ deraadt@
2015-02-10Add support for "constraints": when configured, ntpd(8) will query theReyk Floeter
time from HTTPS servers, by parsing the Date: header, and use the median constraint time as a boundary to verify NTP responses. This adds some level of authentication and protection against MITM attacks while preserving the accuracy of the NTP protocol; without relying on authentication options for NTP that are basically unavailable at present. This is an initial implementation and the semantics will be improved once it is in the tree. Discussed with deraadt@ and henning@ OK henning@
2015-02-10be more verbose when logging privsep errors.Brent Cook
ok phessler@ deraadt@
2015-02-10use correct formatters for s/size_t data types.Brent Cook
ok deraadt@
2015-02-08Add a comment that ntpd MUST NOT use AI_ADDRCONFIG in host_dns()Reyk Floeter
OK henning@
2015-01-21Fix deferred host DNS lookups.Brent Cook
If the network is unreachable when ntpd starts and host_dns fails, be sure that we still close the HOST_DNS imsg. Thanks to Paul de Weerd <weerd at weirdnet dot nl> for reporting this. ok beck@
2015-01-19Use initial assignment of action to check for errors.Brent Cook
This simplifies things and make action = -1 no longer a dead store. Also, spell FALLTHROUGH consistently. reported by fritjof@alokat.org
2015-01-19remove a couple of unused headers.Brent Cook
reported by Jonas 'Sortie' Termansen
2015-01-14Switch drift file format to ppm for compatibility with the ntp.orgChristian Weisgerber
daemon. Old drift files will be interpreted as a minuscule adjustment and ntpd will proceed to rediscover the drift, like starting from zero on a newly installed machine. ok deraadt@
2015-01-13bump failure to set the initial time from debug to warningBrent Cook
from Paul B. Henson, ok phessler@
2015-01-13fix some memory leaks in dns handling.Brent Cook
- Nothing seems to free the result of host_dns(), so add host_dns_free() and call after each query. - If imsg_add() fails, it frees buf. Avoid subsequently dereferencing the freed buf in imsg_close(). ok millert@ deraadt@
2015-01-13prefer sizeof(thing) to sizeof(type)Brent Cook
ok tedu@ deraadt@
2015-01-10don't check for a return value that host() doesn't return, so futureTed Unangst
generations don't try to change any of the values and break the code. ok deraadt
2015-01-10revert host() back to correct behavior.Brent Cook
unbreak config file address parsing
2015-01-09return -1 on host() address parsing failure, not 1.Brent Cook
Match what parse.y expects it to return. ok millert@
2015-01-09return -1 on host() address parsing failure, not 1.Brent Cook
Match what parse.y expects it to return. ok millert@
2015-01-09remove excessive/wrong use of sys/param.hTheo de Raadt
peanuts -- but all work has to start somewhere.