From 5837d32617e40ec26202ff5e8d8f400e387de9b7 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 1 Aug 2015 12:18:48 +0000 Subject: Partial revert of r286152 More work needed on the cli validation --- pw/pw_user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pw/pw_user.c') diff --git a/pw/pw_user.c b/pw/pw_user.c index 6e07f1f..eca8235 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -418,14 +418,14 @@ pw_user(int mode, char *name, long id, struct cargs * args) errx(EX_OSFILE, "root home `%s' is not a directory", cnf->home); } - if (conf.expire_days > 0) - cnf->expire_days = conf.expire_days; + if ((arg = getarg(args, 'e')) != NULL) + cnf->expire_days = atoi(arg->val); if ((arg = getarg(args, 'y')) != NULL) cnf->nispasswd = arg->val; - if (conf.password_days > 0) - cnf->password_days = conf.password_days; + if ((arg = getarg(args, 'p')) != NULL && arg->val) + cnf->password_days = atoi(arg->val); if ((arg = getarg(args, 'g')) != NULL) { if (!*(p = arg->val)) /* Handle empty group list specially */ -- cgit v1.2.3-56-ge451