diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-07-09 14:14:44 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-07-09 14:14:44 +0000 |
commit | b1002b3c03d08cb2ba07261fcb5363561004a077 (patch) | |
tree | 0332c3d388c58e7e0d3c010a2c394ff075989e47 /pw | |
parent | 129c2913052c8f3fef59a58e2b508ea0eff14d7a (diff) | |
download | pw-darwin-b1002b3c03d08cb2ba07261fcb5363561004a077.tar.gz pw-darwin-b1002b3c03d08cb2ba07261fcb5363561004a077.tar.zst pw-darwin-b1002b3c03d08cb2ba07261fcb5363561004a077.zip |
Do not try to set password on group if the group is added as a consequence of
of creating a user (regression from r285136)
Reported by: Fabian Keil <fk@fabiankeil.de>
Diffstat (limited to 'pw')
-rw-r--r-- | pw/pw.c | 1 | ||||
-rw-r--r-- | pw/pw_group.c | 2 | ||||
-rw-r--r-- | pw/pwupd.h | 1 |
3 files changed, 3 insertions, 1 deletions
@@ -215,6 +215,7 @@ main(int argc, char *argv[]) if (mode == -1 || which == -1) cmdhelp(mode, which); + conf.which = which; /* * We know which mode we're in and what we're about to do, so now * let's dispatch the remaining command line args in a genric way. diff --git a/pw/pw_group.c b/pw/pw_group.c index 2a90ff2..c664ef5 100644 --- a/pw/pw_group.c +++ b/pw/pw_group.c @@ -200,7 +200,7 @@ pw_group(int mode, char *name, long id, struct cargs * args) * software. */ - if (conf.fd != -1) + if (conf.which == W_GROUP && conf.fd != -1) set_passwd(grp, mode == M_UPDATE); if (((arg = getarg(args, 'M')) != NULL || @@ -86,6 +86,7 @@ struct pwconf { char *newname; char *config; int fd; + int which; bool dryrun; bool pretty; bool v7; |