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
commit5b291029a9ed6f6ac19b03b29501179559dc07c3 (patch)
treecf01c2495cedc81b8b10df851bc83e1372e3030b /pw/pw_user.c
parent068c2f64c08c71d084c16d066a0fb3802e26b7a9 (diff)
downloadpw-darwin-5b291029a9ed6f6ac19b03b29501179559dc07c3.tar.gz
pw-darwin-5b291029a9ed6f6ac19b03b29501179559dc07c3.tar.zst
pw-darwin-5b291029a9ed6f6ac19b03b29501179559dc07c3.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");
}