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. */
+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;
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;
#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);
}
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)
{
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,
+@@ -744,6 +754,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+ uid = F_OWNER(first);
+ if (preserve_gid)
+ gid = F_GROUP(first);
++ if (crtimes_ndx)
++ crtime = f_crtime(first);
+ if ((preserve_devices && IS_DEVICE(mode))
+ || (preserve_specials && IS_SPECIAL(mode))) {
+ uint32 *devp = F_RDEV_P(first);
+@@ -773,6 +785,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
} else
modtime = read_int(f);
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
-@@ -909,6 +932,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -932,6 +957,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1261,6 +1286,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1308,6 +1335,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;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -1210,6 +1225,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1223,6 +1238,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];
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -1224,14 +1240,16 @@ static void list_file_entry(struct file_struct *f)
+@@ -1237,14 +1253,16 @@ static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -1323,6 +1341,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1336,6 +1354,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
return;
}
}
#ifdef SUPPORT_ACLS
sx.acc_acl = sx.def_acl = NULL;
+diff --git a/hlink.c b/hlink.c
+--- a/hlink.c
++++ b/hlink.c
+@@ -366,6 +366,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
+ char cmpbuf[MAXPATHLEN];
+ stat_x alt_sx;
+ int j = 0;
++ alt_sx.crtime = 0;
+ #ifdef SUPPORT_ACLS
+ alt_sx.acc_acl = alt_sx.def_acl = NULL;
+ #endif
+@@ -494,6 +495,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
+ } else
+ our_name = fname;
+
++ prev_sx.crtime = 0;
+ #ifdef SUPPORT_ACLS
+ prev_sx.acc_acl = prev_sx.def_acl = NULL;
+ #endif
diff --git a/ifuncs.h b/ifuncs.h
--- a/ifuncs.h
+++ b/ifuncs.h
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -653,7 +653,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';
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,
+@@ -428,6 +428,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+ full_fname(fname));
+ return 0;
+ }
++ sx2.crtime = 0;
+ #ifdef SUPPORT_ACLS
+ sx2.acc_acl = sx2.def_acl = NULL;
+ #endif
+@@ -475,6 +476,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
else
file->flags |= FLAG_TIME_FAILED;
}
change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
-@@ -615,7 +623,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -622,7 +631,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
/* move tmp file over real file */
if (verbose > 2)
-@@ -646,7 +654,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -653,7 +662,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
#define XMIT_SAME_FLAGS (1<<14) /* protocols ?? - now */
/* These flags are used in the live flist data. */
-@@ -154,6 +155,7 @@
+@@ -156,6 +157,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define ATTRS_DELAY_IMMUTABLE (1<<2)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -170,7 +172,7 @@
+@@ -172,7 +174,7 @@
#define FNAMECMP_FUZZY 0x83
/* For use by the itemize_changes code */
#define ITEM_REPORT_CHANGE (1<<1)
#define ITEM_REPORT_SIZE (1<<2) /* regular files only */
#define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -651,6 +653,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;
extern int fileflags_ndx;
extern int acls_ndx;
extern int xattrs_ndx;
-@@ -658,6 +661,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)
#define DEV_EXTRA_CNT 2
#define DIRNODE_EXTRA_CNT 3
#define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
-@@ -916,6 +920,7 @@ typedef struct {
+@@ -931,6 +935,7 @@ typedef struct {
typedef struct {
STRUCT_STAT st;
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1022,6 +1023,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1028,6 +1029,9 @@ 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).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
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
-@@ -1674,7 +1678,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
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.
-@@ -1733,6 +1737,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.
diff --git a/tls.c b/tls.c
--- a/tls.c
+++ b/tls.c
-@@ -105,6 +105,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
+@@ -107,6 +107,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
#endif
static void failed(char const *what, char const *where)
{
fprintf(stderr, PROGRAM ": %s %s: %s\n",
-@@ -112,16 +114,36 @@ static void failed(char const *what, char const *where)
+@@ -114,16 +116,36 @@ static void failed(char const *what, char const *where)
exit(1);
}
#ifdef SUPPORT_XATTRS
if (am_root < 0)
stat_xattr(fname, &buf);
-@@ -154,19 +176,11 @@ static void list_file(const char *fname)
+@@ -158,19 +180,11 @@ static void list_file(const char *fname)
permstring(permbuf, buf.st_mode);
/* TODO: Perhaps escape special characters in fname? */
-@@ -177,13 +191,14 @@ static void list_file(const char *fname)
+@@ -181,13 +195,14 @@ static void list_file(const char *fname)
(long)minor(buf.st_rdev));
} else /* NB: use double for size since it might not fit in a long. */
printf("%12.0f", (double)buf.st_size);
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
+ {"crtimes", 'N', POPT_ARG_NONE, &display_crtimes, 0, 0, 0},
+ {"link-times", 'l', POPT_ARG_NONE, &link_times, 0, 0, 0 },
+ {"link-owner", 'L', POPT_ARG_NONE, &link_owner, 0, 0, 0 },
#ifdef SUPPORT_XATTRS
- {"fake-super", 'f', POPT_ARG_VAL, &am_root, -1, 0, 0 },
- #endif
-@@ -197,6 +212,7 @@ static void tls_usage(int ret)
+@@ -203,6 +218,7 @@ static void tls_usage(int ret)
fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
fprintf(F,"Trivial file listing program for portably checking rsync\n");
fprintf(F,"\nOptions:\n");
+ fprintf(F," -N, --crtimes display create times (newness)\n");
+ fprintf(F," -l, --link-times display the time on a symlink\n");
+ fprintf(F," -L, --link-owner display the owner+group on a symlink\n");
#ifdef SUPPORT_XATTRS
- fprintf(F," -f, --fake-super display attributes including fake-super xattrs\n");
- #endif