Problem: ------- For sometime now, I have wanted to be able to rsync ACLs of files on windows machines to a Linux server. I never saw anyone post anything about how to make it work. I tried, but I was never able to compile on Cygwin when I patched the source with the acls.diff patch. ./configure would error out after displaying: Checking whether to support ACLS... checking for acl_get_file in -lacl... no checking for ACL support... no This issue was referenced in this post, but I never saw a follow up or resolution: http://www.cygwin.com/ml/cygwin/2004-01/msg01329.html Solution: ----------- Well I did some poking around the acls.diff patch and started examining the way cygwin implements ACLs to see what could be patched to make it work. I found that cygwin ACLs are implemented using the Solaris implementation: http://www.ee.adfa.edu.au/staff/hrp/webDesignHelp/cygwin-ug-net-nochunks.htm l#OV-HI-PERM Corinna Vinschen also mentioned that the cygwin ACLs were modeled using Solaris ACLs and to reference the sun documentation site for implementation http://sources.redhat.com/ml/cygwin/2001-06/msg01243.html Seeing that the acls.diff patch already had all the code for doing Solaris ACLs, it struck me that maybe it might work for Cygwin. I edited the acls.diff patch and it compiled (albeit with a few warnings). I have since tested it using the 2.6.6 and 2.6.7 code successfully. I was able to rsync acls intact to and from my Linux server. Here is the only edit needed for acls.diff to work on Cygwin ---------------------------------------------------------------------------- ------- Edit the following line + *solaris*) + AC_MSG_RESULT(Using solaris ACLs) + AC_DEFINE(HAVE_SOLARIS_ACLS, 1, [true if you have solaris ACLs]) to read : + *solaris*|*cygwin*) + AC_MSG_RESULT(Using solaris ACLs) + AC_DEFINE(HAVE_SOLARIS_ACLS, 1, [true if you have solaris ACLs]) Open Issue ---------------- 1) The only issue I've seen so far with rsync is that setuid, setgid and sticky bits don't get restored when restoring to windows with --acls . If you restore once with -acls and once more without, it restores both acls and setuid/setgid/sticky bits. 2) I also had to use the old way (autoconf and autoheader) with 2.6.7 as the ./prepare-source did not regenerate the configure file Thought someone might want to test it out and merge the change into CVS. -------------- next part -------------- HTML attachment scrubbed and removed
On Thu, Mar 16, 2006 at 11:21:49AM -0500, Peter Olivia wrote:> I have since tested it using the 2.6.6 and 2.6.7 code successfully. I > was able to rsync acls intact to and from my Linux server.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) The only issue I've seen so far with rsync is that setuid, setgid and > sticky bits don't get restored when restoring to windows with --acls.The acls.diff patch in released rsync versions has the chmod() call prior to the ACL-setting call, so it sounds like this latter action causes the special mode bits to be cleared. This is not something that Solaris does, so perhaps this behavior should be flagged as a bug with the Cygwin folks? 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.> 2) I also had to use the old way (autoconf and autoheader) with 2.6.7 > as the ./prepare-source did not regenerate the configure fileThat script just uses a makefile to call the appropriate commands (such as autoconf and autoheader) if the date of the generated file is older than the date of the source file. Note that if you applied the acls.diff patch from the 2.6.7 tar file, it's not required to run the prepare-source script (it won't do anything if you do, so it doesn't hurt) because the patch in a release tar now contains the changes to the configure script, proto.h, etc. ..wayne..