aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.d
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2016-08-25 02:58:41 +0000
committerCy Schubert <cy@FreeBSD.org>2016-08-25 02:58:41 +0000
commit1ac66dd31d3cb4b86d0b1d71761c5c63e364dfa8 (patch)
tree64152ec1e8f7916158497a2195e6c2421b235dd6 /etc/rc.d
parent0a8083a658de2a6cab3509a84a6fc0ec3aafb55c (diff)
downloadsrc-1ac66dd31d3cb4b86d0b1d71761c5c63e364dfa8.tar.gz
src-1ac66dd31d3cb4b86d0b1d71761c5c63e364dfa8.zip
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
Notes
Notes: svn path=/head/; revision=304781
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/ntpd7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/rc.d/ntpd b/etc/rc.d/ntpd
index 2b68665d7059..7f62bd4a3781 100755
--- a/etc/rc.d/ntpd
+++ b/etc/rc.d/ntpd
@@ -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)