Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133070686
D40642.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
759 B
Referenced Files
None
Subscribers
None
D40642.diff
View Options
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1408,21 +1408,18 @@
static int
cr_canseeothergids(struct ucred *u1, struct ucred *u2)
{
- int i, match;
-
if (!see_other_gids) {
- match = 0;
- for (i = 0; i < u1->cr_ngroups; i++) {
- if (groupmember(u1->cr_groups[i], u2))
- match = 1;
- if (match)
- break;
- }
- if (!match) {
- if (priv_check_cred(u1, PRIV_SEEOTHERGIDS) != 0)
- return (ESRCH);
- }
+ if (realgroupmember(u1->cr_rgid, u2))
+ return (0);
+
+ for (int i = 1; i < u1->cr_ngroups; i++)
+ if (realgroupmember(u1->cr_groups[i], u2))
+ return (0);
+
+ if (priv_check_cred(u1, PRIV_SEEOTHERGIDS) != 0)
+ return (ESRCH);
}
+
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 23, 5:08 PM (6 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24096149
Default Alt Text
D40642.diff (759 B)
Attached To
Mode
D40642: cr_canseeothergids(): Use real instead of effective group membership
Attached
Detach File
Event Timeline
Log In to Comment