diff options
author | Barry Jaspan <bjaspan@mit.edu> | 1996-08-23 18:49:49 +0000 |
---|---|---|
committer | Barry Jaspan <bjaspan@mit.edu> | 1996-08-23 18:49:49 +0000 |
commit | 6738b73cd67edb34bcf74dff14e84e2b6ffe46ea (patch) | |
tree | c3f8f9a134628fd9d8309824ecd06e8ac0714af0 /src/kadmin/cli/getdate.y | |
parent | 341f28899ccdb32e9a7de17436b30e8a33eee89e (diff) | |
download | krb5-6738b73cd67edb34bcf74dff14e84e2b6ffe46ea.tar.gz krb5-6738b73cd67edb34bcf74dff14e84e2b6ffe46ea.tar.xz krb5-6738b73cd67edb34bcf74dff14e84e2b6ffe46ea.zip |
* kadmin.c: add newlines to "invalid date spec" msg
* getdate.y: add "never" as a valid date specification
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8970 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/cli/getdate.y')
-rw-r--r-- | src/kadmin/cli/getdate.y | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/kadmin/cli/getdate.y b/src/kadmin/cli/getdate.y index e105d19e57..459043017f 100644 --- a/src/kadmin/cli/getdate.y +++ b/src/kadmin/cli/getdate.y @@ -193,7 +193,7 @@ static time_t yyRelSeconds; } %token tAGO tDAY tDAYZONE tID tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT -%token tSEC_UNIT tSNUMBER tUNUMBER tZONE tDST +%token tSEC_UNIT tSNUMBER tUNUMBER tZONE tDST tNEVER %type <Number> tDAY tDAYZONE tMINUTE_UNIT tMONTH tMONTH_UNIT %type <Number> tSEC_UNIT tSNUMBER tUNUMBER tZONE @@ -203,6 +203,15 @@ static time_t yyRelSeconds; spec : /* NULL */ | spec item + | tNEVER { + yyYear = 1970; + yyMonth = 1; + yyDay = 1; + yyHour = yyMinutes = yySeconds = 0; + yyDSTmode = DSToff; + yyTimezone = 0; /* gmt */ + yyHaveDate++; + } ; item : time { @@ -466,7 +475,8 @@ static TABLE const OtherTable[] = { { "tenth", tUNUMBER, 10 }, { "eleventh", tUNUMBER, 11 }, { "twelfth", tUNUMBER, 12 }, - { "ago", tAGO, 1 }, + { "ago", tAGO, 1 }, + { "never", tNEVER, 0 }, { NULL } }; @@ -652,7 +662,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode) Year += 1900; DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 29 : 28; - if (Year < EPOCH /* XXX DANGER! || Year > 1999 */ + if (Year < EPOCH || Month < 1 || Month > 12 /* Lint fluff: "conversion from long may lose accuracy" */ || Day < 1 || Day > DaysInMonth[(int)--Month]) |