diff options
author | dd <dd@FreeBSD.org> | 2002-02-27 04:45:37 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2002-02-27 04:45:37 +0000 |
commit | c8a6bd99227ca59b48fafa66f2a21ddb86096d9e (patch) | |
tree | b9bd8d438620748c0c88ed7a994eb55f8d617278 /sys/sys/ucred.h | |
parent | d9b95389509535794ad65d022528710a8400e45f (diff) | |
download | FreeBSD-src-c8a6bd99227ca59b48fafa66f2a21ddb86096d9e.zip FreeBSD-src-c8a6bd99227ca59b48fafa66f2a21ddb86096d9e.tar.gz |
Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being). Accordingly, change users of
xucred to set and check this field as appropriate. In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former. This also has the pleasant sideaffect of removing some
duplicate code.
Reviewed by: rwatson
Diffstat (limited to 'sys/sys/ucred.h')
-rw-r--r-- | sys/sys/ucred.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 03d4337..ed0d576 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -73,12 +73,13 @@ struct ucred { * 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_int 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 #ifdef _KERNEL @@ -96,6 +97,7 @@ void crfree(struct ucred *cr); struct ucred *crget(void); struct ucred *crhold(struct ucred *cr); int crshared(struct ucred *cr); +void cru2x(struct ucred *cr, struct xucred *xcr); int groupmember(gid_t gid, struct ucred *cred); #endif /* _KERNEL */ |