summaryrefslogtreecommitdiffstats
path: root/pw/pw_group.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
commit07d47dbbf964e186685045cb504935dd9be45792 (patch)
tree39f614ab20b46861b3588619bf4212b0fe05a7f0 /pw/pw_group.c
parent1384cb87b1c4c46b04a04d39617eb11537a371e5 (diff)
downloadpw-darwin-07d47dbbf964e186685045cb504935dd9be45792.tar.gz
pw-darwin-07d47dbbf964e186685045cb504935dd9be45792.tar.zst
pw-darwin-07d47dbbf964e186685045cb504935dd9be45792.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_group.c')
-rw-r--r--pw/pw_group.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pw/pw_group.c b/pw/pw_group.c
index daa121d..b9cce0d 100644
--- a/pw/pw_group.c
+++ b/pw/pw_group.c
@@ -73,8 +73,11 @@ pw_group(int mode, char *name, long id, struct cargs * args)
* next gid to stdout
*/
if (mode == M_NEXT) {
- printf("%u\n", gr_gidpolicy(cnf, id));
- return (EXIT_SUCCESS);
+ gid_t next = gr_gidpolicy(cnf, id);
+ if (getarg(args, 'q'))
+ return next;
+ printf("%u\n", next);
+ return EXIT_SUCCESS;
}
if (mode == M_PRINT && getarg(args, 'a')) {