Need to make sure that the destination file doesn't exist before we
[rsync/rsync-patches.git] / acls.diff
index 8f135a8..39875cb 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -1,14 +1,18 @@
 After applying this patch, run these commands for a successful build:
 
     autoconf
-    automake
+    autoheader
     ./configure --with-acl-support
     make proto
     make
 
+The program currently complains when the --acls (-A) option is used to copy
+from a disk that doesn't support ACLs.  This should be changed to silently 
+notice that no ACLs are available to copy.  Of course, trying to write out
+ACLs to a non-ACL-supporting disk should complain.
 
---- Makefile.in        2 May 2004 17:04:14 -0000       1.100
-+++ Makefile.in        13 May 2004 17:58:41 -0000
+--- orig/Makefile.in   2004-08-13 07:18:58
++++ Makefile.in        2004-07-03 20:11:58
 @@ -25,7 +25,7 @@ VERSION=@VERSION@
  .SUFFIXES:
  .SUFFIXES: .c .o
@@ -27,9 +31,9 @@ After applying this patch, run these commands for a successful build:
  OBJS3=progress.o pipe.o
  DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
  popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ acls.c     13 May 2004 17:58:42 -0000
-@@ -0,0 +1,1119 @@
+--- orig/acls.c        2004-09-08 06:09:30
++++ acls.c     2004-09-08 06:09:30
+@@ -0,0 +1,1144 @@
 +/* -*- c-file-style: "linux" -*-
 +   Copyright (C) Andrew Tridgell 1996
 +   Copyright (C) Paul Mackerras 1996
@@ -53,7 +57,7 @@ After applying this patch, run these commands for a successful build:
 +
 +#include "rsync.h"
 +
-+#ifdef SUPPORT_ACLS
++#if SUPPORT_ACLS
 +
 +extern int preserve_acls;
 +extern int am_root;
@@ -392,7 +396,7 @@ After applying this patch, run these commands for a successful build:
 +              BOOL ok;
 +              *curr_racl = rsync_acl_initializer;
 +              if (!(sacl = sys_acl_get_file(fname, *type))) {
-+                      rprintf(FERROR, "send_acl : sys_acl_get_file(%s, %s): %s\n",
++                      rprintf(FERROR, "send_acl: sys_acl_get_file(%s, %s): %s\n",
 +                              fname, str_acl_type(*type), strerror(errno));
 +                      return False;
 +              }
@@ -638,8 +642,8 @@ After applying this patch, run these commands for a successful build:
 +{
 +#if ACLS_NEED_MASK
 +      uchar required_mask_perm = 0;
-+      BOOL saw_mask = False;
 +#endif
++      BOOL saw_mask = False;
 +      BOOL saw_user_obj = False, saw_group_obj = False,
 +              saw_other = False;
 +      size_t count = read_int(f);
@@ -671,9 +675,7 @@ After applying this patch, run these commands for a successful build:
 +                      break;
 +              case 'm':
 +                      race->tag_type = SMB_ACL_MASK;
-+#if ACLS_NEED_MASK
 +                      saw_mask = True;
-+#endif
 +                      break;
 +              default:
 +                      rprintf(FERROR, "receive_rsync_acl: unknown tag %c\n",
@@ -724,6 +726,35 @@ After applying this patch, run these commands for a successful build:
 +              race->tag_type = SMB_ACL_MASK;
 +              race->access = required_mask_perm;
 +      }
++#else
++      /* If we, a system without ACLS_NEED_MASK, received data from a
++       * system that has masks, throw away the extraneous CLASS_OBJs. */
++      if (saw_mask && racl->count == 4) {
++              rsync_ace *group_obj_race = NULL, *mask_race = NULL;
++              rsync_ace *p;
++              size_t i;
++              for (i = 0, p = racl->races; i < racl->count; i++, p++) {
++                      if (p->tag_type == SMB_ACL_MASK)
++                              mask_race = p;
++                      else if (p->tag_type == SMB_ACL_GROUP_OBJ)
++                              group_obj_race = p;
++              }
++              if (mask_race == NULL || group_obj_race == NULL) {
++                      rprintf(FERROR, "receive_rsync_acl: have four ACES "
++                                      "and one's ACL_MASK but missing "
++                                      "either it or ACL_GROUP_OBJ, "
++                                      "when pruning ACL\n");
++              } else {
++                      /* mask off group perms with it first */
++                      group_obj_race->access &= mask_race->access;
++                      /* dump mask_race; re-slot any followers-on */
++                      racl->count--;
++                      if (mask_race != &racl->races[racl->count]) {
++                              *mask_race = racl->races[racl->count];
++                              saw_user_obj = False; /* force re-sort */
++                      }
++              }
++      }
 +#endif
 +#if ACLS_NEED_MASK
 +      if (!(saw_user_obj && saw_group_obj && saw_other && saw_mask))
