summaryrefslogtreecommitdiffstats
path: root/web/attachments/305196-sslutils.c.localtimeformat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/305196-sslutils.c.localtimeformat.patch')
-rw-r--r--web/attachments/305196-sslutils.c.localtimeformat.patch25
1 files changed, 25 insertions, 0 deletions
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 @@
1--- nagios-plugins-1.4.13/plugins/sslutils.c.prelocaltimeformat 2008-12-13 22:26:49.000000000 +0000
2+++ nagios-plugins-1.4.13/plugins/sslutils.c 2008-12-13 22:34:15.000000000 +0000
3@@ -93,7 +93,8 @@
4 int offset;
5 struct tm stamp;
6 int days_left;
7- char timestamp[17] = "";
8+ char timestamp[50] = "";
9+ time_t tm_t;
10
11 certificate=SSL_get_peer_certificate(s);
12 if(! certificate){
13@@ -139,10 +140,8 @@
14 stamp.tm_isdst = -1;
15
16 days_left = (mktime (&stamp) - time (NULL)) / 86400;
17- snprintf
18- (timestamp, 17, "%02d/%02d/%04d %02d:%02d",
19- stamp.tm_mon + 1,
20- stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min);
21+ tm_t = mktime (&stamp);
22+ strftime(timestamp, 50, "%c", localtime(&tm_t));
23
24 if (days_left > 0 && days_left <= days_till_exp) {
25 printf (_("WARNING - Certificate expires in %d day(s) (%s).\n"), days_left, timestamp);