diff options
author | 1999-03-29 21:27:30 +0000 | |
---|---|---|
committer | 1999-03-29 21:27:30 +0000 | |
commit | 4d2534a154e0392a6d4dcbeadd1f122162b4edbd (patch) | |
tree | 1be9170a712e42b71096ad7beaf26e934b8d28a1 /lib/libc/gen/initgroups.c | |
parent | Only print "already up to date" if in verbose mode (diff) | |
download | wireguard-openbsd-4d2534a154e0392a6d4dcbeadd1f122162b4edbd.tar.xz wireguard-openbsd-4d2534a154e0392a6d4dcbeadd1f122162b4edbd.zip |
initgroups(3) should not spew to stderr; giles@nemeton.com.au
Also document the NGROUPS limit.
Diffstat (limited to 'lib/libc/gen/initgroups.c')
-rw-r--r-- | lib/libc/gen/initgroups.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index 179781e8726..8ded71188c5 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: initgroups.c,v 1.4 1997/08/24 21:25:46 millert Exp $"; +static char rcsid[] = "$OpenBSD: initgroups.c,v 1.5 1999/03/29 21:27:31 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -50,12 +50,8 @@ initgroups(uname, agroup) int ngroups; ngroups = NGROUPS; - if (getgrouplist(uname, agroup, groups, &ngroups) < 0) - _warnx("%s is in too many groups, using first %d", - uname, ngroups); - if (setgroups(ngroups, groups) < 0) { - _warn("setgroups"); + (void) getgrouplist(uname, agroup, groups, &ngroups); + if (setgroups(ngroups, groups) < 0) return (-1); - } return (0); } |