From 562f29b535e9d397e2e41e40b2472cfb316d0eea Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 8 Jun 2015 05:27:34 +0000 Subject: 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. --- pw/pw_user.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pw/pw_user.c') 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; } /* -- cgit v1.2.3