From 9eeb3e170f2638ec36c6770687a11bd01846e75a Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Fri, 2 Oct 2015 15:53:08 +0200 Subject: fix typo from #1336 if exactly one hour before the expire date, we would mixup minutes and hours. Signed-off-by: Sven Nierlein --- plugins/sslutils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/sslutils.c b/plugins/sslutils.c index 76e45079..c9882c69 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c @@ -209,7 +209,8 @@ int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){ (tm->data[6 + offset] - '0') * 10 + (tm->data[7 + offset] - '0'); stamp.tm_min = (tm->data[8 + offset] - '0') * 10 + (tm->data[9 + offset] - '0'); - stamp.tm_sec = 0; + stamp.tm_sec = + (tm->data[10 + offset] - '0') * 10 + (tm->data[11 + offset] - '0'); stamp.tm_isdst = -1; time_left = difftime(timegm(&stamp), time(NULL)); @@ -231,7 +232,7 @@ int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){ printf (_("%s - Certificate '%s' expires in %u %s (%s)\n"), (days_left>days_till_exp_crit) ? "WARNING" : "CRITICAL", cn, time_remaining, - time_left > 3600 ? "hours" : "minutes", timestamp); + time_left >= 3600 ? "hours" : "minutes", timestamp); if ( days_left > days_till_exp_crit) status = STATE_WARNING; -- cgit v1.2.3-74-g34f1