aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-06-24 16:33:54 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-09 12:09:43 -0400
commit6738b2512bdf93ffbefe108b38a9165d5a718c3f (patch)
treeb294dc4583e71a58fe328ee8c25783a8c48bb02a /fs/nfs
parentdd07c94750cb1ee4449fb0db06623e1865b3e26e (diff)
NFS4: Set security flavor default for NFSv4 mounts like other defaults
Set the default security flavor when we set the other mount option default values for NFSv4. This cleans up the NFSv4 mount option parsing path to look like the NFSv2/v3 one. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/super.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2f7e7f20c917..4bbdbf6de417 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2125,6 +2125,8 @@ static int nfs4_validate_mount_data(void *options,
2125 args->acdirmin = NFS_DEF_ACDIRMIN; 2125 args->acdirmin = NFS_DEF_ACDIRMIN;
2126 args->acdirmax = NFS_DEF_ACDIRMAX; 2126 args->acdirmax = NFS_DEF_ACDIRMAX;
2127 args->nfs_server.port = NFS_PORT; /* 2049 unless user set port= */ 2127 args->nfs_server.port = NFS_PORT; /* 2049 unless user set port= */
2128 args->auth_flavors[0] = RPC_AUTH_UNIX;
2129 args->auth_flavor_len = 0;
2128 2130
2129 switch (data->version) { 2131 switch (data->version) {
2130 case 1: 2132 case 1:
@@ -2140,18 +2142,13 @@ static int nfs4_validate_mount_data(void *options,
2140 &args->nfs_server.address)) 2142 &args->nfs_server.address))
2141 goto out_no_address; 2143 goto out_no_address;
2142 2144
2143 switch (data->auth_flavourlen) { 2145 if (data->auth_flavourlen) {
2144 case 0: 2146 if (data->auth_flavourlen > 1)
2145 args->auth_flavors[0] = RPC_AUTH_UNIX; 2147 goto out_inval_auth;
2146 break;
2147 case 1:
2148 if (copy_from_user(&args->auth_flavors[0], 2148 if (copy_from_user(&args->auth_flavors[0],
2149 data->auth_flavours, 2149 data->auth_flavours,
2150 sizeof(args->auth_flavors[0]))) 2150 sizeof(args->auth_flavors[0])))
2151 return -EFAULT; 2151 return -EFAULT;
2152 break;
2153 default:
2154 goto out_inval_auth;
2155 } 2152 }
2156 2153
2157 c = strndup_user(data->hostname.data, NFS4_MAXNAMLEN); 2154 c = strndup_user(data->hostname.data, NFS4_MAXNAMLEN);
@@ -2203,15 +2200,8 @@ static int nfs4_validate_mount_data(void *options,
2203 2200
2204 nfs_validate_transport_protocol(args); 2201 nfs_validate_transport_protocol(args);
2205 2202
2206 switch (args->auth_flavor_len) { 2203 if (args->auth_flavor_len > 1)
2207 case 0:
2208 args->auth_flavors[0] = RPC_AUTH_UNIX;
2209 break;
2210 case 1:
2211 break;
2212 default:
2213 goto out_inval_auth; 2204 goto out_inval_auth;
2214 }
2215 2205
2216 if (args->client_address == NULL) 2206 if (args->client_address == NULL)
2217 goto out_no_client_address; 2207 goto out_no_client_address;