robust_unlink(fname); /* Just in case... */
--- old/compat.c
+++ new/compat.c
-@@ -48,6 +48,8 @@ void setup_protocol(int f_out,int f_in)
- preserve_uid = ++flist_extra_cnt;
+@@ -50,6 +50,8 @@ void setup_protocol(int f_out,int f_in)
+ preserve_uid = ++file_extra_cnt;
if (preserve_gid)
- preserve_gid = ++flist_extra_cnt;
+ preserve_gid = ++file_extra_cnt;
+ if (preserve_acls && !am_sender)
-+ preserve_acls = ++flist_extra_cnt;
++ preserve_acls = ++file_extra_cnt;
if (remote_protocol == 0) {
if (!read_batch)
--- old/configure.in
+++ new/configure.in
-@@ -537,6 +537,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
+@@ -542,6 +542,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
AC_CHECK_LIB(resolv, strcasecmp)
fi
dnl At the moment we don't test for a broken memcmp(), because all we
dnl need to do is test for equality, not comparison, and it seems that
dnl every platform has a memcmp that can do at least that.
-@@ -801,6 +806,78 @@ AC_SUBST(OBJ_RESTORE)
+@@ -806,6 +811,78 @@ AC_SUBST(OBJ_RESTORE)
AC_SUBST(CC_SHOBJ_FLAG)
AC_SUBST(BUILD_POPT)
}
@@ -1068,6 +1082,9 @@ static struct file_struct *send_file_nam
- unsigned short flags)
+ int flags)
{
struct file_struct *file;
+#ifdef SUPPORT_ACLS
extern int make_backups;
extern int protocol_version;
extern int remove_source_files;
-@@ -269,15 +270,19 @@ void match_hard_links(void)
+@@ -268,15 +269,19 @@ void match_hard_links(void)
}
static int maybe_hard_link(struct file_struct *file, int ndx,
ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS,
0, "");
}
-@@ -298,7 +303,11 @@ static int maybe_hard_link(struct file_s
+@@ -297,7 +302,11 @@ static int maybe_hard_link(struct file_s
if (hard_link_one(file, fname, oldname, 0)) {
if (itemizing) {
ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS, 0,
realname);
}
-@@ -312,7 +321,7 @@ static int maybe_hard_link(struct file_s
+@@ -311,7 +320,7 @@ static int maybe_hard_link(struct file_s
/* Only called if FLAG_HLINKED is set and FLAG_HLINK_FIRST is not. Returns:
* 0 = process the file, 1 = skip the file, -1 = error occurred. */
int hard_link_check(struct file_struct *file, int ndx, const char *fname,
enum logcode code)
{
STRUCT_STAT prev_st;
-@@ -363,18 +372,20 @@ int hard_link_check(struct file_struct *
+@@ -362,18 +371,20 @@ int hard_link_check(struct file_struct *
if (statret < 0 && basis_dir[0] != NULL) {
/* If we match an alt-dest item, we don't output this as a change. */
char cmpbuf[MAXPATHLEN];
if (verbose < 2 || !stdout_format_has_i) {
itemizing = 0;
code = FNONE;
-@@ -383,16 +394,36 @@ int hard_link_check(struct file_struct *
+@@ -382,16 +393,36 @@ int hard_link_check(struct file_struct *
}
break;
}
realname, itemizing, code) < 0)
return -1;
-@@ -427,7 +458,8 @@ void finish_hard_link(struct file_struct
+@@ -426,7 +457,8 @@ void finish_hard_link(struct file_struct
STRUCT_STAT *stp, int itemizing, enum logcode code,
int alt_dest)
{
char alt_name[MAXPATHLEN], *prev_name;
const char *our_name;
int prev_statret, ndx, prev_ndx = F_HL_PREV(file);
-@@ -451,14 +483,24 @@ void finish_hard_link(struct file_struct
+@@ -450,14 +482,24 @@ void finish_hard_link(struct file_struct
} else
our_name = fname;
--- old/rsync.h
+++ new/rsync.h
-@@ -503,6 +503,14 @@ struct idev_node {
+@@ -532,6 +532,14 @@ struct idev_node {
#define IN_LOOPBACKNET 127
#endif
#define GID_NONE ((gid_t)-1)
union file_extras {
-@@ -522,6 +530,7 @@ struct file_struct {
- extern int flist_extra_cnt;
+@@ -551,6 +559,7 @@ struct file_struct {
+ extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
+extern int preserve_acls;
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
-@@ -554,10 +563,12 @@ extern int preserve_gid;
+@@ -583,10 +592,12 @@ extern int preserve_gid;
/* When the associated option is on, all entries will have these present: */
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GID(f) REQ_EXTRA(f, preserve_gid)->unum
/* This optional item might follow an F_HL_*() item.
* (Note: a device doesn't need to check LEN64_BUMP(f).) */
-@@ -693,6 +704,17 @@ struct stats {
+@@ -722,6 +733,17 @@ struct stats {
struct chmod_mode_struct;
#include "byteorder.h"
#include "lib/mdfour.h"
#include "lib/wildmatch.h"
-@@ -711,6 +733,16 @@ struct chmod_mode_struct;
+@@ -740,6 +762,16 @@ struct chmod_mode_struct;
#define NORETURN __attribute__((__noreturn__))
#endif
--- old/compat.c
+++ new/compat.c
-@@ -48,6 +48,8 @@ void setup_protocol(int f_out,int f_in)
- preserve_uid = ++flist_extra_cnt;
+@@ -50,6 +50,8 @@ void setup_protocol(int f_out,int f_in)
+ preserve_uid = ++file_extra_cnt;
if (preserve_gid)
- preserve_gid = ++flist_extra_cnt;
+ preserve_gid = ++file_extra_cnt;
+ if (preserve_atimes)
-+ preserve_atimes = ++flist_extra_cnt;
++ preserve_atimes = ++file_extra_cnt;
if (remote_protocol == 0) {
if (!read_batch)
+extern int preserve_atimes;
extern int relative_paths;
extern int implied_dirs;
- extern int flist_extra_cnt;
+ extern int file_extra_cnt;
@@ -137,6 +138,7 @@ void show_flist_stats(void)
static void list_file_entry(struct file_struct *f)
{
f_name(f, NULL));
}
}
-@@ -314,6 +318,7 @@ static void send_file_entry(struct file_
+@@ -313,6 +317,7 @@ void flist_expand(struct file_list *flis
+ static void send_file_entry(struct file_struct *file, int f, int ndx)
{
- unsigned short flags;
static time_t modtime;
+ static time_t atime;
static mode_t mode;
add_uid(uid);
@@ -501,7 +515,7 @@ static void send_file_entry(struct file_
static struct file_struct *recv_file_entry(struct file_list *flist,
- unsigned short flags, int f)
+ int flags, int f)
{
- static time_t modtime;
+ static time_t modtime, atime;
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -522,6 +524,7 @@ struct file_struct {
- extern int flist_extra_cnt;
+@@ -551,6 +553,7 @@ struct file_struct {
+ extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
+extern int preserve_atimes;
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
-@@ -554,6 +557,7 @@ extern int preserve_gid;
+@@ -583,6 +586,7 @@ extern int preserve_gid;
/* When the associated option is on, all entries will have these present: */
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GID(f) REQ_EXTRA(f, preserve_gid)->unum
save_filters = push_local_filters(fname, dlen);
non_perishable_cnt = 0;
-+ flist_extra_cnt += SUM_EXTRA_CNT;
++ file_extra_cnt += SUM_EXTRA_CNT;
dirlist = get_dirlist(fname, dlen, 0);
-+ flist_extra_cnt -= SUM_EXTRA_CNT;
++ file_extra_cnt -= SUM_EXTRA_CNT;
ret = non_perishable_cnt ? DR_NOT_EMPTY : DR_SUCCESS;
if (!dirlist->count)
--- old/compat.c
+++ new/compat.c
-@@ -48,6 +48,8 @@ void setup_protocol(int f_out,int f_in)
- preserve_uid = ++flist_extra_cnt;
+@@ -50,6 +50,8 @@ void setup_protocol(int f_out,int f_in)
+ preserve_uid = ++file_extra_cnt;
if (preserve_gid)
- preserve_gid = ++flist_extra_cnt;
+ preserve_gid = ++file_extra_cnt;
+ if (preserve_fileflags)
-+ preserve_fileflags = ++flist_extra_cnt;
++ preserve_fileflags = ++file_extra_cnt;
if (remote_protocol == 0) {
if (!read_batch)
--- old/configure.in
+++ new/configure.in
-@@ -549,7 +549,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
+@@ -554,7 +554,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
memmove lchown vsnprintf snprintf vasprintf asprintf setsid glob strpbrk \
strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
extern int preserve_uid;
extern int preserve_gid;
extern int relative_paths;
-@@ -315,6 +316,9 @@ static void send_file_entry(struct file_
- unsigned short flags;
+@@ -314,6 +315,9 @@ static void send_file_entry(struct file_
+ {
static time_t modtime;
static mode_t mode;
+#ifdef SUPPORT_FLAGS
/* These flags are used in the live flist data. */
-@@ -355,6 +356,10 @@ enum msgcode {
- #define schar char
+@@ -374,6 +375,10 @@ enum msgcode {
+ #endif
#endif
+#ifdef HAVE_CHFLAGS
/* 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. */
-@@ -522,6 +527,7 @@ struct file_struct {
- extern int flist_extra_cnt;
+@@ -551,6 +556,7 @@ struct file_struct {
+ extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
+extern int preserve_fileflags;
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
-@@ -554,6 +560,7 @@ extern int preserve_gid;
+@@ -583,6 +589,7 @@ extern int preserve_gid;
/* When the associated option is on, all entries will have these present: */
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GID(f) REQ_EXTRA(f, preserve_gid)->unum
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
--- old/compat.c
+++ new/compat.c
-@@ -50,6 +50,8 @@ void setup_protocol(int f_out,int f_in)
- preserve_gid = ++flist_extra_cnt;
+@@ -52,6 +52,8 @@ void setup_protocol(int f_out,int f_in)
+ preserve_gid = ++file_extra_cnt;
if (preserve_acls && !am_sender)
- preserve_acls = ++flist_extra_cnt;
+ preserve_acls = ++file_extra_cnt;
+ if (preserve_xattrs && !am_sender)
-+ preserve_xattrs = ++flist_extra_cnt;
++ preserve_xattrs = ++file_extra_cnt;
if (remote_protocol == 0) {
if (!read_batch)
--- old/configure.in
+++ new/configure.in
-@@ -878,6 +878,40 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
+@@ -883,6 +883,40 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
AC_MSG_RESULT(no)
)
return file;
}
@@ -1082,7 +1087,7 @@ static struct file_struct *send_file_nam
- unsigned short flags)
+ int flags)
{
struct file_struct *file;
-#ifdef SUPPORT_ACLS
* will enable owner-writability using chmod, if necessary.
--- old/rsync.h
+++ new/rsync.h
-@@ -511,6 +511,10 @@ struct idev_node {
+@@ -540,6 +540,10 @@ struct idev_node {
#define ACLS_NEED_MASK 1
#endif
#define GID_NONE ((gid_t)-1)
union file_extras {
-@@ -531,6 +535,7 @@ extern int flist_extra_cnt;
+@@ -560,6 +564,7 @@ extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_acls;
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
-@@ -564,6 +569,7 @@ extern int preserve_acls;
+@@ -593,6 +598,7 @@ extern int preserve_acls;
#define F_UID(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GID(f) REQ_EXTRA(f, preserve_gid)->unum
#define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum
/* These items are per-entry optional and mutally exclusive: */
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num
-@@ -739,6 +745,9 @@ typedef struct {
+@@ -768,6 +774,9 @@ typedef struct {
struct rsync_acl *acc_acl; /* access ACL */
struct rsync_acl *def_acl; /* default ACL */
#endif