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/security | |
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/security')
-rw-r--r-- | sys/security/lomac/kernel_socket.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/security/lomac/kernel_socket.c b/sys/security/lomac/kernel_socket.c index 541822b..3ed2ee1 100644 --- a/sys/security/lomac/kernel_socket.c +++ b/sys/security/lomac/kernel_socket.c @@ -265,11 +265,7 @@ lomac_local_connect(struct socket *so, struct sockaddr *nam, struct thread *td) * from its process structure at the time of connect() * (which is now). */ - memset(&unp3->unp_peercred, '\0', sizeof(unp3->unp_peercred)); - unp3->unp_peercred.cr_uid = td->td_proc->p_ucred->cr_uid; - unp3->unp_peercred.cr_ngroups = td->td_proc->p_ucred->cr_ngroups; - memcpy(unp3->unp_peercred.cr_groups, td->td_proc->p_ucred->cr_groups, - sizeof(unp3->unp_peercred.cr_groups)); + cru2x(td->td_proc->p_ucred, &unp3->unp_peercred); unp3->unp_flags |= UNP_HAVEPC; /* * The receiver's (server's) credentials are copied |