@@ -872,13 +903,13 @@ After applying this patch, run these commands for a successful build:
 +              SMB_ACL_T sacl_orig, sacl_bak;
 +              rsync_acl racl_orig, racl_bak;
 +              if (!(sacl_orig = sys_acl_get_file(orig, *type))) {
-+                      rprintf(FERROR, "dup_acl : sys_acl_get_file(%s, %s): %s\n",
++                      rprintf(FERROR, "dup_acl: sys_acl_get_file(%s, %s): %s\n",
 +                              orig, str_acl_type(*type), strerror(errno));
 +                      ret = -1;
 +                      continue;
 +              }
 +              if (!(sacl_bak = sys_acl_get_file(orig, *type))) {
-+                      rprintf(FERROR, "dup_acl : sys_acl_get_file(%s, %s): %s. ignoring\n",
++                      rprintf(FERROR, "dup_acl: sys_acl_get_file(%s, %s): %s. ignoring\n",
 +                              bak, str_acl_type(*type), strerror(errno));
 +                      ret = -1;
 +                      /* try to forge on through */
@@ -904,7 +935,7 @@ After applying this patch, run these commands for a successful build:
 +                              ret = -1;
 +                      }
 +              } else if (-1 == sys_acl_set_file(bak, *type, sacl_bak)) {
-+                      rprintf(FERROR, "dup_acl : sys_acl_set_file(%s, %s): %s\n",
++                      rprintf(FERROR, "dup_acl: sys_acl_set_file(%s, %s): %s\n",
 +                              bak, str_acl_type(*type), strerror(errno));
 +                      ret = -1;
 +              }
@@ -948,7 +979,7 @@ After applying this patch, run these commands for a successful build:
 +                              *sacl = NULL;
 +                      else {
 +                              if (!(*sacl = sys_acl_get_file(orig, *type))) {
-+                                      rprintf(FERROR, "push_keep_backup_acl : sys_acl_get_file(%s, %s): %s\n",
++                                      rprintf(FERROR, "push_keep_backup_acl: sys_acl_get_file(%s, %s): %s\n",
 +                                              orig, str_acl_type(*type),
 +                                              strerror(errno));
 +                              }
@@ -971,7 +1002,7 @@ After applying this patch, run these commands for a successful build:
 +                              if (-1 == sys_acl_set_file(backup_dest_fname,
 +                                                         *type, *sacl))
 +                              {
-+                                      rprintf(FERROR, "push_keep_backup_acl : sys_acl_get_file(%s, %s): %s\n",
++                                      rprintf(FERROR, "push_keep_backup_acl: sys_acl_get_file(%s, %s): %s\n",
 +                                              backup_dest_fname,
 +                                              str_acl_type(*type),
 +                                              strerror(errno));
@@ -1146,12 +1177,10 @@ After applying this patch, run these commands for a successful build:
 +      set_acl_id(gid);
 +}
 +
-+
-+
 +#endif /* SUPPORT_ACLS */
---- backup.c   13 May 2004 06:34:03 -0000      1.30
-+++ backup.c   13 May 2004 17:58:42 -0000
-@@ -104,6 +104,7 @@ static int make_bak_dir(char *fullpath)
+--- orig/backup.c      2004-09-20 19:50:13
++++ backup.c   2004-09-07 21:45:57
+@@ -119,6 +119,7 @@ static int make_bak_dir(char *fullpath)
                        } else {
                                do_lchown(fullpath, st.st_uid, st.st_gid);
                                do_chmod(fullpath, st.st_mode);
@@ -1159,25 +1188,25 @@ After applying this patch, run these commands for a successful build:
                        }
                }
                *p = '/';
-@@ -165,6 +166,8 @@ static int keep_backup(char *fname)
+@@ -176,6 +177,8 @@ static int keep_backup(char *fname)
+       if (!(buf = get_backup_name(fname)))
                return 0;
-       }
  
-+      PUSH_KEEP_BACKUP_ACL(file, fname, backup_dir_buf);
++      PUSH_KEEP_BACKUP_ACL(file, fname, buf);
 +
  #ifdef HAVE_MKNOD
        /* Check to see if this is a device file, or link */
        if (IS_DEVICE(file->mode)) {
-@@ -235,6 +238,7 @@ static int keep_backup(char *fname)
+@@ -251,6 +254,7 @@ static int keep_backup(char *fname)
                }
        }
-       set_perms(backup_dir_buf, file, NULL, 0);
+       set_perms(buf, file, NULL, 0);
 +      CLEANUP_KEEP_BACKUP_ACL();
        free(file);
  
        if (verbose > 1)
---- configure.in       30 Apr 2004 18:03:33 -0000      1.196
-+++ configure.in       13 May 2004 17:58:44 -0000
+--- orig/configure.in  2004-08-13 07:18:59
++++ configure.in       2004-08-19 19:53:27
 @@ -434,6 +434,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
      AC_CHECK_LIB(resolv, strcasecmp)
  fi
@@ -1190,11 +1219,10 @@ After applying this patch, run these commands for a successful build:
  dnl At the moment we don't test for a broken memcmp(), because all we
  dnl need to do is test for equality, not comparison, and it seems that
  dnl every platform has a memcmp that can do at least that.
-@@ -654,6 +659,74 @@ AC_SUBST(OBJ_SAVE)
- AC_SUBST(OBJ_RESTORE)
+@@ -656,6 +661,77 @@ AC_SUBST(OBJ_RESTORE)
  AC_SUBST(CC_SHOBJ_FLAG)
  AC_SUBST(BUILD_POPT)
-+
 +AC_CHECK_HEADERS(sys/acl.h)
 +AC_CHECK_FUNCS(_acl __acl _facl __facl)
 +#################################################
@@ -1233,6 +1261,7 @@ After applying this patch, run these commands for a successful build:
 +                      LIBS="$LIBS -lpacl"
 +                      ;;
 +              *)
