Paul Slootman
2005-May-19 09:04 UTC
Bug#305932: rsync on a directory transfers the files of this directory
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@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@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
Wayne Davison
2005-May-19 09:35 UTC
Bug#305932: rsync on a directory transfers the files of this directory
On Thu, May 19, 2005 at 11:04:23AM +0200, Paul Slootman wrote:> --files-from transferring the contents of a dir (i.e. including the > files in it) specified in the input, even though the files aren't > listed in the input.That's as intended, since a trailing slash means "the contents of the directory". This is not unique to --files-from, but also happens when -d is specified and a directory on the command-line has a trailing slash (obviously -r must not be specified, or even deeper files would also be copied, not just the directory's immediate contents). The behavior was first introduced in 2.6.4 when --dirs (-d) was added. The man page mentions this behavior of a trailing slash in the --dirs section, and it mentions that --files-from implies --dirs. Unfortunately, the NEWS file for 2.6.4 didn't spell this out as a compatibility issue. ..wayne..
Debian Bug Tracking System
2005-May-20 21:24 UTC
Bug#305932: marked as forwarded (rsync on a directory transfers the files of this directory)
Your message dated Thu, 19 May 2005 11:04:23 +0200 with message-id <20050519090423.GA10680@wurtel.net> has caused the Debian Bug report #305932, regarding rsync on a directory transfers the files of this directory to be marked as having been forwarded to the upstream software author(s) rsync@lists.samba.org. (NB: If you are a system administrator and have no idea what I am talking about this indicates a serious mail system misconfiguration somewhere. Please contact me immediately.) Debian bug tracking system administrator (administrator, Debian Bugs database) --------------------------------------- Received: (at 305932-forwarded) by bugs.debian.org; 19 May 2005 09:04:39 +0000>From paul@wurtel.net Thu May 19 02:04:38 2005Return-path: <paul@wurtel.net> Received: from mx.wurtel.net (gw.wurtel.net) [195.64.88.114] (mail) by spohr.debian.org with esmtp (Exim 3.35 1 (Debian)) id 1DYgxI-0007A9-00; Thu, 19 May 2005 02:04:36 -0700 Received: from wurtel ([192.168.1.1] helo=wurtel.net) by gw.wurtel.net with esmtp (Exim 3.36 #1 (Debian)) id 1DYgx5-0006rf-00; Thu, 19 May 2005 11:04:23 +0200 Received: from paul by wurtel.net with local (Exim 4.33 #1 (Debian)) id 1DYgx5-0002oL-5A; Thu, 19 May 2005 11:04:23 +0200 Date: Thu, 19 May 2005 11:04:23 +0200 From: Paul Slootman <paul@debian.org> To: rsync@lists.samba.org Cc: 305932-forwarded@bugs.debian.org Subject: Re: Bug#305932: rsync on a directory transfers the files of this directory Message-ID: <20050519090423.GA10680@wurtel.net> Reply-To: rsync@lists.samba.org, 305932-forwarded@bugs.debian.org Mail-Followup-To: rsync@lists.samba.org, 305932-forwarded@bugs.debian.org References: <20050422235007.GA24271@ay.vinc17.org> <20050425125946.GC11383@wurtel.net> <20050425133100.GN3291@ay.vinc17.org> <20050518094040.GB13033@wurtel.net> <20050519072027.GA5967@ay.vinc17.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050519072027.GA5967@ay.vinc17.org> User-Agent: Mutt/1.5.6i X-Scanner: exiscan *1DYgx5-0006rf-00*p.ONyeecbqw*Wurtel Delivered-To: 305932-forwarded@bugs.debian.org X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 (1.212-2003-09-23-exp) on spohr.debian.org X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER autolearn=no version=2.60-bugs.debian.org_2005_01_02 X-Spam-Level: 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@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@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
Apparently Analagous Threads
- [Bug 49786] New: In xterm, some rectangles are not redrawn when the window is partly covered
- [Bug 2192] New: scp output alignment bug with UTF-8/multibyte sequences
- [Bug 72979] New: garbage / parts of previous session displayed on login screen after reboot
- [Bug 44608] New: Freeze after Fn-F8 - Next boots: screen remains off after suspend/resume
- [Bug 1494] New: doesn't look on path for $SHELL