X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/36e715fdf295b975105dce63581d9cf9f154f34f..ae306a2933c7617493d80f46d891911634ec43d0:/crtimes.diff diff --git a/crtimes.diff b/crtimes.diff index e2154b7..47730fe 100644 --- a/crtimes.diff +++ b/crtimes.diff @@ -19,7 +19,7 @@ diff --git a/compat.c b/compat.c extern int preserve_fileflags; extern int preserve_acls; extern int preserve_xattrs; -@@ -62,7 +63,7 @@ extern iconv_t ic_send, ic_recv; +@@ -63,7 +64,7 @@ extern char *iconv_opt; #endif /* These index values are for the file-list's extra-attribute array. */ @@ -27,8 +27,8 @@ diff --git a/compat.c b/compat.c +int uid_ndx, gid_ndx, crtimes_ndx, fileflags_ndx, acls_ndx, xattrs_ndx, unsort_ndx; int receiver_symlink_times = 0; /* receiver can set the time on a symlink */ - -@@ -136,6 +137,8 @@ void setup_protocol(int f_out,int f_in) + int sender_symlink_iconv = 0; /* sender should convert symlink content */ +@@ -139,6 +140,8 @@ void setup_protocol(int f_out,int f_in) uid_ndx = ++file_extra_cnt; if (preserve_gid) gid_ndx = ++file_extra_cnt; @@ -48,16 +48,16 @@ diff --git a/flist.c b/flist.c extern int relative_paths; extern int implied_dirs; extern int file_extra_cnt; -@@ -389,7 +390,7 @@ int change_pathname(struct file_struct *file, const char *dir, int dirlen) - - static void send_file_entry(int f, const char *fname, struct file_struct *file, int ndx, int first_ndx) +@@ -394,7 +395,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, + #endif + int ndx, int first_ndx) { - static time_t modtime; + static time_t modtime, crtime; static mode_t mode; #ifdef SUPPORT_FILEFLAGS static uint32 fileflags; -@@ -474,6 +475,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, +@@ -479,6 +480,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, xflags |= XMIT_SAME_TIME; else modtime = file->modtime; @@ -71,7 +71,7 @@ diff --git a/flist.c b/flist.c #ifdef SUPPORT_HARD_LINKS if (tmp_dev != 0) { -@@ -543,6 +551,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, +@@ -548,6 +556,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, else write_int(f, modtime); } @@ -80,7 +80,7 @@ diff --git a/flist.c b/flist.c if (!(xflags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); #ifdef SUPPORT_FILEFLAGS -@@ -635,7 +645,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, +@@ -638,7 +648,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, static struct file_struct *recv_file_entry(struct file_list *flist, int xflags, int f) { @@ -89,7 +89,7 @@ diff --git a/flist.c b/flist.c static mode_t mode; #ifdef SUPPORT_FILEFLAGS static uint32 fileflags; -@@ -770,6 +780,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -773,6 +783,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist, } else modtime = read_int(f); } @@ -109,7 +109,7 @@ diff --git a/flist.c b/flist.c if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); -@@ -922,6 +945,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -932,6 +955,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist, F_GROUP(file) = gid; file->flags |= gid_flags; } @@ -118,7 +118,7 @@ diff --git a/flist.c b/flist.c if (unsort_ndx) F_NDX(file) = flist->used + flist->ndx_start; -@@ -1272,6 +1297,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1308,6 +1333,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, F_OWNER(file) = st.st_uid; if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */ F_GROUP(file) = st.st_gid; @@ -146,7 +146,7 @@ diff --git a/generator.c b/generator.c extern int preserve_hard_links; extern int preserve_executability; extern int preserve_fileflags; -@@ -620,6 +622,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp) +@@ -621,6 +623,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp) if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file)) return 0; @@ -160,7 +160,7 @@ diff --git a/generator.c b/generator.c #ifdef SUPPORT_ACLS if (preserve_acls && !S_ISLNK(file->mode)) { if (!ACL_READY(*sxp)) -@@ -663,6 +672,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre +@@ -664,6 +673,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre : iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED) && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname)) iflags |= ITEM_REPORT_TIME; @@ -173,7 +173,7 @@ diff --git a/generator.c b/generator.c #if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST if (S_ISLNK(file->mode)) { ; -@@ -1223,6 +1238,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx, +@@ -1224,6 +1239,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx, static void list_file_entry(struct file_struct *f) { char permbuf[PERMSTRING_SIZE]; @@ -181,7 +181,7 @@ diff --git a/generator.c b/generator.c double len; if (!F_IS_ACTIVE(f)) { -@@ -1237,14 +1253,16 @@ static void list_file_entry(struct file_struct *f) +@@ -1238,14 +1254,16 @@ static void list_file_entry(struct file_struct *f) #ifdef SUPPORT_LINKS if (preserve_links && S_ISLNK(f->mode)) { @@ -200,7 +200,7 @@ diff --git a/generator.c b/generator.c f_name(f, NULL)); } } -@@ -1336,6 +1354,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1337,6 +1355,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, return; } } @@ -243,7 +243,7 @@ diff --git a/ifuncs.h b/ifuncs.h diff --git a/log.c b/log.c --- a/log.c +++ b/log.c -@@ -659,7 +659,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op, +@@ -663,7 +663,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op, c[8] = !(iflags & ITEM_REPORT_FFLAGS) ? '.' : 'f'; c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a'; c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x'; @@ -294,7 +294,7 @@ diff --git a/options.c b/options.c diff --git a/rsync.c b/rsync.c --- a/rsync.c +++ b/rsync.c -@@ -472,6 +472,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -485,6 +485,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, else file->flags |= FLAG_TIME_FAILED; } @@ -309,7 +309,7 @@ diff --git a/rsync.c b/rsync.c change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file); change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP) -@@ -619,7 +627,7 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -632,7 +640,7 @@ int finish_transfer(const char *fname, const char *fnametmp, /* Change permissions before putting the file into place. */ set_file_attrs(fnametmp, file, NULL, fnamecmp, ATTRS_DELAY_IMMUTABLE @@ -318,7 +318,7 @@ diff --git a/rsync.c b/rsync.c /* move tmp file over real file */ if (verbose > 2) -@@ -650,7 +658,7 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -663,7 +671,7 @@ int finish_transfer(const char *fname, const char *fnametmp, do_set_file_attrs: set_file_attrs(fnametmp, file, NULL, fnamecmp, @@ -355,7 +355,7 @@ diff --git a/rsync.h b/rsync.h #define ITEM_REPORT_CHANGE (1<<1) #define ITEM_REPORT_SIZE (1<<2) /* regular files only */ #define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */ -@@ -655,6 +657,7 @@ extern int file_extra_cnt; +@@ -657,6 +659,7 @@ extern int file_extra_cnt; extern int inc_recurse; extern int uid_ndx; extern int gid_ndx; @@ -363,7 +363,7 @@ diff --git a/rsync.h b/rsync.h extern int fileflags_ndx; extern int acls_ndx; extern int xattrs_ndx; -@@ -662,6 +665,7 @@ extern int xattrs_ndx; +@@ -664,6 +667,7 @@ extern int xattrs_ndx; #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename)) #define EXTRA_LEN (sizeof (union file_extras)) #define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN) @@ -371,7 +371,7 @@ diff --git a/rsync.h b/rsync.h #define DEV_EXTRA_CNT 2 #define DIRNODE_EXTRA_CNT 3 #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN) -@@ -920,6 +924,7 @@ typedef struct { +@@ -922,6 +926,7 @@ typedef struct { typedef struct { STRUCT_STAT st; @@ -400,7 +400,7 @@ diff --git a/rsync.yo b/rsync.yo dit(bf(--super)) This tells the receiving side to attempt super-user activities even if the receiving rsync wasn't run by the super-user. These activities include: preserving users via the bf(--owner) option, preserving -@@ -1680,7 +1684,7 @@ with older versions of rsync, but that also turns on the output of other +@@ -1692,7 +1696,7 @@ with older versions of rsync, but that also turns on the output of other verbose messages). The "%i" escape has a cryptic output that is 11 letters long. The general @@ -409,7 +409,7 @@ diff --git a/rsync.yo b/rsync.yo type 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. -@@ -1739,6 +1743,8 @@ quote(itemization( +@@ -1751,6 +1755,8 @@ quote(itemization( it() The bf(f) means that the fileflags information changed. it() The bf(a) means that the ACL information changed. it() The bf(x) means that the extended attribute information changed.