0
@@ -11,7 +11,7 @@ To use this patch, run these commands for a successful build:
0
diff --git a/compat.c b/compat.c
0
-@@ -4
4,6 +44,7 @@ extern int force_change;
0
+@@ -4
5,6 +45,7 @@ extern int force_change;
0
extern int protect_args;
0
extern int preserve_uid;
0
extern int preserve_gid;
0
@@ -19,7 +19,7 @@ diff --git a/compat.c b/compat.c
0
extern int preserve_fileflags;
0
extern int preserve_acls;
0
extern int preserve_xattrs;
0
-@@ -6
1,7 +62,7 @@ extern iconv_t ic_send, ic_recv;
0
+@@ -6
3,7 +64,7 @@ extern char *iconv_opt;
0
/* These index values are for the file-list's extra-attribute array. */
0
@@ -27,8 +27,8 @@ diff --git a/compat.c b/compat.c
0
+int uid_ndx, gid_ndx, crtimes_ndx, fileflags_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
0
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
0
-@@ -135,6 +136,8 @@ void setup_protocol(int f_out,int f_in)
0
+ int sender_symlink_iconv = 0; /* sender should convert symlink content */
0
+@@ -139,6 +140,8 @@ void setup_protocol(int f_out,int f_in)
0
uid_ndx = ++file_extra_cnt;
0
gid_ndx = ++file_extra_cnt;
0
@@ -40,7 +40,7 @@ diff --git a/compat.c b/compat.c
0
diff --git a/flist.c b/flist.c
0
-@@ -5
4,6 +54,7 @@ extern int preserve_fileflags;
0
+@@ -5
6,6 +56,7 @@ extern int preserve_fileflags;
0
@@ -48,16 +48,16 @@ diff --git a/flist.c b/flist.c
0
extern int relative_paths;
0
extern int implied_dirs;
0
extern int file_extra_cnt;
0
-@@ -389,7 +390,7 @@ int change_pathname(struct file_struct *file, const char *dir, int dirlen)
0
- static void send_file_entry(int f, const char *fname, struct file_struct *file, int ndx, int first_ndx)
0
+@@ -394,7 +395,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
+ int ndx, int first_ndx)
0
- static time_t modtime;
0
+ static time_t modtime, crtime;
0
#ifdef SUPPORT_FILEFLAGS
0
static uint32 fileflags;
0
-@@ -47
4,6 +475,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
+@@ -47
9,6 +480,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
xflags |= XMIT_SAME_TIME;
0
modtime = file->modtime;
0
@@ -71,7 +71,7 @@ diff --git a/flist.c b/flist.c
0
#ifdef SUPPORT_HARD_LINKS
0
-@@ -54
3,6 +551,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
+@@ -54
8,6 +556,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
@@ -80,7 +80,7 @@ diff --git a/flist.c b/flist.c
0
if (!(xflags & XMIT_SAME_MODE))
0
write_int(f, to_wire_mode(mode));
0
#ifdef SUPPORT_FILEFLAGS
0
-@@ -63
5,7 +645,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
+@@ -63
8,7 +648,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
0
static struct file_struct *recv_file_entry(struct file_list *flist,
0
@@ -89,7 +89,7 @@ diff --git a/flist.c b/flist.c
0
#ifdef SUPPORT_FILEFLAGS
0
static uint32 fileflags;
0
-@@ -77
0,6 +780,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
0
+@@ -77
3,6 +783,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
0
@@ -109,7 +109,7 @@ diff --git a/flist.c b/flist.c
0
if (!(xflags & XMIT_SAME_MODE))
0
mode = from_wire_mode(read_int(f));
0
-@@ -9
22,6 +945,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
0
+@@ -9
32,6 +955,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
0
file->flags |= gid_flags;
0
@@ -118,7 +118,7 @@ diff --git a/flist.c b/flist.c
0
F_NDX(file) = flist->used + flist->ndx_start;
0
-@@ -1
272,6 +1297,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
0
+@@ -1
308,6 +1333,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
0
F_OWNER(file) = st.st_uid;
0
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
0
F_GROUP(file) = st.st_gid;
0
@@ -136,9 +136,9 @@ diff --git a/generator.c b/generator.c
0
-@@ -38,6 +39,7 @@ extern int preserve_xattrs;
0
+@@ -40,6 +41,7 @@ extern int preserve_xattrs;
0
extern int preserve_links;
0
extern int preserve_devices;
0
extern int preserve_specials;
0
@@ -146,7 +146,7 @@ diff --git a/generator.c b/generator.c
0
extern int preserve_hard_links;
0
extern int preserve_executability;
0
extern int preserve_fileflags;
0
-@@ -6
18,6 +620,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
0
+@@ -6
20,6 +622,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
0
if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
0
@@ -160,7 +160,7 @@ diff --git a/generator.c b/generator.c
0
if (preserve_acls && !S_ISLNK(file->mode)) {
0
-@@ -66
1,6 +670,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
0
+@@ -66
3,6 +672,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
0
: iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
0
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
0
iflags |= ITEM_REPORT_TIME;
0
@@ -173,7 +173,7 @@ diff --git a/generator.c b/generator.c
0
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
0
if (S_ISLNK(file->mode)) {
0
-@@ -122
1,6 +1236,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
0
+@@ -122
3,6 +1238,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
0
static void list_file_entry(struct file_struct *f)
0
char permbuf[PERMSTRING_SIZE];
0
@@ -181,7 +181,7 @@ diff --git a/generator.c b/generator.c
0
-@@ -123
5,14 +1251,16 @@ static void list_file_entry(struct file_struct *f)
0
+@@ -123
7,14 +1253,16 @@ static void list_file_entry(struct file_struct *f)
0
if (preserve_links && S_ISLNK(f->mode)) {
0
@@ -200,7 +200,7 @@ diff --git a/generator.c b/generator.c
0
-@@ -133
4,6 +1352,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
0
+@@ -133
6,6 +1354,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
0
@@ -243,7 +243,7 @@ diff --git a/ifuncs.h b/ifuncs.h
0
diff --git a/log.c b/log.c
0
-@@ -66
4,7 +664,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
0
+@@ -66
3,7 +663,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
0
c[8] = !(iflags & ITEM_REPORT_FFLAGS) ? '.' : 'f';
0
c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a';
0
c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x';
0
@@ -264,7 +264,7 @@ diff --git a/options.c b/options.c
0
-@@ -
698,6 +699,7 @@ void usage(enum logcode F)
0
+@@ -
362,6 +363,7 @@ void usage(enum logcode F)
0
rprintf(F," -D same as --devices --specials\n");
0
rprintf(F," -t, --times preserve modification times\n");
0
rprintf(F," -O, --omit-dir-times omit directories from --times\n");
0
@@ -272,7 +272,7 @@ diff --git a/options.c b/options.c
0
rprintf(F," --super receiver attempts super-user activities\n");
0
rprintf(F," --fake-super store/recover privileged attrs using xattrs\n");
0
-@@ -
847,6 +849,9 @@ static struct poptOption long_options[] = {
0
+@@ -
508,6 +510,9 @@ static struct poptOption long_options[] = {
0
{"times", 't', POPT_ARG_VAL, &preserve_times, 2, 0, 0 },
0
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
0
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
0
@@ -282,7 +282,7 @@ diff --git a/options.c b/options.c
0
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 1, 0, 0 },
0
{"no-omit-dir-times",0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 },
0
{"no-O", 0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 },
0
-@@ -
2180,6 +2185,8 @@ void server_options(char **args, int *argc_p)
0
+@@ -
1799,6 +1804,8 @@ void server_options(char **args, int *argc_p)
0
@@ -294,7 +294,7 @@ diff --git a/options.c b/options.c
0
diff --git a/rsync.c b/rsync.c
0
-@@ -47
1,6 +471,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
0
+@@ -47
2,6 +472,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
0
file->flags |= FLAG_TIME_FAILED;
0
@@ -309,7 +309,7 @@ diff --git a/rsync.c b/rsync.c
0
change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
0
change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
0
-@@ -61
8,7 +626,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
0
+@@ -61
9,7 +627,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
0
/* Change permissions before putting the file into place. */
0
set_file_attrs(fnametmp, file, NULL, fnamecmp,
0
@@ -317,8 +317,8 @@ diff --git a/rsync.c b/rsync.c
0
+ | (ok_to_set_time ? 0 : ATTRS_SKIP_MTIME | ATTRS_SKIP_CRTIME));
0
/* move tmp file over real file */
0
- if (DEBUG_GTE(RECV, 1))
0
-@@ -649,7 +657,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
0
+@@ -650,7 +658,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
0
set_file_attrs(fnametmp, file, NULL, fnamecmp,
0
@@ -355,7 +355,7 @@ diff --git a/rsync.h b/rsync.h
0
#define ITEM_REPORT_CHANGE (1<<1)
0
#define ITEM_REPORT_SIZE (1<<2) /* regular files only */
0
#define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
0
-@@ -65
5,6 +657,7 @@ extern int file_extra_cnt;
0
+@@ -65
7,6 +659,7 @@ extern int file_extra_cnt;
0
extern int inc_recurse;
0
@@ -363,7 +363,7 @@ diff --git a/rsync.h b/rsync.h
0
extern int fileflags_ndx;
0
-@@ -66
2,6 +665,7 @@ extern int xattrs_ndx;
0
+@@ -66
4,6 +667,7 @@ extern int xattrs_ndx;
0
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
0
#define EXTRA_LEN (sizeof (union file_extras))
0
#define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
0
@@ -371,7 +371,7 @@ diff --git a/rsync.h b/rsync.h
0
#define DEV_EXTRA_CNT 2
0
#define DIRNODE_EXTRA_CNT 3
0
#define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
0
-@@ -92
0,6 +924,7 @@ typedef struct {
0
+@@ -92
2,6 +926,7 @@ typedef struct {
0
@@ -382,7 +382,7 @@ diff --git a/rsync.h b/rsync.h
0
diff --git a/rsync.yo b/rsync.yo
0
-@@ -35
2,6 +352,7 @@ to the detailed description below for a complete description. verb(
0
+@@ -35
0,6 +350,7 @@ to the detailed description below for a complete description. verb(
0
-D same as --devices --specials
0
-t, --times preserve modification times
0
-O, --omit-dir-times omit directories from --times
0
@@ -390,7 +390,7 @@ diff --git a/rsync.yo b/rsync.yo
0
--super receiver attempts super-user activities
0
--fake-super store/recover privileged attrs using xattrs
0
-S, --sparse handle sparse files efficiently
0
-@@ -10
69,6 +1070,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
0
+@@ -10
28,6 +1029,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
0
the directories on the receiving side, it is a good idea to use bf(-O).
0
This option is inferred if you use bf(--backup) without bf(--backup-dir).
0
@@ -400,7 +400,7 @@ diff --git a/rsync.yo b/rsync.yo
0
dit(bf(--super)) This tells the receiving side to attempt super-user
0
activities even if the receiving rsync wasn't run by the super-user. These
0
activities include: preserving users via the bf(--owner) option, preserving
0
-@@ -1
758,7 +1762,7 @@ with older versions of rsync, but that also turns on the output of other
0
+@@ -1
692,7 +1696,7 @@ with older versions of rsync, but that also turns on the output of other
0
The "%i" escape has a cryptic output that is 11 letters long. The general
0
@@ -409,7 +409,7 @@ diff --git a/rsync.yo b/rsync.yo
0
type of update being done, bf(X) is replaced by the file-type, and the
0
other letters represent attributes that may be output if they are being
0
-@@ -1
817,6 +1821,8 @@ quote(itemization(
0
+@@ -1
751,6 +1755,8 @@ quote(itemization(
0
it() The bf(f) means that the fileflags information changed.
0
it() The bf(a) means that the ACL information changed.
0
it() The bf(x) means that the extended attribute information changed.
0
@@ -613,3 +613,56 @@ diff --git a/tls.c b/tls.c
0
fprintf(F," -l, --link-times display the time on a symlink\n");
0
fprintf(F," -L, --link-owner display the owner+group on a symlink\n");
0
+diff -up a/proto.h b/proto.h
0
+@@ -312,6 +312,8 @@ int do_stat(const char *fname, STRUCT_ST
0
+ int do_lstat(const char *fname, STRUCT_STAT *st);
0
+ int do_fstat(int fd, STRUCT_STAT *st);
0
+ OFF_T do_lseek(int fd, OFF_T offset, int whence);
0
++time_t get_create_time(const char *path);
0
++int set_create_time(const char *path, time_t crtime);
0
+ void set_compression(const char *fname);
0
+ void send_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
0
+ int32 n, int32 toklen);
0
+diff -up a/rsync.1 b/rsync.1
0
+@@ -425,6 +425,7 @@ to the detailed description below for a
0
+ \-D same as \-\-devices \-\-specials
0
+ \-t, \-\-times preserve modification times
0
+ \-O, \-\-omit\-dir\-times omit directories from \-\-times
0
++ \-N, \-\-crtimes preserve create times (newness)
0
+ \-\-super receiver attempts super-user activities
0
+ \-\-fake\-super store/recover privileged attrs using xattrs
0
+ \-S, \-\-sparse handle sparse files efficiently
0
+@@ -1183,6 +1184,10 @@ it is preserving modification times (see
0
+ the directories on the receiving side, it is a good idea to use \fB\-O\fP.
0
+ This option is inferred if you use \fB\-\-backup\fP without \fB\-\-backup\-dir\fP.
0
++.IP "\fB\-N, \-\-crtimes\fP"
0
++This tells rsync to set the create times (newness) of
0
++the destination files to the same value as the source files.
0
+ This tells the receiving side to attempt super-user
0
+ activities even if the receiving rsync wasn't run by the super-user. These
0
+@@ -1938,7 +1943,7 @@ with older versions of rsync, but that a
0
+ The \(lq%i\(rq escape has a cryptic output that is 11 letters long. The general
0
+-format is like the string \fBYXcstpogfax\fP, where \fBY\fP is replaced by the
0
++format is like the string \fBYXcstpogfaxn\fP, where \fBY\fP is replaced by the
0
+ type of update being done, \fBX\fP is replaced by the file-type, and the
0
+ other letters represent attributes that may be output if they are being
0
+@@ -2013,6 +2018,9 @@ The \fBf\fP means that the fileflags inf
0
+ The \fBa\fP means that the ACL information changed.
0
+ The \fBx\fP means that the extended attribute information changed.
0
++A \fBn\fP means the create time (newness) is different and is being
0
++updated to the sender's value (requires \fB\-\-crtimes\fP).