https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882

--- Comment #3 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 200719
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200719&action=edit
Bug 42882: Honor copy_file_attrs in SFTP uploads

By default Net::SFTP::Foreign copies the local file's permissions and
timestamps onto the remote file at the end of an upload, using an SFTP
setstat operation. Some SFTP servers reject setstat, and the upload then
fails with an error like:

    ERROR: Couldn't setstat remote file: General failure at
    Koha/File/Transport/SFTP.pm line 97.

even though the file contents transferred correctly. This breaks EDIFACT
order uploads ( edi_cron.pl ) and any other SFTP upload to such a server.

This patch makes Koha::File::Transport::SFTP pass copy_perm and copy_time
to put() based on the new copy_file_attrs setting. When copy_file_attrs is
off, the setstat is skipped and the upload succeeds. FTP and local
transports don't perform a setstat, so the setting only affects SFTP.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Restart all the things!
4) prove t/db_dependent/Koha/File/Transport/SFTP.t
5) Note the tests pass!
6) Go to Administration -> File transports and add or edit an SFTP transport
7) Note the new "Copy file attributes" option, set to Enabled by default
8) Change Transport to FTP, note the option is disabled ( as with passive mode
)
9) Set Transport back to SFTP, set the option to Disabled and save, note it is
kept

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to