From 898a2112e681761ce68f6f3aca9ed78921699963 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 2 Jul 2007 22:38:15 +0000 Subject: [PATCH] Fixed failing hunks. --- atimes.diff | 121 +++++++++++++++++++++------------------ checksum-xattr.diff | 31 ++-------- flags.diff | 129 ++++++++++++++++++++++++------------------ omit-dir-changes.diff | 32 +++++------ 4 files changed, 158 insertions(+), 155 deletions(-) diff --git a/atimes.diff b/atimes.diff index e032fa2..2bd9c8a 100644 --- a/atimes.diff +++ b/atimes.diff @@ -9,22 +9,39 @@ TODO: need to fix this to handle 64-bit time_t values! --- old/compat.c +++ new/compat.c -@@ -95,6 +95,8 @@ void setup_protocol(int f_out,int f_in) - preserve_uid = ++file_extra_cnt; +@@ -43,6 +43,7 @@ extern int prune_empty_dirs; + extern int protocol_version; + extern int preserve_uid; + extern int preserve_gid; ++extern int preserve_atimes; + extern int preserve_acls; + extern int preserve_xattrs; + extern int preserve_hard_links; +@@ -57,7 +58,7 @@ extern char *dest_option; + extern struct filter_list_struct filter_list; + + /* These index values are for the file-list's extra-attribute array. */ +-int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx; ++int uid_ndx, gid_ndx, atimes_ndx, acls_ndx, xattrs_ndx; + + /* The server makes sure that if either side only supports a pre-release + * version of a protocol, that both sides must speak a compatible version +@@ -98,6 +99,8 @@ void setup_protocol(int f_out,int f_in) + uid_ndx = ++file_extra_cnt; if (preserve_gid) - preserve_gid = ++file_extra_cnt; + gid_ndx = ++file_extra_cnt; + if (preserve_atimes) -+ preserve_atimes = ++file_extra_cnt; ++ atimes_ndx = ++file_extra_cnt; if (preserve_acls && !am_sender) - preserve_acls = ++file_extra_cnt; + acls_ndx = ++file_extra_cnt; if (preserve_xattrs) --- old/flist.c +++ new/flist.c @@ -52,6 +52,7 @@ extern int preserve_devices; extern int preserve_specials; - extern int preserve_uid; - extern int preserve_gid; -+extern int preserve_atimes; + extern int uid_ndx; + extern int gid_ndx; ++extern int atimes_ndx; extern int relative_paths; extern int implied_dirs; extern int file_extra_cnt; @@ -32,7 +49,7 @@ TODO: need to fix this to handle 64-bit time_t values! static void list_file_entry(struct file_struct *f) { char permbuf[PERMSTRING_SIZE]; -+ time_t atime = preserve_atimes ? F_ATIME(f) : 0; ++ time_t atime = atimes_ndx ? F_ATIME(f) : 0; double len; if (!F_IS_ACTIVE(f)) { @@ -43,7 +60,7 @@ TODO: need to fix this to handle 64-bit time_t values! - rprintf(FINFO, "%s %11.0f %s %s -> %s\n", + rprintf(FINFO, "%s %11.0f %s %s %s -> %s\n", permbuf, len, timestring(f->modtime), -+ preserve_atimes ? timestring(atime) : "", ++ atimes_ndx ? timestring(atime) : "", f_name(f, NULL), F_SYMLINK(f)); } else #endif @@ -51,11 +68,11 @@ TODO: need to fix this to handle 64-bit time_t values! - rprintf(FINFO, "%s %11.0f %s %s\n", + rprintf(FINFO, "%s %11.0f %s %s %s\n", permbuf, len, timestring(f->modtime), -+ preserve_atimes ? timestring(atime) : "", ++ atimes_ndx ? timestring(atime) : "", f_name(f, NULL)); } } -@@ -338,6 +342,7 @@ int push_pathname(const char *dir, int l +@@ -347,6 +351,7 @@ int push_pathname(const char *dir, int l static void send_file_entry(int f, struct file_struct *file, int ndx) { static time_t modtime; @@ -63,11 +80,11 @@ TODO: need to fix this to handle 64-bit time_t values! static mode_t mode; static int64 dev; static dev_t rdev; -@@ -433,6 +438,13 @@ static void send_file_entry(int f, struc +@@ -442,6 +447,13 @@ static void send_file_entry(int f, struc flags |= XMIT_SAME_TIME; else modtime = file->modtime; -+ if (preserve_atimes && !S_ISDIR(mode)) { ++ if (atimes_ndx && !S_ISDIR(mode)) { + time_t file_atime = F_ATIME(file); + if (file_atime == atime) + flags |= XMIT_SAME_ATIME; @@ -77,16 +94,16 @@ TODO: need to fix this to handle 64-bit time_t values! #ifdef SUPPORT_HARD_LINKS if (tmp_dev != 0) { -@@ -504,6 +516,8 @@ static void send_file_entry(int f, struc +@@ -513,6 +525,8 @@ static void send_file_entry(int f, struc } if (!(flags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); -+ if (preserve_atimes && !S_ISDIR(mode) && !(flags & XMIT_SAME_ATIME)) ++ if (atimes_ndx && !S_ISDIR(mode) && !(flags & XMIT_SAME_ATIME)) + write_varlong(f, atime, 4); - if (preserve_uid && !(flags & XMIT_SAME_UID)) { + if (uid_ndx && !(flags & XMIT_SAME_UID)) { if (protocol_version < 30) write_int(f, uid); -@@ -590,7 +604,7 @@ static void send_file_entry(int f, struc +@@ -599,7 +613,7 @@ static void send_file_entry(int f, struc static struct file_struct *recv_file_entry(struct file_list *flist, int xflags, int f) { @@ -95,11 +112,11 @@ TODO: need to fix this to handle 64-bit time_t values! static mode_t mode; static int64 dev; static dev_t rdev; -@@ -726,6 +740,16 @@ static struct file_struct *recv_file_ent +@@ -735,6 +749,16 @@ static struct file_struct *recv_file_ent } if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); -+ if (preserve_atimes && !S_ISDIR(mode) && !(flags & XMIT_SAME_ATIME)) { ++ if (atimes_ndx && !S_ISDIR(mode) && !(xflags & XMIT_SAME_ATIME)) { + atime = read_varlong(f, 4); +#if SIZEOF_TIME_T < SIZEOF_INT64 + if ((atime > INT_MAX || atime < INT_MIN) && !am_generator) { @@ -112,34 +129,34 @@ TODO: need to fix this to handle 64-bit time_t values! if (chmod_modes && !S_ISLNK(mode)) mode = tweak_mode(mode, chmod_modes); -@@ -854,6 +878,8 @@ static struct file_struct *recv_file_ent +@@ -863,6 +887,8 @@ static struct file_struct *recv_file_ent F_GROUP(file) = gid; file->flags |= gid_flags; } -+ if (preserve_atimes) ++ if (atimes_ndx) + F_ATIME(file) = (time_t)atime; #ifdef ICONV_OPTION if (ic_ndx) F_NDX(file) = flist->count + flist->ndx_start; -@@ -1173,6 +1199,8 @@ struct file_struct *make_file(const char +@@ -1182,6 +1208,8 @@ struct file_struct *make_file(const char F_OWNER(file) = st.st_uid; - if (preserve_gid) + if (gid_ndx) F_GROUP(file) = st.st_gid; -+ if (preserve_atimes) ++ if (atimes_ndx) + F_ATIME(file) = st.st_atime; if (basename != thisname) file->dirname = lastdir; --- old/generator.c +++ new/generator.c -@@ -45,6 +45,7 @@ extern int preserve_perms; - extern int preserve_uid; - extern int preserve_gid; +@@ -43,6 +43,7 @@ extern int preserve_specials; + extern int preserve_hard_links; + extern int preserve_perms; extern int preserve_times; +extern int preserve_atimes; extern int omit_dir_times; - extern int delete_mode; - extern int delete_before; + extern int uid_ndx; + extern int gid_ndx; @@ -563,6 +564,9 @@ void itemize(const char *fnamecmp, struc && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname)) || (keep_time && cmp_time(file->modtime, sxp->st.st_mtime) != 0)) @@ -149,7 +166,7 @@ TODO: need to fix this to handle 64-bit time_t values! + iflags |= ITEM_REPORT_ATIME; if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS)) iflags |= ITEM_REPORT_PERMS; - if (preserve_uid && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid) + if (uid_ndx && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid) @@ -880,6 +884,8 @@ static int try_dests_reg(struct file_str if (link_dest) { if (!hard_link_one(file, fname, cmpbuf, 1)) @@ -170,15 +187,7 @@ TODO: need to fix this to handle 64-bit time_t values! else if (!(counter & 0xFF)) --- old/log.c +++ new/log.c -@@ -34,6 +34,7 @@ extern int msg_fd_out; - extern int allow_8bit_chars; - extern int protocol_version; - extern int preserve_times; -+extern int preserve_atimes; - extern int preserve_uid; - extern int preserve_gid; - extern int stdout_format_has_i; -@@ -630,7 +631,8 @@ static void log_formatted(enum logcode c +@@ -631,7 +631,8 @@ static void log_formatted(enum logcode c c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p'; c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o'; c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g'; @@ -286,7 +295,7 @@ TODO: need to fix this to handle 64-bit time_t values! + updated = 0; } - change_uid = am_root && preserve_uid && sxp->st.st_uid != (uid_t)F_OWNER(file); + change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file); --- old/rsync.h +++ new/rsync.h @@ -56,6 +56,7 @@ @@ -307,19 +316,19 @@ TODO: need to fix this to handle 64-bit time_t values! #define NORMAL_FLUSH 0 @@ -582,6 +584,7 @@ struct file_struct { extern int file_extra_cnt; - extern int preserve_uid; - extern int preserve_gid; -+extern int preserve_atimes; - extern int preserve_acls; - extern int preserve_xattrs; + extern int uid_ndx; + extern int gid_ndx; ++extern int atimes_ndx; + extern int acls_ndx; + extern int xattrs_ndx; -@@ -616,6 +619,7 @@ extern int preserve_xattrs; +@@ -616,6 +619,7 @@ extern int xattrs_ndx; /* When the associated option is on, all entries will have these present: */ - #define F_OWNER(f) REQ_EXTRA(f, preserve_uid)->unum - #define F_GROUP(f) REQ_EXTRA(f, preserve_gid)->unum -+#define F_ATIME(f) REQ_EXTRA(f, preserve_atimes)->unum - #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->num - #define F_XATTR(f) REQ_EXTRA(f, preserve_xattrs)->num + #define F_OWNER(f) REQ_EXTRA(f, uid_ndx)->unum + #define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum ++#define F_ATIME(f) REQ_EXTRA(f, atimes_ndx)->unum + #define F_ACL(f) REQ_EXTRA(f, acls_ndx)->num + #define F_XATTR(f) REQ_EXTRA(f, xattrs_ndx)->num #define F_NDX(f) REQ_EXTRA(f, ic_ndx)->num --- old/rsync.yo +++ new/rsync.yo @@ -523,7 +532,7 @@ TODO: need to fix this to handle 64-bit time_t values! #endif --- old/util.c +++ new/util.c -@@ -120,7 +120,7 @@ NORETURN void overflow_exit(const char * +@@ -121,7 +121,7 @@ NORETURN void overflow_exit(const char * exit_cleanup(RERR_MALLOC); } @@ -532,7 +541,7 @@ TODO: need to fix this to handle 64-bit time_t values! { #if !defined HAVE_LUTIMES || !defined HAVE_UTIMES if (S_ISLNK(mode)) -@@ -128,9 +128,13 @@ int set_modtime(const char *fname, time_ +@@ -129,9 +129,13 @@ int set_modtime(const char *fname, time_ #endif if (verbose > 2) { @@ -548,7 +557,7 @@ TODO: need to fix this to handle 64-bit time_t values! } if (dry_run) -@@ -139,7 +143,7 @@ int set_modtime(const char *fname, time_ +@@ -140,7 +144,7 @@ int set_modtime(const char *fname, time_ { #ifdef HAVE_UTIMES struct timeval t[2]; @@ -557,7 +566,7 @@ TODO: need to fix this to handle 64-bit time_t values! t[0].tv_usec = 0; t[1].tv_sec = modtime; t[1].tv_usec = 0; -@@ -152,12 +156,12 @@ int set_modtime(const char *fname, time_ +@@ -153,12 +157,12 @@ int set_modtime(const char *fname, time_ return utimes(fname, t); #elif defined HAVE_UTIMBUF struct utimbuf tbuf; diff --git a/checksum-xattr.diff b/checksum-xattr.diff index 24c4de4..b8c6b81 100644 --- a/checksum-xattr.diff +++ b/checksum-xattr.diff @@ -155,48 +155,25 @@ To use this patch, run these commands for a successful build: +} --- old/xattrs.c +++ new/xattrs.c -@@ -31,6 +31,8 @@ extern int am_generator; - extern int read_only; +@@ -32,6 +32,8 @@ extern int read_only; extern int list_only; + extern int preserve_xattrs; extern int checksum_seed; +extern int checksum_len; +extern int protocol_version; #define RSYNC_XAL_INITIAL 5 #define RSYNC_XAL_LIST_INITIAL 100 -@@ -62,7 +64,8 @@ extern int checksum_seed; +@@ -63,6 +65,8 @@ extern int checksum_seed; #define RPRE_LEN ((int)sizeof RSYNC_PREFIX - 1) #define XSTAT_ATTR RSYNC_PREFIX "%stat" --#define XSTAT_LEN ((int)sizeof XSTAT_ATTR - 1) +#define MD4_ATTR RSYNC_PREFIX "%md4" +#define MD5_ATTR RSYNC_PREFIX "%md5" typedef struct { char *datum, *name; -@@ -223,8 +226,8 @@ static int rsync_xal_get(const char *fna - continue; - #endif - -- if (am_root < 0 && name_len == XSTAT_LEN + 1 -- && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0) -+ if (name_len > RPRE_LEN && name[RPRE_LEN] == '%' -+ && HAS_PREFIX(name, RSYNC_PREFIX)) - continue; - - datum_len = name_len; /* Pass extra size to get_xattr_data() */ -@@ -636,8 +639,8 @@ void receive_xattr(struct file_struct *f - continue; - } - #endif -- if (am_root < 0 && name_len == XSTAT_LEN + 1 -- && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0) { -+ if (name_len > RPRE_LEN && name[RPRE_LEN] == '%' -+ && HAS_PREFIX(name, RSYNC_PREFIX)) { - free(ptr); - continue; - } -@@ -795,6 +798,39 @@ int set_xattr(const char *fname, const s +@@ -797,6 +801,39 @@ int set_xattr(const char *fname, const s return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp); } diff --git a/flags.diff b/flags.diff index 80b2d0d..541b8ca 100644 --- a/flags.diff +++ b/flags.diff @@ -12,14 +12,31 @@ TODO: fix --delete-delay to work with --flags option. --- old/compat.c +++ new/compat.c -@@ -94,6 +94,8 @@ void setup_protocol(int f_out,int f_in) - preserve_uid = ++file_extra_cnt; +@@ -43,6 +43,7 @@ extern int prune_empty_dirs; + extern int protocol_version; + extern int preserve_uid; + extern int preserve_gid; ++extern int preserve_fileflags; + extern int preserve_acls; + extern int preserve_xattrs; + extern int preserve_hard_links; +@@ -57,7 +58,7 @@ extern char *dest_option; + extern struct filter_list_struct filter_list; + + /* These index values are for the file-list's extra-attribute array. */ +-int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx; ++int uid_ndx, gid_ndx, fileflags_ndx, acls_ndx, xattrs_ndx; + + /* The server makes sure that if either side only supports a pre-release + * version of a protocol, that both sides must speak a compatible version +@@ -98,6 +99,8 @@ void setup_protocol(int f_out,int f_in) + uid_ndx = ++file_extra_cnt; if (preserve_gid) - preserve_gid = ++file_extra_cnt; + gid_ndx = ++file_extra_cnt; + if (preserve_fileflags) -+ preserve_fileflags = ++file_extra_cnt; ++ fileflags_ndx = ++file_extra_cnt; if (preserve_acls && !am_sender) - preserve_acls = ++file_extra_cnt; + acls_ndx = ++file_extra_cnt; if (preserve_xattrs) --- old/configure.in +++ new/configure.in @@ -34,15 +51,15 @@ TODO: fix --delete-delay to work with --flags option. AC_CHECK_FUNCS(getpgrp tcgetpgrp) --- old/flist.c +++ new/flist.c -@@ -49,6 +49,7 @@ extern int preserve_links; - extern int preserve_hard_links; - extern int preserve_devices; +@@ -52,6 +52,7 @@ extern int preserve_devices; extern int preserve_specials; -+extern int preserve_fileflags; - extern int preserve_uid; - extern int preserve_gid; + extern int uid_ndx; + extern int gid_ndx; ++extern int fileflags_ndx; extern int relative_paths; -@@ -345,6 +346,9 @@ static void send_file_entry(int f, struc + extern int implied_dirs; + extern int file_extra_cnt; +@@ -348,6 +349,9 @@ static void send_file_entry(int f, struc { static time_t modtime; static mode_t mode; @@ -52,7 +69,7 @@ TODO: fix --delete-delay to work with --flags option. static int64 dev; static dev_t rdev; static uint32 rdev_major; -@@ -393,6 +397,12 @@ static void send_file_entry(int f, struc +@@ -396,6 +400,12 @@ static void send_file_entry(int f, struc flags |= XMIT_SAME_MODE; else mode = file->mode; @@ -65,18 +82,18 @@ TODO: fix --delete-delay to work with --flags option. if ((preserve_devices && IS_DEVICE(mode)) || (preserve_specials && IS_SPECIAL(mode))) { if (protocol_version < 28) { -@@ -510,6 +520,10 @@ static void send_file_entry(int f, struc +@@ -513,6 +523,10 @@ static void send_file_entry(int f, struc } if (!(flags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); +#ifdef SUPPORT_FLAGS -+ if (preserve_fileflags && !(flags & XMIT_SAME_FLAGS)) ++ if (fileflags_ndx && !(flags & XMIT_SAME_FLAGS)) + write_int(f, (int)fileflags); +#endif - if (preserve_uid && !(flags & XMIT_SAME_UID)) { + if (uid_ndx && !(flags & XMIT_SAME_UID)) { if (protocol_version < 30) write_int(f, uid); -@@ -598,6 +612,9 @@ static struct file_struct *recv_file_ent +@@ -601,6 +615,9 @@ static struct file_struct *recv_file_ent { static int64 modtime; static mode_t mode; @@ -86,42 +103,42 @@ TODO: fix --delete-delay to work with --flags option. static int64 dev; static dev_t rdev; static uint32 rdev_major; -@@ -730,9 +747,12 @@ static struct file_struct *recv_file_ent +@@ -735,9 +752,12 @@ static struct file_struct *recv_file_ent } - if (!(flags & XMIT_SAME_MODE)) + if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); - if (chmod_modes && !S_ISLNK(mode)) mode = tweak_mode(mode, chmod_modes); +#ifdef SUPPORT_FLAGS -+ if (preserve_fileflags && !(flags & XMIT_SAME_FLAGS)) ++ if (fileflags_ndx && !(xflags & XMIT_SAME_FLAGS)) + fileflags = (uint32)read_int(f); +#endif - if (preserve_uid && !(flags & XMIT_SAME_UID)) { + if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) -@@ -851,6 +871,10 @@ static struct file_struct *recv_file_ent +@@ -857,6 +877,10 @@ static struct file_struct *recv_file_ent OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32); } file->mode = mode; +#ifdef SUPPORT_FLAGS -+ if (preserve_fileflags) ++ if (fileflags_ndx) + F_FFLAGS(file) = fileflags; +#endif - if (preserve_uid) + if (uid_ndx) F_OWNER(file) = uid; - if (preserve_gid) -@@ -1164,6 +1188,10 @@ struct file_struct *make_file(const char + if (gid_ndx) { +@@ -1178,6 +1202,10 @@ struct file_struct *make_file(const char OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32); } file->mode = st.st_mode; +#ifdef SUPPORT_FLAGS -+ if (preserve_fileflags) ++ if (fileflags_ndx) + F_FFLAGS(file) = st.st_flags; +#endif - if (preserve_uid) + if (uid_ndx) F_OWNER(file) = st.st_uid; - if (preserve_gid) + if (gid_ndx) --- old/generator.c +++ new/generator.c @@ -115,6 +115,14 @@ static int dir_tweaking; @@ -284,7 +301,7 @@ TODO: fix --delete-delay to work with --flags option. int preserve_executability = 0; int preserve_devices = 0; int preserve_specials = 0; -@@ -212,6 +213,7 @@ static void print_rsync_version(enum log +@@ -213,6 +214,7 @@ static void print_rsync_version(enum log char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -292,7 +309,7 @@ TODO: fix --delete-delay to work with --flags option. STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -241,6 +243,9 @@ static void print_rsync_version(enum log +@@ -242,6 +244,9 @@ static void print_rsync_version(enum log #ifdef ICONV_OPTION iconv = ""; #endif @@ -302,7 +319,7 @@ TODO: fix --delete-delay to work with --flags option. rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -254,8 +259,8 @@ static void print_rsync_version(enum log +@@ -255,8 +260,8 @@ static void print_rsync_version(enum log (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); @@ -313,7 +330,7 @@ TODO: fix --delete-delay to work with --flags option. #ifdef MAINTAINER_MODE rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); -@@ -321,6 +326,7 @@ void usage(enum logcode F) +@@ -322,6 +327,7 @@ void usage(enum logcode F) rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n"); rprintf(F," -H, --hard-links preserve hard links\n"); rprintf(F," -p, --perms preserve permissions\n"); @@ -321,7 +338,7 @@ TODO: fix --delete-delay to work with --flags option. rprintf(F," -E, --executability preserve the file's executability\n"); rprintf(F," --chmod=CHMOD affect file and/or directory permissions\n"); #ifdef SUPPORT_ACLS -@@ -458,6 +464,8 @@ static struct poptOption long_options[] +@@ -461,6 +467,8 @@ 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 }, @@ -330,7 +347,7 @@ TODO: fix --delete-delay to work with --flags option. {"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 }, {"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 }, {"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 }, -@@ -1236,6 +1244,15 @@ int parse_arguments(int *argc, const cha +@@ -1252,6 +1260,15 @@ int parse_arguments(int *argc, const cha } #endif @@ -346,7 +363,7 @@ TODO: fix --delete-delay to work with --flags option. if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n"); -@@ -1712,6 +1729,9 @@ void server_options(char **args,int *arg +@@ -1731,6 +1748,9 @@ void server_options(char **args,int *arg if (xfer_dirs && !recurse && delete_mode && am_sender) args[ac++] = "--no-r"; @@ -383,7 +400,7 @@ TODO: fix --delete-delay to work with --flags option. static const char *default_charset(void) { #if defined HAVE_LIBCHARSET_H && defined HAVE_LOCALE_CHARSET -@@ -265,6 +276,41 @@ mode_t dest_mode(mode_t flist_mode, mode +@@ -269,6 +280,41 @@ mode_t dest_mode(mode_t flist_mode, mode return new_mode; } @@ -425,7 +442,7 @@ TODO: fix --delete-delay to work with --flags option. int set_file_attrs(const char *fname, struct file_struct *file, statx *sxp, const char *fnamecmp, int flags) { -@@ -395,6 +441,15 @@ int set_file_attrs(const char *fname, st +@@ -397,6 +443,15 @@ int set_file_attrs(const char *fname, st } #endif @@ -441,7 +458,7 @@ TODO: fix --delete-delay to work with --flags option. if (verbose > 1 && flags & ATTRS_REPORT) { if (updated) rprintf(FCLIENT, "%s\n", fname); -@@ -454,6 +509,9 @@ void finish_transfer(const char *fname, +@@ -456,6 +511,9 @@ void finish_transfer(const char *fname, set_file_attrs(fnametmp, file, NULL, fnamecmp, ok_to_set_time ? 0 : ATTRS_SKIP_MTIME); @@ -451,7 +468,7 @@ TODO: fix --delete-delay to work with --flags option. /* move tmp file over real file */ if (verbose > 2) rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname); -@@ -468,6 +526,9 @@ void finish_transfer(const char *fname, +@@ -470,6 +528,9 @@ void finish_transfer(const char *fname, } if (ret == 0) { /* The file was moved into place (not copied), so it's done. */ @@ -471,7 +488,7 @@ TODO: fix --delete-delay to work with --flags option. /* These flags are used in the live flist data. */ -@@ -404,6 +405,10 @@ enum msgcode { +@@ -405,6 +406,10 @@ enum msgcode { #endif #endif @@ -482,25 +499,25 @@ TODO: fix --delete-delay to work with --flags option. /* Find a variable that is either exactly 32-bits or longer. * If some code depends on 32-bit truncation, it will need to * take special action in a "#if SIZEOF_INT32 > 4" section. */ -@@ -583,6 +588,7 @@ struct file_struct { +@@ -582,6 +587,7 @@ struct file_struct { extern int file_extra_cnt; - extern int preserve_uid; - extern int preserve_gid; -+extern int preserve_fileflags; - extern int preserve_acls; - extern int preserve_xattrs; + extern int uid_ndx; + extern int gid_ndx; ++extern int fileflags_ndx; + extern int acls_ndx; + extern int xattrs_ndx; -@@ -617,6 +623,7 @@ extern int preserve_xattrs; +@@ -616,6 +622,7 @@ extern int xattrs_ndx; /* When the associated option is on, all entries will have these present: */ - #define F_OWNER(f) REQ_EXTRA(f, preserve_uid)->unum - #define F_GROUP(f) REQ_EXTRA(f, preserve_gid)->unum -+#define F_FFLAGS(f) REQ_EXTRA(f, preserve_fileflags)->unum - #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->num - #define F_XATTR(f) REQ_EXTRA(f, preserve_xattrs)->num + #define F_OWNER(f) REQ_EXTRA(f, uid_ndx)->unum + #define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum ++#define F_FFLAGS(f) REQ_EXTRA(f, fileflags_ndx)->unum + #define F_ACL(f) REQ_EXTRA(f, acls_ndx)->num + #define F_XATTR(f) REQ_EXTRA(f, xattrs_ndx)->num #define F_NDX(f) REQ_EXTRA(f, ic_ndx)->num --- old/rsync.yo +++ new/rsync.yo -@@ -321,6 +321,7 @@ to the detailed description below for a +@@ -327,6 +327,7 @@ to the detailed description below for a -K, --keep-dirlinks treat symlinked dir on receiver as dir -H, --hard-links preserve hard links -p, --perms preserve permissions @@ -508,7 +525,7 @@ TODO: fix --delete-delay to work with --flags option. -E, --executability preserve executability --chmod=CHMOD affect file and/or directory permissions -A, --acls preserve ACLs (implies -p) -@@ -520,7 +521,9 @@ specified, in which case bf(-r) is not i +@@ -526,7 +527,9 @@ specified, in which case bf(-r) is not i Note that bf(-a) bf(does not preserve hardlinks), because finding multiply-linked files is expensive. You must separately @@ -519,7 +536,7 @@ TODO: fix --delete-delay to work with --flags option. dit(--no-OPTION) You may turn off one or more implied options by prefixing the option name with "no-". Not all options may be prefixed with a "no-": -@@ -845,6 +848,13 @@ extended attributes to be the same as th +@@ -851,6 +854,13 @@ extended attributes to be the same as th only if the remote machine's rsync supports this option also. This is a non-standard option. diff --git a/omit-dir-changes.diff b/omit-dir-changes.diff index 04c0a7a..cea3e74 100644 --- a/omit-dir-changes.diff +++ b/omit-dir-changes.diff @@ -9,14 +9,14 @@ To use this patch, run these commands for a successful build: --- old/generator.c +++ new/generator.c -@@ -46,6 +46,7 @@ extern int preserve_uid; - extern int preserve_gid; +@@ -44,6 +44,7 @@ extern int preserve_hard_links; + extern int preserve_perms; extern int preserve_times; extern int omit_dir_times; +extern int omit_dir_changes; + extern int uid_ndx; + extern int gid_ndx; extern int delete_mode; - extern int delete_before; - extern int delete_during; @@ -555,6 +556,7 @@ void itemize(const char *fnamecmp, struc int keep_time = !preserve_times ? 0 : S_ISDIR(file->mode) ? !omit_dir_times @@ -29,13 +29,13 @@ To use this patch, run these commands for a successful build: iflags |= ITEM_REPORT_TIME; if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS)) iflags |= ITEM_REPORT_PERMS; -- if (preserve_uid && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid) -+ if (preserve_uid && am_root && !omit_changes +- if (uid_ndx && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid) ++ if (uid_ndx && am_root && !omit_changes + && (uid_t)F_OWNER(file) != sxp->st.st_uid) iflags |= ITEM_REPORT_OWNER; -- if (preserve_gid && !(file->flags & FLAG_SKIP_GROUP) +- if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) - && sxp->st.st_gid != (gid_t)F_GROUP(file)) -+ if (preserve_gid && !omit_changes ++ if (gid_ndx && !omit_changes + && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file)) iflags |= ITEM_REPORT_GROUP; #ifdef SUPPORT_ACLS @@ -59,7 +59,7 @@ To use this patch, run these commands for a successful build: int update_only = 0; int cvs_exclude = 0; int dry_run = 0; -@@ -336,6 +337,7 @@ void usage(enum logcode F) +@@ -337,6 +338,7 @@ void usage(enum logcode F) rprintf(F," -D same as --devices --specials\n"); rprintf(F," -t, --times preserve times\n"); rprintf(F," -O, --omit-dir-times omit directories when preserving times\n"); @@ -67,7 +67,7 @@ To use this patch, run these commands for a successful build: rprintf(F," --super receiver attempts super-user activities\n"); #ifdef SUPPORT_XATTRS rprintf(F," --fake-super store/recover privileged attrs using xattrs\n"); -@@ -469,6 +471,7 @@ static struct poptOption long_options[] +@@ -472,6 +474,7 @@ static struct poptOption long_options[] {"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 }, @@ -75,7 +75,7 @@ To use this patch, run these commands for a successful build: {"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 }, {"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 }, {"no-super", 0, POPT_ARG_VAL, &am_root, 0, 0, 0 }, -@@ -1397,6 +1400,9 @@ int parse_arguments(int *argc, const cha +@@ -1413,6 +1416,9 @@ int parse_arguments(int *argc, const cha "P *%s", backup_suffix); parse_rule(&filter_list, backup_dir_buf, 0, 0); } @@ -85,7 +85,7 @@ To use this patch, run these commands for a successful build: if (make_backups && !backup_dir) omit_dir_times = 1; -@@ -1626,6 +1632,8 @@ void server_options(char **args,int *arg +@@ -1642,6 +1648,8 @@ void server_options(char **args,int *arg argstr[x++] = 'm'; if (omit_dir_times == 2) argstr[x++] = 'O'; @@ -104,14 +104,14 @@ To use this patch, run these commands for a successful build: extern int am_root; extern int am_server; extern int am_sender; -@@ -322,9 +323,11 @@ int set_file_attrs(const char *fname, st +@@ -326,9 +327,11 @@ int set_file_attrs(const char *fname, st updated = 1; } -- change_uid = am_root && preserve_uid && sxp->st.st_uid != (uid_t)F_OWNER(file); -+ change_uid = am_root && preserve_uid && sxp->st.st_uid != (uid_t)F_OWNER(file) +- change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file); ++ change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file) + && !(omit_dir_changes && S_ISDIR(sxp->st.st_mode)); - change_gid = preserve_gid && !(file->flags & FLAG_SKIP_GROUP) + change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP) - && sxp->st.st_gid != (gid_t)F_GROUP(file); + && sxp->st.st_gid != (gid_t)F_GROUP(file) + && !(omit_dir_changes && S_ISDIR(sxp->st.st_mode)); -- 2.34.1