summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-07-10 10:58:06 -0700
committerBrian Behlendorf <[email protected]>2009-07-10 10:58:06 -0700
commit06dea103807ed57621d5711edafc4da2f2d9bbc6 (patch)
tree8472e0287efbe094bb490154eda2df1b10043276
parentd3126abe75a6502d55bfa2339b48d4fa263e1b02 (diff)
Add basic groupmember() function, not sup groups.
-rw-r--r--include/sys/cred.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sys/cred.h b/include/sys/cred.h
index 1e7d3b7c9..47eeda2cb 100644
--- a/include/sys/cred.h
+++ b/include/sys/cred.h
@@ -61,6 +61,18 @@ crgetgroups(cred_t *cr)
return NULL;
}
+static __inline__ int
+groupmember(gid_t gid, const cred_t *cr)
+{
+ /* Primary group check */
+ if ((cr) && (gid == cr->cr_gid))
+ return 1;
+
+ /* Supplemental group check (unsupported) */
+ return 0;
+}
+
+
#ifdef __cplusplus
}
#endif