Bug 15335 - Environment variables in remote host's path do not resolve properly
Summary: Environment variables in remote host's path do not resolve properly
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.2.0
Hardware: x86 Linux
: P5 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2023-03-13 19:38 UTC by ryan.larson
Modified: 2023-03-15 16:04 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description ryan.larson 2023-03-13 19:38:11 UTC
We've had an rsync command that has worked for quite a while (1+ years), but suddenly started getting errors after we upgraded rsync from version 3.2.3 to 3.2.7.  I'm not sure exactly which minor release broke our expectation of how environment variables are used in remote host paths, but there certainly seems to be some major change.  See the example command below in which we were protecting the remote environment variable with single quotes to ensure it resolved on the remote host and not locally.  I was able to reliable reproduce this issue with 3.2.7 and show that the command worked with 3.2.3.

Example Command:

rsync -rl /home/user/test_dir 'user@hostname:$PROJECTS_HOME/INFINITE'

3.2.7 -> rsync: mkdir "/p/home/rlarson/$PROJECTS_HOME/INFINITE" failed: No such file or directory

3.2.3 -> successful rsync

A few notes:
1. The env var and path does exist on remote system
2. "/p/home/rlarson" is my  $HOME dir on remote system
3. Both source and dest OS are Linux

Anything else I can add to help troubleshoot this issue please let me know.
Comment 1 Wayne Davison 2023-03-15 16:04:22 UTC
Read about it in the NEWS file, including how you can get the old behavior: