summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw_user.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-08-01 12:18:48 +0000
committerbapt <bapt@FreeBSD.org>2015-08-01 12:18:48 +0000
commit8fa8b523a25bd6dc2d3d78b1a16a719c2ae992fd (patch)
treed5221c973829509b1cc753108a5c1a07ef6b82f3 /usr.sbin/pw/pw_user.c
parent353f021396aa5a3afff5a95f4eb2d25e976754af (diff)
downloadFreeBSD-src-8fa8b523a25bd6dc2d3d78b1a16a719c2ae992fd.zip
FreeBSD-src-8fa8b523a25bd6dc2d3d78b1a16a719c2ae992fd.tar.gz
Partial revert of r286152
More work needed on the cli validation
Diffstat (limited to 'usr.sbin/pw/pw_user.c')
-rw-r--r--usr.sbin/pw/pw_user.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index 6e07f1f..eca8235 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/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 */
OpenPOWER on IntegriCloud