mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-04-21 14:47:04 -04:00
Fixed the use of a dot-dir path (foo/./bar) inside of a files-from file.
This commit is contained in:
6
flist.c
6
flist.c
@@ -2008,9 +2008,6 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
|
||||
start_write = stats.total_written;
|
||||
gettimeofday(&start_tv, NULL);
|
||||
|
||||
if (!orig_dir)
|
||||
orig_dir = strdup(curr_dir);
|
||||
|
||||
if (relative_paths && protocol_version >= 30)
|
||||
implied_dirs = 1; /* We send flagged implied dirs */
|
||||
|
||||
@@ -2036,6 +2033,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
|
||||
use_ff_fd = 1;
|
||||
}
|
||||
|
||||
if (!orig_dir)
|
||||
orig_dir = strdup(curr_dir);
|
||||
|
||||
while (1) {
|
||||
char fbuf[MAXPATHLEN], *fn, name_type;
|
||||
|
||||
|
||||
30
testsuite/files-from.test
Normal file
30
testsuite/files-from.test
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2008 by Wayne Davison <wayned@samba.org>
|
||||
|
||||
# This program is distributable under the terms of the GNU GPL (see
|
||||
# COPYING).
|
||||
|
||||
# Test that --files-from=FILE works right.
|
||||
|
||||
. "$suitedir/rsync.fns"
|
||||
|
||||
hands_setup
|
||||
|
||||
# This list of files skips the contents of "subsubdir" but includes
|
||||
# the contents of "subsubdir2" due to its trailing slash.
|
||||
cat >"$scratchdir/filelist" <<EOT
|
||||
from/./
|
||||
from/./dir/subdir
|
||||
from/./dir/subdir/subsubdir
|
||||
from/./dir/subdir/subsubdir2/
|
||||
from/./dir/subdir/foobar.baz
|
||||
EOT
|
||||
|
||||
# Create a chkdir without the content that we expect to be omitted.
|
||||
$RSYNC -a --exclude=dir/text --exclude='subsubdir/**' "$fromdir/" "$chkdir/"
|
||||
|
||||
checkit "$RSYNC -av --files-from='$scratchdir/filelist' '$scratchdir' '$todir/'" "$chkdir" "$todir"
|
||||
|
||||
# The script would have aborted on error, so getting here means we've won.
|
||||
exit 0
|
||||
Reference in New Issue
Block a user