Date: Thu, 6 Dec 2001 16:29:04 -0500 (EST) From: Robert Watson <rwatson@freebsd.org> To: Dima Dorfman <dima@trit.org> Cc: arch@freebsd.org Subject: Re: MFC'ing xucred definition Message-ID: <Pine.NEB.3.96L.1011206162805.21187K-100000@fledge.watson.org> In-Reply-To: <20011206065633.9E9953E4B@bazooka.trit.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1011206162805.21187K-100000>