Skip to content
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

Minor improvement for SCP preserve flag: #680

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

Estraysian
Copy link
Contributor

Problem:
When trying to SCP a file to a remote machine, where the file exists (overwrite) and the user you're using for SCP is not the owner of the file, you get error "set mode: Operation not permitted", whenever -p switch is specified.
Solution:
Added a boolean variable to toggle usage of -p switch when using SCPUploadClient.copy()
Since it's an extend, the default behavior is unchanged, omitting -p is optional and needs to be explicitly specified.

- Added an override for copy method, allowing the user to specify whether preserve flag is used in the SCP command.
- Propagated the preserveTime boolean to process method to skip preserveTimeIfPossible when it's not desired
@Estraysian Estraysian requested a review from hierynomus as a code owner April 13, 2021 09:22
@hierynomus hierynomus merged commit e283880 into hierynomus:master Apr 13, 2021
@hierynomus
Copy link
Owner

Thanks! Approved and merged, good addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants