Handle relative time syntax using +<parse_time>.
Example: kadmin mod --pw-expiration-time='+1month 1day' git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24642 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -184,6 +184,18 @@ str2time_t (const char *str, time_t *t)
|
||||
memset (&tm, 0, sizeof (tm));
|
||||
memset (&tm2, 0, sizeof (tm2));
|
||||
|
||||
while(isspace((unsigned char)*str))
|
||||
str++;
|
||||
|
||||
if (str[0] == '+') {
|
||||
str++;
|
||||
*t = parse_time(str, "month");
|
||||
if (t < 0)
|
||||
return -1;
|
||||
*t += time(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(strcasecmp(str, "never") == 0) {
|
||||
*t = 0;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user