Add logic to replace the working ntp leap-seconds file in /var/db

if it contains a $FreeBSD$ header. The header will cause the file
to fail checksum of the hash causing ntpd to ignore the file.

MFC after:	1 day
This commit is contained in:
Cy Schubert 2016-08-25 02:58:41 +00:00
parent 0a8083a658
commit 1ac66dd31d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304781

View File

@ -87,6 +87,13 @@ ntpd_fetch_leapfile() {
verbose=:
fi
# Refresh working leapfile with an invalid hash due to
# FreeBSD id header. Ntpd will ignore leapfiles with a
# mismatch hash. The file must be the virgin file from
# the source.
test -f $ntp_db_leapfile &&
grep -q '\$FreeBSD.*\$' $ntp_db_leapfile &&
cp -p $ntp_src_leapfile $ntp_db_leapfile
ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list"
ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile)