summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordavidn <davidn@FreeBSD.org>2000-07-20 05:11:56 +0000
committerdavidn <davidn@FreeBSD.org>2000-07-20 05:11:56 +0000
commit35b42ab19e84a6a58a4b25c650301ced8a0b3c36 (patch)
tree7ab0cc69cd613479513a7466539906f870481113 /usr.sbin
parent94db016d552528f16c2e7d8979a43221369067f4 (diff)
downloadFreeBSD-src-35b42ab19e84a6a58a4b25c650301ced8a0b3c36.zip
FreeBSD-src-35b42ab19e84a6a58a4b25c650301ced8a0b3c36.tar.gz
Move test for -w flag outside of the code dealing with -D (defaults).
This should cause -w's argument not to be ignored in the usermod case, so it will affect modification of the user's password instead of using the pw.conf (or internal default=no '*') password method. PR: bin/11168
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pw/pw_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index c9119a2..2c491fd 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -255,6 +255,8 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if ((arg = getarg(args, 's')) != NULL)
cnf->shell_default = arg->val;
+ if ((arg = getarg(args, 'w')) != NULL)
+ cnf->default_password = boolean_val(arg->val, cnf->default_password);
if (mode == M_ADD && getarg(args, 'D')) {
if (getarg(args, 'n') != NULL)
errx(EX_DATAERR, "can't combine `-D' with `-n name'");
@@ -270,8 +272,6 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if ((p = strtok(NULL, " ,\t")) == NULL || (cnf->max_gid = (gid_t) atoi(p)) < cnf->min_gid)
cnf->max_gid = 32000;
}
- if ((arg = getarg(args, 'w')) != NULL)
- cnf->default_password = boolean_val(arg->val, cnf->default_password);
arg = getarg(args, 'C');
if (write_userconfig(arg ? arg->val : NULL))
OpenPOWER on IntegriCloud