Check for attr lib.
[rsync.git] / receiver.c
index 1e064d9dd65a02da9946992fb1ced98683a86d1c..39f662745a90e91a97c62ab6762419aed1509648 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1996-2000 Andrew Tridgell
  * Copyright (C) 1996 Paul Mackerras
- * Copyright (C) 2003-2013 Wayne Davison
+ * Copyright (C) 2003-2014 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -113,9 +113,12 @@ int get_tmpname(char *fnametmp, const char *fname, BOOL make_unique)
                }
        } else
                f = fname;
-       if (*f == '.') /* avoid an extra leading dot for OS X's sake */
-               f++;
-       fnametmp[length++] = '.';
+
+       if (!tmpdir) { /* using a tmpdir avoids the leading dot on our temp names */
+               if (*f == '.') /* avoid an extra leading dot for OS X's sake */
+                       f++;
+               fnametmp[length++] = '.';
+       }
 
        /* The maxname value is bufsize, and includes space for the '\0'.
         * NAME_MAX needs an extra -1 for the name's leading dot. */
@@ -580,16 +583,14 @@ int recv_files(int f_in, int f_out, char *local_name)
                        rprintf(FINFO, "recv_files(%s)\n", fname);
 
 #ifdef SUPPORT_XATTRS
-               if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
-                && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
+               if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
                        recv_xattr_request(file, f_in);
 #endif
 
                if (!(iflags & ITEM_TRANSFER)) {
                        maybe_log_item(file, iflags, itemizing, xname);
 #ifdef SUPPORT_XATTRS
-                       if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
-                        && !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE))
+                       if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
                                set_file_attrs(fname, file, NULL, fname, 0);
 #endif
                        if (iflags & ITEM_IS_NEW) {