Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Using --relative with --no-implied-dirs turns off incremental recursion.
[rsync/rsync.git]
/
xattrs.c
diff --git
a/xattrs.c
b/xattrs.c
index
7591660
..
595ec42
100644
(file)
--- a/
xattrs.c
+++ b/
xattrs.c
@@
-6,8
+6,9
@@
* Copyright (C) 2006, 2007 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* Copyright (C) 2006, 2007 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,8
+16,7
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
*/
#include "rsync.h"
@@
-30,6
+30,7
@@
extern int am_sender;
extern int am_generator;
extern int read_only;
extern int list_only;
extern int am_generator;
extern int read_only;
extern int list_only;
+extern int preserve_xattrs;
extern int checksum_seed;
#define RSYNC_XAL_INITIAL 5
extern int checksum_seed;
#define RSYNC_XAL_INITIAL 5
@@
-62,7
+63,6
@@
extern int checksum_seed;
#define RPRE_LEN ((int)sizeof RSYNC_PREFIX - 1)
#define XSTAT_ATTR RSYNC_PREFIX "%stat"
#define RPRE_LEN ((int)sizeof RSYNC_PREFIX - 1)
#define XSTAT_ATTR RSYNC_PREFIX "%stat"
-#define XSTAT_LEN ((int)sizeof XSTAT_ATTR - 1)
typedef struct {
char *datum, *name;
typedef struct {
char *datum, *name;
@@
-223,8
+223,9
@@
static int rsync_xal_get(const char *fname, item_list *xalp)
continue;
#endif
continue;
#endif
- if (am_root < 0 && name_len == XSTAT_LEN + 1
- && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0)
+ /* No rsync.%FOO attributes are copied w/o 2 -X options. */
+ if (preserve_xattrs < 2 && name_len > RPRE_LEN
+ && name[RPRE_LEN] == '%' && HAS_PREFIX(name, RSYNC_PREFIX))
continue;
datum_len = name_len; /* Pass extra size to get_xattr_data() */
continue;
datum_len = name_len; /* Pass extra size to get_xattr_data() */
@@
-636,8
+637,9
@@
void receive_xattr(struct file_struct *file, int f)
continue;
}
#endif
continue;
}
#endif
- if (am_root < 0 && name_len == XSTAT_LEN + 1
- && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0) {
+ /* No rsync.%FOO attributes are copied w/o 2 -X options. */
+ if (preserve_xattrs < 2 && name_len > RPRE_LEN
+ && name[RPRE_LEN] == '%' && HAS_PREFIX(name, RSYNC_PREFIX)) {
free(ptr);
continue;
}
free(ptr);
continue;
}