Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Aug 2002 09:46:59 -0400 (EDT)
From:      Chris Vance <cvance@tislabs.com>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        Chris Vance <cvance@freebsd.org>, Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 15425 for review
Message-ID:  <Pine.LNX.4.33.0208020939090.10371-100000@zorg.gw.tislabs.com>
In-Reply-To: <Pine.NEB.3.96L.1020801221517.90781C-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 1 Aug 2002, Robert Watson wrote:

> On Thu, 1 Aug 2002, Chris Vance wrote:
[deleted]
> > +		case MAC_SYSCALL:
> > +			mpc->mpc_ops->mpo_mac_policy =
> > +			    mpe->mpe_function;
>
> Looks like you're missing a "break;" here.  Should we rename mac_policy()
> to mac_syscall()?

Yes, I am.  But nobody calls the destroy hook anyway :)

> >  		case MAC_DESTROY:
> >  			mpc->mpc_ops->mpo_destroy =
> >  			    mpe->mpe_function;
> > @@ -3060,6 +3063,40 @@
> >  	return (error);
> >  }
> >
> > +/*
> > + * MPSAFE
> > + */
> > +int
> > +mac_policy(struct thread *td, struct mac_policy_args *uap)
> > +{
> > +	int error;
> > +	char target[128]; /* TBD: should be MAX_MAXNAME or some such */
>
> We probably should define a MAC_POLICY_MAXNAME or something and use that,
> as well as bound the policy name provided by the policy to that length
> during registration.

I'll fix this monday.


> > +	error = copyinstr(uap->policy, target, sizeof(target), NULL);
> > +	if (error == ENAMETOOLONG) {
> > +		return (EINVAL);
> > +	}
>
> I would imagine it's OK to return the error verbatim..?

I wasn't sure what the standard practice for syscalls was, I didn't think
I've ever seen one return ENAMETOOLONG.  It doesn't much matter to me.

chris.



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




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