Matt McCutchen's Web Site
/
rsync
/
rsync-patches.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed failing hunks.
[rsync/rsync-patches.git]
/
xattrs.diff
diff --git
a/xattrs.diff
b/xattrs.diff
index
e8a53f7
..
3dfa510
100644
(file)
--- a/
xattrs.diff
+++ b/
xattrs.diff
@@
-61,8
+61,8
@@
TODO:
if (!(file = make_file(rel, NULL, NULL, 0, NO_FILTERS)))
continue;
#ifdef SUPPORT_ACLS
if (!(file = make_file(rel, NULL, NULL, 0, NO_FILTERS)))
continue;
#ifdef SUPPORT_ACLS
-@@ -14
2,6 +146
,12 @@ static int make_bak_dir(char *fullpath)
-
cache_acl(file,
&sx);
+@@ -14
3,6 +147
,12 @@ static int make_bak_dir(char *fullpath)
+
free_acl(
&sx);
}
#endif
+#ifdef SUPPORT_XATTRS
}
#endif
+#ifdef SUPPORT_XATTRS
@@
-74,7
+74,7
@@
TODO:
set_file_attrs(fullpath, file, NULL, 0);
free(file);
}
set_file_attrs(fullpath, file, NULL, 0);
free(file);
}
-@@ -19
3,6 +203
,9 @@ static int keep_backup(const char *fname
+@@ -19
4,6 +204
,9 @@ static int keep_backup(const char *fname
#ifdef SUPPORT_ACLS
sx.acc_acl = sx.def_acl = NULL;
#endif
#ifdef SUPPORT_ACLS
sx.acc_acl = sx.def_acl = NULL;
#endif
@@
-84,8
+84,8
@@
TODO:
if (!(file = make_file(fname, NULL, NULL, 0, NO_FILTERS)))
return 1; /* the file could have disappeared */
if (!(file = make_file(fname, NULL, NULL, 0, NO_FILTERS)))
return 1; /* the file could have disappeared */
-@@ -2
08,6 +221
,12 @@ static int keep_backup(const char *fname
-
cache_acl(file,
&sx);
+@@ -2
10,6 +223
,12 @@ static int keep_backup(const char *fname
+
free_acl(
&sx);
}
#endif
+#ifdef SUPPORT_XATTRS
}
#endif
+#ifdef SUPPORT_XATTRS
@@
-110,9
+110,9
@@
TODO:
if (!read_batch)
--- old/configure.in
+++ new/configure.in
if (!read_batch)
--- old/configure.in
+++ new/configure.in
-@@ -88
3,6 +883
,40 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
- AC_MSG_RESULT(no)
- )
+@@ -88
1,6 +881
,40 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
+ esac
+ fi
+AC_CHECK_HEADERS(attr/xattr.h)
+AC_CHECK_HEADERS(sys/xattr.h)
+AC_CHECK_HEADERS(attr/xattr.h)
+AC_CHECK_HEADERS(sys/xattr.h)
@@
-162,7
+162,7
@@
TODO:
extern int preserve_hard_links;
extern int preserve_devices;
@@ -864,6 +865,10 @@ static struct file_struct *recv_file_ent
extern int preserve_hard_links;
extern int preserve_devices;
@@ -864,6 +865,10 @@ static struct file_struct *recv_file_ent
- if (preserve_acls)
+ if (preserve_acls
&& !S_ISLNK(mode)
)
receive_acl(file, f);
#endif
+#ifdef SUPPORT_XATTRS
receive_acl(file, f);
#endif
+#ifdef SUPPORT_XATTRS
@@
-195,9
+195,9
@@
TODO:
maybe_emit_filelist_progress(flist->count + flist_count_offset);
maybe_emit_filelist_progress(flist->count + flist_count_offset);
-@@ -116
6,6 +1178
,10 @@ static struct file_struct *send_file_nam
- if (preserve_acls)
- send_acl(&sx, f);
+@@ -116
8,6 +1180
,10 @@ static struct file_struct *send_file_nam
+ free_acl(&sx);
+ }
#endif
+#ifdef SUPPORT_XATTRS
+ if (preserve_xattrs)
#endif
+#ifdef SUPPORT_XATTRS
+ if (preserve_xattrs)
@@
-494,7
+494,7
@@
TODO:
* will enable owner-writability using chmod, if necessary.
--- old/rsync.h
+++ new/rsync.h
* will enable owner-writability using chmod, if necessary.
--- old/rsync.h
+++ new/rsync.h
-@@ -55
5,6 +555
,10 @@ struct idev_node {
+@@ -55
1,6 +551
,10 @@ struct idev_node {
#define ACLS_NEED_MASK 1
#endif
#define ACLS_NEED_MASK 1
#endif
@@
-505,7
+505,7
@@
TODO:
#define GID_NONE ((gid_t)-1)
union file_extras {
#define GID_NONE ((gid_t)-1)
union file_extras {
-@@ -57
5,6 +579
,7 @@ extern int file_extra_cnt;
+@@ -57
1,6 +575
,7 @@ extern int file_extra_cnt;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_acls;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_acls;
@@
-513,7
+513,7
@@
TODO:
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
-@@ -60
8,6 +613
,7 @@ extern int preserve_acls;
+@@ -60
4,6 +609
,7 @@ extern int preserve_acls;
#define F_OWNER(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GROUP(f) REQ_EXTRA(f, preserve_gid)->unum
#define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum
#define F_OWNER(f) REQ_EXTRA(f, preserve_uid)->unum
#define F_GROUP(f) REQ_EXTRA(f, preserve_gid)->unum
#define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum
@@
-521,7
+521,7
@@
TODO:
/* These items are per-entry optional and mutally exclusive: */
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num
/* These items are per-entry optional and mutally exclusive: */
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num
-@@ -79
9,6 +805
,9 @@ typedef struct {
+@@ -79
5,6 +801
,9 @@ typedef struct {
struct rsync_acl *acc_acl; /* access ACL */
struct rsync_acl *def_acl; /* default ACL */
#endif
struct rsync_acl *acc_acl; /* access ACL */
struct rsync_acl *def_acl; /* default ACL */
#endif
@@
-545,14
+545,14
@@
TODO:
@@ -324,6 +324,7 @@ to the detailed description below for a
-E, --executability preserve executability
--chmod=CHMOD affect file and/or directory permissions
@@ -324,6 +324,7 @@ to the detailed description below for a
-E, --executability preserve executability
--chmod=CHMOD affect file and/or directory permissions
- -A, --acls preserve ACLs (implies -p)
[non-standard]
-+ -X, --xattrs preserve extended attrs (implies -p)
[n.s.]
+ -A, --acls preserve ACLs (implies -p)
++ -X, --xattrs preserve extended attrs (implies -p)
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--devices preserve device files (super-user only)
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--devices preserve device files (super-user only)
-@@ -83
5,6 +836,11 @@ The ACL-sending protocol used by this ve
- the patch that was shipped with 2.6.8. Sending ACLs to an older version
-
of the ACL patch is not supported
.
+@@ -83
1,6 +832,11 @@ dit(bf(-A, --acls)) This option causes r
+ ACLs to be the same as the source ACLs. This nonstandard option only
+
works if the remote rsync also supports it. bf(--acls) implies bf(--perms)
.
+dit(bf(-X, --xattrs)) This option causes rsync to update the remote
+extended attributes to be the same as the local ones. This will work
+dit(bf(-X, --xattrs)) This option causes rsync to update the remote
+extended attributes to be the same as the local ones. This will work
@@
-564,7
+564,7
@@
TODO:
transfer. The resulting value is treated as though it was the permissions
--- old/xattr.c
+++ new/xattr.c
transfer. The resulting value is treated as though it was the permissions
--- old/xattr.c
+++ new/xattr.c
-@@ -0,0 +1,45
1
@@
+@@ -0,0 +1,45
9
@@
+/*
+ * Extended Attribute support for rsync.
+ * Written by Jay Fenlason, vaguely based on the ACLs patch.
+/*
+ * Extended Attribute support for rsync.
+ * Written by Jay Fenlason, vaguely based on the ACLs patch.
@@
-979,6
+979,14
@@
TODO:
+ name_len = strlen(name) + 1;
+ list_len -= name_len;
+
+ name_len = strlen(name) + 1;
+ list_len -= name_len;
+
++#ifdef HAVE_LINUX_XATTRS
++ /* We always ignore the system namespace, and non-root
++ * ignores everything but the user namespace. */
++ if (am_root ? HAS_PREFIX(name, SYSTEM_PREFIX)
++ : !HAS_PREFIX(name, USER_PREFIX))
++ continue;
++#endif
++
+ for (i = 0; i < xalp->count; i++) {
+ if (strcmp(name, rxas[i].name) == 0)
+ break;
+ for (i = 0; i < xalp->count; i++) {
+ if (strcmp(name, rxas[i].name) == 0)
+ break;