if (__euidaccess (pbuf, R_OK) != 0)
if (__access (pbuf, R_OK) != 0)
iruserok(raddr, superuser, ruser, luser)	u_int32_t raddr;	int superuser;	const char *ruser, *luser;{	register char *cp;	struct stat sbuf;	struct passwd pwdbuf, *pwd;	FILE *hostf;	int first;	first = 1;	hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r");again:	if (hostf) {		if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {			(void)fclose(hostf);			return (0);		}		(void)fclose(hostf);	}	if (first == 1 && (__check_rhosts_file || superuser)) {		char *pbuf;		size_t dirlen;		size_t buflen = __sysconf (_SC_GETPW_R_SIZE_MAX);		char *buffer = __alloca (buflen);		first = 0;		if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)			return -1;		dirlen = strlen (pwd->pw_dir);		pbuf = alloca (dirlen + sizeof "/.rhosts");		memcpy (pbuf, pwd->pw_dir, dirlen);		memcpy (pbuf + dirlen, "/.rhosts", sizeof "/.rhosts");		/*		 * Change effective uid while opening .rhosts.  If root and		 * reading an NFS mounted file system, can't read files that		 * are protected read/write owner only.		 */		if (__euidaccess (pbuf, R_OK) != 0)		  hostf = NULL;		else		  {		    uid_t uid = geteuid ();		    seteuid (pwd->pw_uid);		    hostf = fopen (pbuf, "r");		    seteuid (uid);		  }		if (hostf == NULL)			return (-1);		/*		 * If not a regular file, or is owned by someone other than		 * user or root or if writeable by anyone but the owner, quit.		 */		cp = NULL;		if (lstat(pbuf, &sbuf) < 0)			cp = _(".rhosts lstat failed");		else if (!S_ISREG(sbuf.st_mode))			cp = _(".rhosts not regular file");		else if (fstat(fileno(hostf), &sbuf) < 0)			cp = _(".rhosts fstat failed");		else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)			cp = _("bad .rhosts owner");		else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))			cp = _(".rhosts writeable by other than owner");		/* If there were any problems, quit. */		if (cp) {			__rcmd_errstr = cp;			(void)fclose(hostf);			return (-1);		}		goto again;	}	return (-1);}