Rex icon indicating copy to clipboard operation
Rex copied to clipboard

Allow uploading files even when permissions cannot be set.

Open alip opened this issue 4 years ago • 0 comments

By default, the "file" function uses sftp to upload the target file to the server. During the upload, the Net::SFTP::Foreign runs chmod unconditionally, failing if the target file is not owned by the ssh user, unless that user is a root. This commit changes that behavior by passing an optional "best_effort" flag that instructs sftp to continue even if setting permissions has failed.

As a result, an unprivileged user will be able to use Rex scenarios that call the "file" function without getting permission denied errors.

This PR is an attempt to fix # by .

Checklist

  • [ ] based on top of latest source code
  • [ ] changelog entry included
  • [ ] tests pass on Travis CI
  • [ ] git history is clean
  • [ ] git commit messages are well-written

alip avatar Feb 12 '21 13:02 alip