hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhe Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-10455) Logging the username when deny the setOwner operation
Date Wed, 26 Apr 2017 23:01:04 GMT

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

Zhe Zhang updated HDFS-10455:
-----------------------------
    Target Version/s: 3.0.0-alpha2, 2.8.0  (was: 2.8.0, 3.0.0-alpha2)
       Fix Version/s: 2.7.4

This looks like a good fix for 2.7 as well. I just did the backport.

> 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
>            Assignee: Rakesh R
>            Priority: Minor
>             Fix For: 2.8.0, 2.7.4, 3.0.0-alpha2
>
>         Attachments: HDFS-10455.000.patch, HDFS-10455.002.patch, HDFS-10455-003.patch,
HDFS-10455-branch-2.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()}}.
> {code:title=FSDirAttrOp.java|borderStyle=solid}
>        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);
>          }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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