++                  AC_MSG_RESULT(ACLs requested -- running tests)
 +                  AC_CHECK_LIB(acl,acl_get_file)
 +                      AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
 +                      AC_TRY_LINK([#include <sys/types.h>
@@ -1242,14 +1271,16 @@ After applying this patch, run these commands for a successful build:
 +                      if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
 +                          AC_MSG_RESULT(Using posix ACLs)
 +                          AC_DEFINE(HAVE_POSIX_ACLS, 1, [true if you have posix ACLs])
-+                              AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
++                          AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
 +                              AC_TRY_LINK([#include <sys/types.h>
 +#include <sys/acl.h>],
 +[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
 +samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)])
-+                              if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
-+                                      AC_DEFINE(HAVE_ACL_GET_PERM_NP, 1, [true if you have acl_get_perm_np])
-+                              fi
++                          if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
++                              AC_DEFINE(HAVE_ACL_GET_PERM_NP, 1, [true if you have acl_get_perm_np])
++                          fi
++                      else
++                          AC_MSG_ERROR(Failed to find ACL support)
 +                      fi
 +                      ;;
 +              esac
@@ -1262,12 +1293,13 @@ After applying this patch, run these commands for a successful build:
 +  AC_DEFINE(HAVE_NO_ACLS, 1, [true if you don't have ACLs])
 +  AC_MSG_RESULT(no)
 +)
++
  AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
  AC_OUTPUT
---- flist.c    11 May 2004 17:25:16 -0000      1.221
-+++ flist.c    13 May 2004 17:58:44 -0000
-@@ -931,6 +931,8 @@ void send_file_name(int f, struct file_l
+--- orig/flist.c       2004-09-21 09:40:27
++++ flist.c    2004-07-03 20:11:58
+@@ -966,6 +966,8 @@ void send_file_name(int f, struct file_l
  
        if (!file)
                return;
@@ -1276,7 +1308,7 @@ After applying this patch, run these commands for a successful build:
  
        maybe_emit_filelist_progress(flist);
  
-@@ -942,6 +944,10 @@ void send_file_name(int f, struct file_l
+@@ -974,6 +976,10 @@ void send_file_name(int f, struct file_l
        if (file->basename[0]) {
                flist->files[flist->count++] = file;
                send_file_entry(file, f, base_flags);
@@ -1287,7 +1319,7 @@ After applying this patch, run these commands for a successful build:
        }
  
        if (recursive && S_ISDIR(file->mode)
-@@ -1257,6 +1263,8 @@ struct file_list *recv_file_list(int f)
+@@ -1291,6 +1297,8 @@ struct file_list *recv_file_list(int f)
                        flags |= read_byte(f) << 8;
                receive_file_entry(&flist->files[i], flags, flist, f);
  
@@ -1296,21 +1328,21 @@ After applying this patch, run these commands for a successful build:
                if (S_ISREG(flist->files[i]->mode))
                        stats.total_size += flist->files[i]->length;
  
-@@ -1278,6 +1286,8 @@ struct file_list *recv_file_list(int f)
-               finish_filelist_progress(flist);
+@@ -1313,6 +1321,8 @@ struct file_list *recv_file_list(int f)
  
        clean_flist(flist, relative_paths, 1);
-+
-+      SORT_FILE_ACL_INDEX_LISTS();
  
++      SORT_FILE_ACL_INDEX_LISTS();
++
        if (f != -1) {
                /* Now send the uid/gid list. This was introduced in
---- generator.c        13 May 2004 06:55:01 -0000      1.82
-+++ generator.c        13 May 2004 17:58:45 -0000
-@@ -328,6 +328,10 @@ void recv_generator(char *fname, struct 
-                  permission and modification time repair */
-               if (set_perms(fname,file,NULL,0) && verbose && (f_out != -1))
-                       rprintf(FINFO,"%s/\n",fname);
+                * protocol version 15 */
+--- orig/generator.c   2004-09-20 19:50:13
++++ generator.c        2004-07-03 20:11:58
+@@ -338,6 +338,10 @@ static void recv_generator(char *fname, 
+               if (set_perms(fname, file, statret ? NULL : &st, 0)
+                   && verbose && f_out != -1)
+                       rprintf(FINFO, "%s/\n", safe_fname(fname));
 +#if SUPPORT_ACLS
 +              if (f_out == -1)
 +                      SET_ACL(fname, file);
@@ -1318,8 +1350,8 @@ After applying this patch, run these commands for a successful build:
                return;
        }
  
---- mkproto.awk        1 Jan 2004 21:10:50 -0000       1.6
-+++ mkproto.awk        13 May 2004 17:58:45 -0000
+--- orig/mkproto.awk   2004-01-01 21:10:50
++++ mkproto.awk        2004-06-30 00:04:06
 @@ -58,7 +58,7 @@ BEGIN {
    next;
  }
@@ -1329,9 +1361,9 @@ After applying this patch, run these commands for a successful build:
    next;
  }
  
---- options.c  6 May 2004 21:08:01 -0000       1.148
-+++ options.c  13 May 2004 17:58:45 -0000
-@@ -41,6 +41,7 @@ int archive_mode = 0;
+--- orig/options.c     2004-09-20 05:10:48
++++ options.c  2004-08-19 17:38:57
+@@ -43,6 +43,7 @@ int keep_dirlinks = 0;
  int copy_links = 0;
  int preserve_links = 0;
  int preserve_hard_links = 0;
@@ -1339,15 +1371,15 @@ After applying this patch, run these commands for a successful build:
  int preserve_perms = 0;
  int preserve_devices = 0;
  int preserve_uid = 0;
-@@ -147,6 +148,7 @@ static void print_rsync_version(enum log
- {
+@@ -152,6 +153,7 @@ static void print_rsync_version(enum log
        char const *got_socketpair = "no ";
+       char const *have_inplace = "no ";
        char const *hardlinks = "no ";
 +      char const *acls = "no ";
        char const *links = "no ";
        char const *ipv6 = "no ";
        STRUCT_STAT *dumstat;
-@@ -159,6 +161,10 @@ static void print_rsync_version(enum log
+@@ -168,6 +170,10 @@ static void print_rsync_version(enum log
        hardlinks = "";
  #endif
  
@@ -1358,19 +1390,19 @@ After applying this patch, run these commands for a successful build:
  #if SUPPORT_LINKS
        links = "";
  #endif
-@@ -173,9 +179,9 @@ static void print_rsync_version(enum log
+@@ -182,9 +188,9 @@ static void print_rsync_version(enum log
                "Copyright (C) 1996-2004 by Andrew Tridgell and others\n");
        rprintf(f, "<http://rsync.samba.org/>\n");
        rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
 -              "%shard links, %ssymlinks, batchfiles, \n",
-+              "%shard links, %sacls, %ssymlinks, batchfiles, \n",
++              "%shard links, %sACLs, %ssymlinks, batchfiles, \n",
                (int) (sizeof (OFF_T) * 8),
 -              got_socketpair, hardlinks, links);
 +              got_socketpair, hardlinks, acls, links);
  
        /* Note that this field may not have type ino_t.  It depends
         * on the complicated interaction between largefile feature
-@@ -237,6 +243,7 @@ void usage(enum logcode F)
+@@ -249,6 +255,7 @@ void usage(enum logcode F)
    rprintf(F,"     --safe-links            ignore \"unsafe\" symlinks\n");
    rprintf(F," -H, --hard-links            preserve hard links\n");
    rprintf(F," -p, --perms                 preserve permissions\n");
@@ -1378,15 +1410,15 @@ After applying this patch, run these commands for a successful build:
    rprintf(F," -o, --owner                 preserve owner (root only)\n");
    rprintf(F," -g, --group                 preserve group\n");
    rprintf(F," -D, --devices               preserve devices (root only)\n");
-@@ -380,6 +387,7 @@ static struct poptOption long_options[] 
-   {"address",          0,  POPT_ARG_STRING, &bind_address, 0, 0, 0 },
-   {"backup-dir",       0,  POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
-   {"hard-links",      'H', POPT_ARG_NONE,   &preserve_hard_links, 0, 0, 0 },
-+  {"acls",            'A', POPT_ARG_NONE,   &preserve_acls, 0, 0, 0 },
-   {"read-batch",       0,  POPT_ARG_STRING, &batch_prefix,  OPT_READ_BATCH, 0, 0 },
-   {"write-batch",      0,  POPT_ARG_STRING, &batch_prefix,  OPT_WRITE_BATCH, 0, 0 },
-   {"files-from",       0,  POPT_ARG_STRING, &files_from, 0, 0, 0 },
-@@ -584,6 +592,31 @@ int parse_arguments(int *argc, const cha
+@@ -358,6 +365,7 @@ static struct poptOption long_options[] 
+   {"no-whole-file",    0,  POPT_ARG_VAL,    &whole_file, 0, 0, 0 },
+   {"copy-unsafe-links", 0, POPT_ARG_NONE,   &copy_unsafe_links, 0, 0, 0 },
+   {"perms",           'p', POPT_ARG_NONE,   &preserve_perms, 0, 0, 0 },
++  {"acls",            'A', POPT_ARG_NONE,   0,              'A', 0, 0 },
+   {"owner",           'o', POPT_ARG_NONE,   &preserve_uid, 0, 0, 0 },
+   {"group",           'g', POPT_ARG_NONE,   &preserve_gid, 0, 0, 0 },
+   {"devices",         'D', POPT_ARG_NONE,   &preserve_devices, 0, 0, 0 },
+@@ -616,6 +624,24 @@ int parse_arguments(int *argc, const cha
                        return 0;
  #endif
  
@@ -1400,16 +1432,9 @@ After applying this patch, run these commands for a successful build:
 +                       * restrict group and other access in the presence
 +                       * of any more restrictive ACLs, but this is safe
 +                       * for now */
-+                      /* FIXME: Don't say "server" if this is
-+                       * happening on the client. */
-+                      /* FIXME: Why do we have the duplicated
-+                       * rprintf?  Everybody who gets this message
-+                       * ought to send it to the client and also to
-+                       * the logs. */
 +                      snprintf(err_buf,sizeof(err_buf),
 +                                 "ACLs are not supported on this %s\n",
 +                               am_server ? "server" : "client");
-+                      rprintf(FERROR,"ERROR: ACLs not supported on this platform\n");
 +                      return 0;
 +#endif /* SUPPORT_ACLS */
 +                      break;
@@ -1418,7 +1443,7 @@ After applying this patch, run these commands for a successful build:
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off (opt-BASE is its index). */
-@@ -815,6 +848,8 @@ void server_options(char **args,int *arg
+@@ -938,6 +964,8 @@ void server_options(char **args,int *arg
  
        if (preserve_hard_links)
                argstr[x++] = 'H';
@@ -1427,9 +1452,9 @@ After applying this patch, run these commands for a successful build:
        if (preserve_uid)
                argstr[x++] = 'o';
        if (preserve_gid)
---- rsync.c    13 May 2004 07:08:25 -0000      1.136
-+++ rsync.c    13 May 2004 17:58:45 -0000
-@@ -204,6 +204,14 @@ int set_perms(char *fname,struct file_st
+--- orig/rsync.c       2004-09-07 21:45:30
++++ rsync.c    2004-07-03 20:11:58
+@@ -207,6 +207,14 @@ int set_perms(char *fname,struct file_st
        }
  #endif
  
@@ -1444,9 +1469,9 @@ After applying this patch, run these commands for a successful build:
        if (verbose > 1 && flags & PERMS_REPORT) {
                if (updated)
                        rprintf(FINFO,"%s\n",fname);
---- rsync.h    13 May 2004 06:53:23 -0000      1.202
-+++ rsync.h    13 May 2004 17:58:45 -0000
-@@ -537,6 +537,40 @@ static inline int flist_up(struct file_l
+--- orig/rsync.h       2004-08-03 15:41:32
++++ rsync.h    2004-07-03 20:11:58
+@@ -541,6 +541,40 @@ static inline int flist_up(struct file_l
  #include "lib/permstring.h"
  #include "lib/addrinfo.h"
  
@@ -1487,9 +1512,9 @@ After applying this patch, run these commands for a successful build:
  #include "proto.h"
  
  /* We have replacement versions of these if they're missing. */
---- rsync.yo   7 May 2004 00:18:37 -0000       1.169
-+++ rsync.yo   13 May 2004 17:58:46 -0000
-@@ -295,6 +295,7 @@ verb(
+--- orig/rsync.yo      2004-09-20 05:10:48
++++ rsync.yo   2004-07-03 20:11:58
+@@ -326,6 +326,7 @@ verb(
       --safe-links            ignore "unsafe" symlinks
   -H, --hard-links            preserve hard links
   -p, --perms                 preserve permissions
@@ -1497,20 +1522,20 @@ After applying this patch, run these commands for a successful build:
   -o, --owner                 preserve owner (root only)
   -g, --group                 preserve group
   -D, --devices               preserve devices (root only)
-@@ -520,6 +521,11 @@ Without this option, each new file gets 
- source file's permissions and the umask at the receiving end, while all
+@@ -578,6 +579,11 @@ source file's permissions and the umask 
  other files (including updated files) retain their existing permissions
  (which is the same behavior as other file-copy utilities, such as cp).
-+
 +dit(bf(-A, --acls)) This option causes rsync to update the remote
 +ACLs to be the same as the local ACLs.  This will work only if the
 +remote machine's rsync supports this option also. This is a non-standard
 +option.
++
  dit(bf(-o, --owner)) This option causes rsync to set the owner of the
  destination file to be the same as the source file.  On most systems,
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ smb_acls.h 13 May 2004 17:58:46 -0000
+ only the super-user can set file ownership.  By default, the preservation
+--- orig/smb_acls.h    2004-06-30 00:04:07
++++ smb_acls.h 2004-06-30 00:04:07
 @@ -0,0 +1,277 @@
 +/* 
 +   Unix SMB/Netbios implementation.
@@ -1789,8 +1814,8 @@ After applying this patch, run these commands for a successful build:
 +
 +#endif /* No ACLs. */
 +#endif /* _SMB_ACLS_H */
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ sysacls.c  13 May 2004 17:58:47 -0000
+--- orig/sysacls.c     2004-08-19 17:38:21
++++ sysacls.c  2004-08-19 17:38:21
 @@ -0,0 +1,3117 @@
 +/*
 +   Unix SMB/Netbios implementation.
@@ -4909,8 +4934,8 @@ After applying this patch, run these commands for a successful build:
 +}
 +
 +#endif /* No ACLs. */
---- uidlist.c  28 Apr 2004 17:31:31 -0000      1.24
-+++ uidlist.c  13 May 2004 17:58:47 -0000
+--- orig/uidlist.c     2004-04-29 19:37:25
++++ uidlist.c  2004-07-03 20:11:58
 @@ -34,6 +34,7 @@
  extern int verbose;
  extern int preserve_uid;
@@ -4955,11 +4980,10 @@ After applying this patch, run these commands for a successful build:
                /* read the gid list */
                while ((id = read_int(f)) != 0) {
                        int len = read_byte(f);
-@@ -336,6 +337,18 @@ void recv_uid_list(int f, struct file_li
-                       recv_add_gid(id, name); /* node keeps name's memory */
+@@ -337,6 +338,18 @@ void recv_uid_list(int f, struct file_li
                }
        }
-+
 +#if SUPPORT_ACLS
 +      if (preserve_acls && !numeric_ids) {
 +              id_t id;
@@ -4971,6 +4995,7 @@ After applying this patch, run these commands for a successful build:
 +                      acl_gid_map(match_gid(id));
 +      }
 +#endif /* SUPPORT_ACLS */
++
        /* now convert the uid/gid of all files in the list to the mapped
         * uid/gid */
+       if (am_root && preserve_uid && !numeric_ids) {