reenabled check_expiry

This commit is contained in:
Martin Willi
2006-07-07 12:25:25 +00:00
parent c71d53ba4e
commit af2faa1f1d
+6 -6
View File
@@ -1097,7 +1097,8 @@ char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
{ {
return strict? "fatal (expired)" : "warning (expired)"; return strict? "fatal (expired)" : "warning (expired)";
} }
/* {
{
static char buf[35]; static char buf[35];
const char* unit = "second"; const char* unit = "second";
@@ -1120,11 +1121,10 @@ char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
unit = "minute"; unit = "minute";
} }
snprintf(buf, sizeof(buf), "warning (expires in %d %s%s)", time_left, unit, (time_left == 1)?"":"s"); snprintf(buf, sizeof(buf), "warning (expires in %d %s%s)", time_left, unit, (time_left == 1)?"":"s");
} */
/* TODO: check_expiry from pluto is a hack: it returns a buffer to its stack. /* TODO: This is not thread save and may result in corrupted strings. Rewrite this! */
* this is dangerous and may cause crashes! Reimplement this another way!!! return buf;
*/ }
return "warning (expires in under 30days)";
} }
/** /**