* libmisc/strtoday.c: Add support for numerical dates, assuming

they are already specified in number of days since Epoch. Return
	-2 in case of errors to support the specification of -1.
	* src/usermod.c, src/useradd.c: Adapt to the new error value of
	strtoday().
	* src/chage.c:  Remove isnum(). Adapt to the new error value of
	strtoday(). Support for numerical dates is moved to strtoday().
This commit is contained in:
nekral-guest
2010-03-18 11:53:49 +00:00
parent 79fa4f3343
commit 0cbbdb32c4
5 changed files with 49 additions and 30 deletions

View File

@ -940,7 +940,7 @@ static void process_flags (int argc, char **argv)
case 'e':
if ('\0' != *optarg) {
user_newexpire = strtoday (optarg);
if (user_newexpire == -1) {
if (user_newexpire < -1) {
fprintf (stderr,
_("%s: invalid date '%s'\n"),
Prog, optarg);