Bug 3542 - "rsync --list-only a b/" tries to create b
Summary: "rsync --list-only a b/" tries to create b
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.7
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2006-02-22 17:31 UTC by Matt McCutchen
Modified: 2006-03-12 02:56 UTC (History)
0 users

See Also:

Makes get_local_name return NULL if --list-only is given (504 bytes, patch)
2006-02-22 17:31 UTC, Matt McCutchen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt McCutchen 2006-02-22 17:31:18 UTC
Rsync's --list-only option requires a destination, which is strange because the destination isn't used for anything.  Nevertheless, in get_local_name, rsync ensures that the destination is usable, which may involve trying to create the destination as a directory.  Luckily, if rsync tries to create the directory, the attempt is caught in do_mkdir and an error message results, but rsync really shouldn't care about the destination at all.

The patch I will soon attach causes get_local_name to return NULL immediately if --list-only is given.  However, there has to be a better way to ensure the destination is not touched in this situation.

Separately, it would be an improvement if the destination argument could be omitted when --list-only is given.  (Until I read the man page, I kept trying to run "rsync --list-only source/" and wondered why I got a usage error.)
Comment 1 Matt McCutchen 2006-02-22 17:31:55 UTC
Created attachment 1753 [details]
Makes get_local_name return NULL if --list-only is given
Comment 2 Wayne Davison 2006-02-22 18:40:42 UTC
Thanks!  This is now fixed in CVS.

Also, rsync no longer returns a usage error when used with one local source arg and no destination: this now implies the --list-only option, just like the comparable situation with a remote source arg.