aboutsummaryrefslogtreecommitdiffstats
path: root/generator.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2013-11-25 09:12:06 -0800
committerWayne Davison <wayned@samba.org>2013-11-25 09:18:18 -0800
commiteaa4e2d1ee5518f3d785279cacf6bf794473ef16 (patch)
treea098101512cb5b5bd53c129ccc2231eee45ebe5d /generator.c
parente461cefbabd6ae82ed5aa6686d0d118931b8fdc8 (diff)
downloadandroid_external_rsync-eaa4e2d1ee5518f3d785279cacf6bf794473ef16.tar.gz
android_external_rsync-eaa4e2d1ee5518f3d785279cacf6bf794473ef16.tar.bz2
android_external_rsync-eaa4e2d1ee5518f3d785279cacf6bf794473ef16.zip
Fix itemize bug with --link-dest, -X, and -n.
When running with --*-dest & -X, some alt-dest-found files would not use the right name when looking up old attrs in itemize(), causing a weird error for a --dry-run copy. Fixes bug 10238.
Diffstat (limited to 'generator.c')
-rw-r--r--generator.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generator.c b/generator.c
index b243b07e..b2ca2e05 100644
--- a/generator.c
+++ b/generator.c
@@ -1520,15 +1520,17 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
itemizing = 0;
code = FNONE;
- } else if (j >= 0)
+ } else if (j >= 0) {
statret = 1;
+ fnamecmp = fnamecmpbuf;
+ }
}
if (atomic_create(file, fname, sl, MAKEDEV(0, 0), &sx, statret == 0 ? DEL_FOR_SYMLINK : 0)) {
set_file_attrs(fname, file, NULL, NULL, 0);
if (itemizing) {
if (statret == 0 && !S_ISLNK(sx.st.st_mode))
statret = -1;
- itemize(fname, file, ndx, statret, &sx,
+ itemize(fnamecmp, file, ndx, statret, &sx,
ITEM_LOCAL_CHANGE|ITEM_REPORT_CHANGE, 0, NULL);
}
if (code != FNONE && INFO_GTE(NAME, 1))
@@ -1594,8 +1596,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
itemizing = 0;
code = FNONE;
- } else if (j >= 0)
+ } else if (j >= 0) {
statret = 1;
+ fnamecmp = fnamecmpbuf;
+ }
}
if (DEBUG_GTE(GENR, 1)) {
rprintf(FINFO, "mknod(%s, 0%o, [%ld,%ld])\n",
@@ -1605,7 +1609,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
if (atomic_create(file, fname, NULL, rdev, &sx, del_for_flag)) {
set_file_attrs(fname, file, NULL, NULL, 0);
if (itemizing) {
- itemize(fname, file, ndx, statret, &sx,
+ itemize(fnamecmp, file, ndx, statret, &sx,
ITEM_LOCAL_CHANGE|ITEM_REPORT_CHANGE, 0, NULL);
}
if (code != FNONE && INFO_GTE(NAME, 1))