FreeBSD/sys/rpc/svc_vc.c
/*
 * Get the effective UID of the sending process. Used by rpcbind, keyserv
 * and rpc.yppasswdd on AF_LOCAL.
 */
Get the effective UID of the sending process. Used by rpcbind, keyserv
and rpc.yppasswdd on AF_LOCAL.
Get the effective UID of the sending process . Used by rpcbind keyserv and rpc . yppasswdd on AF_LOCAL .
int
__rpc_get_local_uid(SVCXPRT *transp, uid_t *uid) {
	int sock, ret;
	gid_t egid;
	uid_t euid;
	struct sockaddr *sa;
	sock = transp->xp_fd;
	sa = (struct sockaddr *)transp->xp_rtaddr;
	if (sa->sa_family == AF_LOCAL) {
		ret = getpeereid(sock, &euid, &egid);
		if (ret == 0)
			*uid = euid;
		return (ret);
	} else
		return (-1);
}
int __rpc_get_local_uid ( SVCXPRT * transp , uid_t * uid ) { int sock , ret ; gid_t egid ; uid_t euid ; struct sockaddr * sa ; sock = transp -> xp_fd ; sa = ( struct sockaddr * ) transp -> xp_rtaddr ; if ( sa -> sa_family == AF_LOCAL ) { ret = getpeereid ( sock , & euid , & egid ) ; if ( ret == 0 ) * uid = euid ; return ( ret ) ; } else return ( -1 ) ; }
Get the effective UID of the sending process.
Get the effective UID of the sending process .