extern int read_batch;
extern int write_batch;
-static char topsrcname[MAXPATHLEN];
-
static struct exclude_struct **local_exclude_list;
static struct file_struct null_file;
if (l == -1)
return -1;
linkbuf[l] = 0;
- if (copy_unsafe_links && (topsrcname[0] != '\0') &&
- unsafe_symlink(linkbuf, topsrcname)) {
+ if (copy_unsafe_links && unsafe_symlink(linkbuf, path)) {
+ if (verbose > 1) {
+ rprintf(FINFO,"copying unsafe symlink \"%s\" -> \"%s\"\n",
+ path, linkbuf);
+ }
return do_stat(path, buffer);
}
}
}
for (i = 0; i < argc; i++) {
- char *fname = topsrcname;
+ char fname2[MAXPATHLEN];
+ char *fname = fname2;
strlcpy(fname, argv[i], MAXPATHLEN);
}
}
- topsrcname[0] = '\0';
-
if (f != -1) {
send_file_entry(NULL, f, 0);
}
test_unsafe ../../unsafe/unsafefile `pwd`/from/safe safe
test_unsafe ../files/file1 `pwd`/from/safe safe
-
-# I think these are correct, but I don't really understand the code.
-# Waiting for an answer from dwd
-test_skipped "correct behaviour is unclear"
-
-# Test suspicious handling of '..' in srcdir
-test_unsafe ../../unsafe/unsafefile from/safe/../safe unsafe
-test_unsafe ../files/file1 from/safe/../safe safe
-
test_regular to/links/file2
test_regular to/links/unsafefile
-#next rsync copy correctly
echo "rsync with relative path and --copy-unsafe-links";
$RSYNC -avv --copy-unsafe-links from/safe/ to
test_symlink to/links/file1
test_symlink to/links/file2
test_regular to/links/unsafefile
-# I think these are correct, but I don't really understand the code.
-# Waiting for an answer from dwd
-test_skipped "correct behaviour is unclear"
-
-
rm -rf to
-#next rsync copy incorrectly - links are copied as files not as links
echo "rsync with relative2 path";
(cd from; $RSYNC -avv --copy-unsafe-links safe/ ../to)
test_symlink to/links/file1
test_regular to/links/unsafefile
rm -rf to
-#next rsync copy uncorectly - all links are copied
echo "rsync with absolute path";
$RSYNC -avv --copy-unsafe-links `pwd`/from/safe/ to
test_symlink to/links/file1