Date: Sat, 8 May 2004 16:47:26 -0400 (EDT) From: Robert Watson <rwatson@FreeBSD.org> To: Chris Vance <cvance@FreeBSD.org> Cc: Perforce Change Reviews <perforce@FreeBSD.org> Subject: Re: PERFORCE change 52507 for review Message-ID: <Pine.NEB.3.96L.1040508164543.27309I-100000@fledge.watson.org> In-Reply-To: <200405081331.i48DVDff085433@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 8 May 2004, Chris Vance wrote: <snip> > 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)); > } </snip> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040508164543.27309I-100000>