diff options
author | bapt <bapt@FreeBSD.org> | 2015-06-08 05:27:34 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-06-08 05:27:34 +0000 |
commit | ec480fe320d4aa3e3de9a2d528d9c3a8bf4ec4cc (patch) | |
tree | 5e4a90e22670f8094a1456cfb287ccf021079274 /usr.sbin/pw/pw_user.c | |
parent | 6e327f93661ec99c2f7e70dc01edb9049442e46a (diff) | |
download | FreeBSD-src-ec480fe320d4aa3e3de9a2d528d9c3a8bf4ec4cc.zip FreeBSD-src-ec480fe320d4aa3e3de9a2d528d9c3a8bf4ec4cc.tar.gz |
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 'usr.sbin/pw/pw_user.c')
-rw-r--r-- | usr.sbin/pw/pw_user.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index ea3cb3d..c3b2751 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/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; } /* |