diff options
author | Andrew Elble <aweits@rit.edu> | 2016-06-15 12:52:08 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-07-13 15:32:47 -0400 |
commit | dedeb13f9efb4439a37cf56317c8f25860dd667b (patch) | |
tree | 96b079f3a0e488e5139ed9f0e43202449eb89443 /fs/nfsd | |
parent | 1adf0c5a4451a100cd9253c1d6e3ca77f4a5a98b (diff) |
nfsd: allow mach_creds_match to be used more broadly
Rename mach_creds_match() to nfsd4_mach_creds_match() and un-staticify
Signed-off-by: Andrew Elble <aweits@rit.edu>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 14 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 70d0b9b33031..ef583507d276 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1972,7 +1972,7 @@ static bool svc_rqst_integrity_protected(struct svc_rqst *rqstp) | |||
1972 | service == RPC_GSS_SVC_PRIVACY; | 1972 | service == RPC_GSS_SVC_PRIVACY; |
1973 | } | 1973 | } |
1974 | 1974 | ||
1975 | static bool mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp) | 1975 | bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp) |
1976 | { | 1976 | { |
1977 | struct svc_cred *cr = &rqstp->rq_cred; | 1977 | struct svc_cred *cr = &rqstp->rq_cred; |
1978 | 1978 | ||
@@ -2424,7 +2424,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, | |||
2424 | status = nfserr_inval; | 2424 | status = nfserr_inval; |
2425 | goto out; | 2425 | goto out; |
2426 | } | 2426 | } |
2427 | if (!mach_creds_match(conf, rqstp)) { | 2427 | if (!nfsd4_mach_creds_match(conf, rqstp)) { |
2428 | status = nfserr_wrong_cred; | 2428 | status = nfserr_wrong_cred; |
2429 | goto out; | 2429 | goto out; |
2430 | } | 2430 | } |
@@ -2676,7 +2676,7 @@ nfsd4_create_session(struct svc_rqst *rqstp, | |||
2676 | 2676 | ||
2677 | if (conf) { | 2677 | if (conf) { |
2678 | status = nfserr_wrong_cred; | 2678 | status = nfserr_wrong_cred; |
2679 | if (!mach_creds_match(conf, rqstp)) | 2679 | if (!nfsd4_mach_creds_match(conf, rqstp)) |
2680 | goto out_free_conn; | 2680 | goto out_free_conn; |
2681 | cs_slot = &conf->cl_cs_slot; | 2681 | cs_slot = &conf->cl_cs_slot; |
2682 | status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0); | 2682 | status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0); |
@@ -2692,7 +2692,7 @@ nfsd4_create_session(struct svc_rqst *rqstp, | |||
2692 | goto out_free_conn; | 2692 | goto out_free_conn; |
2693 | } | 2693 | } |
2694 | status = nfserr_wrong_cred; | 2694 | status = nfserr_wrong_cred; |
2695 | if (!mach_creds_match(unconf, rqstp)) | 2695 | if (!nfsd4_mach_creds_match(unconf, rqstp)) |
2696 | goto out_free_conn; | 2696 | goto out_free_conn; |
2697 | cs_slot = &unconf->cl_cs_slot; | 2697 | cs_slot = &unconf->cl_cs_slot; |
2698 | status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0); | 2698 | status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0); |
@@ -2801,7 +2801,7 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, | |||
2801 | if (!session) | 2801 | if (!session) |
2802 | goto out_no_session; | 2802 | goto out_no_session; |
2803 | status = nfserr_wrong_cred; | 2803 | status = nfserr_wrong_cred; |
2804 | if (!mach_creds_match(session->se_client, rqstp)) | 2804 | if (!nfsd4_mach_creds_match(session->se_client, rqstp)) |
2805 | goto out; | 2805 | goto out; |
2806 | status = nfsd4_map_bcts_dir(&bcts->dir); | 2806 | status = nfsd4_map_bcts_dir(&bcts->dir); |
2807 | if (status) | 2807 | if (status) |
@@ -2848,7 +2848,7 @@ nfsd4_destroy_session(struct svc_rqst *r, | |||
2848 | if (!ses) | 2848 | if (!ses) |
2849 | goto out_client_lock; | 2849 | goto out_client_lock; |
2850 | status = nfserr_wrong_cred; | 2850 | status = nfserr_wrong_cred; |
2851 | if (!mach_creds_match(ses->se_client, r)) | 2851 | if (!nfsd4_mach_creds_match(ses->se_client, r)) |
2852 | goto out_put_session; | 2852 | goto out_put_session; |
2853 | status = mark_session_dead_locked(ses, 1 + ref_held_by_me); | 2853 | status = mark_session_dead_locked(ses, 1 + ref_held_by_me); |
2854 | if (status) | 2854 | if (status) |
@@ -3087,7 +3087,7 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta | |||
3087 | status = nfserr_stale_clientid; | 3087 | status = nfserr_stale_clientid; |
3088 | goto out; | 3088 | goto out; |
3089 | } | 3089 | } |
3090 | if (!mach_creds_match(clp, rqstp)) { | 3090 | if (!nfsd4_mach_creds_match(clp, rqstp)) { |
3091 | clp = NULL; | 3091 | clp = NULL; |
3092 | status = nfserr_wrong_cred; | 3092 | status = nfserr_wrong_cred; |
3093 | goto out; | 3093 | goto out; |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index d9554813e58a..74342a7c208a 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -654,6 +654,8 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | |||
654 | 654 | ||
655 | } | 655 | } |
656 | 656 | ||
657 | |||
658 | bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); | ||
657 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | 659 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); |
658 | int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, | 660 | int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, |
659 | struct nfsd4_compoundargs *); | 661 | struct nfsd4_compoundargs *); |