-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rsync] MSYS2 rsync prefixes target path with client's MSYS2 installation dir in server command #5123
Comments
rsync passes the correct, unaltered argument to execvp in pipe.c:83: Apparently this feature is to blame. Unfortunately the described way to disable it does not work: $ MSYS2_ARG_CONV_EXCL='*'
$ echo $MSYS2_ARG_CONV_EXCL
*
$ rsync --rsh='/C/Windows/System32/OpenSSH/ssh.exe -v' -r -v --delete <user>@<server>:<source> <destination>
[...]
debug1: Sending command: rsync --server --sender -vre.iLsfxCIvu . C:/msys64/<source> $ MSYS2_ARG_CONV_EXCL='*' rsync --rsh='/C/Windows/System32/OpenSSH/ssh.exe -v' -r -v --delete <user>@<server>:<source> <destination>
[...]
debug1: Sending command: rsync --server --sender -vre.iLsfxCIvu . C:/msys64/<source> $ MSYS2_ARG_CONV_EXCL="*" rsync --rsh='/C/Windows/System32/OpenSSH/ssh.exe -v' -r -v --delete <user>@<server>:<source> <destination>
[...]
debug1: Sending command: rsync --server --sender -vre.iLsfxCIvu . C:/msys64/<source> $ MSYS2_ARG_CONV_EXCL="<user>@<server>" rsync --rsh='/C/Windows/System32/OpenSSH/ssh.exe -v' -r -v --delete <user>@<server>:<source> <destination>
[...]
debug1: Sending command: rsync --server --sender -vre.iLsfxCIvu . C:/msys64/<source> (I have also tried Note that this substitution also happens if I call rsync from outside of the MSYS2 environment. That should not happen, as far as the documentation claims:
|
Unlike the documented switches, MSYS_NO_PATHCONV has the desired effect: $ MSYS_NO_PATHCONV=1 rsync --rsh='/C/Windows/System32/OpenSSH/ssh.exe -v' -r -v --delete <user>@<server>:<source> /C/msys64/<destination>
[...]
debug1: Sending command: rsync --server --sender -vre.iLsfxCIvu . <source> The connection still closes unexpectedly with code 12, but that is fixed by replacing the Windows-native OpenSSH with the MSYS2-provided one. ... So... is this working-as-intended? I must admit, I am not sure what to do about this situation, but it emphatically does not feel like it's working "correctly". |
A better undocumented workaround, that allows to use the same path string on Windows and Linux, is this one: Just add an additional leading slash to As it is not listed in the documentation, is that intended/guaranteed or just an implementation detail that may spuriously change in the future? |
Description / Steps to reproduce the issue
rsync --rsh='ssh -v' -r -v --delete <user>@<server>:<source path> <destination path> >log.txt 2>&1
rsync --server --sender -vre.iLsfxCIvu . <source path>
server command sent from Windows client (fails with code 12):
rsync --server --sender -vre.iLsfxCIvu . C:/msys64/<source path>
Expected behavior
The source path should not be altered.
Actual behavior
The source path is prefixed with a directory that will generally not contain the relevant data, even if it exists.
(Actual data even on Windows would not be put into
C:/msys64
but e.g. intoC:/Users/<user>/Documents
.)Verification
Windows Version
MINGW64_NT-10.0-26100
Are you willing to submit a PR?
Maybe? Should be easy to fix, but I have not checked.
The text was updated successfully, but these errors were encountered: