From owner-freebsd-arch Thu Dec 20 4:40:49 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id E9F6F37B417; Thu, 20 Dec 2001 04:40:42 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id XAA09572; Thu, 20 Dec 2001 23:40:33 +1100 Date: Thu, 20 Dec 2001 23:40:31 +1100 (EST) From: Bruce Evans X-X-Sender: To: Dima Dorfman Cc: Robert Watson , "Brian F. Feldman" , Subject: Re: xucred versioning and filling (was: MFC'ing xucred definition) In-Reply-To: <20011219005412.54A833E2F@bazooka.trit.org> Message-ID: <20011220232116.P607-100000@gamplex.bde.org> 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 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