Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107088068
D40641.id127924.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
971 B
Referenced Files
None
Subscribers
None
D40641.id127924.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
@@ -1316,6 +1316,19 @@
return (supplementary_group_member(gid, cred));
}
+/*
+ * Check if gid is a member of the real group set (i.e., real and supplementary
+ * groups).
+ */
+int
+realgroupmember(gid_t gid, struct ucred *cred)
+{
+ if (gid == cred->cr_rgid)
+ return (1);
+
+ return (supplementary_group_member(gid, cred));
+}
+
/*
* Test the active securelevel against a given level. securelevel_gt()
* implements (securelevel > level). securelevel_ge() implements
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -159,6 +159,7 @@
void cru2xt(struct thread *td, struct xucred *xcr);
void crsetgroups(struct ucred *cr, int n, gid_t *groups);
int groupmember(gid_t gid, struct ucred *cred);
+int realgroupmember(gid_t gid, struct ucred *cred);
#endif /* _KERNEL */
#endif /* !_SYS_UCRED_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 10:21 PM (3 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15747313
Default Alt Text
D40641.id127924.diff (971 B)
Attached To
Mode
D40641: New realgroupmember()
Attached
Detach File
Event Timeline
Log In to Comment