summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw_user.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-06-07 20:44:06 +0000
committerbapt <bapt@FreeBSD.org>2015-06-07 20:44:06 +0000
commitfc781f489d6d2f9918c9ecdeea749b37a453cdd9 (patch)
tree08e54f734d9d78f52e7d0d94bbd1af042d41b60b /usr.sbin/pw/pw_user.c
parent302d4b4363132d1d7c08566d2a7bc7af78101d09 (diff)
downloadFreeBSD-src-fc781f489d6d2f9918c9ecdeea749b37a453cdd9.zip
FreeBSD-src-fc781f489d6d2f9918c9ecdeea749b37a453cdd9.tar.gz
Fix generating configuration file
Diffstat (limited to 'usr.sbin/pw/pw_user.c')
-rw-r--r--usr.sbin/pw/pw_user.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index c567e68c..c3b2751 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -292,7 +292,7 @@ pw_user(int mode, char *name, long id, struct cargs * args)
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)
+ if (name != NULL)
errx(EX_DATAERR, "can't combine `-D' with `-n name'");
if ((arg = getarg(args, 'u')) != NULL && (p = strtok(arg->val, ", \t")) != NULL) {
if ((cnf->min_uid = (uid_t) atoi(p)) == 0)
@@ -307,9 +307,8 @@ pw_user(int mode, char *name, long id, struct cargs * args)
cnf->max_gid = 32000;
}
- arg = getarg(args, 'C');
- if (write_userconfig(arg ? arg->val : NULL))
- return EXIT_SUCCESS;
+ if (write_userconfig(conf.config))
+ return (EXIT_SUCCESS);
err(EX_IOERR, "config udpate");
}
OpenPOWER on IntegriCloud