hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tianyin Xu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-10416) Empty exception msg in the checking of superuser priviledge in DataNode
Date Tue, 17 May 2016 02:37:12 GMT
Tianyin Xu created HDFS-10416:
---------------------------------

             Summary: 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


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


Mime
View raw message