From 36784fd2c4f908d39e9ed1d9454f22f8aea9d928 Mon Sep 17 00:00:00 2001 From: rwatson Date: Thu, 13 Dec 2001 22:09:37 +0000 Subject: o Back out portions of 1.50 and 1.47, eliminating sonewconn3() and always deriving the credential for a newly accepted connection from the listen socket. Previously, the selection of the credential depended on the protocol: UNIX domain sockets would use the connecting process's credential, and protocols supporting a creation of the socket before the receiving end called accept() would use the listening socket. After this change, it is always the listening credential. Reviewed by: green --- sys/kern/uipc_socket2.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'sys/kern/uipc_socket2.c') diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 122fcda..ae6ba02 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -218,16 +218,6 @@ sonewconn(head, connstatus) register struct socket *head; int connstatus; { - - return (sonewconn3(head, connstatus, NULL)); -} - -struct socket * -sonewconn3(head, connstatus, td) - register struct socket *head; - int connstatus; - struct thread *td; -{ register struct socket *so; if (head->so_qlen > 3 * head->so_qlimit / 2) @@ -242,10 +232,7 @@ sonewconn3(head, connstatus, td) so->so_state = head->so_state | SS_NOFDREF; so->so_proto = head->so_proto; so->so_timeo = head->so_timeo; - if (td != NULL) - so->so_cred = crhold(td->td_proc->p_ucred); - else - so->so_cred = crhold(head->so_cred); + so->so_cred = crhold(head->so_cred); if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sotryfree(so); -- cgit v1.1