[PATCH] change rsync to print warning if ACL detected

Gary Fernandez GaryF at livevault.com
Tue Sep 10 12:43:00 EST 2002


There have been discussions previously about adding support for ACLs to
rsync. There are a number of issues about how to implement them in a
portable manner, so I did not implement them. However, for Solaris, I added
an error message so that rsync would at least print a message if an ACL is
attached to a file being copied.

*** patch starts ***
*** sender.c@@/main/original/1 Tue Apr  9 14:03:44 2002
--- sender.c Fri Apr 12 11:09:52 2002
***************
*** 26,33 ****
  extern int io_error;
  extern int dry_run;
  extern int am_server;
  
- 
  /*
    receive the checksums for a buffer
    */
--- 26,36 ----
  extern int io_error;
  extern int dry_run;
  extern int am_server;
+ extern int preserve_uid;
+ extern int preserve_gid;
+ extern int preserve_perms;
  
  /*
    receive the checksums for a buffer
    */
***************
*** 169,174 ****
--- 172,187 ----
  		    write_batch_csum_info(&i,flist->count,s);
  	  
  		if (!read_batch) {
+ #if defined(sun) && defined(__SVR4)
+ #include <sys/acl.h>
+             int count;
+             aclent_t entries[1];
+             /* see if there is an acl for the file */
+             if ((preserve_uid || preserve_gid || preserve_perms) &&
+                 (count = acl(fname, GETACLCNT, 0, entries)) > 4) {
+                 rprintf(FERROR, "file \"%s\" has an ACL, which will not be
preserved\n", fname);
+             }
+ #endif
  			fd = do_open(fname, O_RDONLY, 0);
  			if (fd == -1) {
  				io_error = 1;



More information about the rsync mailing list