-/*
+/*
Copyright (c) 1995-1998 by Cisco systems, Inc.
Permission to use, copy, modify, and distribute this software for
FITNESS FOR A PARTICULAR PURPOSE.
*/
+
#include "tac_plus.h"
+
+#include <ctype.h>
+#include <time.h>
+#include <string.h>
+#include <stdio.h>
+
#include "expire.h"
+
/*
* check a date for expiry. If the field specifies
* a shell return PW_OK
static long days_ere_month[] = {0, 31, 59, 90, 120, 151,
181, 212, 243, 273, 304, 334};
+int check_expiration TAC_ARGS((const char *date));
+
int
check_expiration(date)
-char *date;
+const char *date;
{
long day, month, year, leaps, now, expiration, warning;
char monthstr[10];
return (PW_OK);
/* Parse date string. Fail it upon error. */
- if (sscanf(date, "%s %d %d", monthstr, &day, &year) != 3)
+ if (sscanf(date, "%s %ld %ld", monthstr, &day, &year) != 3)
return (PW_EXPIRED);
for(i=0; i < 3; i++) {
- monthstr[i] = toupper(monthstr[i]);
+ monthstr[i] = toupper((int) monthstr[i]);
}
/* Compute the expiration date in days. */