Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143058313
D52272.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
817 B
Referenced Files
None
Subscribers
None
D52272.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
@@ -1885,19 +1885,22 @@
static int
cr_canseeothergids(struct ucred *u1, struct ucred *u2)
{
- if (!see_other_gids) {
- if (realgroupmember(u1->cr_rgid, u2))
- return (0);
+ if (see_other_gids)
+ return (0);
- for (int i = 0; i < u1->cr_ngroups; i++)
- if (realgroupmember(u1->cr_groups[i], u2))
- return (0);
+ /* Restriction in force. */
- if (priv_check_cred(u1, PRIV_SEEOTHERGIDS) != 0)
- return (ESRCH);
- }
+ if (realgroupmember(u1->cr_rgid, u2))
+ return (0);
- return (0);
+ for (int i = 0; i < u1->cr_ngroups; i++)
+ if (realgroupmember(u1->cr_groups[i], u2))
+ return (0);
+
+ if (priv_check_cred(u1, PRIV_SEEOTHERGIDS) == 0)
+ return (0);
+
+ return (ESRCH);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 26, 1:30 PM (11 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27959144
Default Alt Text
D52272.diff (817 B)
Attached To
Mode
D52272: cr_canseeothergids(): Make the logic easier to grasp
Attached
Detach File
Event Timeline
Log In to Comment