How to compile Rsync with acl support on Cygwin

Peter Olivia polivia at mindspring.com
Fri Mar 17 06:33:09 GMT 2006


Wayne wrote:

> The latest version of the acls.diff patch in CVS has the chmod() after
> the ACL-setting call, and I've just enhanced the code to work with a
> system where the special mode bits get cleared (though I didn't have an
>easy way to test this yet).  I also fixed a few compiler warnings that
were output by a Solaris build.

This fixed the special mode bits.  They are kept intact now.  It also fixed
another issue.  Previously files with changes in ACLs alone would not be
synced.  Now the ACL only changes are being rsynced and uodated on the
destination.

> Cool.  I've checked in your suggested change to the CVS version of the
> ACL patch, so now Cygwin will choose to use Solaris ACLs.  (You can also
> grab this via the latest "nightly" tar file, if you like.)

1) I grabbed the nightly build and compiled it in Cygwin.  It works great
for local Cygwin rsyncs (i.e. local folder to local folder).  

2) I tried doing rsyncs to a linux server running 2.6.6 (my ultimate goal
here)

Linux rsync version:
-------------------
# rsync --version
rsync  version 2.6.6  protocol version 29
Copyright (C) 1996-2005 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, ACLs, xattrs, symlinks,
batchfiles,
              inplace, IPv6, 64-bit system inums, 64-bit internal inums

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.


But Only dirs retained their ACLs and I got these errors on the files:
---------------------------------------------------------------------
$ ./rsync.exe -avvz --acls ./test  root at linuxserver:/test

building file list ...
done
delta-transmission enabled
test/
test/file1
test/file2
test/file3
test/file4
test/file5
set_acl: sys_acl_set_file(test/.file1.fd94pI, SMB_ACL_TYPE_ACCESS): Invalid
argument
set_acl: sys_acl_set_file(test/.file2.a7AIlJ, SMB_ACL_TYPE_ACCESS): Invalid
argument
set_acl: sys_acl_set_file(test/.file3.HG2nhK, SMB_ACL_TYPE_ACCESS): Invalid
argument
set_acl: sys_acl_set_file(test/.file4.w5D5cL, SMB_ACL_TYPE_ACCESS): Invalid
argument
set_acl: sys_acl_set_file(test/.file5.PxTn9L, SMB_ACL_TYPE_ACCESS): Invalid
argument
total: matches=0  hash_hits=0  false_alarms=0 data=0

sent 420 bytes  received 136 bytes  74.13 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at main.c(892)
[sender]

Source dir:
----------
$ ls -l test
total 0
-rwxr----T+ 1 Owner mkgroup 0 Mar 17 00:41 file1
-rwxr-S---+ 1 Owner mkgroup 0 Mar 17 00:41 file2
-rwsr-----+ 1 Owner mkgroup 0 Mar 17 00:41 file3
-rw-r--r--+ 1 Owner mkgroup 0 Mar 17 00:41 file4
-rw-r--r--+ 1 Owner mkgroup 0 Mar 17 01:05 file5
drwxr-xr-x+ 2 Owner mkgroup 0 Mar 17 01:19 test

$ getfacl.exe test/*
# file: test/file1
# owner: Owner
# group: mkgroup
user::rwx
user:Guest:r--
group::r--
mask:rwx
other:---

# file: test/file2
# owner: Owner
# group: mkgroup
user::rwx
user:Guest:r--
group::r--
mask:rwx
other:---

# file: test/file3
# owner: Owner
# group: mkgroup
user::rwx
user:Guest:r--
group::r--
mask:rwx
other:---

# file: test/file4
# owner: Owner
# group: mkgroup
user::rw-
user:Guest:r--
group::r--
mask:rwx
other:r--

# file: test/file5
# owner: Owner
# group: mkgroup
user::rw-
user:Guest:r--
group::r--
mask:rwx
other:r--

# file: test/test
# owner: Owner
# file: test/test
# owner: Owner
# group: mkgroup
user::rwx
group::r-x
mask:rwx
other:r-x
default:user::rwx
default:group::r-x
default:other:r-x

Dest Dir
--------
# ls -l test/
total 8
-rwxr----T  1 1003 Domain Users    0 Mar 17 00:41 file1
-rwxr-S---  1 1003 Domain Users    0 Mar 17 00:41 file2
-rwsr-----  1 1003 Domain Users    0 Mar 17 00:41 file3
-rw-r--r--  1 1003 Domain Users    0 Mar 17 00:41 file4
-rw-r--r--  1 1003 Domain Users    0 Mar 17 01:05 file5
drwxr-x---+ 2 1003 Domain Users 4096 Mar 17 01:19 test

# getfacl test/*
# file: test/file1
# owner: 1003
# group: Domain Users
user::rwx
group::r--
other::---

# file: test/file2
# owner: 1003
# group: Domain Users
user::rwx
group::r--
other::---

# file: test/file3
# owner: 1003
# group: Domain Users
user::rwx
group::r--
other::---

# file: test/file4
# owner: 1003
# group: Domain Users
user::rw-
group::r--
other::r--

# file: test/file5
# owner: 1003
# group: Domain Users
user::rw-
group::r--
other::r--

# file: test/test
# owner: 1003
# group: Domain Users
user::rwx
group::r-x
other::---
default:user::rwx
default:group::r-x
default:other::r-x

Was wondering if you knew the source of the problems in this situation?
Thanks so much for your help.

Pete




More information about the rsync mailing list