diff options
Diffstat (limited to 'web/attachments/394886-time-rfc822.diff')
-rw-r--r-- | web/attachments/394886-time-rfc822.diff | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/web/attachments/394886-time-rfc822.diff b/web/attachments/394886-time-rfc822.diff new file mode 100644 index 0000000..e2e0d84 --- /dev/null +++ b/web/attachments/394886-time-rfc822.diff | |||
@@ -0,0 +1,25 @@ | |||
1 | --- nagios-plugins-1.4.15/plugins/sslutils.c 2010-07-27 20:47:16.000000000 +0000 | ||
2 | +++ nagios-plugins-1.4.15.new/plugins/sslutils.c 2010-11-30 21:37:29.616606174 +0000 | ||
3 | @@ -102,7 +102,7 @@ | ||
4 | struct tm stamp; | ||
5 | float time_left; | ||
6 | int days_left; | ||
7 | - char timestamp[17] = ""; | ||
8 | + char timestamp[128] = ""; | ||
9 | |||
10 | certificate=SSL_get_peer_certificate(s); | ||
11 | if(! certificate){ | ||
12 | @@ -149,10 +149,9 @@ | ||
13 | |||
14 | time_left = difftime(timegm(&stamp), time(NULL)); | ||
15 | days_left = time_left / 86400; | ||
16 | - snprintf | ||
17 | - (timestamp, 17, "%02d/%02d/%04d %02d:%02d", | ||
18 | - stamp.tm_mon + 1, | ||
19 | - stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min); | ||
20 | + | ||
21 | + stamp.tm_mon++; | ||
22 | + strftime (timestamp, sizeof (timestamp), "%a, %d %b %Y %H:%M:%S %z", &stamp); | ||
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); | ||