The Samba-Bugzilla – Bug 13901
Empty quotes adds cwd to SRC directories
Last modified: 2019-04-17 13:54:54 UTC
Created attachment 15076 [details]
For cmd 'rsync "$UNSET_VAR" --debug=ALL5 --verbose --recursive -- /data/src/ /data/dest/'
Hi! It's my first bug report here so let me know if I should clarify anything!
If you add empty quotes to the rsync command line, it is interpreted as the current working directory ("."), and added to the SRC args. It doesn't matter if the quotes come before or after any options, if it comes before "--" or if there are other source directories specified.
This is a problem if you specify quoted bash variables on the command line and one of them happens to be unset.
/data/cwd $ ls
/data/cwd $ rsync "$UNSET_VAR" --recursive --verbose -- /data/src/ /data/dest/
sending incremental file list
sent 819,001 bytes received 54 bytes 1,638,110.00 bytes/sec
total size is 818,581 speedup is 1.00
I have attached the output of the command with '--debug=ALL5' added, if it helps.