summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-06-08 05:27:34 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-06-08 05:27:34 +0000
commit562f29b535e9d397e2e41e40b2472cfb316d0eea (patch)
tree7c707837725b612c96300d61d6d56cadccccc204 /pw/pw_user.c
parent93e2d84797155e6f491c33d5c43f873dbc114511 (diff)
downloadpw-darwin-562f29b535e9d397e2e41e40b2472cfb316d0eea.tar.gz
pw-darwin-562f29b535e9d397e2e41e40b2472cfb316d0eea.tar.zst
pw-darwin-562f29b535e9d397e2e41e40b2472cfb316d0eea.zip
backout remove of -q option for pw [user|group] next
While the return code is broken, some corner case usage depends on the functionnality, so backout until we get better regression tests covering those corner case usage.
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index ea3cb3d..c3b2751 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -158,10 +158,14 @@ pw_user(int mode, char *name, long id, struct cargs * args)
* With M_NEXT, we only need to return the
* next uid to stdout
*/
- if (mode == M_NEXT) {
- printf("%u:", pw_uidpolicy(cnf, id));
+ if (mode == M_NEXT)
+ {
+ uid_t next = pw_uidpolicy(cnf, id);
+ if (getarg(args, 'q'))
+ return next;
+ printf("%u:", next);
pw_group(mode, name, -1, args);
- return (EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
/*