PERFORCE change 52507 for review

Robert Watson rwatson at FreeBSD.org
Sat May 8 13:47:44 PDT 2004


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 at fledge.watson.org      Senior Research Scientist, McAfee Research




More information about the p4-projects mailing list