summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-10-01 00:08:42 +0000
committerguenther <guenther@openbsd.org>2012-10-01 00:08:42 +0000
commitf145108b27a098862181f4ddbee13b521a66e1dc (patch)
tree61d8c3dd50bc22b63bb9f849a0882500e15da9b3 /sys/kern/kern_prot.c
parentCorrect the addition of the 39320LPE controller. The actual product name (diff)
downloadwireguard-openbsd-f145108b27a098862181f4ddbee13b521a66e1dc.tar.xz
wireguard-openbsd-f145108b27a098862181f4ddbee13b521a66e1dc.zip
Make groupmember() check the effective gid too, so that the checks are
consistent when the effective gid isn't also a supplementary group. ok beck@
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 982dfae4bb4..0cff5251972 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.54 2012/04/12 10:11:41 mikeb Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.55 2012/10/01 00:08:42 guenther Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -745,6 +745,8 @@ groupmember(gid_t gid, struct ucred *cred)
gid_t *gp;
gid_t *egp;
+ if (cred->cr_gid == gid)
+ return (1);
egp = &(cred->cr_groups[cred->cr_ngroups]);
for (gp = cred->cr_groups; gp < egp; gp++)
if (*gp == gid)