summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorDima Dorfman <dd@FreeBSD.org>2002-02-27 04:45:37 +0000
committerDima Dorfman <dd@FreeBSD.org>2002-02-27 04:45:37 +0000
commit76183f345377df655cfb357a53d52aa045fa8073 (patch)
treeb9bd8d438620748c0c88ed7a994eb55f8d617278 /sys/kern/uipc_usrreq.c
parentb7eeb587f6c0aa1aa84ed6cca74ad7ec43ed8019 (diff)
Notes
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 6bc58f2bcbd3..a6522607af15 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -717,11 +717,7 @@ unp_connect(so, nam, 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
@@ -1427,11 +1423,7 @@ unp_listen(unp, p)
struct proc *p;
{
- bzero(&unp->unp_peercred, sizeof(unp->unp_peercred));
- unp->unp_peercred.cr_uid = p->p_ucred->cr_uid;
- unp->unp_peercred.cr_ngroups = p->p_ucred->cr_ngroups;
- bcopy(p->p_ucred->cr_groups, unp->unp_peercred.cr_groups,
- sizeof(unp->unp_peercred.cr_groups));
+ cru2x(p->p_ucred, &unp->unp_peercred);
unp->unp_flags |= UNP_HAVEPCCACHED;
return (0);
}