Page MenuHomeFreeBSD

D40641.id127924.diff
No OneTemporary

D40641.id127924.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
@@ -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

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)

Event Timeline