Lines Matching refs:gid
722 static struct kauth_identity *kauth_identity_alloc(uid_t uid, gid_t gid, guid_t *guidp, time_t guid_expiry,
730 static int kauth_identity_find_gid(gid_t gid, struct kauth_identity *kir);
777 kauth_identity_alloc(uid_t uid, gid_t gid, guid_t *guidp, time_t guid_expiry, ntsid_t *ntsidp, time_t ntsid_expiry)
784 if (gid != KAUTH_GID_NONE) {
785 kip->ki_gid = gid;
790 panic("can't allocate kauth identity with both uid and gid");
1095 * Parameters: gid GID to find
1105 kauth_identity_find_gid(uid_t gid, struct kauth_identity *kir)
1111 if ((kip->ki_valid & KI_VALID_GID) && (gid == kip->ki_gid)) {
1567 * Parameters: gid GID to examine
1577 kauth_cred_gid2guid(gid_t gid, guid_t *guidp)
1579 return(kauth_cred_cache_lookup(KI_VALID_GID, KI_VALID_GUID, &gid, guidp));
1631 * Parameters: gid GID to examine
1641 kauth_cred_gid2ntsid(gid_t gid, ntsid_t *sidp)
1643 return(kauth_cred_cache_lookup(KI_VALID_GID, KI_VALID_NTSID, &gid, sidp));
2047 * gid GID to check for membership
2069 kauth_cred_ismember_gid(kauth_cred_t cred, gid_t gid, int *resultp)
2082 if (gid == cred->cr_groups[i]) {
2117 if ((gm->gm_uid == cred->cr_gmuid) && (gm->gm_gid == gid) && !kauth_groups_expired(gm)) {
2135 el.el_gid = gid;
2180 gid_t gid;
2193 /* translate guid to gid */
2194 if ((error = kauth_cred_guid2gid(guidp, &gid)) != 0) {
2196 * If we have no guid -> gid translation, it's not a group and
2204 error = kauth_cred_ismember_gid(cred, gid, resultp);
2236 gid_t gid;
2240 gid = cred1->cr_groups[i];
2241 if ((err = kauth_cred_ismember_gid(cred2, gid, &res)) != 0) {
2245 if (!res && gid != cred2->cr_rgid && gid != cred2->cr_svgid) {
2251 /* Check real gid */
2262 /* Finally, check saved gid */
2920 * credential when the given gid actually results in changes to the existing
3020 * gid The new GID to use
3046 kauth_cred_setuidgid(kauth_cred_t cred, uid_t uid, gid_t gid)
3057 cred->cr_groups[0] == gid && cred->cr_rgid == gid && cred->cr_svgid == gid) {
3080 if (kauth_cred_change_egid(&temp_cred, gid)) {
3084 temp_cred.cr_rgid = gid;
3085 temp_cred.cr_svgid = gid;
3097 * Description: Function used by execve to set the saved uid and gid values
3102 * gid The saved gid to set
3119 kauth_cred_setsvuidgid(kauth_cred_t cred, uid_t uid, gid_t gid)
3124 DEBUG_CRED_ENTER("kauth_cred_setsvuidgid: %p u%d->%d g%d->%d\n", cred, cred->cr_svuid, uid, cred->cr_svgid, gid);
3131 if (cred->cr_svuid == uid && cred->cr_svgid == gid) {
3142 temp_cred.cr_svgid = gid;