hadoop-hdfs-dev 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-10455) Logging the username when deny the setOwner operation
Date Tue, 24 May 2016 23:18:12 GMT
Tianyin Xu created HDFS-10455:

             Summary: Logging the username when deny the setOwner operation
                 Key: HDFS-10455
                 URL: https://issues.apache.org/jira/browse/HDFS-10455
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: namenode
    Affects Versions: 2.7.2
            Reporter: Tianyin Xu
            Priority: Minor
         Attachments: HDFS-10455.000.patch

The attached patch appends the user name in the logging when the setOwner operation is denied
due to insufficient permissions on this user (based on his/her name). 

The same practice is used in {{FSPermissionChecker}} such as {{checkOwner()}} and {{checkSuperuserPrivilege()}}.

       if (!pc.isSuperUser()) {
         if (username != null && !pc.getUser().equals(username)) {
-          throw new AccessControlException("Non-super user cannot change owner");
+          throw new AccessControlException("User " + pc.getUser()
+              + " is not a super user (non-super user cannot change owner).");
         if (group != null && !pc.containsGroup(group)) {
-          throw new AccessControlException("User does not belong to " + group);
+          throw new AccessControlException("User " + pc.getUser()
+              + " does not belong to " + group);


This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org

View raw message