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:
Love Hörnquist Åstrand
2009-02-07 15:11:22 +00:00
parent ec2535c8d8
commit 5be004f3fa

View File

@@ -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;