From owner-p4-projects Fri Aug 2 6:46:22 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D222737B405; Fri, 2 Aug 2002 06:46:17 -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 5DEBB37B400; Fri, 2 Aug 2002 06:46:17 -0700 (PDT) Received: from sentry.gw.tislabs.com (sentry.gw.tislabs.com [192.94.214.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DB5843E3B; Fri, 2 Aug 2002 06:46:16 -0700 (PDT) (envelope-from cvance@tislabs.com) Received: by sentry.gw.tislabs.com; id JAA18375; Fri, 2 Aug 2002 09:45:45 -0400 (EDT) Received: from zorg.gw.tislabs.com(10.33.60.104) by sentry.gw.tislabs.com via smap (V5.5) id xma018370; Fri, 2 Aug 02 13:45:03 GMT Received: from localhost (cvance@localhost) by zorg.gw.tislabs.com (8.11.2/8.11.2) with ESMTP id g72Dkxt10425; Fri, 2 Aug 2002 09:46:59 -0400 X-Authentication-Warning: zorg.gw.tislabs.com: cvance owned process doing -bs Date: Fri, 2 Aug 2002 09:46:59 -0400 (EDT) From: Chris Vance X-X-Sender: To: Robert Watson Cc: Chris Vance , Perforce Change Reviews Subject: Re: PERFORCE change 15425 for review In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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