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 C883E200B17 for ; Tue, 17 May 2016 06:55:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C72C7160A16; Tue, 17 May 2016 04:55:14 +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 1B044160A19 for ; Tue, 17 May 2016 06:55:13 +0200 (CEST) Received: (qmail 37599 invoked by uid 500); 17 May 2016 04:55:13 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 37566 invoked by uid 99); 17 May 2016 04:55:12 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2016 04:55:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CE9BF2C1F5C for ; Tue, 17 May 2016 04:55:12 +0000 (UTC) Date: Tue, 17 May 2016 04:55:12 +0000 (UTC) From: "Tianyin Xu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-10416) Empty exception msg in the checking of superuser priviledge in DataNode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 17 May 2016 04:55:15 -0000 [ https://issues.apache.org/jira/browse/HDFS-10416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tianyin Xu updated HDFS-10416: ------------------------------ Attachment: HDFS-10416.000.patch > Empty exception msg in the checking of superuser priviledge in DataNode > ------------------------------------------------------------------------ > > Key: HDFS-10416 > URL: https://issues.apache.org/jira/browse/HDFS-10416 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode > Affects Versions: 2.7.2 > Reporter: Tianyin Xu > Attachments: HDFS-10416.000.patch > > > In {{checkSuperuserPrivilege}} ({{DataNode.java}}), when the check fails, it throws an empty {{AccessControlException}} object which is really confusing for users to understand precisely what happened underneath the "permission denied" error. > {code:title=org.apache.hadoop.hdfs.server.datanode.DataNode|borderStyle=solid} > private void checkSuperuserPrivilege() ... { > ... > // Not a superuser. > throw new AccessControlException(); > } > {code} > (the method is used in a number of DataNode operations like {{refreshNamenodes}}, {{deleteBlockPool}}, {{shutdownDatanode}}, just listing a few). > \\ > As the comparison, if we look at the *exactly same method* implemented for {{NameNode}}: > {code:title=org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker|borderStyle=solid} > public void checkSuperuserPrivilege() ... { > if (!isSuperUser()) { > throw new AccessControlException("Access denied for user " > + getUser() + ". Superuser privilege is required"); > } > } > {code} > The message is much more clear and easier to understand. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org