From: Brian Behlendorf Date: Fri, 10 Jul 2009 17:58:06 +0000 (-0700) Subject: Add basic groupmember() function, not sup groups. X-Git-Tag: spl-0.4.5~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06dea103807ed57621d5711edafc4da2f2d9bbc6;p=spl Add basic groupmember() function, not sup groups. --- diff --git a/include/sys/cred.h b/include/sys/cred.h index 1e7d3b7..47eeda2 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