Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2000 07:54:10 +0700 (ALMST)
From:      Boris Popov <bp@butya.kz>
To:        Poul-Henning Kamp <phk@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: Patch test & review: vop_stdaccess()
Message-ID:  <Pine.BSF.4.10.10008170721550.16090-100000@lion.butya.kz>
In-Reply-To: <53850.966458102@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 16 Aug 2000, Poul-Henning Kamp wrote:

> Please test and review this patch:
> 
> http://phk.freebsd.dk/patch/vop_stdaccess.patch

	Looks fine to me except vop_stdaccess() itself. Since VREAD,
VWRITE and VEXEC bits are carefully layed this function can be rewritten
to use single shift operation instead of 3 'or's:

	if (cred->cr_uid != uid) {
		amode >>= 3;
		if (!groupmember(gid, cred))
			amode >>= 3;
	}
	return (fmode & amode) == amode ? 0 : EACCES;

--
Boris Popov
http://www.butya.kz/~bp/



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10008170721550.16090-100000>