diff options
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 6bc58f2..a6522607 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); } |