From cbbd8e2e8bf72aa46c84c7de43e19da40f040fa7 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 7 Mar 2008 15:23:39 -0800 Subject: [PATCH] The --fake-super option conflicts with -XX (which copies internal rsync xattrs literally). --- clientserver.c | 7 +++++-- options.c | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/clientserver.c b/clientserver.c index 7c15e3bf..6bcbc81e 100644 --- a/clientserver.c +++ b/clientserver.c @@ -32,6 +32,7 @@ extern int am_daemon; extern int am_root; extern int rsync_port; extern int ignore_errors; +extern int preserve_xattrs; extern int kluge_around_eof; extern int daemon_over_rsh; extern int sanitize_paths; @@ -745,9 +746,11 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) if (write_batch < 0) dry_run = 1; - if (lp_fake_super(i)) + if (lp_fake_super(i)) { + if (preserve_xattrs > 1) + preserve_xattrs = 1; am_root = -1; - else if (am_root < 0) /* Treat --fake-super from client as --super. */ + } else if (am_root < 0) /* Treat --fake-super from client as --super. */ am_root = 2; if (filesfrom_fd == 0) diff --git a/options.c b/options.c index 7972121b..4ac8846d 100644 --- a/options.c +++ b/options.c @@ -1314,7 +1314,13 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) } #endif -#ifndef SUPPORT_XATTRS +#ifdef SUPPORT_XATTRS + if (am_root < 0 && preserve_xattrs > 1) { + snprintf(err_buf, sizeof err_buf, + "--fake-super conflicts with -XX\n"); + return 0; + } +#else if (am_root < 0) { snprintf(err_buf, sizeof err_buf, "--fake-super requires an rsync with extended attributes enabled\n"); -- 2.34.1