From owner-freebsd-arch Thu Dec 6 13:30:32 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 32EA737B62B for ; Thu, 6 Dec 2001 13:29:42 -0800 (PST) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.5) with SMTP id fB6LT4i28807; Thu, 6 Dec 2001 16:29:04 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 6 Dec 2001 16:29:04 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Dima Dorfman Cc: arch@freebsd.org Subject: Re: MFC'ing xucred definition In-Reply-To: <20011206065633.9E9953E4B@bazooka.trit.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I've actually been thinking about modifying xucred in -CURRENT to export additional information from a kernel ucred, such as real and saved ids, now that we have that information in ucred. Before we MFC xucred, it might make sense to make a few tweaks to xucred, including changing the first _cr_unused0 into a version number, and teaching applications how to understand the version number. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services On Thu, 6 Dec 2001, Dima Dorfman wrote: > Is there any reason the definition of struct xucred shouldn't be > MFC'd? I'd like to MFC my LOCAL_PEERCRED/getpeereid() changes, and > would prefer not to have to use the old ucred for a new interface. > I'm not planning to merge the changes to existing interfaces to use > xucred as was done in current (this would probably cause unnecessary > pain in -stable), I just want to merge the definition. > > Here's the change I'm talking about. Any objections? > > Thanks. > > Index: ucred.h > =================================================================== > RCS file: /ref/cvsf/src/sys/sys/ucred.h,v > retrieving revision 1.14.2.4 > diff -u -r1.14.2.4 ucred.h > --- ucred.h 2001/05/17 03:51:28 1.14.2.4 > +++ ucred.h 2001/11/27 21:30:40 > @@ -53,6 +53,19 @@ > #define cr_gid cr_groups[0] > #define NOCRED ((struct ucred *)0) /* no credential available */ > #define FSCRED ((struct ucred *)-1) /* filesystem credential */ > + > +/* > + * This is the external representation of struct ucred, based upon the > + * size of a 4.2-RELEASE struct ucred. There will probably never be > + * any need to change the size of this or layout of its used fields. > + */ > +struct xucred { > + u_short _cr_unused0; /* compatibility with old ucred */ > + uid_t cr_uid; /* effective user id */ > + short cr_ngroups; /* number of groups */ > + gid_t cr_groups[NGROUPS]; /* groups */ > + void *_cr_unused1; /* compatibility with old ucred */ > +}; > > #ifdef _KERNEL > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message