From patchwork Thu Jul 14 02:44:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 9228823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 81B7260868 for ; Thu, 14 Jul 2016 02:44:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72D5F27FB7 for ; Thu, 14 Jul 2016 02:44:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 678F928111; Thu, 14 Jul 2016 02:44:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BBD627FB7 for ; Thu, 14 Jul 2016 02:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751040AbcGNCoi (ORCPT ); Wed, 13 Jul 2016 22:44:38 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34637 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750887AbcGNCoh (ORCPT ); Wed, 13 Jul 2016 22:44:37 -0400 Received: by mail-pf0-f194.google.com with SMTP id g202so4085932pfb.1 for ; Wed, 13 Jul 2016 19:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=tt6y07WUl04SNHiYpPxWfEkc5zNH6Nc6RMqRrgh1nYM=; b=u/W/cqc68DvKDA5iPYol4zPZwG6theKcqf+DkbDzgOJfrScc09OIY2VKuRDVULKSxQ 9/TnHRUgujl+b2fow4WUMCt4XpMLyYtWRExnaWwGFU+fuNHhTVZGX4ctPrhSWHGp6VfS QnLKJhbGs2PB+SFhz784J7k1YxNvlUx37ItFsjEqo8LzDiaDScvxw/Gj5YzPU1dShjZr GlxEsMecbE4bt4YM4SCcIX1EYRhiN85JQBr0aijcKFquXUKAbLs0eYcEe87Noqs09TL2 wuWn2lQalEE69irHLThDtmCAs61vwI9yK4RchdhnssqFepDx1GYhMsLDazyEGRPzNDhb m12g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=tt6y07WUl04SNHiYpPxWfEkc5zNH6Nc6RMqRrgh1nYM=; b=KM+7emk57snDBR/B3DE3+884TRsppqX6CQSL1E+c8OeH3npMj6wUZVyQ8prPBexD5A R27A8LE1NF9v/s2fT0356tlEpHKHwACTbrm4j1AGD5dT/DmSLQ7qQ88muWJYJwX/QB9H p6j+X1lamm7VtDJrifV1FOt5WH0LP8NVcS1mI7lYD3pbur5iS7IFhSNeJ/zhXoZs9+oy 3imFUx3qqH8wYJ8bTylb9efzuP8UCBdWeVRsiW57i8XfWWLfzNg9PmcZa4gfbaBlXqp5 TvOFP1Mse3pMYheQ96BQLbxJ7lu02Sbiuc/RLdiRtGLvp6GhgpwsbmUKofkJAyH2aalg vxRQ== X-Gm-Message-State: ALyK8tJPoLgsFtxuBTO++b8B6dWkUIaYcoQwAvwcBAxktMyBFIu88YG7wLdnw/ulNxDJUQ== X-Received: by 10.98.28.142 with SMTP id c136mr8709923pfc.131.1468464276853; Wed, 13 Jul 2016 19:44:36 -0700 (PDT) Received: from [192.168.99.7] ([191.101.234.188]) by smtp.googlemail.com with ESMTPSA id uj5sm50090pac.28.2016.07.13.19.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 19:44:36 -0700 (PDT) To: Steve Dickson Cc: linux-nfs@vger.kernel.org, Kinglong Mee From: Kinglong Mee Subject: [PATCH] Gssd: Avoid compiling warning and simplify codes Message-ID: <839f5fbe-0dea-ea36-d38f-15d0a997edbb@gmail.com> Date: Thu, 14 Jul 2016 10:44:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes -pipe -g -O2 -g -O2 -MT gssd-krb5_util.o -MD -MP -MF .deps/gssd-krb5_util.Tpo -c -o gssd-krb5_util.o `test -f 'krb5_util.c' || echo './'`krb5_util.c krb5_util.c: In function ‘gssd_acquire_user_cred’: krb5_util.c:1389:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (get_verbosity() > 0) ^~ krb5_util.c:1392:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ ret = -1; Signed-off-by: Kinglong Mee --- utils/gssd/krb5_util.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index c1e4d2b..b64818a 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -1380,17 +1380,17 @@ gssd_acquire_user_cred(gss_cred_id_t *gss_cred) int ret; ret = gssd_acquire_krb5_cred(gss_cred); + if (ret) + return ret; /* force validation of cred to check for expiry */ - if (ret == 0) { - maj_stat = gss_inquire_cred(&min_stat, *gss_cred, + maj_stat = gss_inquire_cred(&min_stat, *gss_cred, NULL, NULL, NULL, NULL); - if (maj_stat != GSS_S_COMPLETE) { - if (get_verbosity() > 0) - pgsserr("gss_inquire_cred", - maj_stat, min_stat, &krb5oid); - ret = -1; - } + if (maj_stat != GSS_S_COMPLETE) { + if (get_verbosity() > 0) + pgsserr("gss_inquire_cred", + maj_stat, min_stat, &krb5oid); + ret = -1; } return ret;