Add basic groupmember() function, not sup groups.

This commit is contained in:
Brian Behlendorf 2009-07-10 10:58:06 -07:00
parent d3126abe75
commit 06dea10380

View File

@ -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