diff options
author | Andy Adamson <andros@citi.umich.edu> | 2007-07-17 07:04:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:08 -0400 |
commit | 32c1eb0cd7ee00b5eb7b6f7059c635fbc1052966 (patch) | |
tree | c1a15e47d2dd93417b38d374346332809d461bda /fs/nfsd/nfssvc.c | |
parent | 6c0a654dceaa4342270306de77eadb0173dfb58a (diff) |
knfsd: nfsd4: return nfserr_wrongsec
Make the first actual use of the secinfo information by using it to return
nfserr_wrongsec when an export is found that doesn't allow the flavor used on
this request.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 5c8192bcbced..a8c89ae4c743 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -494,6 +494,15 @@ out: | |||
494 | module_put_and_exit(0); | 494 | module_put_and_exit(0); |
495 | } | 495 | } |
496 | 496 | ||
497 | static __be32 map_new_errors(u32 vers, __be32 nfserr) | ||
498 | { | ||
499 | if (nfserr == nfserr_jukebox && vers == 2) | ||
500 | return nfserr_dropit; | ||
501 | if (nfserr == nfserr_wrongsec && vers < 4) | ||
502 | return nfserr_acces; | ||
503 | return nfserr; | ||
504 | } | ||
505 | |||
497 | int | 506 | int |
498 | nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) | 507 | nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) |
499 | { | 508 | { |
@@ -536,6 +545,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) | |||
536 | 545 | ||
537 | /* Now call the procedure handler, and encode NFS status. */ | 546 | /* Now call the procedure handler, and encode NFS status. */ |
538 | nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp); | 547 | nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp); |
548 | nfserr = map_new_errors(rqstp->rq_vers, nfserr); | ||
539 | if (nfserr == nfserr_jukebox && rqstp->rq_vers == 2) | 549 | if (nfserr == nfserr_jukebox && rqstp->rq_vers == 2) |
540 | nfserr = nfserr_dropit; | 550 | nfserr = nfserr_dropit; |
541 | if (nfserr == nfserr_dropit) { | 551 | if (nfserr == nfserr_dropit) { |