From 74c988116231129320925a665e7420e513faaabe Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 7 Sep 2013 13:26:57 -0400 Subject: NFS: Clean up the auth flavour array mess What is the point of having a 'auth_flavor_len' field, if it is always set to 1, and can't be used to determine if the user has selected an auth flavour? This cleanup goes back to using auth_flavor_len for its original intended purpose, and gets rid of the ad-hoc replacements. Signed-off-by: Trond Myklebust --- fs/nfs/nfs4super.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/nfs/nfs4super.c') diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 5dbe2d269210..4ad837cf4786 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -253,8 +253,10 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name, dfprintk(MOUNT, "--> nfs4_try_mount()\n"); - if (data->auth_flavors[0] == RPC_AUTH_MAXFLAVOR) + if (data->auth_flavor_len < 1) { data->auth_flavors[0] = RPC_AUTH_UNIX; + data->auth_flavor_len = 1; + } export_path = data->nfs_server.export_path; data->nfs_server.export_path = "/"; root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, mount_info, -- cgit v1.2.1 From 5e6b19901b763f502e62b5fd4f583778df983ce7 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 7 Sep 2013 12:58:57 -0400 Subject: NFSv4: Fix security auto-negotiation NFSv4 security auto-negotiation has been broken since commit 4580a92d44e2b21c2254fa5fef0f1bfb43c82318 (NFS: Use server-recommended security flavor by default (NFSv3)) because nfs4_try_mount() will automatically select AUTH_SYS if it sees no auth flavours. Signed-off-by: Trond Myklebust Cc: Chuck Lever --- fs/nfs/nfs4super.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'fs/nfs/nfs4super.c') diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 4ad837cf4786..e26acdd1a645 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -253,10 +253,6 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name, dfprintk(MOUNT, "--> nfs4_try_mount()\n"); - if (data->auth_flavor_len < 1) { - data->auth_flavors[0] = RPC_AUTH_UNIX; - data->auth_flavor_len = 1; - } export_path = data->nfs_server.export_path; data->nfs_server.export_path = "/"; root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, mount_info, -- cgit v1.2.1