OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
fileio.o batch.o clientname.o
OBJS3=progress.o pipe.o
---- orig/cleanup.c 2005-01-10 09:46:11
+--- orig/cleanup.c 2005-01-28 23:01:07
+++ cleanup.c 2004-07-03 20:22:18
-@@ -143,8 +143,12 @@ void _exit_cleanup(int code, const char
+@@ -142,8 +142,12 @@ void _exit_cleanup(int code, const char
code = RERR_VANISHED;
}
- if (code)
+ if (code) {
log_exit(code, file, line);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
+ db_log_exit(code,file,line);
+#endif
+ }
if (verbose > 2) {
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): about to call exit(%d)\n",
---- orig/clientserver.c 2005-01-25 12:14:14
+--- orig/clientserver.c 2005-02-01 10:39:22
+++ clientserver.c 2004-07-03 20:22:18
-@@ -341,6 +341,9 @@ static int rsync_module(int f_in, int f_
- XFLG_WORD_SPLIT | XFLG_ABS_PATH | XFLG_DEF_EXCLUDE);
+@@ -344,6 +344,9 @@ static int rsync_module(int f_in, int f_
+ XFLG_WORD_SPLIT | XFLG_ANCHORED2ABS | XFLG_DEF_EXCLUDE);
log_init();
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
+ db_log_open();
+#endif
if (use_chroot) {
/*
-@@ -459,6 +462,9 @@ static int rsync_module(int f_in, int f_
+@@ -463,6 +466,9 @@ static int rsync_module(int f_in, int f_
rprintf(FLOG, "rsync %s %s from %s@%s (%s)\n",
am_sender ? "on" : "to",
request, auth_user, host, addr);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
+ db_log_session();
+#endif
} else {
rprintf(FLOG, "rsync %s %s from %s (%s)\n",
am_sender ? "on" : "to",
---- orig/configure.in 2005-01-10 00:21:12
+--- orig/configure.in 2005-01-28 23:01:08
+++ configure.in 2004-07-03 20:22:18
@@ -94,6 +94,8 @@ AC_ARG_WITH(rsync-path,
[ --with-rsync-path=PATH set default --rsync-path to PATH (default: rsync)],
AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
-@@ -500,6 +502,14 @@ then
+@@ -524,6 +526,14 @@ then
AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
fi
+
+#include "rsync.h"
+
-+#ifdef HAVE_SQL_H
++#if HAVE_SQL_H
+#include <sql.h>
+#else
-+#ifdef HAVE_ODBC_SQL_H
++#if HAVE_ODBC_SQL_H
+#include <odbc/sql.h>
+#endif
+#endif
+
-+#ifdef HAVE_SQLEXT_H
++#if HAVE_SQLEXT_H
+#include <sqlext.h>
+#else
-+#ifdef HAVE_ODBC_SQLEXT_H
++#if HAVE_ODBC_SQLEXT_H
+#include <odbc/sqlext.h>
+#endif
+#endif
+
-+#ifdef HAVE_SQLTYPES_H
++#if HAVE_SQLTYPES_H
+#include <sqltypes.h>
+#else
-+#ifdef HAVE_ODBC_SQLTYPES_H
++#if HAVE_ODBC_SQLTYPES_H
+#include <odbc/sqltypes.h>
+#endif
+#endif
FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors)
FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable)
FN_LOCAL_STRING(lp_uid, uid)
---- orig/log.c 2004-09-07 19:54:51
+--- orig/log.c 2005-02-01 10:39:22
+++ log.c 2004-07-03 20:22:18
@@ -75,7 +75,7 @@ struct {
/*
{
int i;
for (i = 0; rerr_names[i].name; i++) {
---- orig/main.c 2005-01-25 12:14:14
+--- orig/main.c 2005-01-30 10:07:21
+++ main.c 2004-07-03 20:22:18
-@@ -139,6 +139,9 @@ static void report(int f)
+@@ -137,6 +137,9 @@ static void report(int f)
if (am_daemon) {
log_exit(0, __FILE__, __LINE__);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
+ db_log_exit(0,__FILE__,__LINE__);
+#endif
if (f == -1 || !am_sender)
return;
}
---- orig/receiver.c 2005-01-25 12:14:14
+--- orig/receiver.c 2005-02-03 02:04:20
+++ receiver.c 2004-07-20 21:47:47
-@@ -490,6 +490,9 @@ int recv_files(int f_in, struct file_lis
+@@ -504,6 +504,9 @@ int recv_files(int f_in, struct file_lis
fname, fd2, file->length);
log_recv(file, &initial_stats);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
+ db_log_transfer(file, &initial_stats, "receive");
+#endif
if (fd1 != -1)
close(fd1);
---- orig/sender.c 2005-01-25 00:00:31
+--- orig/sender.c 2005-02-03 02:04:20
+++ sender.c 2004-07-15 02:37:48
-@@ -231,6 +231,9 @@ void send_files(struct file_list *flist,
+@@ -236,6 +236,9 @@ void send_files(struct file_list *flist,
match_sums(f_out, s, mbuf, st.st_size);
log_send(file, &initial_stats);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
+ db_log_transfer(file, &initial_stats,"send");
+#endif
AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
AC_OUTPUT
---- orig/flist.c 2005-01-30 10:07:21
+--- orig/flist.c 2005-02-03 02:04:20
+++ flist.c 2004-07-03 20:11:58
-@@ -976,6 +976,8 @@ void send_file_name(int f, struct file_l
+@@ -983,6 +983,8 @@ void send_file_name(int f, struct file_l
if (!file)
return;
maybe_emit_filelist_progress(flist);
-@@ -984,6 +986,10 @@ void send_file_name(int f, struct file_l
+@@ -991,6 +993,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)
-@@ -1316,6 +1322,8 @@ struct file_list *recv_file_list(int f)
+@@ -1309,6 +1315,8 @@ struct file_list *recv_file_list(int f)
flags |= read_byte(f) << 8;
- receive_file_entry(&flist->files[i], flags, flist, f);
+ receive_file_entry(flist, i, flags, f);
+ RECEIVE_ACL(flist->files[i], f);
+
if (S_ISREG(flist->files[i]->mode))
stats.total_size += flist->files[i]->length;
-@@ -1338,6 +1346,8 @@ struct file_list *recv_file_list(int f)
+@@ -1331,6 +1339,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-30 10:07:21
+--- orig/generator.c 2005-02-03 02:04:20
+++ generator.c 2005-01-30 10:09:44
-@@ -315,6 +315,10 @@ static void recv_generator(char *fname,
+@@ -313,6 +313,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));
+ SET_ACL(fname, file);
+#endif
if (delete_during && f_out != -1 && csum_length != SUM_LENGTH
- && (file->flags & FLAG_DEL_START))
- delete_in_dir(flist, fname);
+ && (file->flags & FLAG_DEL_HERE))
+ delete_in_dir(flist, fname, file);
--- orig/lib/sysacls.c 2004-10-20 15:35:58
+++ lib/sysacls.c 2004-10-20 15:35:58
@@ -0,0 +1,3217 @@
next;
}
---- orig/options.c 2005-01-30 10:07:21
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2004-08-19 17:38:57
@@ -44,6 +44,7 @@ int keep_dirlinks = 0;
int copy_links = 0;
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -1141,6 +1167,8 @@ void server_options(char **args,int *arg
+@@ -1144,6 +1170,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-28 19:08:20
+--- orig/rsync.c 2005-02-01 10:39:22
+++ rsync.c 2004-07-03 20:11:58
-@@ -234,6 +234,14 @@ int set_perms(char *fname,struct file_st
+@@ -235,6 +235,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-30 10:07:21
+--- orig/rsync.h 2005-02-03 02:04:20
+++ rsync.h 2004-07-03 20:11:58
-@@ -609,6 +609,40 @@ static inline int flist_up(struct file_l
+@@ -605,6 +605,40 @@ struct stats {
#include "lib/permstring.h"
#include "lib/addrinfo.h"
#include "proto.h"
/* We have replacement versions of these if they're missing. */
---- orig/rsync.yo 2005-01-30 10:07:21
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2004-07-03 20:11:58
-@@ -328,6 +328,7 @@ verb(
+@@ -317,6 +317,7 @@ to the detailed description below for a
-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)
-@@ -623,6 +624,11 @@ source file's permissions and the umask
+@@ -612,6 +613,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).
make proto
---- orig/batch.c 2004-08-02 05:02:24
+--- orig/batch.c 2005-02-03 02:04:20
+++ batch.c 2004-07-03 20:15:41
-@@ -184,6 +184,8 @@ void show_flist(int index, struct file_s
+@@ -204,6 +204,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-01-25 00:53:58
-+++ flist.c 2004-07-03 20:15:41
+--- orig/flist.c 2005-02-03 02:04:20
++++ flist.c 2005-02-01 10:42:59
@@ -63,6 +63,7 @@ extern int make_backups;
extern int backup_suffix_len;
extern int copy_links;
extern int protocol_version;
extern int sanitize_paths;
extern int delete_excluded;
-@@ -147,17 +148,17 @@ static void list_file_entry(struct file_
+@@ -150,17 +151,17 @@ static void list_file_entry(struct file_
#if SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
}
}
-@@ -333,6 +334,7 @@ void send_file_entry(struct file_struct
+@@ -323,6 +324,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;
-@@ -348,7 +350,7 @@ void send_file_entry(struct file_struct
+@@ -338,7 +340,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;
-@@ -397,6 +399,12 @@ void send_file_entry(struct file_struct
+@@ -387,6 +389,12 @@ void send_file_entry(struct file_struct
flags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#if SUPPORT_HARD_LINKS
if (file->link_u.idev) {
-@@ -452,6 +460,8 @@ void send_file_entry(struct file_struct
+@@ -442,6 +450,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);
-@@ -525,6 +535,7 @@ void receive_file_entry(struct file_stru
- struct file_list *flist, int f)
+@@ -515,6 +525,7 @@ static void receive_file_entry(struct fi
+ unsigned short flags, int f)
{
static time_t modtime;
+ static time_t atime;
static mode_t mode;
static int64 dev;
static dev_t rdev;
-@@ -543,7 +554,7 @@ void receive_file_entry(struct file_stru
+@@ -533,7 +544,7 @@ static void receive_file_entry(struct fi
struct file_struct *file;
- if (!fptr) {
+ if (!flist) {
- modtime = 0, mode = 0;
+ modtime = 0, atime = 0, mode = 0;
dev = 0, rdev = makedev(0, 0);
rdev_major = 0;
uid = 0, gid = 0;
-@@ -599,6 +610,8 @@ void receive_file_entry(struct file_stru
+@@ -589,6 +600,8 @@ static void receive_file_entry(struct fi
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);
-@@ -649,6 +662,7 @@ void receive_file_entry(struct file_stru
+@@ -639,6 +652,7 @@ static void receive_file_entry(struct fi
file->flags = 0;
file->modtime = modtime;
file->length = file_length;
file->mode = mode;
file->uid = uid;
-@@ -889,6 +903,7 @@ skip_excludes:
+@@ -885,6 +899,7 @@ skip_filters:
file->flags = flags;
file->modtime = st.st_mtime;
file->length = st.st_size;
file->mode = st.st_mode;
file->uid = st.st_uid;
---- orig/generator.c 2005-01-24 06:20:37
+--- orig/generator.c 2005-02-03 02:04:20
+++ generator.c 2004-11-03 23:02:12
@@ -99,7 +99,7 @@ static int unchanged_file(char *fn, stru
if (ignore_times)
}
-@@ -499,7 +499,7 @@ static void recv_generator(char *fname,
+@@ -497,7 +497,7 @@ static void recv_generator(char *fname,
}
if (update_only && fnamecmp_type == FNAMECMP_FNAME
if (verbose > 1)
rprintf(FINFO, "%s is newer\n", safe_fname(fname));
return;
---- orig/options.c 2005-01-25 03:26:51
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-24 01:51:48
-@@ -49,6 +49,7 @@ int preserve_uid = 0;
+@@ -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;
-@@ -266,6 +267,7 @@ void usage(enum logcode F)
+@@ -270,6 +271,7 @@ void usage(enum logcode F)
rprintf(F," -g, --group preserve group\n");
rprintf(F," -D, --devices preserve devices (root only)\n");
rprintf(F," -t, --times preserve times\n");
rprintf(F," -O, --omit-dir-times omit directories when preserving times\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
-@@ -382,6 +384,7 @@ static struct poptOption long_options[]
+@@ -389,6 +391,7 @@ static struct poptOption long_options[]
{"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 },
{"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
{"omit-dir-times", 'O', POPT_ARG_NONE, &omit_dir_times, 0, 0, 0 },
{"checksum", 'c', POPT_ARG_NONE, &always_checksum, 0, 0, 0 },
{"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 },
{"quiet", 'q', POPT_ARG_NONE, 0, 'q', 0, 0 },
-@@ -1128,6 +1131,8 @@ void server_options(char **args,int *arg
+@@ -1152,6 +1155,8 @@ void server_options(char **args,int *arg
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
if (omit_dir_times && am_sender)
argstr[x++] = 'O';
if (preserve_perms)
---- orig/rsync.c 2005-01-24 00:57:24
+--- orig/rsync.c 2005-02-01 10:39:22
+++ rsync.c 2005-01-24 01:59:12
@@ -26,6 +26,7 @@ extern int verbose;
extern int dry_run;
extern int omit_dir_times;
+extern int copy_atimes;
extern int am_root;
+ extern int am_server;
extern int am_sender;
- extern int am_generator;
-@@ -153,6 +154,7 @@ int set_perms(char *fname,struct file_st
+@@ -155,6 +156,7 @@ int set_perms(char *fname,struct file_st
int updated = 0;
STRUCT_STAT st2;
int change_uid, change_gid;
if (!st) {
if (dry_run)
-@@ -165,18 +167,28 @@ int set_perms(char *fname,struct file_st
+@@ -167,18 +169,28 @@ int set_perms(char *fname,struct file_st
st = &st2;
}
}
change_uid = am_root && preserve_uid && st->st_uid != file->uid;
---- orig/rsync.h 2005-01-25 00:53:58
+--- orig/rsync.h 2005-02-03 02:04:20
+++ rsync.h 2004-07-03 20:15:41
@@ -54,6 +54,7 @@
#define XMIT_HAS_IDEV_DATA (1<<9)
/* These flags are used in the live flist data. */
-@@ -117,6 +118,7 @@
+@@ -118,6 +119,7 @@
#define PERMS_REPORT (1<<0)
#define PERMS_SKIP_MTIME (1<<1)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -435,6 +437,7 @@ struct file_struct {
+@@ -485,6 +487,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-01-25 03:26:51
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2005-01-24 01:57:18
-@@ -332,6 +332,7 @@ verb(
+@@ -322,6 +322,7 @@ to the detailed description below for a
-D, --devices preserve devices (root only)
-t, --times preserve times
-O, --omit-dir-times omit directories when preserving times
+ -A, --copy-atimes copy access times
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
- -W, --whole-file copy whole files, no incremental checks
-@@ -648,6 +649,11 @@ dit(bf(-O, --omit-dir-times)) This tells
- it is preserving modification times (see --times). If NFS is sharing
- the directories on the receiving side, it is a good idea to use -O.
+ -W, --whole-file copy files whole
+@@ -641,6 +642,11 @@ dit(bf(-O, --omit-dir-times)) This tells
+ it is preserving modification times (see bf(--times)). If NFS is sharing
+ the directories on the receiving side, it is a good idea to use bf(-O).
+dit(bf(-A, --copy-atimes)) This tells rsync to transfer access times
+along with the files and update them on the remote system. Note that
return 0;
}
---- orig/util.c 2005-01-20 23:05:34
+--- orig/util.c 2005-01-28 19:08:20
+++ util.c 2005-01-21 18:56:05
@@ -128,12 +128,20 @@ void overflow(char *str)
if (dry_run)
@@ -142,17 +150,17 @@ int set_modtime(char *fname, time_t modt
{
- #ifdef HAVE_UTIMBUF
+ #if HAVE_UTIMBUF
struct utimbuf tbuf;
- tbuf.actime = time(NULL);
+ tbuf.actime = atime;
tbuf.modtime = modtime;
return utime(fname,&tbuf);
- #elif defined(HAVE_UTIME)
+ #elif HAVE_UTIME
time_t t[2];
- t[0] = time(NULL);
+ t[0] = atime;
+ deleting = 0;
+ return ret;
+}
---- orig/flist.c 2005-01-30 10:07:21
+--- orig/flist.c 2005-02-03 02:04:20
+++ flist.c 2005-01-30 10:11:42
@@ -47,6 +47,8 @@ extern char curr_dir[MAXPATHLEN];
extern unsigned int curr_dir_len;
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
-@@ -1659,10 +1662,14 @@ char *f_name(struct file_struct *f)
+@@ -1647,10 +1650,14 @@ char *f_name(struct file_struct *f)
}
}
-@@ -1759,11 +1766,12 @@ void delete_missing(struct file_list *fu
+@@ -1739,11 +1746,12 @@ void delete_missing(struct file_list *fu
|| (delete_during && S_ISDIR(mode)
&& !S_ISDIR(full_list->files[j]->mode))) {
char *f = f_name(dir_list->files[i]);
safe_fname(f));
}
} else if (S_ISDIR(mode)) {
---- orig/options.c 2005-01-30 10:07:21
+--- orig/options.c 2005-02-01 10:39:22
+++ 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 },
-@@ -935,6 +945,8 @@ int parse_arguments(int *argc, const cha
+@@ -938,6 +948,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);
}
-@@ -961,6 +973,12 @@ int parse_arguments(int *argc, const cha
+@@ -964,6 +976,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);
-@@ -981,6 +999,16 @@ int parse_arguments(int *argc, const cha
+@@ -984,6 +1002,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;
-@@ -1000,6 +1028,31 @@ int parse_arguments(int *argc, const cha
+@@ -1003,6 +1031,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;
-@@ -1217,6 +1270,10 @@ void server_options(char **args,int *arg
+@@ -1220,6 +1273,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) {
-@@ -1225,7 +1282,13 @@ void server_options(char **args,int *arg
+@@ -1228,7 +1285,13 @@ void server_options(char **args,int *arg
goto oom;
args[ac++] = arg;
}
+ }
+ return 0;
+}
---- orig/flist.c 2005-01-25 00:53:58
+--- orig/flist.c 2005-02-03 02:04:20
+++ flist.c 2004-09-18 01:51:11
@@ -70,6 +70,8 @@ extern int max_delete;
extern int orig_umask;
extern struct filter_list_struct filter_list;
extern struct filter_list_struct server_filter_list;
-@@ -890,7 +892,10 @@ skip_excludes:
+@@ -886,7 +888,10 @@ skip_filters:
file->flags = flags;
file->modtime = st.st_mtime;
file->length = st.st_size;
file->uid = st.st_uid;
file->gid = st.st_gid;
---- orig/options.c 2005-01-25 03:26:51
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-24 01:48:30
@@ -132,6 +132,7 @@ char *log_format = NULL;
char *password_file = NULL;
static int daemon_opt; /* sets am_daemon after option error-reporting */
static int F_option_cnt = 0;
static int modify_window_set;
-@@ -267,6 +270,7 @@ void usage(enum logcode F)
+@@ -271,6 +274,7 @@ void usage(enum logcode F)
rprintf(F," -D, --devices preserve devices (root only)\n");
rprintf(F," -t, --times preserve times\n");
rprintf(F," -O, --omit-dir-times omit directories when preserving 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 whole files, no incremental checks\n");
-@@ -379,6 +383,7 @@ static struct poptOption long_options[]
+ rprintf(F," -W, --whole-file copy files whole\n");
+@@ -386,6 +390,7 @@ static struct poptOption long_options[]
{"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 },
{"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
{"omit-dir-times", 'O', POPT_ARG_NONE, &omit_dir_times, 0, 0, 0 },
-@@ -984,6 +989,13 @@ int parse_arguments(int *argc, const cha
+@@ -1004,6 +1009,13 @@ int parse_arguments(int *argc, const cha
return 0;
}
if (do_progress && !verbose)
verbose = 1;
-@@ -1277,6 +1289,11 @@ void server_options(char **args,int *arg
+@@ -1305,6 +1317,11 @@ void server_options(char **args,int *arg
}
}
if (files_from && (!am_sender || remote_filesfrom_file)) {
if (remote_filesfrom_file) {
args[ac++] = "--files-from";
---- orig/rsync.yo 2005-01-25 03:26:51
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2005-01-24 01:48:43
-@@ -332,6 +332,7 @@ verb(
+@@ -322,6 +322,7 @@ to the detailed description below for a
-D, --devices preserve devices (root only)
-t, --times preserve times
-O, --omit-dir-times omit directories when preserving 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 whole files, no incremental checks
-@@ -648,6 +649,14 @@ dit(bf(-O, --omit-dir-times)) This tells
- it is preserving modification times (see --times). If NFS is sharing
- the directories on the receiving side, it is a good idea to use -O.
+ -W, --whole-file copy files whole
+@@ -641,6 +642,14 @@ dit(bf(-O, --omit-dir-times)) This tells
+ it is preserving modification times (see bf(--times)). If NFS is sharing
+ the directories on the receiving side, it is a good idea to use bf(-O).
+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
[Patched update to have context and apply to latest CVS source.]
---- orig/generator.c 2005-01-25 12:14:14
+--- orig/generator.c 2005-02-03 02:04:20
+++ generator.c 2004-11-11 22:15:27
@@ -43,6 +43,7 @@ extern int inplace;
extern int make_backups;
if (st->st_size != file->length)
return 0;
---- orig/options.c 2005-01-28 19:08:20
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-28 19:14:15
@@ -88,6 +88,7 @@ int keep_partial = 0;
int safe_symlinks = 0;
{"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"one-file-system", 'x', POPT_ARG_NONE, &one_file_system, 0, 0, 0 },
{"existing", 0, POPT_ARG_NONE, &only_existing, 0, 0, 0 },
-@@ -1241,6 +1244,9 @@ void server_options(char **args,int *arg
+@@ -1247,6 +1250,9 @@ void server_options(char **args,int *arg
if (size_only)
args[ac++] = "--size-only";
if (modify_window_set) {
if (asprintf(&arg, "--modify-window=%d", modify_window) < 0)
goto oom;
---- orig/rsync.yo 2005-01-28 17:12:14
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2005-01-28 19:14:37
-@@ -360,6 +360,7 @@ verb(
+@@ -349,6 +349,7 @@ to the detailed description below for a
--timeout=TIME set I/O timeout in seconds
-I, --ignore-times don't skip files that match size and time
--size-only skip files that match in size
--modify-window=NUM compare mod-times with reduced accuracy
-T --temp-dir=DIR create temporary files in directory DIR
--compare-dest=DIR also compare received files relative to DIR
-@@ -448,6 +449,12 @@ regardless of timestamp. This is useful
+@@ -434,6 +435,12 @@ regardless of timestamp. This is useful
after using another mirroring system which may not preserve timestamps
exactly.
This patch from Sami Farin lets you specify --fsync if you want fsync()
to be called on every file we write.
---- orig/options.c 2005-01-24 01:43:10
-+++ options.c 2004-11-27 18:10:44
-@@ -38,6 +38,7 @@ int make_backups = 0;
+--- orig/options.c 2005-02-01 10:39:22
++++ options.c 2005-01-28 19:30:47
+@@ -39,6 +39,7 @@ int make_backups = 0;
**/
int whole_file = -1;
int archive_mode = 0;
int keep_dirlinks = 0;
int copy_links = 0;
-@@ -251,6 +252,7 @@ void usage(enum logcode F)
- rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n");
- rprintf(F," --backup-dir make backups into this directory\n");
- rprintf(F," --suffix=SUFFIX backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
+@@ -294,6 +295,7 @@ void usage(enum logcode F)
+ rprintf(F," --partial keep partially transferred files\n");
+ rprintf(F," --partial-dir=DIR put a partially transferred file into DIR\n");
+ rprintf(F," --delay-updates put all updated files into place at transfer's end\n");
+ rprintf(F," --fsync fsync every written file\n");
- rprintf(F," -u, --update update only (don't overwrite newer files)\n");
- rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
- rprintf(F," -d, --dirs transfer directories without recursing\n");
-@@ -358,6 +360,7 @@ static struct poptOption long_options[]
+ rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n");
+ rprintf(F," --timeout=TIME set I/O timeout in seconds\n");
+ rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
+@@ -371,6 +373,7 @@ static struct poptOption long_options[]
{"safe-links", 0, POPT_ARG_NONE, &safe_symlinks, 0, 0, 0 },
{"help", 'h', POPT_ARG_NONE, 0, 'h', 0, 0 },
{"backup", 'b', POPT_ARG_NONE, &make_backups, 0, 0, 0 },
{"dry-run", 'n', POPT_ARG_NONE, &dry_run, 0, 0, 0 },
{"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 },
{"cvs-exclude", 'C', POPT_ARG_NONE, &cvs_exclude, 0, 0, 0 },
-@@ -1227,6 +1230,9 @@ void server_options(char **args,int *arg
+@@ -1293,6 +1296,9 @@ void server_options(char **args,int *arg
args[ac++] = tmpdir;
}
if (basis_dir[0] && am_sender) {
/* the server only needs this option if it is not the sender,
* and it may be an older version that doesn't know this
---- orig/receiver.c 2005-01-24 01:43:10
+--- orig/receiver.c 2005-02-03 02:04:20
+++ receiver.c 2004-07-16 20:13:31
-@@ -35,6 +35,7 @@ extern int keep_dirlinks;
+@@ -34,6 +34,7 @@ extern int keep_dirlinks;
extern int preserve_hard_links;
extern int preserve_perms;
extern int io_error;
extern char *tmpdir;
extern char *partial_dir;
extern char *basis_dir[];
-@@ -237,6 +238,12 @@ static int receive_data(int f_in, char *
+@@ -242,6 +243,12 @@ static int receive_data(int f_in, char *
exit_cleanup(RERR_FILEIO);
}
sum_end(file_sum1);
if (mapbuf)
---- orig/t_stub.c 2004-07-29 16:08:04
+--- orig/t_stub.c 2005-01-25 12:14:14
+++ t_stub.c 2004-10-09 04:03:09
@@ -28,6 +28,7 @@
char *partial_dir;
struct filter_list_struct server_filter_list;
---- orig/util.c 2005-01-20 23:05:34
+--- orig/util.c 2005-01-28 19:08:20
+++ util.c 2004-07-03 20:18:13
@@ -33,6 +33,7 @@ extern int module_id;
extern int modify_window;
Be sure to run "make proto" before "make".
---- orig/generator.c 2005-01-25 12:14:14
-+++ generator.c 2005-01-19 18:39:15
+--- orig/generator.c 2005-02-03 02:04:20
++++ generator.c 2005-02-03 02:11:10
@@ -47,6 +47,7 @@ extern int size_only;
extern OFF_T max_size;
extern int io_timeout;
+}
+
- /*
- * Acts on file number @p i from @p flist, whose name is @p fname.
-@@ -479,6 +562,15 @@ static void recv_generator(char *fname,
+ /* Acts on flist->file's ndx'th item, whose name is fname. If a directory,
+ * make sure it exists, and has the right permissions/timestamp info. For
+@@ -477,6 +560,15 @@ static void recv_generator(char *fname,
} else
partialptr = NULL;
if (statret == -1) {
if (preserve_hard_links && hard_link_check(file, HL_SKIP))
return;
-@@ -507,6 +599,8 @@ static void recv_generator(char *fname,
+@@ -505,6 +597,8 @@ static void recv_generator(char *fname,
if (!compare_dest && fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
;
else if (unchanged_file(fnamecmp, file, &st)) {
if (fnamecmp_type == FNAMECMP_FNAME)
set_perms(fname, file, &st, PERMS_REPORT);
-@@ -581,8 +675,24 @@ notify_others:
- write_int(f_out, i);
+@@ -579,8 +673,24 @@ notify_others:
+ write_int(f_out, ndx);
if (protocol_version >= 29 && inplace && !read_batch)
write_byte(f_out, fnamecmp_type);
- if (f_out_name >= 0)
if (dry_run || read_batch)
return;
---- orig/main.c 2005-01-28 19:08:20
+--- orig/main.c 2005-01-30 10:07:21
+++ main.c 2005-01-14 18:33:15
-@@ -49,6 +49,7 @@ extern int keep_dirlinks;
+@@ -48,6 +48,7 @@ extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int recurse;
extern int relative_paths;
extern int rsync_port;
extern int whole_file;
-@@ -485,7 +486,8 @@ static int do_recv(int f_in,int f_out,st
+@@ -491,7 +492,8 @@ static int do_recv(int f_in,int f_out,st
int pid;
int status = 0;
int error_pipe[2], name_pipe[2];
/* The receiving side mustn't obey this, or an existing symlink that
* points to an identical file won't be replaced by the referent. */
---- orig/options.c 2005-01-28 19:08:20
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-28 19:31:20
@@ -90,6 +90,7 @@ int copy_unsafe_links = 0;
int size_only = 0;
/* TODO: Should this take an optional int giving the compression level? */
{"compress", 'z', POPT_ARG_NONE, &do_compression, 0, 0, 0 },
{"stats", 0, POPT_ARG_NONE, &do_stats, 0, 0, 0 },
-@@ -1315,6 +1318,9 @@ void server_options(char **args,int *arg
+@@ -1321,6 +1324,9 @@ void server_options(char **args,int *arg
if (!implied_dirs && !am_sender)
args[ac++] = "--no-implied-dirs";
*argc = ac;
return;
---- orig/receiver.c 2005-01-28 19:08:20
+--- orig/receiver.c 2005-02-03 02:04:20
+++ receiver.c 2005-01-15 21:21:02
-@@ -252,6 +252,27 @@ static int receive_data(int f_in, char *
+@@ -256,6 +256,27 @@ static int receive_data(int f_in, char *
}
static void discard_receive_data(int f_in, OFF_T length)
{
receive_data(f_in, NULL, -1, 0, NULL, -1, length);
-@@ -390,6 +411,10 @@ int recv_files(int f_in, struct file_lis
+@@ -395,6 +416,10 @@ int recv_files(int f_in, struct file_lis
case FNAMECMP_BACKUP:
fnamecmp = get_backup_name(fname);
break;
default:
if (j >= basis_dir_cnt) {
rprintf(FERROR,
---- orig/rsync.h 2005-01-28 19:08:20
+--- orig/rsync.h 2005-02-03 02:04:20
+++ rsync.h 2005-01-19 18:36:47
-@@ -130,6 +130,7 @@
+@@ -131,6 +131,7 @@
#define FNAMECMP_FNAME 0x80
#define FNAMECMP_PARTIAL_DIR 0x81
#define FNAMECMP_BACKUP 0x82
/* For calling delete_file() */
#define DEL_DIR (1<<0)
---- orig/rsync.yo 2005-01-28 17:12:14
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2005-01-28 19:31:36
-@@ -365,6 +365,7 @@ verb(
+@@ -354,6 +354,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
-z, --compress compress file data
-C, --cvs-exclude auto-ignore files in the same way CVS does
-f, --filter=RULE add a file-filtering RULE
-@@ -949,6 +950,14 @@ Note that rsync versions prior to 2.6.1
- (or implied by -a). You can work-around this bug by avoiding the -o option
+@@ -937,6 +938,14 @@ bf(--link-dest) from working properly fo
+ (or implied by bf(-a)). You can work-around this bug by avoiding the bf(-o) option
when sending to an old rsync.
+dit(bf(--fuzzy)) This option tells rsync that it should look around for a
This adds the --ignore-case option, which makes rsync compare filenames
in a case-insensitive manner.
---- orig/lib/wildmatch.c 2003-07-14 15:12:59
+--- orig/lib/wildmatch.c 2005-01-28 23:01:12
+++ lib/wildmatch.c 2004-08-13 16:43:27
@@ -53,6 +53,8 @@
#define ISUPPER(c) (ISASCII(c) && isupper(c))
#ifdef WILD_TEST_ITERATIONS
int wildmatch_iteration_count;
#endif
-@@ -76,9 +78,19 @@ static int domatch(const unsigned char *
+@@ -76,9 +78,19 @@ static int domatch(const uchar *p, const
ch = *++p;
/* FALLTHROUGH */
default:
case '?':
/* Match anything but '/'. */
if (*text == '/')
---- orig/options.c 2005-01-01 21:11:00
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2004-10-14 17:22:51
-@@ -94,6 +94,7 @@ int max_delete = 0;
+@@ -97,6 +97,7 @@ int max_delete = 0;
OFF_T max_size = 0;
int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
int inplace = 0;
-@@ -297,6 +298,7 @@ void usage(enum logcode F)
- rprintf(F," --include-from=FILE don't exclude patterns listed in FILE\n");
- rprintf(F," --files-from=FILE read FILE for list of source-file names\n");
+@@ -314,6 +315,7 @@ void usage(enum logcode F)
+ rprintf(F," --include-from=FILE read include patterns from FILE\n");
+ rprintf(F," --files-from=FILE read list of source-file names from FILE\n");
rprintf(F," -0, --from0 all *-from file lists are delimited by nulls\n");
+ rprintf(F," --ignore-case ignore case when comparing filenames\n");
rprintf(F," --version print version number\n");
rprintf(F," --port=PORT specify double-colon alternate port number\n");
rprintf(F," --blocking-io use blocking I/O for the remote shell\n");
-@@ -347,6 +349,7 @@ static struct poptOption long_options[]
+@@ -368,6 +370,7 @@ static struct poptOption long_options[]
{"include", 0, POPT_ARG_STRING, 0, OPT_INCLUDE, 0, 0 },
{"exclude-from", 0, POPT_ARG_STRING, 0, OPT_EXCLUDE_FROM, 0, 0 },
{"include-from", 0, POPT_ARG_STRING, 0, OPT_INCLUDE_FROM, 0, 0 },
{"safe-links", 0, POPT_ARG_NONE, &safe_symlinks, 0, 0, 0 },
{"help", 'h', POPT_ARG_NONE, 0, 'h', 0, 0 },
{"backup", 'b', POPT_ARG_NONE, &make_backups, 0, 0, 0 },
-@@ -1182,6 +1185,9 @@ void server_options(char **args,int *arg
+@@ -1259,6 +1262,9 @@ void server_options(char **args,int *arg
args[ac++] = arg;
}
if (partial_dir && am_sender) {
args[ac++] = "--partial-dir";
args[ac++] = partial_dir;
---- orig/t_stub.c 2004-07-29 16:08:04
+--- orig/t_stub.c 2005-01-25 12:14:14
+++ t_stub.c 2004-08-13 17:19:56
@@ -28,6 +28,7 @@
char *partial_dir;
struct filter_list_struct server_filter_list;
---- orig/util.c 2004-09-07 21:45:30
+--- orig/util.c 2005-01-28 19:08:20
+++ util.c 2004-08-13 16:40:34
@@ -31,6 +31,7 @@ extern int verbose;
extern int dry_run;
extern char *partial_dir;
extern struct filter_list_struct server_filter_list;
-@@ -1015,11 +1016,23 @@ int u_strcmp(const char *cs1, const char
+@@ -1011,11 +1012,23 @@ int u_strcmp(const char *cs1, const char
{
const uchar *s1 = (const uchar *)cs1;
const uchar *s2 = (const uchar *)cs2;
+}
+
+#endif
---- orig/options.c 2005-01-28 19:08:20
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-28 19:32:26
@@ -132,6 +132,7 @@ char *log_format = NULL;
char *password_file = NULL;
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -1299,6 +1317,11 @@ void server_options(char **args,int *arg
+@@ -1305,6 +1323,11 @@ void server_options(char **args,int *arg
}
}
if (files_from && (!am_sender || remote_filesfrom_file)) {
if (remote_filesfrom_file) {
args[ac++] = "--files-from";
---- orig/receiver.c 2005-01-28 19:08:20
+--- orig/receiver.c 2005-02-03 02:04:20
+++ receiver.c 2005-01-15 21:29:13
-@@ -36,6 +36,7 @@ extern int preserve_hard_links;
+@@ -35,6 +35,7 @@ extern int preserve_hard_links;
extern int preserve_perms;
extern int io_error;
extern char *tmpdir;
extern char *partial_dir;
extern char *basis_dir[];
extern int basis_dir_cnt;
-@@ -132,12 +133,13 @@ static int get_tmpname(char *fnametmp, c
+@@ -136,12 +137,13 @@ static int get_tmpname(char *fnametmp, c
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
int32 len;
OFF_T offset = 0;
OFF_T offset2;
-@@ -157,6 +159,9 @@ static int receive_data(int f_in, char *
+@@ -161,6 +163,9 @@ static int receive_data(int f_in, char *
} else
mapbuf = NULL;
sum_init(checksum_seed);
while ((i = recv_token(f_in, &data)) != 0) {
-@@ -173,6 +178,8 @@ static int receive_data(int f_in, char *
+@@ -177,6 +182,8 @@ static int receive_data(int f_in, char *
cleanup_got_literal = 1;
sum_update(data, i);
if (fd != -1 && write_file(fd,data,i) != i)
goto report_write_error;
-@@ -199,6 +206,8 @@ static int receive_data(int f_in, char *
+@@ -203,6 +210,8 @@ static int receive_data(int f_in, char *
see_token(map, len);
sum_update(map, len);
}
if (inplace) {
-@@ -239,6 +248,8 @@ static int receive_data(int f_in, char *
+@@ -243,6 +252,8 @@ static int receive_data(int f_in, char *
}
sum_end(file_sum1);
if (mapbuf)
unmap_file(mapbuf);
-@@ -254,7 +265,7 @@ static int receive_data(int f_in, char *
+@@ -258,7 +269,7 @@ static int receive_data(int f_in, char *
static void discard_receive_data(int f_in, OFF_T length)
{
}
-@@ -495,8 +506,12 @@ int recv_files(int f_in, struct file_lis
+@@ -500,8 +511,12 @@ int recv_files(int f_in, struct file_lis
rprintf(FINFO, "%s\n", safe_fname(fname));
/* recv file data */
log_recv(file, &initial_stats);
---- orig/rsync.c 2005-01-28 19:08:20
+--- orig/rsync.c 2005-02-01 10:39:22
+++ rsync.c 2004-08-13 18:14:34
-@@ -35,6 +35,7 @@ extern int force_delete;
+@@ -36,6 +36,7 @@ extern int force_delete;
extern int recurse;
extern int keep_dirlinks;
extern int make_backups;
extern char *backup_dir;
extern int inplace;
-@@ -281,7 +282,12 @@ void finish_transfer(char *fname, char *
+@@ -282,7 +283,12 @@ void finish_transfer(char *fname, char *
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
if (ret < 0) {
rsyserr(FERROR, errno, "%s %s -> \"%s\"",
ret == -2 ? "copy" : "rename",
---- orig/rsync.h 2005-01-28 19:08:20
+--- orig/rsync.h 2005-02-03 02:04:20
+++ rsync.h 2004-07-03 20:20:15
-@@ -599,6 +599,14 @@ struct stats {
+@@ -598,6 +598,14 @@ struct stats {
int current_file_index;
};
+};
+
- /* we need this function because of the silly way in which duplicate
- entries are handled in the file lists - we can't change this
---- orig/rsync.yo 2005-01-28 17:12:14
+ #include "byteorder.h"
+ #include "lib/mdfour.h"
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2005-01-28 19:32:45
-@@ -365,6 +365,7 @@ verb(
+@@ -354,6 +354,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
handle relative symlinks properly, and that has not yet been fixed
in this modified version.
---- orig/flist.c 2005-01-28 19:08:20
+--- orig/flist.c 2005-02-03 02:04:20
+++ flist.c 2004-07-16 16:58:04
@@ -52,6 +52,7 @@ extern int filesfrom_fd;
extern int one_file_system;
extern int preserve_hard_links;
extern int preserve_perms;
extern int preserve_devices;
-@@ -740,6 +741,30 @@ void receive_file_entry(struct file_stru
+@@ -738,6 +739,30 @@ static void receive_file_entry(struct fi
}
/**
* Create a file_struct for a named file by reading its stat()
* information and performing extensive checks against global
-@@ -864,7 +889,13 @@ skip_filters:
+@@ -862,7 +887,13 @@ skip_filters:
basename_len = strlen(basename) + 1; /* count the '\0' */
#if SUPPORT_LINKS
#else
linkname_len = 0;
#endif
---- orig/options.c 2005-01-28 19:08:20
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-28 19:33:24
-@@ -42,6 +42,7 @@ int archive_mode = 0;
+@@ -43,6 +43,7 @@ int archive_mode = 0;
int keep_dirlinks = 0;
int copy_links = 0;
int preserve_links = 0;
{"copy-links", 'L', POPT_ARG_NONE, ©_links, 0, 0, 0 },
{"keep-dirlinks", 'K', POPT_ARG_NONE, &keep_dirlinks, 0, 0, 0 },
{"whole-file", 'W', POPT_ARG_VAL, &whole_file, 1, 0, 0 },
---- orig/rsync.yo 2005-01-28 17:12:14
+--- orig/rsync.yo 2005-02-01 10:39:23
+++ rsync.yo 2005-01-28 19:33:40
-@@ -322,6 +322,7 @@ verb(
+@@ -311,6 +311,7 @@ to the detailed description below for a
--inplace update destination files in-place
-d, --dirs transfer directories without recursing
-l, --links copy symlinks as symlinks
This patch still needs autoconf support for portability.
---- orig/access.c 2005-01-15 20:06:58
+--- orig/access.c 2005-01-28 19:08:19
+++ access.c 2005-01-15 20:09:59
@@ -22,12 +22,15 @@
*/
TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o
---- orig/cleanup.c 2005-01-10 09:46:11
+--- orig/cleanup.c 2005-01-28 23:01:07
+++ cleanup.c 2005-01-10 10:43:22
@@ -22,6 +22,9 @@
#include "rsync.h"
extern int io_error;
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+extern int use_ssl;
+#endif
extern int keep_partial;
extern int log_got_error;
extern char *partial_dir;
-@@ -98,6 +101,11 @@ void _exit_cleanup(int code, const char
+@@ -97,6 +100,11 @@ void _exit_cleanup(int code, const char
signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ if (use_ssl)
+ end_tls();
+#endif
if (verbose > 3) {
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n",
code, file, line);
---- orig/clientserver.c 2005-01-25 00:53:58
+--- orig/clientserver.c 2005-02-01 10:39:22
+++ clientserver.c 2004-10-08 20:44:59
-@@ -47,6 +47,9 @@ extern int select_timeout;
+@@ -45,6 +45,9 @@ extern int select_timeout;
extern int orig_umask;
extern int no_detach;
extern int default_af_hint;
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+extern int use_ssl;
+#endif
extern char *bind_address;
+ if (ret < 0)
+ return ret;
+
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ if (use_ssl) {
+ int f_in = get_tls_rfd();
+ int f_out = get_tls_wfd();
if (verbose > 1)
print_child_argv(sargs);
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ if (use_ssl) {
+ io_printf(f_out, "#starttls\n");
+ while (1) {
* server to terminate the listing of modules.
* We don't want to go on and transfer
* anything; just exit. */
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ if (use_ssl)
+ end_tls();
+#endif
rprintf(FERROR, "%s\n", line);
/* This is always fatal; the server will now
* close the socket. */
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ if (use_ssl)
+ end_tls();
+#endif
return RERR_STARTCLIENT;
} else {
rprintf(FINFO,"%s\n", line);
-@@ -519,6 +567,7 @@ static void send_listing(int fd)
+@@ -523,6 +571,7 @@ static void send_listing(int fd)
io_printf(fd,"@RSYNCD: EXIT\n");
}
/* this is called when a connection is established to a client
and we want to start talking. The setup of the system is done from
here */
-@@ -568,6 +617,9 @@ int start_daemon(int f_in, int f_out)
+@@ -572,6 +621,9 @@ int start_daemon(int f_in, int f_out)
if (protocol_version > remote_protocol)
protocol_version = remote_protocol;
line[0] = 0;
if (!read_line(f_in, line, sizeof line - 1))
return -1;
-@@ -577,6 +629,20 @@ int start_daemon(int f_in, int f_out)
+@@ -581,6 +633,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
if (*line == '#') {
/* it's some sort of command that I don't understand */
io_printf(f_out, "@ERROR: Unknown command '%s'\n", line);
---- orig/configure.in 2005-01-10 00:21:12
+--- orig/configure.in 2005-01-28 23:01:08
+++ configure.in 2004-07-03 20:22:28
@@ -271,6 +271,21 @@ yes
AC_SEARCH_LIBS(getaddrinfo, inet6)
AC_MSG_CHECKING([whether to call shutdown on all sockets])
case $host_os in
*cygwin* ) AC_MSG_RESULT(yes)
---- orig/main.c 2005-01-24 01:43:10
+--- orig/main.c 2005-01-30 10:07:21
+++ main.c 2004-10-08 20:15:28
-@@ -57,6 +57,9 @@ extern int write_batch;
+@@ -56,6 +56,9 @@ extern int write_batch;
extern int batch_fd;
extern int batch_gen_fd;
extern int filesfrom_fd;
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+extern int use_ssl;
+#endif
extern pid_t cleanup_child_pid;
extern char *files_from;
extern char *remote_filesfrom_file;
-@@ -808,33 +811,48 @@ static int start_client(int argc, char *
+@@ -835,33 +838,48 @@ static int start_client(int argc, char *
if ((rc = copy_argv(argv)))
return rc;
- *p = '\0';
+ /* rsync:// always uses rsync server over direct socket connection */
+ if (strncasecmp(URL_PREFIX, argv[0], url_prefix_len) != 0) {
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ url_prefix_len = sizeof SSL_URL_PREFIX - 1;
+ if (strncasecmp(SSL_URL_PREFIX, argv[0], url_prefix_len) != 0)
+ url_prefix_len = 0;
p = find_colon(argv[0]);
if (p) { /* source is remote */
if (remote_filesfrom_file
-@@ -866,12 +884,26 @@ static int start_client(int argc, char *
+@@ -893,12 +911,26 @@ static int start_client(int argc, char *
argv++;
} else { /* source is local */
am_sender = 1;
/* rsync:// destination uses rsync server over direct socket */
- if (strncasecmp(URL_PREFIX, argv[argc-1], strlen(URL_PREFIX)) == 0) {
+ if (strncasecmp(URL_PREFIX, argv[argc-1], url_prefix_len) != 0) {
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ url_prefix_len = sizeof SSL_URL_PREFIX - 1;
+ if (strncasecmp(SSL_URL_PREFIX, argv[argc-1], url_prefix_len) != 0)
+ url_prefix_len = 0;
p = strchr(host,'/');
if (p) {
*p = '\0';
---- orig/options.c 2005-01-25 03:26:51
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2004-11-27 18:31:46
@@ -144,6 +144,14 @@ int quiet = 0;
int always_checksum = 0;
int list_only = 0;
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+int use_ssl = 0;
+char *ssl_cert_path = NULL;
+char *ssl_key_path = NULL;
+ char const *ssl = "no ";
STRUCT_STAT *dumstat;
- #ifdef HAVE_SOCKETPAIR
+ #if HAVE_SOCKETPAIR
@@ -188,6 +197,10 @@ static void print_rsync_version(enum log
ipv6 = "";
#endif
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ ssl = "";
+#endif
+
#ifdef MAINTAINER_MODE
rprintf(f, " panic action: \"%s\"\n",
get_panic_action());
-@@ -325,6 +338,13 @@ void usage(enum logcode F)
+@@ -331,6 +344,13 @@ void usage(enum logcode F)
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
#endif
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ rprintf(F," --ssl allow socket connections to use SSL\n");
+ rprintf(F," --ssl-cert=FILE path to server's SSL certificate\n");
+ rprintf(F," --ssl-key=FILE path to server's SSL private key\n");
rprintf(F," -h, --help show this help screen\n");
rprintf(F,"\nUse \"rsync --daemon --help\" to see the daemon-mode command-line options.\n");
-@@ -335,7 +355,7 @@ void usage(enum logcode F)
+@@ -341,7 +361,7 @@ void usage(enum logcode F)
enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW,
OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -428,6 +448,13 @@ static struct poptOption long_options[]
+@@ -436,6 +456,13 @@ static struct poptOption long_options[]
{"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 },
{"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 },
#endif
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ {"ssl", 0, POPT_ARG_NONE, 0, OPT_USE_SSL, 0, 0},
+ {"ssl-cert", 0, POPT_ARG_STRING, &ssl_cert_path, OPT_USE_SSL, 0, 0},
+ {"ssl-key", 0, POPT_ARG_STRING, &ssl_key_path, OPT_USE_SSL, 0, 0},
/* All these options switch us into daemon-mode option-parsing. */
{"address", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
-@@ -788,6 +815,12 @@ int parse_arguments(int *argc, const cha
+@@ -802,6 +829,12 @@ int parse_arguments(int *argc, const cha
basis_dir[basis_dir_cnt++] = (char *)arg;
break;
+ case OPT_USE_SSL:
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ use_ssl = 1;
+#endif
+ break;
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -995,6 +1028,17 @@ int parse_arguments(int *argc, const cha
- bwlimit_writemax = 512;
- }
+@@ -1018,6 +1051,17 @@ int parse_arguments(int *argc, const cha
+ if (delay_updates && !partial_dir)
+ partial_dir = ".~tmp~";
-+#ifdef HAVE_OPENSSL
++#if HAVE_OPENSSL
+ if (use_ssl) {
+ if (init_tls()) {
+ snprintf(err_buf, sizeof(err_buf),
if (inplace) {
#if HAVE_FTRUNCATE
if (partial_dir) {
---- orig/rsync.h 2005-01-25 00:53:58
+--- orig/rsync.h 2005-02-03 02:04:20
+++ rsync.h 2004-10-08 21:01:33
@@ -32,6 +32,7 @@
#define BACKUP_SUFFIX "~"
-@@ -339,6 +340,11 @@ enum msgcode {
- #define INT64_IS_OFF_T
+@@ -386,6 +387,11 @@ enum msgcode {
+ # define SIZEOF_INT64 SIZEOF_OFF_T
#endif
+#if HAVE_OPENSSL
+
+#include "rsync.h"
+
-+#ifdef HAVE_SYS_SELECT_H
++#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#else
+#include <sys/time.h>
rsync -avoogg host:/from/ /to/
---- orig/compat.c 2004-07-21 23:59:35
+--- orig/compat.c 2005-02-01 10:39:22
+++ compat.c 2004-09-09 01:59:08
@@ -28,8 +28,11 @@
int remote_protocol = 0;
+ preserve_gid = 2;
+ }
}
---- orig/options.c 2005-01-24 01:43:10
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2004-09-09 01:59:08
-@@ -371,8 +371,8 @@ static struct poptOption long_options[]
+@@ -384,8 +384,8 @@ 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 },
{"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 },
{"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
{"omit-dir-times", 'O', POPT_ARG_NONE, &omit_dir_times, 0, 0, 0 },
-@@ -654,6 +654,14 @@ int parse_arguments(int *argc, const cha
+@@ -690,6 +690,14 @@ int parse_arguments(int *argc, const cha
usage(FINFO);
exit_cleanup(0);
case 'v':
verbose++;
break;
-@@ -849,8 +857,8 @@ int parse_arguments(int *argc, const cha
+@@ -901,8 +909,8 @@ int parse_arguments(int *argc, const cha
#endif
preserve_perms = 1;
preserve_times = 1;
preserve_devices = 1;
}
-@@ -1080,10 +1088,16 @@ void server_options(char **args,int *arg
+@@ -1144,10 +1152,16 @@ void server_options(char **args,int *arg
if (preserve_hard_links)
argstr[x++] = 'H';
if (preserve_devices)
argstr[x++] = 'D';
if (preserve_times)
---- orig/rsync.c 2005-01-24 00:57:24
-+++ rsync.c 2005-01-24 02:07:24
+--- orig/rsync.c 2005-02-01 10:39:22
++++ rsync.c 2005-02-01 10:46:04
@@ -26,7 +26,6 @@ extern int verbose;
extern int dry_run;
extern int preserve_times;
extern int omit_dir_times;
-extern int am_root;
+ extern int am_server;
extern int am_sender;
extern int am_generator;
- extern int preserve_uid;
-@@ -179,7 +178,7 @@ int set_perms(char *fname,struct file_st
+@@ -181,7 +180,7 @@ int set_perms(char *fname,struct file_st
updated = 1;
}
change_gid = preserve_gid && file->gid != GID_NONE
&& st->st_gid != file->gid;
#if !HAVE_LCHOWN && !CHOWN_MODIFIES_SYMLINK
---- orig/uidlist.c 2004-04-29 19:37:25
+--- orig/uidlist.c 2005-01-28 19:08:20
+++ uidlist.c 2004-09-09 01:59:08
@@ -35,7 +35,6 @@ extern int verbose;
extern int preserve_uid;
[Updated to latest CVS source by Wayne Davison.]
---- orig/syscall.c 2004-08-02 21:56:59
+--- orig/syscall.c 2005-01-28 23:01:10
+++ syscall.c 2004-04-22 23:48:45
-@@ -58,9 +58,14 @@ int do_symlink(char *fname1, char *fname
+@@ -62,9 +62,14 @@ int do_symlink(char *fname1, char *fname
#if HAVE_LINK
int do_link(char *fname1, char *fname2)
{
Do we need configure support for mktime()?
---- orig/io.c 2005-01-28 06:51:59
+--- orig/io.c 2005-02-03 02:04:20
+++ io.c 2004-07-17 15:28:36
@@ -51,6 +51,7 @@ extern int eol_nulls;
extern int csum_length;
- if (t - last_io >= io_timeout) {
+ if (io_timeout && t - last_io >= io_timeout) {
if (!am_server && !am_daemon) {
- rprintf(FERROR, "io timeout after %d seconds - exiting\n",
+ rprintf(FERROR, "io timeout after %d seconds -- exiting\n",
(int)(t-last_io));
---- orig/options.c 2005-01-28 19:08:20
+--- orig/options.c 2005-02-01 10:39:22
+++ options.c 2005-01-28 19:35:23
@@ -102,6 +102,7 @@ int checksum_seed = 0;
int inplace = 0;
default:
/* A large opt value means that set_refuse_options()
* turned this option off (opt-BASE is its index). */
-@@ -1210,6 +1246,15 @@ void server_options(char **args,int *arg
+@@ -1216,6 +1252,15 @@ void server_options(char **args,int *arg
args[ac++] = arg;
}
if (backup_dir) {
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
---- orig/rsync.yo 2005-01-28 17:12:14
-+++ rsync.yo 2005-01-28 19:35:35
-@@ -387,6 +387,8 @@ verb(
+--- orig/rsync.yo 2005-02-01 10:39:23
++++ rsync.yo 2005-02-01 10:46:35
+@@ -376,6 +376,8 @@ to the detailed description below for a
--password-file=FILE read password from FILE
--list-only list the files instead of copying them
--bwlimit=KBPS limit I/O bandwidth; KBytes per second
+ --stop-at=y-m-dTh:m Stop rsync at year-month-dayThour:minute
+ --time-limit=MINS Stop rsync after MINS minutes have elapsed
- --write-batch=FILE write a batched update to FILE
+ --write-batch=FILE write a batched update to FILE
--read-batch=FILE read a batched update from FILE
--checksum-seed=NUM set block/file checksum seed (advanced)
-@@ -1124,6 +1126,19 @@ transfer was too fast, it will wait befo
+@@ -1108,6 +1110,19 @@ transfer was too fast, it will wait befo
result is an average transfer rate equaling the specified limit. A value
of zero specifies no limit.
+number of minutes rsync will run for.
+
dit(bf(--write-batch=FILE)) Record a file that can later be applied to
- another identical destination with --read-batch. See the "BATCH MODE"
+ another identical destination with bf(--read-batch). See the "BATCH MODE"
section for details.
--- orig/util.c 2005-01-28 19:08:20
+++ util.c 2004-07-03 20:23:22
#if defined(__KAME__) && defined(INET6)
# define FAITH
#endif
---- orig/syscall.c 2004-10-06 00:12:16
+--- orig/syscall.c 2005-01-28 23:01:10
+++ syscall.c 2004-10-06 00:17:22
@@ -27,6 +27,7 @@
#include "rsync.h"