DO NOT REPLY [Bug 3549] New: rsync applies umask to some directories even when a default ACL takes effect

samba-bugs at samba.org samba-bugs at samba.org
Fri Feb 24 00:58:49 GMT 2006


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

           Summary: rsync applies umask to some directories even when a
                    default ACL takes effect
           Product: rsync
           Version: 2.6.7
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: hashproduct at verizon.net
         QAContact: rsync-qa at samba.org


Starting in a new, empty directory with ACLs supported, run:
    umask 0077
    setfacl -dm u::rwx,g::rwx,o::rwx .
    mkdir src
    touch src/foo
    rsync --relative --no-implied-dirs src/foo dest/
Rsync creates dest/src with 700 permissions even though the default ACL
specifies 777 permissions.

The trouble is that the receiving rsync restricts the mode of such "auxiliary
directories" as omitted implied directories and directories created on the way
to the backup directory.  The receiving rsync runs with umask 0 and thus
applies the umask to the permissions it gives to mkdir; if the new directory's
containing directory is a default ACL, mkdir will apply the default ACL
automatically, but the umask should not be applied.

The correct technique, which is already used in get_local_name to create a
top-level destination directory outside the transfer, is to set the umask back
to the original umask temporarily and pass 0777 to mkdir.  The patch I will
soon attach factors this technique out into a function do_mkdir_defmode in
util.c and changes both the current get_local_name code and calls to
do_mkdir(x, 0777 & ~orig_umask) to calls to do_mkdir_defmode(x).

Even though the patch is only needed in the presence of ACLs, it does not
mention ACLs itself, so it can be applied to the trunk.


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