bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8527: cp/mv in coreutils don't respect the default ACL of parent


From: Linda A. Walsh
Subject: bug#8527: cp/mv in coreutils don't respect the default ACL of parent
Date: Tue, 07 Oct 2014 03:08:54 -0700
User-agent: Thunderbird

address@hidden wrote:
I can confirm. Tests show that the parent folder ACL "Default mask" is not inherited as the ACL "Access mask" of the file|dir created by cp|mv.

What file system and core utils are you using?

Are you using a file system that has alternate user-data forks
or extended attributes that have them included by default? Or are you using a file system where they were added on as a super-user control'd option? Have you tried copying them as root?

The reason I ask, is that I just tried it and it appears to work:
1) First the dir:
 cd /tmp
 llg -d /tmp
drwxrwxrwt 25 root root 8192 Oct  7 02:21 /tmp/
 lsacl /tmp
[u::rwx,g::rwx,o::rwx] /tmp               #default ACL from mode bits

2) Create file with 'touch'
 touch x                                 # new file
Ishtar:/tmp> llg x
-rw-rw-r-- 1 law lawgroup 0 Oct  7 02:26 x
 lsacl
[u::rw-,g::rw-,o::r--] x                  #default ACL
----
3) now I'll copy in a *directory* that has both types of ACL's on it, but
not specifying that any permissions be copied:

 ll -d  /Media/Library/_artwork/test       #source
drwxrwsr-x+ 2 10 Oct  7 02:33 /Media/Library/_artwork/test/
Ishtar:/tmp> lsacl /Media/Library/_artwork/test [u::rwx,u:Media:rwx,g::rwx,g:Media:rwx,m::rwx,o::r-x/u::rwx,u:Media:rwx,g::rwx,g:Media:rwx,m::rwx,o::r-x] /Media/Library/_artwork/test

(note, 2nd acl is default dir (lsacl uses "chacl -l")
Ishtar:/tmp> 'cp' -r /Media/Library/_artwork/test .  #recursive to tmp
Ishtar:/tmp> llg -d test
drwxrwxr-x 2 law lawgroup 6 Oct  7 02:34 test/
Ishtar:/tmp> lsacl test                              #no attr indicated
[u::rwx,g::rwx,o::r-x] test                          #default ACL shown
----
So far all seems fine.

4) Now lets copy the perms too:

Ishtar:/tmp> rd test
Ishtar:/tmp> 'cp' -a /Media/Library/_artwork/test .
Ishtar:/tmp> llg -d test
drwxrwsr-x+ 2 law Media 6 Oct  7 02:33 test/
Ishtar:/tmp> lsacl test                          #same ACL as source
[u::rwx,u:Media:rwx,g::rwx,g:Media:rwx,m::rwx,o::r-x/u::rwx,u:Media:rwx,g::rwx,g:Media:rwx,m::rwx,o::r-x] test

5) create file in that dir:

Ishtar:/tmp> cd test
Ishtar:/tmp/test> touch touched_file
Ishtar:/tmp/test> llg touched_file
-rw-rw-r--+ 1 law Media 0 Oct  7 02:42 touched_file
Ishtar:/tmp/test> lsacl touched_file
[u::rw-,u:Media:rwx,g::rwx,g:Media:rwx,m::rw-,o::r--] touched_file
---
File has expected inherited ACL.

6) Now ... lets use cp to copy a file w/o acls in:
(first create normal file under /tmp):

 echo "perm test">/tmp/perm.txt
Ishtar:/tmp/test> llg /tmp/perm.txt
-rw-rw-r-- 1 law lawgroup 10 Oct  7 02:59 /tmp/perm.txt
Ishtar:/tmp/test> lsacl /tmp/perm.txt
[u::rw-,g::rw-,o::r--] /tmp/perm.txt
 'cp' /tmp/perm.txt .
Ishtar:/tmp/test> llg perm.txt
-rw-rw-r--+ 1 law Media 10 Oct  7 03:01 perm.txt
Ishtar:/tmp/test> lsacl perm.txt
[u::rw-,u:Media:rwx,g::rwx,g:Media:rwx,m::rw-,o::r--] perm.txt

----
8) Looks the same to me...However, check this out:

Ishtar:/tmp/test> rm perm.txt
Ishtar:/tmp/test> cp /tmp/perm.txt . Ishtar:/tmp/test> llg /tmp/perm.txt
-rw-rw-r-- 1 law lawgroup 10 Oct  7 02:59 /tmp/perm.txt
Ishtar:/tmp/test> lsacl perm.txt

No acl this time, but same copy...or was it?

Note I was careful to use 'cp' most of the time when copying except
this last time, cuz:
 alias cp
alias cp='cp --preserve=mode,timestamps'

my normal cp is an alias -- that says to preserve the mode. It wouldn't be able to do that if it allowed the default ACL
to be set on the file.

--------------
So, I don't know if this is related to your problem, but
cp appears to be working correctly here
filesystem = xfs (acls are always on as they came with the filesystem).
kernel=

Linux Ishtar 3.16.2-Isht-Van #1 SMP PREEMPT Tue Sep 9 18:26:43 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux


==================================

If this was any help -- great, if it was an annoyance,
just delete it and I can claim my dog ate my keyboard...
(funny things come out of dogs stomachs.... ;-))...








reply via email to

[Prev in Thread] Current Thread [Next in Thread]