Bug 11650 - temporal directory path parsing fails on '/'-terminated strings
Summary: temporal directory path parsing fails on '/'-terminated strings
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.1
Hardware: All All
: P5 trivial (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2015-12-25 11:10 UTC by Dietrich
Modified: 2020-07-26 09:03 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Dietrich 2015-12-25 11:10:55 UTC
rsync's tmp-dir option fails to correctly parse the directory name if the string ends in '/' causing the files to be downloaded, but never saved anywhere.

rsync --tmp-dir=/tmp/.rsync/ (...)
> rsync: mkstemp "/tmp/.rsync//filename.randomStr" failed: No such file or directory

I used something like this from a cron job. The most awful part is that the download occurs, so it may appear that the syncing is going ok, but it's not.

It may be argued that the directory name is just wrongly typed as the directory is just another file (and thus, it's name should not contain the final '/'), but it is not unusual to denote directories with the "extra" '/', so at least the behavior should be to abort early and blame the user, but silently "fixing" the directory name seems a way better option.

I'm not sure about the extent of this bug, maybe more flags fail to parse '/'-ended directory names.
Comment 1 Wayne Davison 2020-07-26 09:03:33 UTC
The trailing slash is fine, it just failed to complain about the directory being missing prior to starting the transfer of the files.  This is now fixed.