export.c (2ea2209f073dc7049bd285b4f5dbc0aa273f9746) | export.c (32c1eb0cd7ee00b5eb7b6f7059c635fbc1052966) |
---|---|
1#define MSNFS /* HACK HACK */ 2/* 3 * linux/fs/nfsd/export.c 4 * 5 * NFS exporting and validation. 6 * 7 * We maintain a list of clients, each of which has a list of 8 * exports. To export an fs to a given client, you first have --- 1214 unchanged lines hidden (view full) --- 1223 exp = exp_get_by_name(clp, ek->ek_mnt, ek->ek_dentry, reqp); 1224 cache_put(&ek->h, &svc_expkey_cache); 1225 1226 if (IS_ERR(exp)) 1227 return ERR_PTR(PTR_ERR(exp)); 1228 return exp; 1229} 1230 | 1#define MSNFS /* HACK HACK */ 2/* 3 * linux/fs/nfsd/export.c 4 * 5 * NFS exporting and validation. 6 * 7 * We maintain a list of clients, each of which has a list of 8 * exports. To export an fs to a given client, you first have --- 1214 unchanged lines hidden (view full) --- 1223 exp = exp_get_by_name(clp, ek->ek_mnt, ek->ek_dentry, reqp); 1224 cache_put(&ek->h, &svc_expkey_cache); 1225 1226 if (IS_ERR(exp)) 1227 return ERR_PTR(PTR_ERR(exp)); 1228 return exp; 1229} 1230 |
1231__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp) 1232{ 1233 struct exp_flavor_info *f; 1234 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; 1235 1236 /* legacy gss-only clients are always OK: */ 1237 if (exp->ex_client == rqstp->rq_gssclient) 1238 return 0; 1239 /* ip-address based client; check sec= export option: */ 1240 for (f = exp->ex_flavors; f < end; f++) { 1241 if (f->pseudoflavor == rqstp->rq_flavor) 1242 return 0; 1243 } 1244 /* defaults in absence of sec= options: */ 1245 if (exp->ex_nflavors == 0) { 1246 if (rqstp->rq_flavor == RPC_AUTH_NULL || 1247 rqstp->rq_flavor == RPC_AUTH_UNIX) 1248 return 0; 1249 } 1250 return nfserr_wrongsec; 1251} 1252 |
|
1231/* 1232 * Uses rq_client and rq_gssclient to find an export; uses rq_client (an 1233 * auth_unix client) if it's available and has secinfo information; 1234 * otherwise, will try to use rq_gssclient. 1235 * 1236 * Called from functions that handle requests; functions that do work on 1237 * behalf of mountd are passed a single client name to use, and should 1238 * use exp_get_by_name() or exp_find(). --- 96 unchanged lines hidden (view full) --- 1335 mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL); 1336 1337 exp = rqst_exp_find(rqstp, FSID_NUM, fsidv); 1338 if (PTR_ERR(exp) == -ENOENT) 1339 return nfserr_perm; 1340 if (IS_ERR(exp)) 1341 return nfserrno(PTR_ERR(exp)); 1342 rv = fh_compose(fhp, exp, exp->ex_dentry, NULL); | 1253/* 1254 * Uses rq_client and rq_gssclient to find an export; uses rq_client (an 1255 * auth_unix client) if it's available and has secinfo information; 1256 * otherwise, will try to use rq_gssclient. 1257 * 1258 * Called from functions that handle requests; functions that do work on 1259 * behalf of mountd are passed a single client name to use, and should 1260 * use exp_get_by_name() or exp_find(). --- 96 unchanged lines hidden (view full) --- 1357 mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL); 1358 1359 exp = rqst_exp_find(rqstp, FSID_NUM, fsidv); 1360 if (PTR_ERR(exp) == -ENOENT) 1361 return nfserr_perm; 1362 if (IS_ERR(exp)) 1363 return nfserrno(PTR_ERR(exp)); 1364 rv = fh_compose(fhp, exp, exp->ex_dentry, NULL); |
1365 if (rv) 1366 goto out; 1367 rv = check_nfsd_access(exp, rqstp); 1368out: |
|
1343 exp_put(exp); 1344 return rv; 1345} 1346 1347/* Iterator */ 1348 1349static void *e_start(struct seq_file *m, loff_t *pos) 1350 __acquires(svc_export_cache.hash_lock) --- 271 unchanged lines hidden --- | 1369 exp_put(exp); 1370 return rv; 1371} 1372 1373/* Iterator */ 1374 1375static void *e_start(struct seq_file *m, loff_t *pos) 1376 __acquires(svc_export_cache.hash_lock) --- 271 unchanged lines hidden --- |