Author: cy
Date: Thu Aug 25 03:09:23 2016
New Revision: 304782
URL: https://svnweb.freebsd.org/changeset/base/304782

Log:
  Make validation of the leap-seconds file unconditional.
  
  MFC after:    1 day

Modified:
  head/etc/rc.d/ntpd

Modified: head/etc/rc.d/ntpd
==============================================================================
--- head/etc/rc.d/ntpd  Thu Aug 25 02:58:41 2016        (r304781)
+++ head/etc/rc.d/ntpd  Thu Aug 25 03:09:23 2016        (r304782)
@@ -29,6 +29,8 @@ ntpd_precmd()
                rc_flags="-g $rc_flags"
        fi
 
+       ntpd_valid_leapfile
+
        if [ ! -f $ntp_db_leapfile ]; then
                ntpd_fetch_leapfile
        fi
@@ -78,6 +80,19 @@ get_ntp_leapfile_expiry() {
                '^\([1-9][0-9]*\)$' \| 0
 }
 
+ntpd_valid_leapfile() {
+       # 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.
+       if [ -f $ntp_db_leapfile ]; then
+               grep -q '\$FreeBSD.*\$' $ntp_db_leapfile &&
+                       cp -p $ntp_src_leapfile $ntp_db_leapfile
+       else
+               cp -p $ntp_src_leapfile $ntp_db_leapfile
+       fi
+}
+
 ntpd_fetch_leapfile() {
        local ntp_tmp_leapfile rc verbose
        
@@ -87,13 +102,6 @@ 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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to