summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pw/pw.c1
-rw-r--r--pw/pw_group.c2
-rw-r--r--pw/pwupd.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/pw/pw.c b/pw/pw.c
index b9bd9d0..6769738 100644
--- a/pw/pw.c
+++ b/pw/pw.c
@@ -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 ||
diff --git a/pw/pwupd.h b/pw/pwupd.h
index c6ed32e..37303de 100644
--- a/pw/pwupd.h
+++ b/pw/pwupd.h
@@ -86,6 +86,7 @@ struct pwconf {
char *newname;
char *config;
int fd;
+ int which;
bool dryrun;
bool pretty;
bool v7;