linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd4: fix cr_principal comparison check in same_creds
@ 2012-07-24 15:48 Vivek Trivedi
  2012-07-24 16:53 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Vivek Trivedi @ 2012-07-24 15:48 UTC (permalink / raw)
  To: J. Bruce Fields, linux-nfs, linux-kernel; +Cc: Vivek Trivedi, Namjae Jeon

This fixes a wrong check for same cr_principal in same_creds

Signed-off-by: Vivek Trivedi <vtrivedi018@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
---
 fs/nfsd/nfs4state.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 94effd5..e8ead04 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1215,7 +1215,7 @@ static bool groups_equal(struct group_info *g1, struct group_info *g2)
 	return true;
 }
 
-static int
+static bool
 same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
 {
 	if ((cr1->cr_flavor != cr2->cr_flavor)
@@ -1227,7 +1227,7 @@ same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
 		return true;
 	if (!cr1->cr_principal || !cr2->cr_principal)
 		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)
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfsd4: fix cr_principal comparison check in same_creds
  2012-07-24 15:48 [PATCH] nfsd4: fix cr_principal comparison check in same_creds Vivek Trivedi
@ 2012-07-24 16:53 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2012-07-24 16:53 UTC (permalink / raw)
  To: Vivek Trivedi; +Cc: linux-nfs, linux-kernel, Namjae Jeon

On Tue, Jul 24, 2012 at 09:18:20PM +0530, Vivek Trivedi wrote:
> This fixes a wrong check for same cr_principal in same_creds

Thanks for the fix.

Looks like I introduced that with
8fbba96e5b327665265ad02b7f331b68536828bf "nfsd4: stricter cred
comparison for setclientid/exchange_id".

Queuing for 3.6, cc'ing stable.

--b.

> 
> Signed-off-by: Vivek Trivedi <vtrivedi018@gmail.com>
> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
> ---
>  fs/nfsd/nfs4state.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 94effd5..e8ead04 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1215,7 +1215,7 @@ static bool groups_equal(struct group_info *g1, struct group_info *g2)
>  	return true;
>  }
>  
> -static int
> +static bool
>  same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
>  {
>  	if ((cr1->cr_flavor != cr2->cr_flavor)
> @@ -1227,7 +1227,7 @@ same_creds(struct svc_cred *cr1, struct svc_cred *cr2)
>  		return true;
>  	if (!cr1->cr_principal || !cr2->cr_principal)
>  		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)
> -- 
> 1.7.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-24 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 15:48 [PATCH] nfsd4: fix cr_principal comparison check in same_creds Vivek Trivedi
2012-07-24 16:53 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).