From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- .../305196-sslutils.c.localtimeformat.patch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 web/attachments/305196-sslutils.c.localtimeformat.patch (limited to 'web/attachments/305196-sslutils.c.localtimeformat.patch') diff --git a/web/attachments/305196-sslutils.c.localtimeformat.patch b/web/attachments/305196-sslutils.c.localtimeformat.patch new file mode 100644 index 0000000..66435b8 --- /dev/null +++ b/web/attachments/305196-sslutils.c.localtimeformat.patch @@ -0,0 +1,25 @@ +--- nagios-plugins-1.4.13/plugins/sslutils.c.prelocaltimeformat 2008-12-13 22:26:49.000000000 +0000 ++++ nagios-plugins-1.4.13/plugins/sslutils.c 2008-12-13 22:34:15.000000000 +0000 +@@ -93,7 +93,8 @@ + int offset; + struct tm stamp; + int days_left; +- char timestamp[17] = ""; ++ char timestamp[50] = ""; ++ time_t tm_t; + + certificate=SSL_get_peer_certificate(s); + if(! certificate){ +@@ -139,10 +140,8 @@ + stamp.tm_isdst = -1; + + days_left = (mktime (&stamp) - time (NULL)) / 86400; +- snprintf +- (timestamp, 17, "%02d/%02d/%04d %02d:%02d", +- stamp.tm_mon + 1, +- stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min); ++ tm_t = mktime (&stamp); ++ strftime(timestamp, 50, "%c", localtime(&tm_t)); + + if (days_left > 0 && days_left <= days_till_exp) { + printf (_("WARNING - Certificate expires in %d day(s) (%s).\n"), days_left, timestamp); -- cgit v1.2.3-74-g34f1