From 67347196b13941fdf455517855481875ccf21152 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 12 Jun 2008 23:08:43 -0700 Subject: [PATCH] Fix the problem with setting xattrs on a directory that has an identical match found in a --link-dest/--copy-dest hierarchy. --- generator.c | 5 +++++ testsuite/xattrs.test | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/generator.c b/generator.c index 73dc163d..1fcdb4c2 100644 --- a/generator.c +++ b/generator.c @@ -1444,6 +1444,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (j == -2) { itemizing = 0; code = FNONE; + statret = 1; } else if (j >= 0) statret = 1; } @@ -1466,6 +1467,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } } +#ifdef SUPPORT_XATTRS + if (preserve_xattrs && statret == 1) + copy_xattrs(fnamecmpbuf, fname); +#endif if (set_file_attrs(fname, file, real_ret ? NULL : &real_sx, NULL, 0) && verbose && code != FNONE && f_out != -1) rprintf(code, "%s/\n", fname); diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test index 93e23a9b..8a311c4a 100644 --- a/testsuite/xattrs.test +++ b/testsuite/xattrs.test @@ -64,6 +64,10 @@ xset user.foo foo file2 xset user.bar bar file2 xset user.long 'a long attribute for our new file that tests to ensure that this works' file2 +xset user.dir1 'need to test directory xattrs too' foo +xset user.dir2 'another xattr' foo +xset user.dir3 'this is one last one for the moment' foo + xset user.foo 'new foo' foo/file3 foo/bar/file5 xset user.bar 'new bar' foo/file3 foo/bar/file5 xset user.long 'this is also a long attribute that will be truncated in the initial data send' foo/file3 foo/bar/file5 -- 2.34.1