From: Harlan Stenn Date: Sat, 18 Jan 2020 09:05:48 +0000 (-0500) Subject: [Bug 3637] Emit the version of ntpd in saveconfig X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8e9643fd1246f5f4c6df39519bcbac0da0d3967;p=thirdparty%2Fntp.git [Bug 3637] Emit the version of ntpd in saveconfig bk: 5e22ca6c59T9epNBvwxvQ2POUD_WhA --- diff --git a/ChangeLog b/ChangeLog index f3816a92d..1d68b16b6 100644 --- 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 - applied patch by Gerry Garvey diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index ff3c08566..6022f9af2 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -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;