cifs: Convert struct cifs_ses to use a kuid_t and a kgid_t
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 6 Feb 2013 10:30:39 +0000 (02:30 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 13 Feb 2013 15:28:55 +0000 (07:28 -0800)
Cc: Steve French <smfrench@gmail.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/cifs/cifs_spnego.c
fs/cifs/cifsglob.h
fs/cifs/connect.c

index 086f381d648954c4001542be40b3ba6beffbceb0..10e7747612992bcc25706851c9027762e2fc134d 100644 (file)
@@ -149,10 +149,12 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
                goto out;
 
        dp = description + strlen(description);
-       sprintf(dp, ";uid=0x%x", sesInfo->linux_uid);
+       sprintf(dp, ";uid=0x%x",
+               from_kuid_munged(&init_user_ns, sesInfo->linux_uid));
 
        dp = description + strlen(description);
-       sprintf(dp, ";creduid=0x%x", sesInfo->cred_uid);
+       sprintf(dp, ";creduid=0x%x",
+               from_kuid_munged(&init_user_ns, sesInfo->cred_uid));
 
        if (sesInfo->user_name) {
                dp = description + strlen(description);
index e308e8bd0772dc439f6686534b3bbccafd72e6f5..aaef57beba0e895fc3cc291932b05efc8f2c6750 100644 (file)
@@ -702,8 +702,8 @@ struct cifs_ses {
        char *serverNOS;        /* name of network operating system of server */
        char *serverDomain;     /* security realm of server */
        __u64 Suid;             /* remote smb uid  */
-       uid_t linux_uid;        /* overriding owner of files on the mount */
-       uid_t cred_uid;         /* owner of credentials */
+       kuid_t linux_uid;       /* overriding owner of files on the mount */
+       kuid_t cred_uid;        /* owner of credentials */
        unsigned int capabilities;
        char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for
                                TCP names - will ipv6 and sctp addresses fit? */
index 01279b8f5d1fb955a292e9e0b7cccacb2986bde3..067b0e169fe4ddbfab0402022cd5c38ba27bcf44 100644 (file)
@@ -2271,7 +2271,7 @@ static int match_session(struct cifs_ses *ses, struct smb_vol *vol)
 {
        switch (ses->server->secType) {
        case Kerberos:
-               if (vol->cred_uid != ses->cred_uid)
+               if (!uid_eq(vol->cred_uid, ses->cred_uid))
                        return 0;
                break;
        default: