Fix the problem with setting xattrs on a directory that has an
authorWayne Davison <wayned@samba.org>
Fri, 13 Jun 2008 06:08:43 +0000 (23:08 -0700)
committerWayne Davison <wayned@samba.org>
Fri, 13 Jun 2008 06:08:43 +0000 (23:08 -0700)
identical match found in a --link-dest/--copy-dest hierarchy.

generator.c
testsuite/xattrs.test

index 73dc163..1fcdb4c 100644 (file)
@@ -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);
index 93e23a9..8a311c4 100644 (file)
@@ -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