lib/librpc/rpc/auth_unix.c
/*
 * Returns an auth handle with parameters determined by doing lots of
 * syscalls.
 */
Returns an auth handle with parameters determined by doing lots of
syscalls.
Returns an auth handle with parameters determined by doing lots of syscalls .
AUTH *
authunix_create_default()
{
	register int len;
	char machname[MAX_MACHINE_NAME + 1];
	register int uid;
	register int gid;
	int gids[NGRPS];
	if (gethostname(machname, MAX_MACHINE_NAME) == -1)
		abort();
	machname[MAX_MACHINE_NAME] = 0;
	uid = geteuid();
	gid = getegid();
	if ((len = getgroups(NGRPS, gids)) < 0)
		abort();
	if (len > maxgrplist)
		len = maxgrplist;
	return (authunix_create(machname, uid, gid, len, gids));
}
AUTH * authunix_create_default ( ) { register int len ; char machname [ MAX_MACHINE_NAME + 1 ] ; register int uid ; register int gid ; int gids [ NGRPS ] ; if ( gethostname ( machname , MAX_MACHINE_NAME ) == -1 ) abort ( ) ; machname [ MAX_MACHINE_NAME ] = 0 ; uid = geteuid ( ) ; gid = getegid ( ) ; if ( ( len = getgroups ( NGRPS , gids ) ) < 0 ) abort ( ) ; if ( len > maxgrplist ) len = maxgrplist ; return ( authunix_create ( machname , uid , gid , len , gids ) ) ; }
Returns an auth handle with parameters determined by doing lots of
 syscalls.
Returns an auth handle with parameters determined by doing lots of syscalls .