diff options
author | Igor Mammedov <niallan@gmail.com> | 2007-11-08 11:13:31 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-11-08 11:13:31 -0500 |
commit | 9eae8a8903c3d90283d338fad2cc58f2eb90adcb (patch) | |
tree | 69427c6fe09b8ee7c313c9b97887a98ee84a49dd | |
parent | 63d2583f5a1a0b72fea3f2171f23f0ca8fa556ec (diff) |
[CIFS] Add uid to key description so krb can handle user mounts
Adds uid to key description fro supporting user mounts
and minor formating changes
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Igor Mammedov <niallain@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/cifs_spnego.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c index e142faf2d0ae..ad54a3a6e434 100644 --- a/fs/cifs/cifs_spnego.c +++ b/fs/cifs/cifs_spnego.c | |||
@@ -76,9 +76,10 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo, const char *hostname) | |||
76 | struct key *spnego_key; | 76 | struct key *spnego_key; |
77 | 77 | ||
78 | 78 | ||
79 | /* version + ;ip{4|6}= + address + ;host=hostname + ;sec= + NULL */ | 79 | /* version + ;ip{4|6}= + address + ;host=hostname + |
80 | desc_len = 2 + 5 + 32 + 1 + 5 + strlen(hostname) + | 80 | ;sec= + ;uid= + NULL */ |
81 | strlen(";sec=krb5") + 1; | 81 | desc_len = 4 + 5 + 32 + 1 + 5 + strlen(hostname) + |
82 | strlen(";sec=krb5") + 7 + sizeof(uid_t)*2 + 1; | ||
82 | spnego_key = ERR_PTR(-ENOMEM); | 83 | spnego_key = ERR_PTR(-ENOMEM); |
83 | description = kzalloc(desc_len, GFP_KERNEL); | 84 | description = kzalloc(desc_len, GFP_KERNEL); |
84 | if (description == NULL) | 85 | if (description == NULL) |
@@ -87,7 +88,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo, const char *hostname) | |||
87 | dp = description; | 88 | dp = description; |
88 | /* start with version and hostname portion of UNC string */ | 89 | /* start with version and hostname portion of UNC string */ |
89 | spnego_key = ERR_PTR(-EINVAL); | 90 | spnego_key = ERR_PTR(-EINVAL); |
90 | sprintf(dp, "%2.2x;host=%s;", CIFS_SPNEGO_UPCALL_VERSION, | 91 | sprintf(dp, "0x%2.2x;host=%s;", CIFS_SPNEGO_UPCALL_VERSION, |
91 | hostname); | 92 | hostname); |
92 | dp = description + strlen(description); | 93 | dp = description + strlen(description); |
93 | 94 | ||
@@ -109,6 +110,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo, const char *hostname) | |||
109 | else | 110 | else |
110 | goto out; | 111 | goto out; |
111 | 112 | ||
113 | dp = description + strlen(description); | ||
114 | sprintf(dp, ";uid=0x%x", sesInfo->linux_uid); | ||
115 | |||
112 | cFYI(1, ("key description = %s", description)); | 116 | cFYI(1, ("key description = %s", description)); |
113 | spnego_key = request_key(&cifs_spnego_key_type, description, ""); | 117 | spnego_key = request_key(&cifs_spnego_key_type, description, ""); |
114 | 118 | ||