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 2005-07-07 23:11:07
-+++ Makefile.in 2005-07-07 23:11:55
+--- orig/Makefile.in 2005-11-07 04:29:00
++++ Makefile.in 2005-11-07 04:31:05
@@ -25,15 +25,15 @@ VERSION=@VERSION@
.SUFFIXES:
.SUFFIXES: .c .o
OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
-- fileio.o batch.o clientname.o
-+ fileio.o batch.o clientname.o acls.o
+- fileio.o batch.o clientname.o chmod.o
++ fileio.o batch.o clientname.o chmod.o acls.o
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 \
AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
AC_OUTPUT
---- orig/flist.c 2005-09-29 07:43:17
+--- orig/flist.c 2005-11-07 04:29:01
+++ flist.c 2005-07-29 02:49:06
-@@ -966,6 +966,8 @@ static struct file_struct *send_file_nam
+@@ -960,6 +960,8 @@ static struct file_struct *send_file_nam
file = make_file(fname, flist, f == -2 ? SERVER_FILTERS : ALL_FILTERS);
if (!file)
return NULL;
maybe_emit_filelist_progress(flist->count + flist_count_offset);
-@@ -974,6 +976,10 @@ static struct file_struct *send_file_nam
+@@ -968,6 +970,10 @@ static struct file_struct *send_file_nam
if (file->basename[0]) {
flist->files[flist->count++] = file;
send_file_entry(file, f, base_flags);
}
return file;
}
-@@ -1320,6 +1326,8 @@ struct file_list *recv_file_list(int f)
+@@ -1323,6 +1329,8 @@ struct file_list *recv_file_list(int f)
flags |= read_byte(f) << 8;
file = receive_file_entry(flist, flags, f);
if (S_ISREG(file->mode))
stats.total_size += file->length;
-@@ -1342,6 +1350,8 @@ struct file_list *recv_file_list(int f)
+@@ -1345,6 +1353,8 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths, 1);
if (f >= 0) {
/* Now send the uid/gid list. This was introduced in
* protocol version 15 */
---- orig/generator.c 2005-10-14 20:03:01
+--- orig/generator.c 2005-10-30 22:30:28
+++ generator.c 2005-05-12 23:34:00
@@ -725,6 +725,10 @@ static void recv_generator(char *fname,
if (set_perms(fname, file, statret ? NULL : &st, 0)
next;
}
---- orig/options.c 2005-10-15 16:39:46
+--- orig/options.c 2005-11-07 04:29:01
+++ options.c 2005-08-27 21:15:29
-@@ -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;
-@@ -182,6 +183,7 @@ static void print_rsync_version(enum log
+@@ -187,6 +188,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;
-@@ -198,6 +200,10 @@ static void print_rsync_version(enum log
+@@ -203,6 +205,10 @@ static void print_rsync_version(enum log
hardlinks = "";
#endif
#ifdef SUPPORT_LINKS
links = "";
#endif
-@@ -212,9 +218,9 @@ static void print_rsync_version(enum log
+@@ -217,9 +223,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, "
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
-@@ -284,6 +290,7 @@ void usage(enum logcode F)
+@@ -289,6 +295,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");
-@@ -387,6 +394,9 @@ static struct poptOption long_options[]
+@@ -394,6 +401,9 @@ static struct poptOption long_options[]
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
-@@ -967,6 +977,24 @@ int parse_arguments(int *argc, const cha
+@@ -994,6 +1004,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. */
-@@ -1388,6 +1416,8 @@ void server_options(char **args,int *arg
+@@ -1421,6 +1449,8 @@ void server_options(char **args,int *arg
if (preserve_hard_links)
argstr[x++] = 'H';
#include "proto.h"
/* We have replacement versions of these if they're missing. */
---- orig/rsync.yo 2005-10-15 16:39:47
+--- orig/rsync.yo 2005-11-07 04:29:02
+++ rsync.yo 2004-07-03 20:11:58
@@ -316,6 +316,7 @@ to the detailed description below for a
-H, --hard-links preserve hard links
-o, --owner preserve owner (root only)
-g, --group preserve group
-D, --devices preserve devices (root only)
-@@ -666,6 +667,11 @@ based on the source file's permissions,
+@@ -668,6 +669,11 @@ based on the source file's permissions,
umask setting
(which is the same behavior as other file-copy utilities, such as cp).
make proto
---- orig/batch.c 2005-04-09 18:00:28
+--- orig/batch.c 2005-10-26 16:49:08
+++ batch.c 2004-07-03 20:15:41
-@@ -208,6 +208,8 @@ void show_flist(int index, struct file_s
+@@ -225,6 +225,8 @@ void show_flist(int index, struct file_s
rprintf(FINFO, "flist->flags=%#x\n", fptr[i]->flags);
rprintf(FINFO, "flist->modtime=%#lx\n",
(long unsigned) fptr[i]->modtime);
rprintf(FINFO, "flist->length=%.0f\n",
(double) fptr[i]->length);
rprintf(FINFO, "flist->mode=%#o\n", (int) fptr[i]->mode);
---- orig/flist.c 2005-09-17 21:48:45
+--- orig/flist.c 2005-11-07 04:29:01
+++ flist.c 2005-07-28 00:16:34
@@ -50,6 +50,7 @@ extern int preserve_perms;
extern int preserve_devices;
extern int relative_paths;
extern int implied_dirs;
extern int copy_links;
-@@ -141,16 +142,18 @@ static void list_file_entry(struct file_
+@@ -138,16 +139,18 @@ static void list_file_entry(struct file_
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
safe_fname(f_name(f)));
}
}
-@@ -314,6 +317,7 @@ void send_file_entry(struct file_struct
+@@ -309,6 +312,7 @@ void send_file_entry(struct file_struct
{
unsigned short flags;
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -329,7 +333,7 @@ void send_file_entry(struct file_struct
+@@ -324,7 +328,7 @@ void send_file_entry(struct file_struct
if (!file) {
write_byte(f, 0);
dev = 0, rdev = makedev(0, 0);
rdev_major = 0;
uid = 0, gid = 0;
-@@ -378,6 +382,12 @@ void send_file_entry(struct file_struct
+@@ -373,6 +377,12 @@ void send_file_entry(struct file_struct
flags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#ifdef SUPPORT_HARD_LINKS
if (file->link_u.idev) {
-@@ -433,6 +443,8 @@ void send_file_entry(struct file_struct
+@@ -426,6 +436,8 @@ void send_file_entry(struct file_struct
write_int(f, modtime);
if (!(flags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(flags & XMIT_SAME_UID)) {
if (!numeric_ids)
add_uid(uid);
-@@ -503,6 +515,7 @@ static struct file_struct *receive_file_
+@@ -494,6 +506,7 @@ static struct file_struct *receive_file_
unsigned short flags, int f)
{
static time_t modtime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -521,7 +534,7 @@ static struct file_struct *receive_file_
+@@ -512,7 +525,7 @@ static struct file_struct *receive_file_
struct file_struct *file;
if (!flist) {
dev = 0, rdev = makedev(0, 0);
rdev_major = 0;
uid = 0, gid = 0;
-@@ -577,6 +590,8 @@ static struct file_struct *receive_file_
+@@ -568,6 +581,8 @@ static struct file_struct *receive_file_
modtime = (time_t)read_int(f);
if (!(flags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (preserve_uid && !(flags & XMIT_SAME_UID))
uid = (uid_t)read_int(f);
-@@ -627,6 +642,7 @@ static struct file_struct *receive_file_
+@@ -618,6 +633,7 @@ static struct file_struct *receive_file_
file->flags = 0;
file->modtime = modtime;
file->length = file_length;
file->mode = mode;
file->uid = uid;
-@@ -876,6 +892,7 @@ skip_filters:
+@@ -866,6 +882,7 @@ skip_filters:
file->flags = flags;
file->modtime = st.st_mtime;
+ file->atime = st.st_atime;
file->length = st.st_size;
- file->mode = st.st_mode;
- file->uid = st.st_uid;
---- orig/generator.c 2005-09-15 18:09:14
+ if (chmod_modes && am_sender && (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)))
+ file->mode = tweak_mode(st.st_mode, chmod_modes);
+--- orig/generator.c 2005-10-30 22:30:28
+++ generator.c 2005-07-28 00:14:43
@@ -44,6 +44,7 @@ extern int preserve_uid;
extern int preserve_gid;
extern int delete_before;
extern int delete_during;
extern int delete_after;
-@@ -324,9 +325,21 @@ void itemize(struct file_struct *file, i
+@@ -325,9 +326,21 @@ void itemize(struct file_struct *file, i
: S_ISDIR(file->mode) ? !omit_dir_times
: !S_ISLNK(file->mode);
iflags |= ITEM_REPORT_TIME;
if (preserve_perms
&& (file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS))
-@@ -378,7 +391,7 @@ static int unchanged_file(char *fn, stru
+@@ -379,7 +392,7 @@ static int unchanged_file(char *fn, stru
if (ignore_times)
return 0;
}
-@@ -538,7 +551,7 @@ static int find_fuzzy(struct file_struct
+@@ -539,7 +552,7 @@ static int find_fuzzy(struct file_struct
name = fp->basename;
if (fp->length == file->length
if (verbose > 4) {
rprintf(FINFO,
"fuzzy size/modtime match for %s\n",
-@@ -881,7 +894,7 @@ static void recv_generator(char *fname,
+@@ -891,7 +904,7 @@ static void recv_generator(char *fname,
}
if (update_only && statret == 0
if (verbose > 1)
rprintf(FINFO, "%s is newer\n", safe_fname(fname));
return;
---- orig/log.c 2005-06-10 21:33:28
+--- orig/log.c 2005-10-26 16:49:08
+++ log.c 2005-07-28 00:22:30
@@ -38,6 +38,7 @@ extern int module_id;
extern int msg_fd_out;
extern int log_format_has_o_or_i;
extern int daemon_log_format_has_o_or_i;
extern char *auth_user;
-@@ -501,11 +502,14 @@ static void log_formatted(enum logcode c
+@@ -503,11 +504,14 @@ static void log_formatted(enum logcode c
n[4] = !(iflags & ITEM_REPORT_TIME) ? '.'
: !preserve_times || IS_DEVICE(file->mode)
|| S_ISLNK(file->mode) ? 'T' : 't';
if (iflags & (ITEM_IS_NEW|ITEM_MISSING_DATA)) {
char ch = iflags & ITEM_IS_NEW ? '+' : '?';
---- orig/options.c 2005-09-24 17:40:31
-+++ options.c 2005-08-27 21:16:51
-@@ -49,6 +49,7 @@ int preserve_uid = 0;
+--- orig/options.c 2005-11-07 04:29:01
++++ options.c 2005-11-07 04:32:19
+@@ -50,6 +50,7 @@ int preserve_uid = 0;
int preserve_gid = 0;
int preserve_times = 0;
int omit_dir_times = 0;
int update_only = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -286,8 +287,9 @@ void usage(enum logcode F)
+@@ -292,8 +293,9 @@ void usage(enum logcode F)
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");
+ rprintf(F," -t, --times preserve modify times\n");
+ rprintf(F," -O, --omit-dir-times omit directories when preserving modify times\n");
+ rprintf(F," -A, --atimes preserve access times\n");
+ rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
- rprintf(F," -W, --whole-file copy files whole (without rsync algorithm)\n");
-@@ -388,6 +390,9 @@ static struct poptOption long_options[]
+@@ -397,6 +399,9 @@ static struct poptOption long_options[]
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 },
{"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"owner", 'o', POPT_ARG_VAL, &preserve_uid, 1, 0, 0 },
-@@ -1356,6 +1361,8 @@ void server_options(char **args,int *arg
+@@ -1429,6 +1434,8 @@ void server_options(char **args,int *arg
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
}
change_uid = am_root && preserve_uid && st->st_uid != file->uid;
---- orig/rsync.h 2005-09-24 17:40:31
+--- orig/rsync.h 2005-10-14 18:45:50
+++ rsync.h 2005-07-28 00:04:51
@@ -54,6 +54,7 @@
#define XMIT_HAS_IDEV_DATA (1<<9)
/* These flags are used in the live flist data. */
-@@ -118,6 +119,7 @@
+@@ -119,6 +120,7 @@
#define PERMS_REPORT (1<<0)
#define PERMS_SKIP_MTIME (1<<1)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -139,6 +141,7 @@
+@@ -140,6 +142,7 @@
#define DEL_TERSE (1<<3)
/* For use by the itemize_changes code */
#define ITEM_REPORT_CHECKSUM (1<<1)
#define ITEM_REPORT_SIZE (1<<2)
#define ITEM_REPORT_TIME (1<<3)
-@@ -521,6 +524,7 @@ struct file_struct {
+@@ -522,6 +525,7 @@ struct file_struct {
struct hlink *links;
} link_u;
time_t modtime;
uid_t uid;
gid_t gid;
mode_t mode;
---- orig/rsync.yo 2005-09-24 17:40:31
-+++ rsync.yo 2005-07-28 01:04:09
+--- orig/rsync.yo 2005-11-07 04:29:02
++++ rsync.yo 2005-11-07 04:34:55
@@ -319,8 +319,9 @@ to the detailed description below for a
-o, --owner preserve owner (root only)
-g, --group preserve group
-D, --devices preserve devices (root only)
- -t, --times preserve times
+- -O, --omit-dir-times omit directories when preserving times
+ -t, --times preserve modify times
- -O, --omit-dir-times omit directories when preserving times
++ -O, --omit-dir-times omit directories when preserving mod-times
+ -A, --atimes preserve access times
+ --chmod=CHMOD change destination permissions
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
- -W, --whole-file copy files whole (without rsync algorithm)
-@@ -695,6 +696,12 @@ it is preserving modification times (see
+@@ -698,6 +699,12 @@ it is preserving modification times (see
the directories on the receiving side, it is a good idea to use bf(-O).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
+repeated rsync runs with --atimes may be needed if you want to force the
+access-time values to be 100% identical on the two systems.
+
- dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers,
- instead it will just report the actions it would have taken.
-
-@@ -1104,7 +1111,7 @@ changes that are being made to each file
+ dit(bf(--chmod)) This options tells rsync to apply the listed "chmod" pattern
+ to the permission of the files on the destination. In addition to the normal
+ parsing rules specified in the chmod manpage, you can specify an item that
+@@ -1139,7 +1146,7 @@ changes that are being made to each file
This is exactly the same as specifying bf(--log-format='%i %n%L').
The "%i" escape has a cryptic output that is 9 letters long. The general
kind of update being done, bf(X) is replaced by the file-type, and the
other letters represent attributes that may be output if they are being
modified.
-@@ -1143,17 +1150,22 @@ quote(itemize(
+@@ -1178,17 +1185,22 @@ quote(itemize(
by the file transfer.
it() A bf(t) means the modification time is different and is being updated
to the sender's value (requires bf(--times)). An alternate value of bf(T)
return 0;
}
---- orig/util.c 2005-08-17 06:45:08
+--- orig/util.c 2005-10-16 22:38:40
+++ util.c 2005-07-27 23:37:27
-@@ -128,7 +128,7 @@ void overflow_exit(char *str)
+@@ -129,7 +129,7 @@ void overflow_exit(char *str)
{
#if !defined HAVE_LUTIMES || !defined HAVE_UTIMES
if (S_ISLNK(mode))
-@@ -136,9 +136,13 @@ int set_modtime(char *fname, time_t modt
+@@ -137,9 +137,13 @@ int set_modtime(char *fname, time_t modt
#endif
if (verbose > 2) {
}
if (dry_run)
-@@ -147,7 +151,7 @@ int set_modtime(char *fname, time_t modt
+@@ -148,7 +152,7 @@ int set_modtime(char *fname, time_t modt
{
#ifdef HAVE_UTIMES
struct timeval t[2];
t[0].tv_usec = 0;
t[1].tv_sec = modtime;
t[1].tv_usec = 0;
-@@ -158,12 +162,12 @@ int set_modtime(char *fname, time_t modt
+@@ -159,12 +163,12 @@ int set_modtime(char *fname, time_t modt
return utimes(fname, t);
#elif defined HAVE_UTIMBUF
struct utimbuf tbuf;
t[1] = modtime;
return utime(fname,t);
#else
-@@ -1166,8 +1170,8 @@ int msleep(int t)
+@@ -1171,8 +1175,8 @@ int msleep(int t)
/**
* --modify-window).
*
* @retval 0 if the times should be treated as the same
-@@ -1176,7 +1180,7 @@ int msleep(int t)
+@@ -1181,7 +1185,7 @@ int msleep(int t)
*
* @retval -1 if the 2nd is later
**/
+ deleting = 0;
+ return ret;
+}
---- orig/generator.c 2005-08-17 06:45:07
+--- orig/generator.c 2005-10-30 22:30:28
+++ generator.c 2005-03-11 11:22:38
-@@ -87,16 +87,23 @@ extern dev_t filesystem_dev;
+@@ -88,16 +88,23 @@ extern dev_t filesystem_dev;
extern char *backup_dir;
extern char *backup_suffix;
extern int backup_suffix_len;
}
-@@ -113,8 +120,8 @@ static int delete_item(char *fname, int
+@@ -114,8 +121,8 @@ static int delete_item(char *fname, int
if (!S_ISDIR(mode)) {
if (max_delete && ++deletion_count > max_delete)
return 0;
else
ok = robust_unlink(fname) == 0;
if (ok) {
-@@ -137,9 +144,9 @@ static int delete_item(char *fname, int
+@@ -138,9 +145,9 @@ static int delete_item(char *fname, int
|| (dry_run && zap_dir)) {
ok = 0;
errno = ENOTEMPTY;
else
ok = do_rmdir(fname) == 0;
if (ok) {
---- orig/options.c 2005-08-27 21:11:26
-+++ options.c 2005-08-27 21:17:50
-@@ -128,10 +128,14 @@ int no_detach
+--- orig/options.c 2005-11-07 04:29:01
++++ options.c 2005-11-07 04:35:54
+@@ -131,10 +131,14 @@ int no_detach
int write_batch = 0;
int read_batch = 0;
int backup_dir_len = 0;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
-@@ -141,7 +145,9 @@ char *log_format = NULL;
- char *password_file = NULL;
+@@ -145,7 +149,9 @@ char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
+ char *chmod_mode = NULL;
+char *backup_dir_dels = NULL;
char backup_dir_buf[MAXPATHLEN];
+char backup_dir_dels_buf[MAXPATHLEN];
int rsync_port = 0;
int compare_dest = 0;
int copy_dest = 0;
-@@ -273,6 +279,8 @@ void usage(enum logcode F)
+@@ -278,6 +284,8 @@ void usage(enum logcode F)
rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n");
rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
rprintf(F," -u, --update skip files that are newer on the receiver\n");
rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," --append append data onto shorter files\n");
-@@ -460,7 +468,9 @@ static struct poptOption long_options[]
+@@ -473,7 +481,9 @@ static struct poptOption long_options[]
{"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 },
{"backup", 'b', POPT_ARG_NONE, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"list-only", 0, POPT_ARG_VAL, &list_only, 2, 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 },
-@@ -1053,6 +1063,8 @@ int parse_arguments(int *argc, const cha
+@@ -1131,6 +1141,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 (server_filter_list.head && !am_sender) {
struct filter_list_struct *elp = &server_filter_list;
-@@ -1087,6 +1099,14 @@ int parse_arguments(int *argc, const cha
+@@ -1165,6 +1177,14 @@ int parse_arguments(int *argc, const cha
return 0;
}
}
}
if (!backup_suffix)
-@@ -1098,6 +1118,16 @@ int parse_arguments(int *argc, const cha
+@@ -1176,6 +1196,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;
-@@ -1119,6 +1149,31 @@ int parse_arguments(int *argc, const cha
+@@ -1197,6 +1227,31 @@ int parse_arguments(int *argc, const cha
"--suffix cannot be a null string without --backup-dir\n");
return 0;
}
if (make_backups && !backup_dir)
omit_dir_times = 1;
-@@ -1416,6 +1471,10 @@ void server_options(char **args,int *arg
+@@ -1519,6 +1574,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) {
-@@ -1424,7 +1483,13 @@ void server_options(char **args,int *arg
+@@ -1527,7 +1586,13 @@ void server_options(char **args,int *arg
goto oom;
args[ac++] = arg;
}
Note that you'll need to run 'make proto' after applying this patch.
---- orig/Makefile.in 2005-07-07 23:11:07
-+++ Makefile.in 2004-07-03 20:18:02
+--- orig/Makefile.in 2005-11-07 04:29:00
++++ Makefile.in 2005-11-07 04:36:50
@@ -34,7 +34,7 @@ OBJS1=rsync.o generator.o receiver.o cle
main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
- fileio.o batch.o clientname.o
+ fileio.o batch.o clientname.o chmod.o
-OBJS3=progress.o pipe.o
+OBJS3=progress.o pipe.o fnameconv.o
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
#define RERR_SIGNAL 20 /* status returned when sent SIGUSR1, SIGINT */
#define RERR_WAITCHILD 21 /* some error returned by waitpid() */
---- orig/flist.c 2005-10-19 08:24:28
+--- orig/flist.c 2005-11-07 04:29:01
+++ flist.c 2005-03-05 00:29:08
@@ -57,6 +57,7 @@ extern int copy_unsafe_links;
extern int protocol_version;
extern struct stats stats;
extern struct file_list *the_file_list;
-@@ -332,7 +333,10 @@ void send_file_entry(struct file_struct
+@@ -334,7 +335,10 @@ void send_file_entry(struct file_struct
io_write_phase = "send_file_entry";
flags = base_flags;
-@@ -541,6 +545,9 @@ static struct file_struct *receive_file_
+@@ -543,6 +547,9 @@ static struct file_struct *receive_file_
strlcpy(lastname, thisname, MAXPATHLEN);
clean_fname(thisname, 0);
if (sanitize_paths)
-@@ -1064,6 +1071,9 @@ struct file_list *send_file_list(int f,
+@@ -1073,6 +1080,9 @@ struct file_list *send_file_list(int f,
start_write = stats.total_written;
gettimeofday(&start_tv, NULL);
flist = flist_new(WITH_HLINK, "send_file_list");
io_start_buffering_out();
-@@ -1268,6 +1278,9 @@ struct file_list *send_file_list(int f,
+@@ -1285,6 +1295,9 @@ struct file_list *send_file_list(int f,
stats.flist_size = stats.total_written - start_write;
stats.num_files = flist->count;
if (verbose > 3)
output_flist(flist);
-@@ -1288,6 +1301,9 @@ struct file_list *recv_file_list(int f)
+@@ -1305,6 +1318,9 @@ struct file_list *recv_file_list(int f)
start_read = stats.total_read;
flist = flist_new(WITH_HLINK, "recv_file_list");
flist->count = 0;
-@@ -1340,6 +1356,9 @@ struct file_list *recv_file_list(int f)
+@@ -1357,6 +1373,9 @@ struct file_list *recv_file_list(int f)
io_error |= read_int(f);
}
+ if (verbose > 2)
+ rprintf(FINFO, "Converted filename: %s -> %s\n", src, dest);
+}
---- orig/generator.c 2005-10-14 20:03:01
+--- orig/generator.c 2005-10-30 22:30:28
+++ generator.c 2005-03-05 00:29:37
@@ -594,7 +594,13 @@ static int phase = 0;
* start sending checksums.
{ RERR_SIGNAL , "received SIGUSR1 or SIGINT" },
{ RERR_WAITCHILD , "waitpid() failed" },
{ RERR_MALLOC , "error allocating core memory buffers" },
---- orig/main.c 2005-10-26 16:49:08
+--- orig/main.c 2005-11-02 07:22:12
+++ main.c 2004-07-22 00:31:47
-@@ -391,7 +391,7 @@ static pid_t do_cmd(char *cmd, char *mac
+@@ -388,7 +388,7 @@ static pid_t do_cmd(char *cmd, char *mac
whole_file = 1;
ret = local_child(argc, args, f_in, f_out, child_main);
} else
if (dir)
free(dir);
---- orig/options.c 2005-10-26 16:49:08
+--- orig/options.c 2005-11-07 04:29:01
+++ options.c 2005-10-26 16:49:33
@@ -141,6 +141,7 @@ char *basis_dir[MAX_BASIS_DIRS+1];
char *config_file = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
-@@ -325,6 +326,7 @@ void usage(enum logcode F)
+@@ -329,6 +330,7 @@ void usage(enum logcode F)
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
rprintf(F," -z, --compress compress file data during the transfer\n");
rprintf(F," --compress-level=NUM explicitly set compression level\n");
rprintf(F," -C, --cvs-exclude auto-ignore files the same way CVS does\n");
-@@ -454,6 +456,7 @@ static struct poptOption long_options[]
+@@ -459,6 +461,7 @@ static struct poptOption long_options[]
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 },
the file's name.
---- orig/Makefile.in 2005-07-07 23:11:07
-+++ Makefile.in 2004-07-03 20:20:15
+--- orig/Makefile.in 2005-11-07 04:29:00
++++ Makefile.in 2005-11-07 04:37:17
@@ -34,7 +34,7 @@ OBJS1=rsync.o generator.o receiver.o cle
main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
- fileio.o batch.o clientname.o
+ fileio.o batch.o clientname.o chmod.o
-OBJS3=progress.o pipe.o
+OBJS3=progress.o pipe.o hashlink.o
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
+}
+
+#endif
---- orig/options.c 2005-10-14 20:03:21
-+++ options.c 2005-10-14 20:18:23
-@@ -142,6 +142,7 @@ char *log_format = NULL;
- char *password_file = NULL;
+--- orig/options.c 2005-11-07 04:29:01
++++ options.c 2005-11-07 04:37:30
+@@ -145,6 +145,7 @@ char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
+ char *chmod_mode = NULL;
+char *link_by_hash_dir = NULL;
char backup_dir_buf[MAXPATHLEN];
int rsync_port = 0;
int compare_dest = 0;
-@@ -323,6 +324,7 @@ void usage(enum logcode F)
+@@ -329,6 +330,7 @@ void usage(enum logcode F)
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
+ rprintf(F," --link-by-hash=DIR create hardlinks by hash into DIR\n");
rprintf(F," -z, --compress compress file data during the transfer\n");
+ rprintf(F," --compress-level=NUM explicitly set compression level\n");
rprintf(F," -C, --cvs-exclude auto-ignore files the same way CVS does\n");
- rprintf(F," -f, --filter=RULE add a file-filtering RULE\n");
-@@ -365,7 +367,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
+@@ -372,7 +374,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OP
OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
-@@ -450,6 +452,7 @@ static struct poptOption long_options[]
+@@ -458,6 +460,7 @@ static struct poptOption long_options[]
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
+ {"link-by-hash", 0, POPT_ARG_STRING, 0, OPT_LINK_BY_HASH, 0, 0},
{"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 },
- {"compress", 'z', POPT_ARG_NONE, &do_compression, 0, 0, 0 },
- {0, 'P', POPT_ARG_NONE, 0, 'P', 0, 0 },
-@@ -968,6 +971,21 @@ int parse_arguments(int *argc, const cha
+ {"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 },
+ {"compress-level", 0, POPT_ARG_INT, &def_compress_level, 'z', 0, 0 },
+@@ -994,6 +997,21 @@ 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. */
-@@ -1573,6 +1591,11 @@ void server_options(char **args,int *arg
- }
+@@ -1616,6 +1634,11 @@ void server_options(char **args,int *arg
+ args[ac++] = chmod_mode;
}
+ if (link_by_hash_dir && am_sender) {
#include "byteorder.h"
#include "lib/mdfour.h"
---- orig/rsync.yo 2005-10-14 20:03:01
+--- orig/rsync.yo 2005-11-07 04:29:02
+++ rsync.yo 2005-02-13 06:58:47
-@@ -355,6 +355,7 @@ to the detailed description below for a
+@@ -356,6 +356,7 @@ to the detailed description below for a
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
+ --link-by-hash=DIR create hardlinks by hash into DIR
-z, --compress compress file data during the transfer
+ --compress-level=NUM explicitly set compression level
-C, --cvs-exclude auto-ignore files in the same way CVS does
- -f, --filter=RULE add a file-filtering RULE
make proto
make
---- orig/Makefile.in 2005-07-07 23:11:55
-+++ Makefile.in 2005-07-07 23:15:20
+--- orig/Makefile.in 2005-11-07 04:31:05
++++ Makefile.in 2005-11-07 04:38:36
@@ -27,13 +27,13 @@ VERSION=@VERSION@
HEADERS=byteorder.h config.h errcode.h proto.h rsync.h smb_acls.h lib/pool_alloc.h
OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
-- fileio.o batch.o clientname.o acls.o
-+ fileio.o batch.o clientname.o acls.o xattr.o
+- fileio.o batch.o clientname.o chmod.o acls.o
++ fileio.o batch.o clientname.o chmod.o acls.o xattr.o
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/flist.c 2005-07-29 02:49:06
+++ flist.c 2005-10-16 23:03:04
-@@ -968,6 +968,8 @@ static struct file_struct *send_file_nam
+@@ -962,6 +962,8 @@ static struct file_struct *send_file_nam
return NULL;
if (MAKE_ACL(file, fname) < 0)
return NULL;
maybe_emit_filelist_progress(flist->count + flist_count_offset);
-@@ -977,9 +979,11 @@ static struct file_struct *send_file_nam
+@@ -971,9 +973,11 @@ static struct file_struct *send_file_nam
flist->files[flist->count++] = file;
send_file_entry(file, f, base_flags);
SEND_ACL(file, f);
}
return file;
}
-@@ -1327,6 +1331,7 @@ struct file_list *recv_file_list(int f)
+@@ -1330,6 +1334,7 @@ struct file_list *recv_file_list(int f)
file = receive_file_entry(flist, flags, f);
RECEIVE_ACL(file, f);
if (S_ISREG(file->mode))
stats.total_size += file->length;
-@@ -1351,6 +1356,7 @@ struct file_list *recv_file_list(int f)
+@@ -1354,6 +1359,7 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths, 1);
SORT_FILE_ACL_INDEX_LISTS();
+#endif /* No xattrs */
--- orig/options.c 2005-08-27 21:15:29
+++ options.c 2005-08-27 21:29:40
-@@ -44,6 +44,7 @@ int copy_links = 0;
+@@ -45,6 +45,7 @@ int copy_links = 0;
int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_acls = 0;
int preserve_perms = 0;
int preserve_devices = 0;
int preserve_uid = 0;
-@@ -184,6 +185,7 @@ static void print_rsync_version(enum log
+@@ -189,6 +190,7 @@ static void print_rsync_version(enum log
char const *have_inplace = "no ";
char const *hardlinks = "no ";
char const *acls = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
-@@ -203,7 +205,9 @@ static void print_rsync_version(enum log
+@@ -208,7 +210,9 @@ static void print_rsync_version(enum log
#ifdef SUPPORT_ACLS
acls = "";
#endif
#ifdef SUPPORT_LINKS
links = "";
#endif
-@@ -218,9 +222,9 @@ static void print_rsync_version(enum log
+@@ -223,9 +227,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, "
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
-@@ -291,6 +295,7 @@ void usage(enum logcode F)
+@@ -296,6 +300,7 @@ void usage(enum logcode F)
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -p, --perms preserve permissions\n");
rprintf(F," -A, --acls preserve ACLs (implies --perms)\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");
-@@ -397,6 +402,9 @@ static struct poptOption long_options[]
+@@ -404,6 +409,9 @@ static struct poptOption long_options[]
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
{"no-A", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
-@@ -994,6 +1002,17 @@ int parse_arguments(int *argc, const cha
+@@ -1021,6 +1029,17 @@ int parse_arguments(int *argc, const cha
return 0;
#endif /* SUPPORT_ACLS */
default:
/* A large opt value means that set_refuse_options()
-@@ -1418,6 +1437,8 @@ void server_options(char **args,int *arg
+@@ -1451,6 +1470,8 @@ void server_options(char **args,int *arg
argstr[x++] = 'H';
if (preserve_acls)
argstr[x++] = 'A';
-o, --owner preserve owner (root only)
-g, --group preserve group
-D, --devices preserve devices (root only)
-@@ -672,6 +673,11 @@ ACLs to be the same as the local ACLs.
+@@ -674,6 +675,11 @@ ACLs to be the same as the local ACLs.
remote machine's rsync supports this option also. This is a non-standard
option.