summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-01 17:20:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-01 17:20:49 +0000
commit356cbd38254e705678eb76ec729cf8b28e3cb776 (patch)
tree972577f1677553c8a8828a7df429ed11afe9d5a0
parent77c63412cf7e098aa626a2445e6380282e354bd2 (diff)
SO_PEERCRED should pass out the main pid, not the "pid" of the current
thread. Discussion with guenther.
-rw-r--r--sys/kern/uipc_usrreq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index d9c8da248c8..a7bffce7b64 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.46 2010/06/30 19:57:05 deraadt Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.47 2010/07/01 17:20:48 deraadt Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -433,7 +433,7 @@ unp_bind(struct unpcb *unp, struct mbuf *nam, struct proc *p)
unp->unp_addr = m_copy(nam, 0, (int)M_COPYALL);
unp->unp_connid.uid = p->p_ucred->cr_uid;
unp->unp_connid.gid = p->p_ucred->cr_gid;
- unp->unp_connid.pid = p->p_pid;
+ unp->unp_connid.pid = p->p_p->ps_mainproc->p_pid;
unp->unp_flags |= UNP_FEIDSBIND;
VOP_UNLOCK(vp, 0, p);
return (0);
@@ -487,7 +487,7 @@ unp_connect(struct socket *so, struct mbuf *nam, struct proc *p)
m_copy(unp2->unp_addr, 0, (int)M_COPYALL);
unp3->unp_connid.uid = p->p_ucred->cr_uid;
unp3->unp_connid.gid = p->p_ucred->cr_gid;
- unp3->unp_connid.pid = p->p_pid;
+ unp3->unp_connid.pid = p->p_p->ps_mainproc->p_pid;
unp3->unp_flags |= UNP_FEIDS;
so2 = so3;
if (unp2->unp_flags & UNP_FEIDSBIND) {