FreeBSD/sys/kern/kern_prot.c
/*-
 * Determine whether the subject represented by cred can "see" a socket.
 * Returns: 0 for permitted, ENOENT otherwise.
 */
Determine whether the subject represented by cred can "see" a socket.
Returns: 0 for permitted, ENOENT otherwise.
Determine whether the subject represented by cred can " see " a socket . Returns : 0 for permitted ENOENT otherwise .
int
cr_canseesocket(struct ucred *cred, struct socket *so)
{
	int error;
	error = prison_check(cred, so->so_cred);
	if (error)
		return (ENOENT);
#ifdef MAC
	error = mac_socket_check_visible(cred, so);
	if (error)
		return (error);
#endif
	if (cr_seeotheruids(cred, so->so_cred))
		return (ENOENT);
	if (cr_seeothergids(cred, so->so_cred))
		return (ENOENT);
	return (0);
}
int cr_canseesocket ( struct ucred * cred , struct socket * so ) { int error ; error = prison_check ( cred , so -> so_cred ) ; if ( error ) return ( ENOENT ) ; #ifdef MAC error = mac_socket_check_visible ( cred , so ) ; if ( error ) return ( error ) ; #endif if ( cr_seeotheruids ( cred , so -> so_cred ) ) return ( ENOENT ) ; if ( cr_seeothergids ( cred , so -> so_cred ) ) return ( ENOENT ) ; return ( 0 ) ; }
Determine whether the subject represented by cred can "see" a socket.
Determine whether the subject represented by cred can " see " a socket .