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

Chris Nauroth commented on HADOOP-10557:
----------------------------------------

[~ajisakaa], on Unix, it's true that {{cp -p}} attempts to preserve the ACL, 
but it's possible for this to fail if the destination is on a different file 
system that doesn't support ACLs.  When that happens, {{cp}} doesn't just log a 
warning.  It fails with a non-zero exit code.  See below for a transcript 
demonstrating this on Ubuntu.  My system is set up so that /home/cnauroth is on 
a file system with ACL support, but /mnt/share is on a file system without ACL 
support.

I think failure is desirable in this case.  A user might be surprised that a 
sensitive file was opened for access after successfully copying it, and log 
messages don't always give sufficient visibility into the problem.

{code}
[root@ubuntu:pts/0] ~                                                           
                                    
> touch /home/cnauroth/fileWithAcl 

[root@ubuntu:pts/0] ~                                                           
                                    
> setfacl -m user:cnauroth:rwx /home/cnauroth/fileWithAcl 

[root@ubuntu:pts/0] ~                                                           
                                    
> cp /home/cnauroth/fileWithAcl /mnt/share/cnauroth/fileWithAclNoPreserve

[root@ubuntu:pts/0] ~                                                           
                                    
> cp -p /home/cnauroth/fileWithAcl /mnt/share/cnauroth/fileWithAclPreserve
cp: preserving permissions for `/mnt/share/cnauroth/fileWithAclPreserve': 
Operation not supported

[root@ubuntu:pts/0] ~                                                           
                                    
> echo $?
1
{code}


> FsShell -cp -p does not preserve extended ACLs
> ----------------------------------------------
>
>                 Key: HADOOP-10557
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10557
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Akira AJISAKA
>            Assignee: Akira AJISAKA
>         Attachments: HADOOP-10557.2.patch, HADOOP-10557.3.patch, 
> HADOOP-10557.patch
>
>
> This issue tracks enhancing FsShell cp to
> * preserve extended ACLs by -p option
> or
> * add a new command-line option for preserving extended ACLs.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to