[ 
https://issues.apache.org/jira/browse/HADOOP-12774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15563646#comment-15563646
 ] 

ASF GitHub Bot commented on HADOOP-12774:
-----------------------------------------

Github user cnauroth commented on a diff in the pull request:

    https://github.com/apache/hadoop/pull/136#discussion_r82688624
  
    --- Diff: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileStatus.java
 ---
    @@ -32,18 +32,24 @@
     @InterfaceStability.Evolving
     public class S3AFileStatus extends FileStatus {
       private boolean isEmptyDirectory;
    +  private final String owner;
     
       // Directories
    -  public S3AFileStatus(boolean isdir, boolean isemptydir, Path path) {
    +  public S3AFileStatus(boolean isdir,
    +      boolean isemptydir,
    +      Path path,
    +      String owner) {
         super(0, isdir, 1, 0, 0, path);
         isEmptyDirectory = isemptydir;
    +    this.owner = owner;
    --- End diff --
    
    Consider removing the member variable and changing this line of code to:
    
        this.setOwner(owner);
        this.setGroup(owner);
    
    (These are `protected` methods in the base class.)


> s3a should use UGI.getCurrentUser.getShortname() for username
> -------------------------------------------------------------
>
>                 Key: HADOOP-12774
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12774
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 2.7.2
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>
> S3a users {{System.getProperty("user.name")}} to get the username for the 
> homedir. This is wrong, as it doesn't work on a YARN app where the identity 
> is set by HADOOP_USER_NAME, or in a doAs clause.
> Obviously, {{UGI.getCurrentUser.getShortname()}} provides that name, 
> everywhere. 
> This is a simple change in the source, though testing is harder ... probably 
> best to try in a doAs



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to