From owner-p4-projects@FreeBSD.ORG Sat May 8 13:47:44 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5EE9C16A4D0; Sat, 8 May 2004 13:47:44 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C3B316A4CE; Sat, 8 May 2004 13:47:44 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC4C043D2F; Sat, 8 May 2004 13:47:43 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i48KlQgx046068; Sat, 8 May 2004 16:47:27 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i48KlQKJ046065; Sat, 8 May 2004 16:47:26 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sat, 8 May 2004 16:47:26 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Chris Vance In-Reply-To: <200405081331.i48DVDff085433@repoman.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Perforce Change Reviews Subject: Re: PERFORCE change 52507 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 20:47:44 -0000 On Sat, 8 May 2004, Chris Vance wrote: > static int > -pipe_has_perm(struct ucred *cred, struct pipe *pipe, access_vector_t perm) > +pipe_has_perm(struct ucred *cred, struct pipepair *pp, access_vector_t perm) > { > struct task_security_struct *task; > struct vnode_security_struct *file; > > task = SLOT(cred->cr_label); > - file = SLOT(pipe->pipe_label); > + file = SLOT(pp->pp_label); > > /* > * TBD: No audit information yet > @@ -1011,31 +1011,31 @@ > } > > static int > -sebsd_check_pipe_ioctl(struct ucred *cred, struct pipe *pipe, > +sebsd_check_pipe_ioctl(struct ucred *cred, struct pipepair *pp, > struct label *pipelabel, unsigned long cmd, void /* caddr_t */ *data) > { > > - return (pipe_has_perm(cred, pipe, FIFO_FILE__IOCTL)); > + return (pipe_has_perm(cred, pp, FIFO_FILE__IOCTL)); > } Out of curiosity -- is there a reason we pass around the pipepair reference instead of just passing the label reference? That avoids having to dereference the pipe pair again to find the label since it's already passed in... Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research