git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was manufactured by cvs2svn to create tag
[linux-2.6.git]
/
net
/
unix
/
af_unix.c
diff --git
a/net/unix/af_unix.c
b/net/unix/af_unix.c
index
89fb7eb
..
3493439
100644
(file)
--- a/
net/unix/af_unix.c
+++ b/
net/unix/af_unix.c
@@
-405,6
+405,8
@@
static int unix_release_sock (struct sock *sk, int embrion)
mntput(mnt);
}
mntput(mnt);
}
+ clr_vx_info(&sk->sk_vx_info);
+ clr_nx_info(&sk->sk_nx_info);
sock_put(sk);
/* ---- Socket is dead now and most probably destroyed ---- */
sock_put(sk);
/* ---- Socket is dead now and most probably destroyed ---- */
@@
-559,6
+561,10
@@
static struct sock * unix_create1(struct socket *sock)
sock_init_data(sock,sk);
sk_set_owner(sk, THIS_MODULE);
sock_init_data(sock,sk);
sk_set_owner(sk, THIS_MODULE);
+ set_vx_info(&sk->sk_vx_info, current->vx_info);
+ set_nx_info(&sk->sk_nx_info, current->nx_info);
+ sk->sk_xid = vx_current_xid();
+
sk->sk_write_space = unix_write_space;
sk->sk_max_ack_backlog = sysctl_unix_max_dgram_qlen;
sk->sk_destruct = unix_sock_destructor;
sk->sk_write_space = unix_write_space;
sk->sk_max_ack_backlog = sysctl_unix_max_dgram_qlen;
sk->sk_destruct = unix_sock_destructor;
@@
-870,7
+876,7
@@
static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
goto out;
alen = err;
goto out;
alen = err;
- if (
sock->passcred
&& !unix_sk(sk)->addr &&
+ if (
test_bit(SOCK_PASS_CRED, &sock->flags)
&& !unix_sk(sk)->addr &&
(err = unix_autobind(sock)) != 0)
goto out;
(err = unix_autobind(sock)) != 0)
goto out;
@@
-961,7
+967,8
@@
static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
goto out;
addr_len = err;
goto out;
addr_len = err;
- if (sock->passcred && !u->addr && (err = unix_autobind(sock)) != 0)
+ if (test_bit(SOCK_PASS_CRED, &sock->flags)
+ && !u->addr && (err = unix_autobind(sock)) != 0)
goto out;
timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
goto out;
timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
@@
-1295,7
+1302,8
@@
static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
goto out;
}
goto out;
}
- if (sock->passcred && !u->addr && (err = unix_autobind(sock)) != 0)
+ if (test_bit(SOCK_PASS_CRED, &sock->flags)
+ && !u->addr && (err = unix_autobind(sock)) != 0)
goto out;
err = -EMSGSIZE;
goto out;
err = -EMSGSIZE;
@@
-1829,7
+1837,7
@@
static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
case SIOCOUTQ:
amount = atomic_read(&sk->sk_wmem_alloc);
{
case SIOCOUTQ:
amount = atomic_read(&sk->sk_wmem_alloc);
- err = put_user(amount, (int *)arg);
+ err = put_user(amount, (int
__user
*)arg);
break;
case SIOCINQ:
{
break;
case SIOCINQ:
{
@@
-1844,12
+1852,12
@@
static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
if (skb)
amount=skb->len;
spin_unlock(&sk->sk_receive_queue.lock);
if (skb)
amount=skb->len;
spin_unlock(&sk->sk_receive_queue.lock);
- err = put_user(amount, (int *)arg);
+ err = put_user(amount, (int
__user
*)arg);
break;
}
default:
break;
}
default:
- err = dev_ioctl(cmd, (void *)arg);
+ err = dev_ioctl(cmd, (void
__user
*)arg);
break;
}
return err;
break;
}
return err;