]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Handle the driftfile option correctly when ntpd_flags is empty.
authorian <ian@FreeBSD.org>
Thu, 23 May 2019 01:41:49 +0000 (01:41 +0000)
committerian <ian@FreeBSD.org>
Thu, 23 May 2019 01:41:49 +0000 (01:41 +0000)
commit3f912ff987f4ed4bfb1399965ec15412049edeeb
tree352f3ad066a13b6221272a4f7f0920596c7e96f8
parent0331abb6ef062b759cd0e0b7c7b3b305c8b7e57b
Handle the driftfile option correctly when ntpd_flags is empty.

The logic I originally wrote to detect whether a driftfile option was in the
set of flags was based on the result of removing the pattern *flag* being an
empty string.  That didn't handle the case where the string was empty to
begin with.  Doh!  So now it also specifically checks for an empty string.

The result of the bad check was that ntpd would run without a driftfile, but
it would do so only if it was running as root instead of the non-priveleged
ntpd user, which isn't a typical case.  Ntpd runs fine without a driftfile,
although it does take it longer to stabilize the clock frequency at startup.

Reported by: avg@
Pointy hat: ian@
MFC after: some testing
libexec/rc/rc.d/ntpd