FreeBSD/sys/kern/kern_prot.c
/*
 * Determine if u1 can "see" the subject specified by u2, according to the
 * 'see_other_gids' policy.
 * Returns: 0 for permitted, ESRCH otherwise
 * Locks: none
 * References: *u1 and *u2 must not change during the call
 *             u1 may equal u2, in which case only one reference is required
 */
Determine if u1 can "see" the subject specified by u2, according to the
'see_other_gids' policy.
Returns: 0 for permitted, ESRCH otherwise
Locks: none
References: *u1 and *u2 must not change during the call
u1 may equal u2, in which case only one reference is required
Determine if u1 can " see " the subject specified by u2 according to the ' see_other_gids ' policy . Returns : 0 for permitted ESRCH otherwise Locks : none References : * u1 and * u2 must not change during the call u1 may equal u2 in which case only one reference is required
static int
cr_seeothergids(struct ucred *u1, struct ucred *u2)
{
	int i, match;
	if (!see_other_gids) {
		match = 0;
		for (i = 0; i < u1->cr_ngroups; i++) {
			if (groupmember(u1->cr_groups[i], u2))
				match = 1;
			if (match)
				break;
		}
		if (!match) {
			if (priv_check_cred(u1, PRIV_SEEOTHERGIDS, 0) != 0)
				return (ESRCH);
		}
	}
	return (0);
}
static int cr_seeothergids ( struct ucred * u1 , struct ucred * u2 ) { int i , match ; if ( ! see_other_gids ) { match = 0 ; for ( i = 0 ; i < u1 -> cr_ngroups ; i ++ ) { if ( groupmember ( u1 -> cr_groups [ i ] , u2 ) ) match = 1 ; if ( match ) break ; } if ( ! match ) { if ( priv_check_cred ( u1 , PRIV_SEEOTHERGIDS , 0 ) != 0 ) return ( ESRCH ) ; } } return ( 0 ) ; }
Determine if u1 can "see" the subject specified by u2, according to the
 'see_other_gids' policy.
Determine if u1 can " see " the subject specified by u2 according to the ' see_other_gids ' policy .