[ 
https://issues.apache.org/jira/browse/HDFS-13626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

luhuachao updated HDFS-13626:
-----------------------------
    Description: 
when do the chown operation on target file /tmp/test with user 'root' to user 
'hive', the log displays 'User hive is not a super user' ;This appropriate log 
here should be 'User root is not a super user'
{code:java}
[root@lhccmh1 ~]# hdfs dfs -ls /tmp/test
rw-rr- 3 root hdfs 0 2018-05-28 10:33 /tmp/test
[root@lhccmh1 ~]# hdfs dfs -chown hive /tmp/test
chown: changing ownership of '/tmp/test': User hive is not a super user 
(non-super user cannot change owner).{code}
The last version patch of issue HDFS-10455 use username but not pc.getUser() in 
logs; 
{code:java}
 
       if (!pc.isSuperUser()) {
         if (username != null && !pc.getUser().equals(username)) {
-          throw new AccessControlException("Non-super user cannot change 
owner");
+          throw new AccessControlException("User " + username
+              + " is not a super user (non-super user cannot change owner).");
         }
         if (group != null && !pc.isMemberOfGroup(group)) {
-          throw new AccessControlException("User does not belong to " + group);
+          throw new AccessControlException(
+              "User " + username + " does not belong to " + group);
         }
       } {code}
 

  was:
when do the chown operation on target file /tmp/test with user 'root' to user 
'hive', the log displays 'User hive is not a super user' ;This appropriate log 
here should be 'User root is not a super user'
{code:java}
[root@lhccmh1 ~]# hdfs dfs -ls /tmp/test
rw-rr- 3 root hdfs 0 2018-05-28 10:33 /tmp/test
[root@lhccmh1 ~]# hdfs dfs -chown hive /tmp/test
chown: changing ownership of '/tmp/test': User hive is not a super user 
(non-super user cannot change owner).{code}
The last version patch of issue HDFS-10455 use username but not pc.getUser() in 
logs;

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


> When the setOwner operation was denied,The logging username is not appropriate
> ------------------------------------------------------------------------------
>
>                 Key: HDFS-13626
>                 URL: https://issues.apache.org/jira/browse/HDFS-13626
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.8.0, 2.7.4, 3.0.0-alpha2
>         Environment: hadoop 2.8.2
>            Reporter: luhuachao
>            Priority: Minor
>
> when do the chown operation on target file /tmp/test with user 'root' to user 
> 'hive', the log displays 'User hive is not a super user' ;This appropriate 
> log here should be 'User root is not a super user'
> {code:java}
> [root@lhccmh1 ~]# hdfs dfs -ls /tmp/test
> rw-rr- 3 root hdfs 0 2018-05-28 10:33 /tmp/test
> [root@lhccmh1 ~]# hdfs dfs -chown hive /tmp/test
> chown: changing ownership of '/tmp/test': User hive is not a super user 
> (non-super user cannot change owner).{code}
> The last version patch of issue HDFS-10455 use username but not pc.getUser() 
> in logs; 
> {code:java}
>  
>        if (!pc.isSuperUser()) {
>          if (username != null && !pc.getUser().equals(username)) {
> -          throw new AccessControlException("Non-super user cannot change 
> owner");
> +          throw new AccessControlException("User " + username
> +              + " is not a super user (non-super user cannot change 
> owner).");
>          }
>          if (group != null && !pc.isMemberOfGroup(group)) {
> -          throw new AccessControlException("User does not belong to " + 
> group);
> +          throw new AccessControlException(
> +              "User " + username + " does not belong to " + group);
>          }
>        } {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to