summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/initgroups.c
diff options
context:
space:
mode:
authortobez <tobez@FreeBSD.org>2001-11-28 10:55:02 +0000
committertobez <tobez@FreeBSD.org>2001-11-28 10:55:02 +0000
commit390c9f0f6ee0486a427e4caeea12828da443b805 (patch)
treec98e3ceceeb1cee49d8a3d0e9586c3f263f2f0dd /lib/libc/gen/initgroups.c
parent6828ec15153c53bfa2f4ad08ab0dcee1d1c70b63 (diff)
downloadFreeBSD-src-390c9f0f6ee0486a427e4caeea12828da443b805.zip
FreeBSD-src-390c9f0f6ee0486a427e4caeea12828da443b805.tar.gz
Do not write warning messages on stderr - a caller is expected to check
the return code and errno instead. Those warnings did not do any good for daemonized users of initgroups(3), and confused cvs clients that communicated with non-root cvs pserver. The committed fix differs from the one suggested in the PR, and was submitted by ru. PR: 15421 Approved by: markm Discussed on: -stable, -current at various times
Diffstat (limited to 'lib/libc/gen/initgroups.c')
-rw-r--r--lib/libc/gen/initgroups.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index 9918955..3fc9bb2 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -56,12 +56,6 @@ initgroups(uname, agroup)
int groups[NGROUPS], 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");
- return (-1);
- }
- return (0);
+ getgrouplist(uname, agroup, groups, &ngroups);
+ return (setgroups(ngroups, groups));
}
OpenPOWER on IntegriCloud