From f8722dba569df64060e823fab854f31b1a302d99 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 24 Jul 2008 07:46:16 -0700 Subject: [PATCH] Fixed the --fake-super test in the xattrs testsuite when there are root-level xattrs on the files (e.g. selinux values). --- NEWS | 10 +++++----- testsuite/xattrs.test | 4 ++++ xattrs.c | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 879b7a41..1488c623 100644 --- a/NEWS +++ b/NEWS @@ -5,14 +5,14 @@ Changes since 3.0.3: BUG FIXES: - Fixed a bug in the hard-linking code where it would sometimes try to - allocate 0 bytes of memory (which fails on OSes, such as AIX). + allocate 0 bytes of memory (which fails on some OSes, such as AIX). - Fixed a couple issues in the --fake-super handling of xattrs when the destination files have root-level attributes (e.g. selinux values) that a non-root copy can't affect. - - Improved the keep-alive in-loop check in the generator to work properly - in incremental recursion mode. + - Improved the keep-alive check in the generator to fire consistently in + incremental-recursion mode when --timeout is enabled. - Fixed a potential alignment issue in the IRIX ACL code when allocating the initial "struct acl" object. Also, cast mallocs to avoid warnings. @@ -20,9 +20,9 @@ Changes since 3.0.3: ENHANCEMENTS: - Rsync will avoid sending an -e option to the server if an older protocol - in requested (and thus the option would not be useful). This lets the + is requested (and thus the option would not be useful). This lets the user specify the --protocol=29 option to access an overly-restrictive - server. + server that is rejecting the protocol-30 use of -e to the server. DEVELOPER RELATED: diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test index 86758fac..e6d8d5c2 100644 --- a/testsuite/xattrs.test +++ b/testsuite/xattrs.test @@ -99,8 +99,12 @@ rm -rf "$todir" xset user.nice 'this is nice, but different' file1 +checkit "$RSYNC -aiX --fake-super . ../chk" "$fromdir" "$chkdir" + +cd "$chkdir" xls $files >"$scratchdir/xattrs.txt" +cd "$fromdir" checkit "$RSYNC -aiX --fake-super --link-dest=../chk . ../to" "$chkdir" "$todir" cd "$todir" diff --git a/xattrs.c b/xattrs.c index 85341b37..60c7d7e8 100644 --- a/xattrs.c +++ b/xattrs.c @@ -210,7 +210,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp) size_t datum_len, name_offset; char *name, *ptr; #ifdef HAVE_LINUX_XATTRS - int user_only = am_sender ? 0 : !am_root; + int user_only = am_sender ? 0 : am_root <= 0; #endif rsync_xa *rxa; int count; @@ -294,7 +294,7 @@ int copy_xattrs(const char *source, const char *dest) size_t datum_len; char *name, *ptr; #ifdef HAVE_LINUX_XATTRS - int user_only = am_sender ? 0 : am_root <= 0; + int user_only = am_root <= 0; #endif /* This puts the name list into the "namebuf" buffer. */ -- 2.34.1