From commits-return-6885-apmail-sentry-commits-archive=sentry.apache.org@sentry.incubator.apache.org Tue Jun 23 10:58:02 2015 Return-Path: X-Original-To: apmail-sentry-commits-archive@minotaur.apache.org Delivered-To: apmail-sentry-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B1FB180E1 for ; Tue, 23 Jun 2015 10:58:02 +0000 (UTC) Received: (qmail 30324 invoked by uid 500); 23 Jun 2015 10:58:02 -0000 Delivered-To: apmail-sentry-commits-archive@sentry.apache.org Received: (qmail 30274 invoked by uid 500); 23 Jun 2015 10:58:02 -0000 Mailing-List: contact commits-help@sentry.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sentry.incubator.apache.org Delivered-To: mailing list commits@sentry.incubator.apache.org Received: (qmail 30265 invoked by uid 99); 23 Jun 2015 10:58:02 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2015 10:58:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E72A71A5C6B for ; Tue, 23 Jun 2015 10:58:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.77 X-Spam-Level: * X-Spam-Status: No, score=1.77 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id k1huD7WGNUTl for ; Tue, 23 Jun 2015 10:58:01 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 0609843E3E for ; Tue, 23 Jun 2015 10:58:00 +0000 (UTC) Received: (qmail 30243 invoked by uid 99); 23 Jun 2015 10:58:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2015 10:58:00 +0000 Date: Tue, 23 Jun 2015 10:58:00 +0000 (UTC) From: "Dapeng Sun (JIRA)" To: commits@sentry.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SENTRY-777) SentryServiceIntegrationBase#after() should be run under client subject MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SENTRY-777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dapeng Sun updated SENTRY-777: ------------------------------ Attachment: SENTRY-777.001.patch > SentryServiceIntegrationBase#after() should be run under client subject > ----------------------------------------------------------------------- > > Key: SENTRY-777 > URL: https://issues.apache.org/jira/browse/SENTRY-777 > Project: Sentry > Issue Type: Bug > Affects Versions: 1.5.0 > Reporter: Dapeng Sun > Assignee: Dapeng Sun > Fix For: 1.6.0 > > Attachments: SENTRY-777.001.patch > > > {noformat} > @After > public void after() throws Exception { > if (client != null) { > Set tRoles = client.listRoles(ADMIN_USER); > if (tRoles != null) { > for (TSentryRole tRole : tRoles) { > client.dropRole(ADMIN_USER, tRole.getRoleName()); > } > } > client.close(); > } > policyFilePath.delete(); > } > {noformat} > * client in {{after()}} isn't run under client subject, if client need client subject, such as in Kerberos mode, it may throw an exception. > * {{policyFilePath.delete();}} may not execute if the client throws an exception when it does operations like clean db or close, there should be a try-catch-finally statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)