Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2001 23:40:31 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Dima Dorfman <dima@trit.org>
Cc:        Robert Watson <rwatson@FreeBSD.ORG>, "Brian F. Feldman" <green@FreeBSD.ORG>, <arch@FreeBSD.ORG>
Subject:   Re: xucred versioning and filling (was: MFC'ing xucred definition)
Message-ID:  <20011220232116.P607-100000@gamplex.bde.org>
In-Reply-To: <20011219005412.54A833E2F@bazooka.trit.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 19 Dec 2001, Dima Dorfman wrote:

> Does anybody have any comments on this?  I'd like to commit it
> soon-ish, but don't plan to MFC it before 4.5 (since it's a new
> interface, and I'd rather not set it in stone (-stable) yet).

> > Index: sys/sys/ucred.h
> > ===================================================================
> > RCS file: /ref/cvsf/src/sys/sys/ucred.h,v
> > retrieving revision 1.26
> > diff -u -r1.26 ucred.h
> > --- sys/sys/ucred.h	2001/10/11 23:38:17	1.26
> > +++ sys/sys/ucred.h	2001/12/14 03:30:26
> > @@ -73,12 +73,13 @@
> >   * any need to change the size of this or layout of its used fields.
> >   */
> >  struct xucred {
> > -	u_short	_cr_unused0;		/* compatibility with old ucred */
> > +	u_short cr_version;		/* structure layout version */
> >  	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 */
> >  };
> > +#define	XUCRED_VERSION	0

_cr_unused0 does a poor job of reflecting the unused fields in the struct.
The layout of the struct is actually:

	uint16_t cr_spare1;
	uint16_t cr_spare2;
	uint32_t cr_uid;
	int16_t  cr_ngroups;
	int16_t  cr_spare3;
	uint32_t cr_groups[NGROUPS];
	uint32_t cr_spare4;

Since you're changing the interface a little, I think the new field should
use all the space available.  RELENG_4 already uses it all, since it has
the change from u_short to u_int for cr_ref.

Bruce


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?20011220232116.P607-100000>