./configure (optional if already run)
make
-based-on: 0ac7ebceef70417355f25daf9e2fd94e84c49749
+based-on: f9e29dfb0912f2689ad10a7ba14ebb3ed43cf153
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
iflags |= ITEM_REPORT_GROUP;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
-@@ -1448,7 +1450,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1451,7 +1453,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
real_ret = statret;
if (file->flags & FLAG_DIR_CREATED)
statret = -1;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -62,6 +62,7 @@ int preserve_gid = 0;
+@@ -64,6 +64,7 @@ int preserve_gid = 0;
int preserve_mtimes = 0;
int preserve_atimes = 0;
int preserve_crtimes = 0;
+int omit_dir_changes = 0;
int omit_dir_times = 0;
int omit_link_times = 0;
- int update_only = 0;
-@@ -643,6 +644,7 @@ static struct poptOption long_options[] = {
+ int trust_sender = 0;
+@@ -646,6 +647,7 @@ static struct poptOption long_options[] = {
{"omit-link-times", 'J', POPT_ARG_VAL, &omit_link_times, 1, 0, 0 },
{"no-omit-link-times",0, POPT_ARG_VAL, &omit_link_times, 0, 0, 0 },
{"no-J", 0, POPT_ARG_VAL, &omit_link_times, 0, 0, 0 },
{"modify-window", '@', POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 },
{"no-super", 0, POPT_ARG_VAL, &am_root, 0, 0, 0 },
-@@ -2296,7 +2298,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2302,7 +2304,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
omit_dir_times = -1; /* Implied, so avoid -O to sender. */
if (stdout_format) {
-@@ -2792,6 +2794,8 @@ void server_options(char **args, int *argc_p)
+@@ -2815,6 +2817,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--size-only";
if (do_stats)
args[ac++] = "--stats";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -383,6 +383,7 @@ has its own detailed description later in this manpage.
+@@ -427,6 +427,7 @@ has its own detailed description later in this manpage.
--crtimes, -N preserve create times (newness)
--omit-dir-times, -O omit directories from --times
--omit-link-times, -J omit symlinks from --times
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
--sparse, -S turn sequences of nulls into sparse blocks
-@@ -1549,6 +1550,11 @@ your home directory (remove the '=' for that).
+@@ -1604,6 +1605,11 @@ expand it.
This tells rsync to omit symlinks when it is preserving modification,
access, and create times.
stat_x sx2;
int change_uid, change_gid;
mode_t new_mode = file->mode;
-+ int omit_uid_gid = omit_dir_changes && S_ISDIR(sxp->st.st_mode);
++ int omit_uid_gid;
int inherit;
if (!sxp) {
-@@ -520,9 +522,9 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -520,9 +522,10 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
get_acl(fname, sxp);
#endif
- change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
- change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
- && sxp->st.st_gid != (gid_t)F_GROUP(file);
++ omit_uid_gid = omit_dir_changes && S_ISDIR(sxp->st.st_mode);
+ change_uid = am_root && !omit_uid_gid && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
+ change_gid = gid_ndx && !omit_uid_gid && !(file->flags & FLAG_SKIP_GROUP)
+ && sxp->st.st_gid != (gid_t)F_GROUP(file);