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.
--- orig/Makefile.in 2004-08-13 07:18:58
+++ Makefile.in 2004-07-03 20:11:58
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 \
---- orig/acls.c 2004-08-19 17:09:41
-+++ acls.c 2004-08-19 17:09:41
-@@ -0,0 +1,1117 @@
+--- 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
+ 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;
+ }
+{
+#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);
+ 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",
+ 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))
+ 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 */
+ 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;
+ }
+ *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));
+ }
+ 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));
+}
+
+#endif /* SUPPORT_ACLS */
---- orig/backup.c 2004-07-26 06:19:04
-+++ backup.c 2004-07-03 20:11:58
-@@ -105,6 +105,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);
}
}
*p = '/';
-@@ -168,6 +169,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)) {
-@@ -242,6 +245,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);
AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
AC_OUTPUT
---- orig/flist.c 2004-08-12 18:34:38
+--- orig/flist.c 2004-09-21 09:40:27
+++ flist.c 2004-07-03 20:11:58
-@@ -944,6 +944,8 @@ void send_file_name(int f, struct file_l
+@@ -966,6 +966,8 @@ void send_file_name(int f, struct file_l
if (!file)
return;
maybe_emit_filelist_progress(flist);
-@@ -952,6 +954,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);
}
if (recursive && S_ISDIR(file->mode)
-@@ -1268,6 +1274,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);
if (S_ISREG(flist->files[i]->mode))
stats.total_size += flist->files[i]->length;
-@@ -1290,6 +1298,8 @@ struct file_list *recv_file_list(int f)
+@@ -1313,6 +1321,8 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths, 1);
if (f != -1) {
/* Now send the uid/gid list. This was introduced in
* protocol version 15 */
---- orig/generator.c 2004-08-05 18:24:21
+--- orig/generator.c 2004-09-20 19:50:13
+++ generator.c 2004-07-03 20:11:58
-@@ -332,6 +332,10 @@ static void recv_generator(char *fname,
+@@ -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));
next;
}
---- orig/options.c 2004-08-12 18:34:38
+--- 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;
{"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 },
-@@ -620,6 +628,24 @@ int parse_arguments(int *argc, const cha
+@@ -616,6 +624,24 @@ int parse_arguments(int *argc, const cha
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -932,6 +958,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';
if (preserve_uid)
argstr[x++] = 'o';
if (preserve_gid)
---- orig/rsync.c 2004-08-09 21:07:10
+--- 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
}
#include "proto.h"
/* We have replacement versions of these if they're missing. */
---- orig/rsync.yo 2004-08-19 16:30:47
+--- 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
+ return acl_free(the_acl);
+}
+
-+int sys_acl_free_qualifier(void *qual, UNUSED(SMB_ACL_TAG_T tagtype))
++int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
+{
+ return acl_free(qual);
+}