I need rsync + acl support for windows?

Matt McCutchen hashproduct+rsync at gmail.com
Tue Oct 17 22:14:04 GMT 2006


On 10/16/06, Chris Diphoorn <chris.diphoorn at intouchdirect.com.au> wrote:
> Can you help?

Rsync's support for Windows ACLs is limited.  What are you trying to
do?  Copy files from Windows to Windows, preserving Windows ACLs?  If
so, you might be better off using rsync to copy the files and another
tool to copy the ACLs.

Since rsync is meant first and foremost for Unix-like systems, it only
handles POSIX ACLs, and it runs on Windows only under Cygwin.  If you
run rsync inside a Cygwin installation that is in "ntsec" mode (set
the environment variable CYGWIN=ntsec), Cygwin will convert between
POSIX ACLs and Windows ACLs as necessary.  That means Cygwin on the
sender will convert Windows ACLs to POSIX ACLs, rsync will transfer
the POSIX ACLs to the receiver, and Cygwin on the receiver will
convert the POSIX ACLs back to Windows ACLs.  The following Cygwin
user guide page explains "ntsec" mode and the conversion in more
detail:
    http://www.cygwin.com/cygwin-ug-net/ntsec.html

There are two opportunities for information loss in the ACL conversion:

- POSIX ACLs support only read, write, and execute permissions.  Thus,
aspects of Windows ACLs that cannot be represented by a combination of
read, write, and execute (often shown as "Special Permissions" in the
Windows ACL editor) will be lost.

- Rsync uses Unix-like UIDs and GIDs.  To get Cygwin to convert
Windows users and groups to and from UIDs and GIDs in a meaningful
fashion, you must assign UIDs and GIDs to all the users on the system
in the /etc/passwd and /etc/group files.  See the Cygwin page I linked
above for much more information.  Additionally, if you are copying
from one machine to another, rsync gives you the option to preserve
users and groups by UID/GID or by Cygwin name (which may or may not
match the Windows name depending on how you did /etc/passwd and
/etc/group); see rsync's --numeric-ids option.

Having considered this, if you want to use rsync's ACL support, you
first need a Cygwin installation and a special ACL-enabled copy of
rsync.  So get the rsync source code from
    http://rsync.samba.org/ftp/rsync/rsync-2.6.8.tar.gz ,
extract it, and apply the ACL patch:
    $ patch -p1 <patches/acls.diff
If you have trouble with this for some reason, here is a package I
made of the source code with the patch already applied:
    http://www.kepreon.com/~matt/myrsync/rsync-acl-2.6.8.tar.bz2

Then, configure rsync with ACLs enabled, compile it, and install it:
    $ ./configure --enable-acl-support
    $ make
    $ make install
If you did it right, rsync should list "ACLs" among its "capabilities"
when you run:
    $ rsync --version
Then, pass the -A, --acls option to rsync to tell it to preserve ACLs.

Srinivasa Battula (CC-ed on this message) said in June that he made
modified versions of rsync and Cygwin that copied Windows ACLs
perfectly:
    http://lists.samba.org/archive/rsync/2006-June/015843.html
You might want to use his rsync and Cygwin.

Matt


More information about the rsync mailing list