From 5b291029a9ed6f6ac19b03b29501179559dc07c3 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 7 Jun 2015 20:44:06 +0000 Subject: Fix generating configuration file --- pw/pw_user.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pw/pw_user.c') 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"); } -- cgit v1.2.3