Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147693963
D52272.1784097470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
817 B
Referenced Files
None
Subscribers
None
D52272.1784097470.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
Wed, Jul 15, 6:37 AM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29139959
Default Alt Text
D52272.1784097470.diff (817 B)
Attached To
Mode
D52272: cr_canseeothergids(): Make the logic easier to grasp
Attached
Detach File
Event Timeline
Log In to Comment