Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103253156
D46908.id145899.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46908.id145899.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
@@ -1289,7 +1289,7 @@
/*
* Returns whether gid designates a supplementary group in cred.
*/
-static bool
+bool
group_is_supplementary(const gid_t gid, const struct ucred *const cred)
{
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -155,6 +155,17 @@
void cru2x(struct ucred *cr, struct xucred *xcr);
void cru2xt(struct thread *td, struct xucred *xcr);
void crsetgroups(struct ucred *cr, int n, gid_t *groups);
+
+/*
+ * Returns whether gid designates a primary group in cred.
+ */
+static inline bool
+group_is_primary(const gid_t gid, const struct ucred *const cred)
+{
+ return (gid == cred->cr_groups[0] || gid == cred->cr_rgid ||
+ gid == cred->cr_svgid);
+}
+bool group_is_supplementary(const gid_t gid, const struct ucred *const cred);
bool groupmember(gid_t gid, const struct ucred *cred);
bool realgroupmember(gid_t gid, const struct ucred *cred);
#endif /* _KERNEL */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 4:17 PM (4 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14805604
Default Alt Text
D46908.id145899.diff (1 KB)
Attached To
Mode
D46908: cred: Make group_is_supplementary() public; New group_is_primary()
Attached
Detach File
Event Timeline
Log In to Comment