summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-06-07 20:44:06 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-06-07 20:44:06 +0000
commitd1593426badd25926a46d772133118bc1d3aab7b (patch)
tree56d4cb38ba7295ac4bfebaa0e5b1f889b8cbb569 /pw/pw_user.c
parentacdde8a5fd9f78f37032cd8801a0731e96c5a119 (diff)
downloadpw-darwin-d1593426badd25926a46d772133118bc1d3aab7b.tar.gz
pw-darwin-d1593426badd25926a46d772133118bc1d3aab7b.zip
Fix generating configuration file
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index c567e68..c3b2751 100644
--- a/pw/pw_user.c
+++ b/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");
}