[Bug 8745] New: disallow rebuild_zebra.pl from executing, when run by root user
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Priority: P5 - low Change sponsored?: --- Bug ID: 8745 Assignee: gmcharlt@gmail.com Summary: disallow rebuild_zebra.pl from executing, when run by root user Severity: normal Classification: Unclassified OS: All Reporter: mtj@kohaaloha.com Hardware: All Status: NEW Version: master Component: Tools Product: Koha many people run rebuild_zebra.pl as root, this often causes zebra reindexing to fail, (sometimes silently) the Koha mailing-list has many people experiencing problems causes by this patching rebuild_zebra.pl to quit (with a warning) when run from root user, would stop this perhaps --force arg could be passed to rebuild_zebra.pl, to allow it to run as root -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 --- Comment #1 from Barry Cannon <barry@oslo.ie> --- Created attachment 12107 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12107&action=edit Addition of "executed by user" check to warn if execute by root user. This patch will check the uid of user who executed the script. If it is the root user a warning will be issued and die. A user can force "execute as root" by using the -runas-root switch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12107|0 |1 is obsolete| | --- Comment #2 from Mason James <mtj@kohaaloha.com> --- Created attachment 13274 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13274&action=edit Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user. Added a check to warn users of execution as root user. Added a 'runas-root' switch to allow users to force execution as root user. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #3 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #2)
Created attachment 13274 [details] Signed-off-by: Mason James <mtj@kohaaloha.com>
just tested this patch, it works well... thanks for the patch Barry! :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 --- Comment #4 from Mason James <mtj@kohaaloha.com> ---
Added a 'runas-root' switch to allow users to force execution as root user.
just a quickie... 1/ i 'improved' the arg name to --run-as-root 2/ and added a help section for the arg too -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Hi Mason, There are debug messages in your SO patch. Sorry about that, I know it is the second time I bore you with that but I think it is unnecessary to load the Smart::comments module in this patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #13274|0 |1 is obsolete| | --- Comment #6 from Mason James <mtj@kohaaloha.com> --- Created attachment 13477 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13477&action=edit Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user. Added a check to warn users of execution as root user. Added a 'runas-root' switch to allow users to force execution as root user. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 --- Comment #7 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #5)
Hi Mason,
Sorry about that, I know it is the second time I bore you with that but I think it is unnecessary to load the Smart::comments module in this patch.
i've fixed this, a new patch is attached... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA QA Contact| |jonathan.druart@biblibre.co | |m --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- This patch cannot work. the following line is wrong: if( undef $run_as_root and $run_user eq 'root') undef $run_as_root is always false. You wanted write if ( not defined $run_as_root and $run_user eq 'root' ) Marked as Failed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #13477|0 |1 is obsolete| | --- Comment #9 from Mason James <mtj@kohaaloha.com> --- Created attachment 17116 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17116&action=edit Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user. Added a check to warn users of execution as root user. Added a 'runas-root' switch to allow users to force execution as root user. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17116|0 |1 is obsolete| | --- Comment #10 from Mason James <mtj@kohaaloha.com> --- Created attachment 17117 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17117&action=edit Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user. Added a check to warn users of execution as root user. Added a 'runas-root' switch to allow users to force execution as root user. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 --- Comment #11 from Mason James <mtj@kohaaloha.com> --- Created attachment 17118 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17118&action=edit general whitespace and tab tidy -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #12 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #8)
This patch cannot work.
the following line is wrong: if( undef $run_as_root and $run_user eq 'root')
undef $run_as_root is always false.
You wanted write if ( not defined $run_as_root and $run_user eq 'root' )
Marked as Failed QA.
Jonathan, thanks for spotting the mistake. i have fixed it now -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 --- Comment #13 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #1)
Created attachment 12107 [details] [review] Addition of "executed by user" check to warn if execute by root user.
This patch will check the uid of user who executed the script. If it is the root user a warning will be issued and die. A user can force "execute as root" by using the -runas-root switch.
to test, apply patch... 1/ run script as root user, script should quit 2/ run script as root user with -run-as-root arg, script should *not* quit -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17117|0 |1 is obsolete| | Attachment #17118|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17266 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17266&action=edit [PASSED QA] Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user. Added a check to warn users of execution as root user. Added a 'runas-root' switch to allow users to force execution as root user. Signed-off-by: Mason James <mtj@kohaaloha.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17267 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17267&action=edit [PASSED QA] Bug 8745: General whitespace and tab tidy http://bugs.koha-community.org/show_bug.cgi?id=8745 Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> 1) Runs not with root. 2) Runs with root and -run-as-root. 3) Runs using the normal koha user. Note: Maybe the message should be clear about why running as root is bad and which user you should be running the script with? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master and 3.12.x. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8745 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #17 from Chris Cormack <chris@bigballofwax.co.nz> --- Good patch, may break running systems though, so will not push to stable branches. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org