--- old/backup.c
+++ new/backup.c
-@@ -130,7 +130,7 @@ static int make_bak_dir(char *fullpath)
+@@ -128,7 +128,7 @@ static int make_bak_dir(char *fullpath)
if (p >= rel) {
/* Try to transfer the directory settings of the
* actual dir that the files are coming from. */
rsyserr(FERROR, errno,
"make_bak_dir stat %s failed",
full_fname(rel));
-@@ -201,7 +201,7 @@ static int keep_backup(const char *fname
+@@ -199,7 +199,7 @@ static int keep_backup(const char *fname
int ret_code;
/* return if no file to keep */
sx.acc_acl = sx.def_acl = NULL;
--- old/clientserver.c
+++ new/clientserver.c
-@@ -625,6 +625,11 @@ static int rsync_module(int f_in, int f_
+@@ -627,6 +627,11 @@ static int rsync_module(int f_in, int f_
ret = parse_arguments(&argc, (const char ***) &argv, 0);
quiet = 0; /* Don't let someone try to be tricky. */
--- old/flist.c
+++ new/flist.c
-@@ -191,7 +191,7 @@ static int readlink_stat(const char *pat
+@@ -193,7 +193,7 @@ static int readlink_stat(const char *pat
}
return 0;
#else
#endif
}
-@@ -199,17 +199,17 @@ int link_stat(const char *path, STRUCT_S
+@@ -201,17 +201,17 @@ int link_stat(const char *path, STRUCT_S
{
#ifdef SUPPORT_LINKS
if (copy_links)
#endif
}
-@@ -244,26 +244,6 @@ static int is_excluded(char *fname, int
+@@ -246,26 +246,6 @@ static int is_excluded(char *fname, int
return 0;
}
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len);
-@@ -803,7 +783,7 @@ struct file_struct *make_file(const char
+@@ -814,7 +794,7 @@ struct file_struct *make_file(const char
if (save_errno == ENOENT) {
#ifdef SUPPORT_LINKS
/* Avoid "vanished" error if symlink points nowhere. */
&& S_ISLNK(st.st_mode)) {
io_error |= IOERR_GENERAL;
rprintf(FERROR, "symlink has no referent: %s\n",
-@@ -962,7 +942,7 @@ struct file_struct *make_file(const char
+@@ -982,7 +962,7 @@ struct file_struct *make_file(const char
int save_mode = file->mode;
file->mode = S_IFDIR; /* Find a directory with our name. */
if (flist_find(the_file_list, file) >= 0
- && do_stat(thisname, &st2) == 0 && S_ISDIR(st2.st_mode)) {
+ && x_stat(thisname, &st2, NULL) == 0 && S_ISDIR(st2.st_mode)) {
file->modtime = st2.st_mtime;
- file->length = st2.st_size;
+ file->len32 = 0;
file->mode = st2.st_mode;
--- old/loadparm.c
+++ new/loadparm.c
@@ -289,7 +293,7 @@ int set_file_attrs(char *fname, struct f
#ifdef HAVE_CHMOD
- if ((sxp->st.st_mode & CHMOD_BITS) != (new_mode & CHMOD_BITS)) {
+ if (!BITS_EQUAL(sxp->st.st_mode, new_mode, CHMOD_BITS)) {
- int ret = do_chmod(fname, new_mode);
+ int ret = am_root < 0 ? 0 : do_chmod(fname, new_mode);
if (ret < 0) {
"failed to set permissions on %s",
--- old/rsync.h
+++ new/rsync.h
-@@ -726,6 +726,12 @@ typedef struct {
+@@ -751,6 +751,12 @@ typedef struct {
#include "proto.h"
/* We have replacement versions of these if they're missing. */
#ifndef HAVE_ASPRINTF
int asprintf(char **ptr, const char *format, ...);
-@@ -944,6 +950,26 @@ int inet_pton(int af, const char *src, v
+@@ -969,6 +975,26 @@ int inet_pton(int af, const char *src, v
const char *get_panic_action(void);
#endif