]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3637] Emit the version of ntpd in saveconfig
authorHarlan Stenn <stenn@ntp.org>
Sat, 18 Jan 2020 09:05:48 +0000 (04:05 -0500)
committerHarlan Stenn <stenn@ntp.org>
Sat, 18 Jan 2020 09:05:48 +0000 (04:05 -0500)
bk: 5e22ca6c59T9epNBvwxvQ2POUD_WhA

ChangeLog
ntpd/ntp_config.c

index f3816a92d6beedfcf9c73bea893343970bf1c6d7..1d68b16b6353c3afb2c28b195f5585cf12925165 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 * [Sec 3610] process_control() should bail earlier on short packets. stenn@
   - Reported by Philippe Antoine
+* [Bug 3637] Emit the version of ntpd in saveconfig.  stenn@
 * [Bug 3634] Typo in discipline.html, reported by Jason Harrison.  stenn@
 * [Bug 3620] memory leak in ntpq sysinfo <perlinger@ntp.org>
   - applied patch by Gerry Garvey
index ff3c08566318c5f4b1ecd8c12a7b2b934b640fac..6022f9af27d8ebe1a7e2a8a2e6b8a01798666e12 100644 (file)
@@ -500,6 +500,13 @@ dump_all_config_trees(
 {
        config_tree *   cfg_ptr;
        int             return_value;
+       time_t          now = time(NULL)
+       struct tm       tm = *localtime(&now);
+
+       fprintf(df, "#NTF:D %04d%02d%02d@%02d:%02d:%02d\n",
+               tm.tm.tm_year+1900, tm.tm_mon+1, tm.tm_day,
+               tm.tm_hour, tm.tm_min, tm.tm_sec);
+       fprintf(df, "#NTF:V %s\n", Version);
 
        return_value = 0;
        for (cfg_ptr = cfg_tree_history;