diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index eb90f77bb0e2..2775acbca199 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -467,8 +467,7 @@ static int unix_listen(struct socket *sock, int backlog) | |||
467 | sk->sk_state = TCP_LISTEN; | 467 | sk->sk_state = TCP_LISTEN; |
468 | /* set credentials so connect can copy them */ | 468 | /* set credentials so connect can copy them */ |
469 | sk->sk_peercred.pid = task_tgid_vnr(current); | 469 | sk->sk_peercred.pid = task_tgid_vnr(current); |
470 | sk->sk_peercred.uid = current->euid; | 470 | current_euid_egid(&sk->sk_peercred.uid, &sk->sk_peercred.gid); |
471 | sk->sk_peercred.gid = current->egid; | ||
472 | err = 0; | 471 | err = 0; |
473 | 472 | ||
474 | out_unlock: | 473 | out_unlock: |
@@ -1126,8 +1125,7 @@ restart: | |||
1126 | newsk->sk_state = TCP_ESTABLISHED; | 1125 | newsk->sk_state = TCP_ESTABLISHED; |
1127 | newsk->sk_type = sk->sk_type; | 1126 | newsk->sk_type = sk->sk_type; |
1128 | newsk->sk_peercred.pid = task_tgid_vnr(current); | 1127 | newsk->sk_peercred.pid = task_tgid_vnr(current); |
1129 | newsk->sk_peercred.uid = current->euid; | 1128 | current_euid_egid(&newsk->sk_peercred.uid, &newsk->sk_peercred.gid); |
1130 | newsk->sk_peercred.gid = current->egid; | ||
1131 | newu = unix_sk(newsk); | 1129 | newu = unix_sk(newsk); |
1132 | newsk->sk_sleep = &newu->peer_wait; | 1130 | newsk->sk_sleep = &newu->peer_wait; |
1133 | otheru = unix_sk(other); | 1131 | otheru = unix_sk(other); |
@@ -1187,8 +1185,9 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb) | |||
1187 | unix_peer(ska)=skb; | 1185 | unix_peer(ska)=skb; |
1188 | unix_peer(skb)=ska; | 1186 | unix_peer(skb)=ska; |
1189 | ska->sk_peercred.pid = skb->sk_peercred.pid = task_tgid_vnr(current); | 1187 | ska->sk_peercred.pid = skb->sk_peercred.pid = task_tgid_vnr(current); |
1190 | ska->sk_peercred.uid = skb->sk_peercred.uid = current->euid; | 1188 | current_euid_egid(&skb->sk_peercred.uid, &skb->sk_peercred.gid); |
1191 | ska->sk_peercred.gid = skb->sk_peercred.gid = current->egid; | 1189 | ska->sk_peercred.uid = skb->sk_peercred.uid; |
1190 | ska->sk_peercred.gid = skb->sk_peercred.gid; | ||
1192 | 1191 | ||
1193 | if (ska->sk_type != SOCK_DGRAM) { | 1192 | if (ska->sk_type != SOCK_DGRAM) { |
1194 | ska->sk_state = TCP_ESTABLISHED; | 1193 | ska->sk_state = TCP_ESTABLISHED; |