[Bug 22143] New: Fix permission and owner of configuration backups
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 Bug ID: 22143 Summary: Fix permission and owner of configuration backups Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: mirko@abunchofthings.net Target Milestone: --- If you install Koha with the Debian packages you get backups in /var/spool/koha/<instance>/ that look like this: -rw------- 1 root root 6616261 jan. 12 03:11 xxxxxxxx-2019-01-12.tar.gz -rw-r----- 1 root xxxxxxxx-koha 109473282 jan. 13 03:10 xxxxxxxx-2019-01-13.sql.gz -rw------- 1 root root 6677496 jan. 13 03:10 xxxxxxxx-2019-01-13.tar.gz -rw-r----- 1 root xxxxxxxx-koha 109473283 jan. 14 03:20 xxxxxxxx-2019-01-14.sql.gz -rw------- 1 root root 6721580 jan. 14 03:20 xxxxxxxx-2019-01-14.tar.gz -rw-r----- 1 root xxxxxxxx-koha 109473282 jan. 15 03:16 xxxxxxxx-2019-01-15.sql.gz -rw------- 1 root root 6723809 jan. 15 03:16 xxxxxxxx-2019-01-15.tar.gz -rw-r----- 1 root xxxxxxxx-koha 109473283 jan. 16 03:17 xxxxxxxx-2019-01-16.sql.gz -rw------- 1 root root 6770890 jan. 16 03:17 xxxxxxxx-2019-01-16.tar.gz Notice the difference in the permissions and the ownership of the files. Recently, I tried to turn on download of backups from the "Export" tool, with these settings in koha-conf.xml: <backup_db_via_tools>1</backup_db_via_tools> <backup_conf_via_tools>1</backup_conf_via_tools> This worked nicely for the db files, but not for the conf files, where the page just said "Unfortunately, no backups are available." I found a workaround was to do the following: $ sudo chmod 0640 /var/spool/koha/<instance>/* $ sudo chown root:<instance>-koha /var/spool/koha/<instance>/* After this, the files showed up as expected. This is due to the check on line 342 of /usr/share/koha/intranet/cgi-bin/tools/export.pl: return unless ( -f $filename && -r $filename ); The -r mens "File is readable by effective uid/gid." Looking around in Bugzilla, I found a patch for this problem, by Dobrica Pavlinusic, on bug 8437. That bug is mainly about downloading large files with Plack, and the permissions issue described here is fixed in a followup patch. I will try and move that patch to this bug, so the discussion about Plack does not block fixing the permissions. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Created attachment 84074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84074&action=edit Patch from Bug 8437 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 --- Comment #2 from Magnus Enger <magnus@libriotech.no> --- Created attachment 84075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84075&action=edit Bug 22143 - Fix permission and owner of configuration backups This allows backups created using Debian package to show up automatically in web interface and makes permissions of backup files consistent. Signed-off-by: Magnus Enger <magnus@libriotech.no> Original patch by Dobrica Pavlinusic. Moved from Bug 8437 by me. Tested thusly: - Look at backup files in /var/spool/koha/<instance>/ - Notice that permissions for .tar.gz files are -rw------- - Notice ownership of .tar.gz files are root:root - Apply this patch - Make sure the changes in the patch are applied to the script you run when you run "sudo koha-dump". This might include copying debian/scripts/koha-dump to /usr/sbin/koha-dump, if you are on a gitified setup. - Run the modified koha-dump - Notice that both backup files dated today are now -rw-r----- and ownership is root:<instance>-koha For extra testing credit: Set <backup_conf_via_tools>1</backup_conf_via_tools> in koha-conf.xml and verify that no files are listed under Tools > Export > Export configuration initially. After patching and running koha-dump the .tar.gz with the current date should show up. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #84074|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=22143 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Assignee|koha-bugs@lists.koha-commun |dpavlin@rot13.org |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 Mirko Tietgen <mirko@abunchofthings.net> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14564 Status|Signed Off |In Discussion --- Comment #3 from Mirko Tietgen <mirko@abunchofthings.net> --- Hi Magnus, this is a duplicate of bug 14564. I won't duplicate-link to it so I don't close your bug, but please take a look and see if you agree with the discussion. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|In Discussion |RESOLVED --- Comment #4 from Magnus Enger <magnus@libriotech.no> --- *** This bug has been marked as a duplicate of bug 14564 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22143 --- Comment #5 from Magnus Enger <magnus@libriotech.no> --- (In reply to Mirko Tietgen from comment #3)
Hi Magnus, this is a duplicate of bug 14564. I won't duplicate-link to it so I don't close your bug, but please take a look and see if you agree with the discussion. :)
Thanks for pointing it out, bad searching on my part. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org