Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
NFS: Change initial mount authflavor only when server returns NFS4ERR_WRONGSEC
NFS: Fix a signed vs. unsigned secinfo bug
Revert "net/sunrpc: Use static const char arrays"

+27 -37
+25 -33
fs/nfs/namespace.c
··· 148 148 return pseudoflavor; 149 149 } 150 150 151 - static rpc_authflavor_t nfs_negotiate_security(const struct dentry *parent, const struct dentry *dentry) 151 + static int nfs_negotiate_security(const struct dentry *parent, 152 + const struct dentry *dentry, 153 + rpc_authflavor_t *flavor) 152 154 { 153 - int status = 0; 154 155 struct page *page; 155 156 struct nfs4_secinfo_flavors *flavors; 156 157 int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); 157 - rpc_authflavor_t flavor = RPC_AUTH_UNIX; 158 + int ret = -EPERM; 158 159 159 160 secinfo = NFS_PROTO(parent->d_inode)->secinfo; 160 161 if (secinfo != NULL) { 161 162 page = alloc_page(GFP_KERNEL); 162 163 if (!page) { 163 - status = -ENOMEM; 164 + ret = -ENOMEM; 164 165 goto out; 165 166 } 166 167 flavors = page_address(page); 167 - status = secinfo(parent->d_inode, &dentry->d_name, flavors); 168 - flavor = nfs_find_best_sec(flavors, dentry->d_inode); 168 + ret = secinfo(parent->d_inode, &dentry->d_name, flavors); 169 + *flavor = nfs_find_best_sec(flavors, dentry->d_inode); 169 170 put_page(page); 170 171 } 171 172 172 - return flavor; 173 - 174 173 out: 175 - status = -ENOMEM; 176 - return status; 174 + return ret; 177 175 } 178 176 179 - static rpc_authflavor_t nfs_lookup_with_sec(struct nfs_server *server, struct dentry *parent, 180 - struct dentry *dentry, struct path *path, 181 - struct nfs_fh *fh, struct nfs_fattr *fattr) 177 + static int nfs_lookup_with_sec(struct nfs_server *server, struct dentry *parent, 178 + struct dentry *dentry, struct path *path, 179 + struct nfs_fh *fh, struct nfs_fattr *fattr, 180 + rpc_authflavor_t *flavor) 182 181 { 183 - rpc_authflavor_t flavor; 184 182 struct rpc_clnt *clone; 185 183 struct rpc_auth *auth; 186 184 int err; 187 185 188 - flavor = nfs_negotiate_security(parent, path->dentry); 189 - if (flavor < 0) 186 + err = nfs_negotiate_security(parent, path->dentry, flavor); 187 + if (err < 0) 190 188 goto out; 191 189 clone = rpc_clone_client(server->client); 192 - auth = rpcauth_create(flavor, clone); 190 + auth = rpcauth_create(*flavor, clone); 193 191 if (!auth) { 194 - flavor = -EIO; 192 + err = -EIO; 195 193 goto out_shutdown; 196 194 } 197 195 err = server->nfs_client->rpc_ops->lookup(clone, parent->d_inode, 198 196 &path->dentry->d_name, 199 197 fh, fattr); 200 - if (err < 0) 201 - flavor = err; 202 198 out_shutdown: 203 199 rpc_shutdown_client(clone); 204 200 out: 205 - return flavor; 201 + return err; 206 202 } 207 203 #else /* CONFIG_NFS_V4 */ 208 - static inline rpc_authflavor_t nfs_lookup_with_sec(struct nfs_server *server, 209 - struct dentry *parent, struct dentry *dentry, 210 - struct path *path, struct nfs_fh *fh, 211 - struct nfs_fattr *fattr) 204 + static inline int nfs_lookup_with_sec(struct nfs_server *server, 205 + struct dentry *parent, struct dentry *dentry, 206 + struct path *path, struct nfs_fh *fh, 207 + struct nfs_fattr *fattr, 208 + rpc_authflavor_t *flavor) 212 209 { 213 210 return -EPERM; 214 211 } ··· 231 234 struct nfs_fh *fh = NULL; 232 235 struct nfs_fattr *fattr = NULL; 233 236 int err; 234 - rpc_authflavor_t flavor = 1; 237 + rpc_authflavor_t flavor = RPC_AUTH_UNIX; 235 238 236 239 dprintk("--> nfs_d_automount()\n"); 237 240 ··· 252 255 err = server->nfs_client->rpc_ops->lookup(server->client, parent->d_inode, 253 256 &path->dentry->d_name, 254 257 fh, fattr); 255 - if (err == -EPERM) { 256 - flavor = nfs_lookup_with_sec(server, parent, path->dentry, path, fh, fattr); 257 - if (flavor < 0) 258 - err = flavor; 259 - else 260 - err = 0; 261 - } 258 + if (err == -EPERM && NFS_PROTO(parent->d_inode)->secinfo != NULL) 259 + err = nfs_lookup_with_sec(server, parent, path->dentry, path, fh, fattr, &flavor); 262 260 dput(parent); 263 261 if (err != 0) { 264 262 mnt = ERR_PTR(err);
+1 -3
fs/nfs/nfs4proc.c
··· 2204 2204 goto out; 2205 2205 } 2206 2206 ret = nfs4_lookup_root(server, fhandle, info); 2207 - if (ret < 0) 2208 - ret = -EAGAIN; 2209 2207 out: 2210 2208 return ret; 2211 2209 } ··· 2224 2226 2225 2227 for (i = 0; i < len; i++) { 2226 2228 status = nfs4_lookup_root_sec(server, fhandle, info, flav_array[i]); 2227 - if (status == 0) 2229 + if (status != -EPERM) 2228 2230 break; 2229 2231 } 2230 2232 if (status == 0)
+1 -1
net/sunrpc/auth_gss/gss_krb5_mech.c
··· 427 427 context_derive_keys_rc4(struct krb5_ctx *ctx) 428 428 { 429 429 struct crypto_hash *hmac; 430 - static const char sigkeyconstant[] = "signaturekey"; 430 + char sigkeyconstant[] = "signaturekey"; 431 431 int slen = strlen(sigkeyconstant) + 1; /* include null terminator */ 432 432 struct hash_desc desc; 433 433 struct scatterlist sg[1];