userns: Convert sock_i_uid to return a kuid_t
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 23 May 2012 23:16:53 +0000 (17:16 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 15 Aug 2012 04:47:34 +0000 (21:47 -0700)
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
include/net/sock.h
net/core/sock.c

index b3730239bf1828bd9fb618b8b8988b37832fe5c3..65c3d62bfa5a9efcc4c4198e47f6b276e5847134 100644 (file)
@@ -1668,7 +1668,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
        write_unlock_bh(&sk->sk_callback_lock);
 }
 
-extern int sock_i_uid(struct sock *sk);
+extern kuid_t sock_i_uid(struct sock *sk);
 extern unsigned long sock_i_ino(struct sock *sk);
 
 static inline struct dst_entry *
index 9c7fe4ff30fcd28d2a96b9603f44048b2f606c1e..5c6a435717e05c68d399ba2c5850f355e40845e7 100644 (file)
@@ -1526,12 +1526,12 @@ void sock_edemux(struct sk_buff *skb)
 }
 EXPORT_SYMBOL(sock_edemux);
 
-int sock_i_uid(struct sock *sk)
+kuid_t sock_i_uid(struct sock *sk)
 {
-       int uid;
+       kuid_t uid;
 
        read_lock_bh(&sk->sk_callback_lock);
-       uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0;
+       uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : GLOBAL_ROOT_UID;
        read_unlock_bh(&sk->sk_callback_lock);
        return uid;
 }