Commit f944f959 authored by Ulrich Drepper's avatar Ulrich Drepper Committed by Stephen Hemminger

[NET]: Use task->tgid instead of task->pid in SCM credentials code.

parent 579d5c49
......@@ -39,7 +39,7 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
memset(scm, 0, sizeof(*scm));
scm->creds.uid = current->uid;
scm->creds.gid = current->gid;
scm->creds.pid = current->pid;
scm->creds.pid = current->tgid;
if (msg->msg_controllen <= 0)
return 0;
return __scm_send(sock, msg, scm);
......
......@@ -448,7 +448,7 @@ static int unix_listen(struct socket *sock, int backlog)
sk->sk_max_ack_backlog = backlog;
sk->sk_state = TCP_LISTEN;
/* set credentials so connect can copy them */
sk->sk_peercred.pid = current->pid;
sk->sk_peercred.pid = current->tgid;
sk->sk_peercred.uid = current->euid;
sk->sk_peercred.gid = current->egid;
err = 0;
......@@ -983,7 +983,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
unix_peer(newsk) = sk;
newsk->sk_state = TCP_ESTABLISHED;
newsk->sk_type = SOCK_STREAM;
newsk->sk_peercred.pid = current->pid;
newsk->sk_peercred.pid = current->tgid;
newsk->sk_peercred.uid = current->euid;
newsk->sk_peercred.gid = current->egid;
newu = unix_sk(newsk);
......@@ -1045,7 +1045,7 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb)
sock_hold(skb);
unix_peer(ska)=skb;
unix_peer(skb)=ska;
ska->sk_peercred.pid = skb->sk_peercred.pid = current->pid;
ska->sk_peercred.pid = skb->sk_peercred.pid = current->tgid;
ska->sk_peercred.uid = skb->sk_peercred.uid = current->euid;
ska->sk_peercred.gid = skb->sk_peercred.gid = current->egid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment