From patchwork Tue Jul 24 15:48:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Trivedi X-Patchwork-Id: 1231831 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B8AABDF25A for ; Tue, 24 Jul 2012 15:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755754Ab2GXPst (ORCPT ); Tue, 24 Jul 2012 11:48:49 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:38840 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755740Ab2GXPsr (ORCPT ); Tue, 24 Jul 2012 11:48:47 -0400 Received: by ghrr11 with SMTP id r11so6792714ghr.19 for ; Tue, 24 Jul 2012 08:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=vlWljg5K5UEfx7PxnxRbcSHXTPzd7Z4eTvfBCdBJm7E=; b=q0c/fC6nFB2H7yPcLLfZx3/uKPEr7f89l0M/Nf5cQ7+X12QUtcWTJtWoucxNyCG/rf hxvzD8YibRVWEESJ90x26lwPp04A2TvauZoHD9FV630RaO6DMvbJB2Ou6gP8mn9rTb+p Vr1erbXB3OHb7qIrGxTypOd1w5FBx7RbJmbPT14uAfrtBttDsSZ1ZWeL917pqbmSxnd6 Ovber0zKx8J9N8WCLPpxK524gHVohQ5xLXy50aXTylij8PuszMadsb5umgBzhvIbRKPf na36MxlYoeO9tQd/63u8o8JoNLG/kBmUm82D1jIeN1G7sEZzyfBr/RIXKhovTg1b/T3G lHWg== Received: by 10.68.212.138 with SMTP id nk10mr46001530pbc.93.1343144926749; Tue, 24 Jul 2012 08:48:46 -0700 (PDT) Received: from localhost.localdomain ([182.68.247.23]) by mx.google.com with ESMTPS id sk5sm12398411pbc.7.2012.07.24.08.48.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 08:48:45 -0700 (PDT) From: Vivek Trivedi To: "J. Bruce Fields" , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vivek Trivedi , Namjae Jeon Subject: [PATCH] nfsd4: fix cr_principal comparison check in same_creds Date: Tue, 24 Jul 2012 21:18:20 +0530 Message-Id: <1343144900-4522-1-git-send-email-vtrivedi018@gmail.com> X-Mailer: git-send-email 1.7.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This fixes a wrong check for same cr_principal in same_creds Signed-off-by: Vivek Trivedi Signed-off-by: Namjae Jeon --- 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)