Page MenuHomeFreeBSD

D46908.diff
No OneTemporary

D46908.diff

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

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)

Event Timeline