FreeBSD/sys/kern/kern_prot.c
/*-
 * Determine if u1 "can see" the subject specified by u2.
 * Returns: 0 for permitted, an errno value 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.
Returns: 0 for permitted, an errno value 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 . Returns : 0 for permitted an errno value 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
int
cr_cansee(struct ucred *u1, struct ucred *u2)
{
	int error;
	if ((error = prison_check(u1, u2)))
		return (error);
#ifdef MAC
	if ((error = mac_cred_check_visible(u1, u2)))
		return (error);
#endif
	if ((error = cr_seeotheruids(u1, u2)))
		return (error);
	if ((error = cr_seeothergids(u1, u2)))
		return (error);
	return (0);
}
int cr_cansee ( struct ucred * u1 , struct ucred * u2 ) { int error ; if ( ( error = prison_check ( u1 , u2 ) ) ) return ( error ) ; #ifdef MAC if ( ( error = mac_cred_check_visible ( u1 , u2 ) ) ) return ( error ) ; #endif if ( ( error = cr_seeotheruids ( u1 , u2 ) ) ) return ( error ) ; if ( ( error = cr_seeothergids ( u1 , u2 ) ) ) return ( error ) ; return ( 0 ) ; }
Determine if u1 "can see" the subject specified by u2.
Determine if u1 " can see " the subject specified by u2 .