Bug#305932: rsync on a directory transfers the files of this directory

Paul Slootman paul at debian.org
Thu May 19 09:04:23 GMT 2005


Hi,

I got the following report from a Debian user, about --files-from
transferring the contents of a dir (i.e. including the files in it)
specified in the input, even thugh the files aren't listed in the input.
This happens only when the dir name ends with a slash. I asked him to
cook up a script to reproduce this (as it wasn't quite clear to me at
first what happened exactly).

Any ideas?

Please include 305932-forwarded at bugs.debian.org in the recipients of any
replies, so that the discussion is recorded with the bug.

Thanks,
Paul Slootman

On Thu 19 May 2005, Vincent Lefevre wrote:
> On 2005-05-18 11:40:40 +0200, Paul Slootman wrote:
> > Could you reproduce this with a fixed list, i.e. give a script that
> > creates the directories and files, generates the list (e.g. with find)
> > and then calls rsync?  That might help to make it clear what exactly is
> > going wrong...
> 
> The following script shows the bug.
> 
> #!/bin/zsh
> 
> set -e
> cd $HOME
> mkdir test
> cd test
> mkdir src d1 d2
> mkdir src/dir
> mkdir src/dir/dir
> touch src/dir/file
> touch src/dir/dir/file
> cd src
> echo dir  | rsync --files-from=- -zuv --progress -e ssh . localhost:test/d1/
> echo dir/ | rsync --files-from=- -zuv --progress -e ssh . localhost:test/d2/
> cd ..
> ls -Fld **/*
> 
> I get:
> 
> drwxr-xr-x  3 lefevre lefevre 4096 2005-05-19 09:18:29 d1/
> drwxr-xr-x  2 lefevre lefevre 4096 2005-05-19 09:18:29 d1/dir/
> drwxr-xr-x  3 lefevre lefevre 4096 2005-05-19 09:18:32 d2/
> drwxr-xr-x  3 lefevre lefevre 4096 2005-05-19 09:18:32 d2/dir/
> drwxr-xr-x  2 lefevre lefevre 4096 2005-05-19 09:18:32 d2/dir/dir/
> -rw-r--r--  1 lefevre lefevre    0 2005-05-19 09:18:32 d2/dir/file
> drwxr-xr-x  3 lefevre lefevre 4096 2005-05-19 09:18:26 src/
> drwxr-xr-x  3 lefevre lefevre 4096 2005-05-19 09:18:26 src/dir/
> drwxr-xr-x  2 lefevre lefevre 4096 2005-05-19 09:18:26 src/dir/dir/
> -rw-r--r--  1 lefevre lefevre    0 2005-05-19 09:18:26 src/dir/dir/file
> -rw-r--r--  1 lefevre lefevre    0 2005-05-19 09:18:26 src/dir/file
> 
> So, the problem occurs only when the directory ends with a slash
> (this is the case for d2 in the above script).
> 
> -- 
> Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
> Work: CR INRIA - computer arithmetic / SPACES project at LORIA


More information about the rsync mailing list