DO NOT REPLY [Bug 5298] New: xattrs and acls do not work well together along with fake-super, even worse on XFS

samba-bugs at samba.org samba-bugs at samba.org
Sun Mar 2 22:16:23 GMT 2008


https://bugzilla.samba.org/show_bug.cgi?id=5298

           Summary: xattrs and acls do not work well together along with
                    fake-super, even worse on XFS
           Product: rsync
           Version: 3.0.0
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: stlman at poczta.fm
         QAContact: rsync-qa at samba.org


I may suspect there is a problem with the options: fake-super, xattrs and acls.

Let me present an example. (create a test directory and enter it as root,
configure rsyncd with the test module too)

rm -rf source
mkdir source

echo data2 > source/file2
echo data1 > source/file1
chown 1000:1000 source/file1
setfattr -n user.DOSATTRIB -v "0x30783031" source/file1
setfacl -m g:wheel:rw- source/file1

rsync $OPTS -av source/ backup::test/dest1
rsync $OPTS -av --link-dest ../dest1 source/ backup::test/dest2

-------------------------------------------
For OPTS=""
../test/dest1:
total 16
-rw-rw-r-- 2 backup nobody 6 Mar  2 23:00 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:00 file2

../test/dest2:
total 16
-rw-rw-r-- 2 backup nobody 6 Mar  2 23:00 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:00 file2

I am not sure file1 should get 664 but this may be the problem of stat(2). The
number of hard links is OK.

# file: ../test/dest1/file1
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest1/file2
user.rsync.%stat="100644 0,0 0:0"

# file: ../test/dest2/file1
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest2/file2
user.rsync.%stat="100644 0,0 0:0"
-------------------------------------------
For OPTS=--acls ls is the same as above and getfattr

# file: ../test/dest1/file1
user.rsync.%aacl=0sgAAAAAQAAAAGAAAAgAAAAAoAAAAGAAAA
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest1/file2
user.rsync.%stat="100644 0,0 0:0"

# file: ../test/dest2/file1
user.rsync.%aacl=0sgAAAAAQAAAAGAAAAgAAAAAoAAAAGAAAA
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest2/file2
user.rsync.%stat="100644 0,0 0:0"

Seems OK.
-------------------------------------------
For OPTS=--xattrs
# file: ../test/dest1/file1
user.DOSATTRIB="0x01"
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest1/file2
user.rsync.%stat="100644 0,0 0:0"

# file: ../test/dest2/file1
user.DOSATTRIB="0x01"
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest2/file2
user.rsync.%stat="100644 0,0 0:0"

../test/dest1:
total 16
-rw-rw-r-- 2 backup nobody 6 Mar  2 23:05 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:05 file2

../test/dest2:
total 16
-rw-rw-r-- 2 backup nobody 6 Mar  2 23:05 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:05 file2

Still OK. Number of links is two. user.DOSATTRIB is preserved.
-------------------------------------------
For OPTS="-AX" (the manual does not forbid this)
# file: ../test/dest1/file1
user.DOSATTRIB="0x01"
user.rsync.%aacl=0sgAAAAAQAAAAGAAAAgAAAAAoAAAAGAAAA
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest1/file2
user.rsync.%stat="100644 0,0 0:0"

# file: ../test/dest2/file1
user.DOSATTRIB="0x01"
user.rsync.%stat="100664 0,0 1000:1000"

# file: ../test/dest2/file2
user.rsync.%stat="100644 0,0 0:0"

../test/dest1:
total 16
-rw-rw-r-- 1 backup nobody 6 Mar  2 23:06 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:06 file2

../test/dest2:
total 16
-rw-rw-r-- 1 backup nobody 6 Mar  2 23:06 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:06 file2

Well this is really odd. file1 gets copied twice each time with different
xattrs!
-------------------------------------------

What makes the game even more fascinating is the XFS filesystem which stores
ACLs  as trusted.SGI_ACL_FILE extended attribute and generates 
system.posix_acl_access on the fly. One might think that this means that
--xattrs can be used without --acls and XFS will be preserved. That's true but 
for some reason rsync  copies files with trusted.SGI_ACL_FILE twice  instead of
linking it. Even when the values are the same.

# file: ../test/dest1/file1
user.DOSATTRIB="0x01"
user.rsync.%stat="100664 0,0 1000:1000"
user.rsync.trusted.SGI_ACL_FILE=0sAAAABQAAAAH/////AAYAAAAAAAT/////AAQUCAAAAAgAAAAKAAYAAAAAABD/////AAZJRgAAACD/////AAQAAA==

# file: ../test/dest1/file2
user.rsync.%stat="100644 0,0 0:0"

# file: ../test/dest2/file1
user.DOSATTRIB="0x01"
user.rsync.%stat="100664 0,0 1000:1000"
user.rsync.trusted.SGI_ACL_FILE=0sAAAABQAAAAH/////AAYAAAAAAAT/////AAQUCAAAAAgAAAAKAAYAAAAAABD/////AAZJRgAAACD/////AAQAAA==

# file: ../test/dest2/file2
user.rsync.%stat="100644 0,0 0:0"

../test/dest1:
total 16
-rw-rw-r-- 1 backup nobody 6 Mar  2 23:09 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:09 file2

../test/dest2:
total 16
-rw-rw-r-- 1 backup nobody 6 Mar  2 23:09 file1
-rw-r--r-- 2 backup nobody 6 Mar  2 23:09 file2


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the rsync mailing list