-
Notifications
You must be signed in to change notification settings - Fork 104
fix(RemoteCmdRunner): fix scp destination string #10585
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the scp command in RemoteCmdRunner to enforce usage of the legacy scp protocol by adding the '-O' flag, addressing differences between Ubuntu 24.04 and 22.04.
- Updated scp command to include '-O'.
- Ensures compatibility with both newer openssh versions (using SFTP by default) and older versions (ignoring the flag).
Turns out not all flavors of scp ignore unknown option, like the package for Ubuntu for instance |
Scp command behaviour has changed on systems that have newer openssh version (v9.0+, like in Ubuntu24) compared to older version (e.g. v8.*, Like in Ubuntu22). Newer openssh versions use SFTP protocol by default. This affected the behavior of RemoteCmdRunner send_files and receive_files API, where we quote path portion of desctination to be sure that we can run the command with multiple remote paths. This change removes single quotes around the destination parameter in scp command. This helps to avoid improper shell expansion of remote path portion of destination. Fixes: scylladb#10584
9f7f0c7
to
c6926f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems should be fine - we have 2 usages of this and anyway we pass double-quoted path for remote and using quote()
for local destination, so looks like we added another single-quotes unnecessarily and it worked only because we never had special chars/space in local dest (which is usually /tmp).
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Scp command behaviour has changed on systems that have newer openssh version (v9.0+,
like in Ubuntu24) compared to older version (e.g. v8.*, Like in Ubuntu22). Newer openssh
versions use SFTP protocol by default. This affected the behavior of RemoteCmdRunner
send_files and receive_files API, where we quote path portion of desctination to be sure
that we can run the command with multiple remote paths.
This change removes single quotes around the destination parameter in scp command.
This helps to avoid improper shell expansion of remote path portion of destination.
Fixes: #10584
Testing
PR pre-checks (self review)
backport
labelsReminders
sdcm/sct_config.py
)unit-test/
folder)