From owner-freebsd-current Thu Aug 17 0:51:48 2000 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (beachchick.freebsd.dk [212.242.32.208]) by hub.freebsd.org (Postfix) with ESMTP id 046EF37B575 for ; Thu, 17 Aug 2000 00:51:45 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.3) with ESMTP id JAA55372; Thu, 17 Aug 2000 09:51:35 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Boris Popov Cc: current@freebsd.org Subject: Re: Patch test & review: vop_stdaccess() In-Reply-To: Your message of "Thu, 17 Aug 2000 07:54:10 +0700." Date: Thu, 17 Aug 2000 09:51:35 +0200 Message-ID: <55370.966498695@critter> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message , Boris Pop ov writes: >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; You are right, but such an optimization should be committed as a the next step. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD coreteam member | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message