Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37AA310CE6 for ; Wed, 27 May 2015 00:06:06 +0000 (UTC) Received: (qmail 59819 invoked by uid 500); 27 May 2015 00:06:06 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 59795 invoked by uid 500); 27 May 2015 00:06:06 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 59783 invoked by uid 99); 27 May 2015 00:06:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2015 00:06:05 +0000 Date: Wed, 27 May 2015 00:06:05 +0000 (UTC) From: "Abdelrahman Shettia (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-10528) Hiveserver2 in HTTP mode is not applying auth_to_local rules 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/HIVE-10528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Abdelrahman Shettia updated HIVE-10528: --------------------------------------- Attachment: HIVE-10528.2.patch > Hiveserver2 in HTTP mode is not applying auth_to_local rules > ------------------------------------------------------------ > > Key: HIVE-10528 > URL: https://issues.apache.org/jira/browse/HIVE-10528 > Project: Hive > Issue Type: Bug > Components: HiveServer2 > Affects Versions: 1.0.0, 1.2.0, 1.1.0, 1.3.0 > Environment: Centos 6 > Reporter: Abdelrahman Shettia > Assignee: Abdelrahman Shettia > Attachments: HIVE-10528.1.patch, HIVE-10528.1.patch, HIVE-10528.2.patch > > > PROBLEM: Authenticating to HS2 in HTTP mode with Kerberos, auth_to_local mappings do not get applied. Because of this various permissions checks which rely on the local cluster name for a user are going to fail. > STEPS TO REPRODUCE: > 1. Create kerberos cluster and HS2 in HTTP mode > 2. Create a new user, test, along with a kerberos principal for this user > 3. Create a separate principal, mapped-test > 4. Create an auth_to_local rule to make sure that mapped-test is mapped to test > 5. As the test user, connect to HS2 with beeline and create a simple table: > {code} > CREATE TABLE permtest (field1 int); > {code} > There is no need to load anything into this table. > 6. Establish that it works as the test user: > {code} > show create table permtest; > {code} > 7. Drop the test identity and become mapped-test > 8. Re-connect to HS2 with beeline, re-run the above command: > {code} > show create table permtest; > {code} > You will find that when this is done in HTTP mode, you will get an HDFS error (because of StorageBasedAuthorization doing a HDFS permissions check) and the user will be mapped-test and NOT test as it should be. > ANALYSIS: This appears to be HTTP specific and the problem seems to come in {{ThriftHttpServlet$HttpKerberosServerAction.getPrincipalWithoutRealmAndHost()}}: > {code} > try { > fullKerberosName = ShimLoader.getHadoopShims().getKerberosNameShim(fullPrincipal); > } catch (IOException e) { > throw new HttpAuthenticationException(e); > } > return fullKerberosName.getServiceName(); > {code} > getServiceName applies no auth_to_local rules. Seems like maybe this should be getShortName()? -- This message was sent by Atlassian JIRA (v6.3.4#6332)