[Git][NTPsec/ntpsec][master] Fix crash on missing "nts enable"
Hal Murray
gitlab at mg.gitlab.com
Tue Apr 14 03:03:24 UTC 2020
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
1ec837ad by Hal Murray at 2020-04-13T20:01:19-07:00
Fix crash on missing "nts enable"
Needs a valid certificate file.
- - - - -
1 changed file:
- ntpd/nts_server.c
Changes:
=====================================
ntpd/nts_server.c
=====================================
@@ -153,19 +153,14 @@ bool nts_server_init2(void) {
return true;
}
-#define SecondsPerHour 3600
+/* called every hour */
void nts_cert_timer(void) {
- static time_t C_time = 0;
- time_t now = time(NULL);
- if (SecondsPerHour > (now-C_time)) {
+ if (NULL == server_ctx)
return;
- }
check_cert_file();
- while (SecondsPerHour < (now-C_time)) {
- C_time += SecondsPerHour;
- }
}
+/* call hourly and by SIGHUP */
void check_cert_file(void) {
nts_lock_certlock();
nts_reload_certificate(server_ctx);
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/1ec837ad94eceb61a398368b85f95f698f9f6c2f
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/1ec837ad94eceb61a398368b85f95f698f9f6c2f
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20200414/68841438/attachment-0001.htm>
More information about the vc
mailing list