Commit 28b25222 authored by Vivek Trivedi's avatar Vivek Trivedi Committed by Greg Kroah-Hartman

nfsd4: fix cr_principal comparison check in same_creds

commit 5559b50a upstream.

This fixes a wrong check for same cr_principal in same_creds

Introduced by 8fbba96e "nfsd4: stricter
cred comparison for setclientid/exchange_id".
Signed-off-by: default avatarVivek Trivedi <vtrivedi018@gmail.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ebe58c7c
...@@ -1215,7 +1215,7 @@ static bool groups_equal(struct group_info *g1, struct group_info *g2) ...@@ -1215,7 +1215,7 @@ static bool groups_equal(struct group_info *g1, struct group_info *g2)
return true; return true;
} }
static int static bool
same_creds(struct svc_cred *cr1, struct svc_cred *cr2) same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
{ {
if ((cr1->cr_flavor != cr2->cr_flavor) if ((cr1->cr_flavor != cr2->cr_flavor)
...@@ -1227,7 +1227,7 @@ same_creds(struct svc_cred *cr1, struct svc_cred *cr2) ...@@ -1227,7 +1227,7 @@ same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
return true; return true;
if (!cr1->cr_principal || !cr2->cr_principal) if (!cr1->cr_principal || !cr2->cr_principal)
return false; return false;
return 0 == strcmp(cr1->cr_principal, cr1->cr_principal); return 0 == strcmp(cr1->cr_principal, cr2->cr_principal);
} }
static void gen_clid(struct nfs4_client *clp) static void gen_clid(struct nfs4_client *clp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment