Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6D67B200BC3 for ; Fri, 4 Nov 2016 03:59:15 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6BEBB160B0B; Fri, 4 Nov 2016 02:59:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B29B8160AFF for ; Fri, 4 Nov 2016 03:59:14 +0100 (CET) Received: (qmail 62353 invoked by uid 500); 4 Nov 2016 02:59:13 -0000 Mailing-List: contact commits-help@ranger.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ranger.incubator.apache.org Delivered-To: mailing list commits@ranger.incubator.apache.org Received: (qmail 62344 invoked by uid 99); 4 Nov 2016 02:59:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 02:59:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 31617C0957 for ; Fri, 4 Nov 2016 02:59:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id QPrTC-Ume50m for ; Fri, 4 Nov 2016 02:59:10 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id DDEF55FD01 for ; Fri, 4 Nov 2016 02:59:09 +0000 (UTC) Received: (qmail 60043 invoked by uid 99); 4 Nov 2016 02:57:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2016 02:57:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E1FDEE03D1; Fri, 4 Nov 2016 02:57:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bosco@apache.org To: commits@ranger.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-ranger git commit: RANGER-1187:call pam_end before exit Date: Fri, 4 Nov 2016 02:57:36 +0000 (UTC) archived-at: Fri, 04 Nov 2016 02:59:15 -0000 Repository: incubator-ranger Updated Branches: refs/heads/master 92d20fe1d -> 85f272920 RANGER-1187:call pam_end before exit Signed-off-by: Don Bosco Durai Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/85f27292 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/85f27292 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/85f27292 Branch: refs/heads/master Commit: 85f27292053d2a08c16b61ac40b4088d55da5d85 Parents: 92d20fe Author: zhangqiang2 Authored: Fri Oct 28 18:15:59 2016 +0800 Committer: Don Bosco Durai Committed: Thu Nov 3 19:56:19 2016 -0700 ---------------------------------------------------------------------- unixauthpam/src/main/c/pamCredValidator.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/85f27292/unixauthpam/src/main/c/pamCredValidator.c ---------------------------------------------------------------------- diff --git a/unixauthpam/src/main/c/pamCredValidator.c b/unixauthpam/src/main/c/pamCredValidator.c index ab19080..df84a3e 100644 --- a/unixauthpam/src/main/c/pamCredValidator.c +++ b/unixauthpam/src/main/c/pamCredValidator.c @@ -71,12 +71,18 @@ int main(int ac, char **av, char **ev) if (retval != PAM_SUCCESS) { /* why expose this? */ fprintf(stdout, "FAILED: [%s] does not exists.\n", username) ; + if (pamh) { + pam_end(pamh, retval); + } exit(1); } retval = pam_authenticate(pamh, 0); if (retval != PAM_SUCCESS) { fprintf(stdout, "FAILED: Password did not match.\n") ; + if (pamh) { + pam_end(pamh, retval); + } exit(1); } @@ -84,12 +90,18 @@ int main(int ac, char **av, char **ev) retval = pam_acct_mgmt(pamh, 0); if (retval != PAM_SUCCESS) { fprintf(stdout, "FAILED: [%s] is not authorized.\n", username) ; + if (pamh) { + pam_end(pamh, retval); + } exit(1); } /* establish the requested credentials */ if ((retval = pam_setcred(pamh, PAM_ESTABLISH_CRED)) != PAM_SUCCESS) { fprintf(stdout, "FAILED: Error setting credentials for [%s].\n", username) ; + if (pamh) { + pam_end(pamh, retval); + } exit(1); }