[Bug 42882] New: Add option to disable setting time and permissions for File Transports
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 Bug ID: 42882 Summary: Add option to disable setting time and permissions for File Transports Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Some vendors don't allow the SFTP use to change the time and permissions on uploaded files. This results in the error "Couldn't setstat remote file: General failure at /usr/share/koha/lib/Koha/File/Transport/SFTP.pm line 97." for SFTP transports. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- We should add the option to File Transports to disable setting the time and permissions. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200718&action=edit Bug 42882: Add copy_file_attrs column to file_transports Patch from commit 8ce6001 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200720&action=edit Bug 42882: Add copy_file_attrs to the file transports REST API Patch from commit 6052338 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200721&action=edit Bug 42882: Add copy_file_attrs to the file transports editor Patch from commit a54f3c0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #6 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200722&action=edit Bug 42882: Add unit tests Patch from commit 7f31968 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200723&action=edit Bug 42882: Update Schema files [DO NOT PUSH] Patch from commit 67e3aae -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42882 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |david@davidnind.com --- Comment #8 from David Nind <david@davidnind.com> --- After the patches, updatedatabase, yarn build, restart, etc., I'm getting an Error 500 on the file transports page, and it sits with "Processing...": jquery-3.6.0.min_26.0600003.js:2 GET http://127.0.0.1:8081/api/v1/config/file_transports?_page=1&_per_page=20&_match=contains&_order_by=%2Bme.name 500 (Internal Server Error) datatables_26.0600003.js:413 Got 500 (Internal Server Error) datatables_26.0600003.js:436 DataTables warning: table id=file_transports - Ajax error. For more information about this error, please see https://datatables.net/tn/7 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org