Skip to content

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