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
Got rid of patch fuzz.
[rsync/rsync-patches.git]
/
xattrs.diff
diff --git
a/xattrs.diff
b/xattrs.diff
index
4214ca9
..
16548fb
100644
(file)
--- a/
xattrs.diff
+++ b/
xattrs.diff
@@
-12,10
+12,10
@@
To use this patch, run these commands for a successful build:
--- old/compat.c
+++ new/compat.c
--- old/compat.c
+++ new/compat.c
-@@ -1
15,13 +115
,6 @@ void setup_protocol(int f_out,int f_in)
- protocol_version);
- exit_cleanup(RERR_PROTOCOL);
- }
+@@ -1
63,13 +163
,6 @@ void setup_protocol(int f_out,int f_in)
+ if (protocol_version < 30) {
+ if (append_mode == 1)
+ append_mode = 2;
- if (preserve_xattrs && !local_server) {
- rprintf(FERROR,
- "--xattrs requires protocol 30 or higher"
- if (preserve_xattrs && !local_server) {
- rprintf(FERROR,
- "--xattrs requires protocol 30 or higher"
@@
-28,23
+28,23
@@
To use this patch, run these commands for a successful build:
if (delete_mode && !(delete_before+delete_during+delete_after)) {
--- old/xattrs.c
+++ new/xattrs.c
if (delete_mode && !(delete_before+delete_during+delete_after)) {
--- old/xattrs.c
+++ new/xattrs.c
-@@ -20,6 +20,7 @@
- */
+@@ -21,6 +21,7 @@
#include "rsync.h"
#include "rsync.h"
+ #include "ifuncs.h"
+#include "io.h"
#include "lib/sysxattrs.h"
#ifdef SUPPORT_XATTRS
+#include "io.h"
#include "lib/sysxattrs.h"
#ifdef SUPPORT_XATTRS
-@@ -31,6 +32,7 @@ extern int am_generator;
- extern int read_only;
+@@ -33,6 +34,7 @@ extern int read_only;
extern int list_only;
extern int list_only;
+ extern int preserve_xattrs;
extern int checksum_seed;
+extern int protocol_version;
#define RSYNC_XAL_INITIAL 5
#define RSYNC_XAL_LIST_INITIAL 100
extern int checksum_seed;
+extern int protocol_version;
#define RSYNC_XAL_INITIAL 5
#define RSYNC_XAL_LIST_INITIAL 100
-@@ -2
22,7 +224
,7 @@ static int rsync_xal_get(const char *fna
+@@ -2
33,7 +235
,7 @@ static int rsync_xal_get(const char *fna
if (!(ptr = get_xattr_data(fname, name, &datum_len, 0)))
return -1;
if (!(ptr = get_xattr_data(fname, name, &datum_len, 0)))
return -1;
@@
-53,7
+53,7
@@
To use this patch, run these commands for a successful build:
/* For large datums, we store a flag and a checksum. */
name_offset = 1 + MAX_DIGEST_LEN;
sum_init(checksum_seed);
/* For large datums, we store a flag and a checksum. */
name_offset = 1 + MAX_DIGEST_LEN;
sum_init(checksum_seed);
-@@ -2
78,7 +280
,7 @@ static int find_matching_xattr(item_list
+@@ -2
97,7 +299
,7 @@ static int find_matching_xattr(item_list
|| rxas1[j].datum_len != rxas2[j].datum_len
|| strcmp(rxas1[j].name, rxas2[j].name))
break;
|| rxas1[j].datum_len != rxas2[j].datum_len
|| strcmp(rxas1[j].name, rxas2[j].name))
break;
@@
-62,7
+62,7
@@
To use this patch, run these commands for a successful build:
if (memcmp(rxas1[j].datum + 1,
rxas2[j].datum + 1,
MAX_DIGEST_LEN) != 0)
if (memcmp(rxas1[j].datum + 1,
rxas2[j].datum + 1,
MAX_DIGEST_LEN) != 0)
-@@ -3
15,34 +317
,43 @@ int send_xattr(statx *sxp, int f)
+@@ -3
34,34 +336
,43 @@ int send_xattr(statx *sxp, int f)
{
int ndx = find_matching_xattr(sxp->xattr);
{
int ndx = find_matching_xattr(sxp->xattr);
@@
-116,7
+116,7
@@
To use this patch, run these commands for a successful build:
write_buf(f, rxa->datum + 1, MAX_DIGEST_LEN);
else
write_buf(f, rxa->datum, rxa->datum_len);
write_buf(f, rxa->datum + 1, MAX_DIGEST_LEN);
else
write_buf(f, rxa->datum, rxa->datum_len);
-@@ -
392,7 +403
,7 @@ int xattr_diff(struct file_struct *file,
+@@ -
411,7 +422
,7 @@ int xattr_diff(struct file_struct *file,
cmp = rec_cnt ? strcmp(snd_rxa->name, rec_rxa->name) : -1;
if (cmp > 0)
same = 0;
cmp = rec_cnt ? strcmp(snd_rxa->name, rec_rxa->name) : -1;
if (cmp > 0)
same = 0;
@@
-125,7
+125,7
@@
To use this patch, run these commands for a successful build:
same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
&& memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
MAX_DIGEST_LEN) == 0;
same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
&& memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
MAX_DIGEST_LEN) == 0;
-@@ -4
35,6 +446
,9 @@ void send_xattr_request(const char *fnam
+@@ -4
54,6 +465
,9 @@ void send_xattr_request(const char *fnam
int j, cnt, prior_req = -1;
rsync_xa *rxa;
int j, cnt, prior_req = -1;
rsync_xa *rxa;
@@
-135,7
+135,7
@@
To use this patch, run these commands for a successful build:
lst += F_XATTR(file);
cnt = lst->count;
for (rxa = lst->items, j = 0; j < cnt; rxa++, j++) {
lst += F_XATTR(file);
cnt = lst->count;
for (rxa = lst->items, j = 0; j < cnt; rxa++, j++) {
-@@ -5
06,6 +520
,9 @@ void recv_xattr_request(struct file_stru
+@@ -5
25,6 +539
,9 @@ void recv_xattr_request(struct file_stru
rsync_xa *rxa;
int rel_pos, cnt;
rsync_xa *rxa;
int rel_pos, cnt;
@@
-145,7
+145,7
@@
To use this patch, run these commands for a successful build:
if (F_XATTR(file) < 0) {
rprintf(FERROR, "recv_xattr_request: internal data error!\n");
exit_cleanup(RERR_STREAMIO);
if (F_XATTR(file) < 0) {
rprintf(FERROR, "recv_xattr_request: internal data error!\n");
exit_cleanup(RERR_STREAMIO);
-@@ -5
52,7 +569
,22 @@ void receive_xattr(struct file_struct *f
+@@ -5
71,7 +588
,22 @@ void receive_xattr(struct file_struct *f
{
static item_list temp_xattr = EMPTY_ITEM_LIST;
int count;
{
static item_list temp_xattr = EMPTY_ITEM_LIST;
int count;
@@
-169,7
+169,7
@@
To use this patch, run these commands for a successful build:
if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
rprintf(FERROR, "receive_xattr: xa index %d out of"
if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
rprintf(FERROR, "receive_xattr: xa index %d out of"
-@@ -5
65,7 +597
,7 @@ void receive_xattr(struct file_struct *f
+@@ -5
84,7 +616
,7 @@ void receive_xattr(struct file_struct *f
return;
}
return;
}
@@
-178,7
+178,7
@@
To use this patch, run these commands for a successful build:
(void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
temp_xattr.count = 0;
}
(void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
temp_xattr.count = 0;
}
-@@ -5
73,9 +605
,10 @@ void receive_xattr(struct file_struct *f
+@@ -5
92,9 +624
,10 @@ void receive_xattr(struct file_struct *f
while (count--) {
char *ptr, *name;
rsync_xa *rxa;
while (count--) {
char *ptr, *name;
rsync_xa *rxa;
@@
-189,6
+189,6
@@
To use this patch, run these commands for a successful build:
+ size_t datum_len = read_varint30(f);
+ size_t dget_len = datum_len > MAX_FULL_DATUM && protocol_version >= 30
+ ? 1 + MAX_DIGEST_LEN : datum_len;
+ size_t datum_len = read_varint30(f);
+ size_t dget_len = datum_len > MAX_FULL_DATUM && protocol_version >= 30
+ ? 1 + MAX_DIGEST_LEN : datum_len;
- #ifdef HAVE_LINUX_XATTRS
- size_t extra_len = 0;
- #else
+ size_t extra_len = MIGHT_NEED_RPRE ? RPRE_LEN : 0;
+ if (dget_len + extra_len < dget_len)
+ out_of_memory("receive_xattr"); /* overflow */