+}
+
+#endif /* SUPPORT_ACLS */
---- orig/backup.c 2005-01-19 20:11:10
+--- orig/backup.c 2005-01-25 12:14:14
+++ backup.c 2004-10-06 00:13:09
@@ -119,6 +119,7 @@ static int make_bak_dir(char *fullpath)
} else {
free(file);
if (verbose > 1)
---- orig/configure.in 2005-01-10 00:21:12
+--- orig/configure.in 2005-01-28 23:01:08
+++ configure.in 2004-08-19 19:53:27
-@@ -443,6 +443,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
+@@ -467,6 +467,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
AC_CHECK_LIB(resolv, strcasecmp)
fi
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.
-@@ -718,6 +723,77 @@ AC_SUBST(OBJ_RESTORE)
+@@ -713,6 +718,77 @@ AC_SUBST(OBJ_RESTORE)
AC_SUBST(CC_SHOBJ_FLAG)
AC_SUBST(BUILD_POPT)
AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
AC_OUTPUT
---- orig/flist.c 2005-01-24 01:43:09
+--- orig/flist.c 2005-01-30 10:07:21
+++ flist.c 2004-07-03 20:11:58
-@@ -994,6 +994,8 @@ void send_file_name(int f, struct file_l
+@@ -976,6 +976,8 @@ void send_file_name(int f, struct file_l
if (!file)
return;
maybe_emit_filelist_progress(flist);
-@@ -1002,6 +1004,10 @@ void send_file_name(int f, struct file_l
+@@ -984,6 +986,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)
-@@ -1327,6 +1333,8 @@ struct file_list *recv_file_list(int f)
+@@ -1316,6 +1322,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;
-@@ -1349,6 +1357,8 @@ struct file_list *recv_file_list(int f)
+@@ -1338,6 +1346,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 2005-01-24 01:43:09
-+++ generator.c 2005-01-24 01:45:43
-@@ -313,6 +313,10 @@ static void recv_generator(char *fname,
+--- orig/generator.c 2005-01-30 10:07:21
++++ generator.c 2005-01-30 10:09:44
+@@ -315,6 +315,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 (f_out == -1)
+ SET_ACL(fname, file);
+#endif
- if (delete_during && f_out != -1
+ if (delete_during && f_out != -1 && csum_length != SUM_LENGTH
&& (file->flags & FLAG_DEL_START))
delete_in_dir(flist, fname);
--- orig/lib/sysacls.c 2004-10-20 15:35:58
next;
}
---- orig/options.c 2005-01-24 01:43:10
+--- orig/options.c 2005-01-30 10:07:21
+++ options.c 2004-08-19 17:38:57
-@@ -43,6 +43,7 @@ int keep_dirlinks = 0;
+@@ -44,6 +44,7 @@ int keep_dirlinks = 0;
int copy_links = 0;
int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_perms = 0;
int preserve_devices = 0;
int preserve_uid = 0;
-@@ -163,6 +164,7 @@ static void print_rsync_version(enum log
+@@ -164,6 +165,7 @@ static void print_rsync_version(enum log
char const *got_socketpair = "no ";
char const *have_inplace = "no ";
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
-@@ -179,6 +181,10 @@ static void print_rsync_version(enum log
+@@ -180,6 +182,10 @@ static void print_rsync_version(enum log
hardlinks = "";
#endif
#if SUPPORT_LINKS
links = "";
#endif
-@@ -193,9 +199,9 @@ static void print_rsync_version(enum log
- "Copyright (C) 1996-2004 by Andrew Tridgell and others\n");
+@@ -194,9 +200,9 @@ static void print_rsync_version(enum log
+ "Copyright (C) 1996-2005 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",
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
-@@ -261,6 +267,7 @@ void usage(enum logcode F)
+@@ -266,6 +272,7 @@ void usage(enum logcode F)
rprintf(F," -H, --hard-links preserve hard links\n");
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -p, --perms preserve permissions\n");
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");
-@@ -371,6 +378,7 @@ static struct poptOption long_options[]
+@@ -384,6 +391,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, ©_unsafe_links, 0, 0, 0 },
{"perms", 'p', POPT_ARG_NONE, &preserve_perms, 0, 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 },
-@@ -753,6 +761,24 @@ int parse_arguments(int *argc, const cha
+@@ -802,6 +810,24 @@ int parse_arguments(int *argc, const cha
basis_dir[basis_dir_cnt++] = (char *)arg;
break;
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -1080,6 +1106,8 @@ void server_options(char **args,int *arg
+@@ -1141,6 +1167,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 2005-01-24 00:57:24
+--- orig/rsync.c 2005-01-28 19:08:20
+++ rsync.c 2004-07-03 20:11:58
-@@ -233,6 +233,14 @@ int set_perms(char *fname,struct file_st
+@@ -234,6 +234,14 @@ int set_perms(char *fname,struct file_st
}
#endif
if (verbose > 1 && flags & PERMS_REPORT) {
if (updated)
rprintf(FINFO,"%s\n",fname);
---- orig/rsync.h 2005-01-21 00:35:26
+--- orig/rsync.h 2005-01-30 10:07:21
+++ rsync.h 2004-07-03 20:11:58
-@@ -549,6 +549,40 @@ static inline int flist_up(struct file_l
+@@ -609,6 +609,40 @@ static inline int flist_up(struct file_l
#include "lib/permstring.h"
#include "lib/addrinfo.h"
+#define ACLS_NEED_MASK HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|HAVE_HPUX_ACLS
+
+#if SUPPORT_ACLS
-+#ifdef HAVE_SYS_ACL_H
++#if HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#define MAKE_ACL(file, fname) make_acl(file, fname)
#include "proto.h"
/* We have replacement versions of these if they're missing. */
---- orig/rsync.yo 2005-01-24 01:43:10
+--- orig/rsync.yo 2005-01-30 10:07:21
+++ rsync.yo 2004-07-03 20:11:58
-@@ -327,6 +327,7 @@ verb(
+@@ -328,6 +328,7 @@ verb(
-H, --hard-links preserve hard links
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-p, --perms preserve permissions
-o, --owner preserve owner (root only)
-g, --group preserve group
-D, --devices preserve devices (root only)
-@@ -615,6 +616,11 @@ source file's permissions and the umask
+@@ -623,6 +624,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).
+
+#endif /* No ACLs. */
+#endif /* _SMB_ACLS_H */
---- orig/uidlist.c 2004-04-29 19:37:25
+--- orig/uidlist.c 2005-01-28 19:08:20
+++ uidlist.c 2004-07-03 20:11:58
@@ -34,6 +34,7 @@
extern int verbose;
+ deleting = 0;
+ return ret;
+}
---- orig/flist.c 2005-01-28 19:08:20
-+++ flist.c 2005-01-24 02:21:33
+--- orig/flist.c 2005-01-30 10:07:21
++++ flist.c 2005-01-30 10:11:42
@@ -47,6 +47,8 @@ extern char curr_dir[MAXPATHLEN];
extern unsigned int curr_dir_len;
extern char *backup_dir;
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
-@@ -1674,10 +1677,14 @@ char *f_name(struct file_struct *f)
- return f_name_to(f, names[n]);
+@@ -1659,10 +1662,14 @@ char *f_name(struct file_struct *f)
}
+
+/* Function now checks if file matches backup or delete suffix patterns */
static int is_backup_file(char *fn)
{
+ return k > 0 && strcmp(fn+k, backup_suffix_rm) == 0;
}
- void delete_in_dir(struct file_list *flist, char *fname)
-@@ -1731,11 +1738,12 @@ void delete_in_dir(struct file_list *fli
+
+@@ -1759,11 +1766,12 @@ void delete_missing(struct file_list *fu
|| (delete_during && S_ISDIR(mode)
- && !S_ISDIR(flist->files[j]->mode))) {
- char *f = f_name(del_flist->files[i]);
+ && !S_ISDIR(full_list->files[j]->mode))) {
+ char *f = f_name(dir_list->files[i]);
- if (make_backups && (backup_dir || !is_backup_file(f))
+ int backup_file = is_backup_file(f);
+ if (make_backups && (backup_dir_rm || !backup_file)
+ rprintf(FINFO, "safe-deleting %s\n",
safe_fname(f));
}
- } else {
---- orig/options.c 2005-01-28 19:08:20
+ } else if (S_ISDIR(mode)) {
+--- orig/options.c 2005-01-30 10:07:21
+++ options.c 2005-01-28 19:17:35
@@ -119,10 +119,14 @@ int no_detach = 0;
int write_batch = 0;
{"hard-links", 'H', POPT_ARG_NONE, &preserve_hard_links, 0, 0, 0 },
{"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
{"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
-@@ -932,6 +942,8 @@ int parse_arguments(int *argc, const cha
+@@ -935,6 +945,8 @@ int parse_arguments(int *argc, const cha
partial_dir = sanitize_path(NULL, partial_dir, NULL, 0);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0);
if (files_from)
files_from = sanitize_path(NULL, files_from, NULL, 0);
}
-@@ -958,6 +970,12 @@ int parse_arguments(int *argc, const cha
+@@ -961,6 +973,12 @@ int parse_arguments(int *argc, const cha
if (check_filter(elp, backup_dir, 1) < 0)
goto options_rejected;
}
}
if (server_filter_list.head && files_from) {
clean_fname(files_from, 1);
-@@ -978,6 +996,16 @@ int parse_arguments(int *argc, const cha
+@@ -981,6 +999,16 @@ int parse_arguments(int *argc, const cha
backup_suffix);
return 0;
}
if (backup_dir) {
backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-@@ -997,6 +1025,31 @@ int parse_arguments(int *argc, const cha
+@@ -1000,6 +1028,31 @@ int parse_arguments(int *argc, const cha
"--suffix cannot be a null string without --backup-dir\n");
return 0;
}
if (do_progress && !verbose)
verbose = 1;
-@@ -1214,6 +1267,10 @@ void server_options(char **args,int *arg
+@@ -1217,6 +1270,10 @@ void server_options(char **args,int *arg
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
}
/* Only send --suffix if it specifies a non-default value. */
if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1222,7 +1279,13 @@ void server_options(char **args,int *arg
+@@ -1225,7 +1282,13 @@ void server_options(char **args,int *arg
goto oom;
args[ac++] = arg;
}