aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
committerJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
commitcbacc2c7f066a1e01b33b0e27ae5efbf534bc2db (patch)
tree90d1093131d2a3543a8b3b1f3364e7c6f4081a93 /net/unix
parent4a6908a3a050aacc9c3a2f36b276b46c0629ad91 (diff)
parent74192246910ff4fb95309ba1a683215644beeb62 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 66d5ac4773ab..b152e2b9b988 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
474out_unlock: 473out_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;