Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F98844676
D46908.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.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
is_a_supplementary_group(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,18 @@
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
+is_a_primary_group(const gid_t gid, const struct ucred *const cred)
+{
+ return (gid == cred->cr_groups[0] || gid == cred->cr_rgid ||
+ gid == cred->cr_svgid);
+}
+bool is_a_supplementary_group(const gid_t gid,
+ const struct ucred *const cred);
bool groupmember(gid_t gid, struct ucred *cred);
bool realgroupmember(gid_t gid, struct ucred *cred);
#endif /* _KERNEL */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 5, 11:23 PM (21 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13678385
Default Alt Text
D46908.diff (1 KB)
Attached To
Mode
D46908: cred: is_a_supplementary_group() public; New is_a_primary_group()
Attached
Detach File
Event Timeline
Log In to Comment