On some Linux distributions like RedHat, Fedora, CentOS you can use SELinux for enhanced security. Among others, this involves file labeling (security context). In other distributions SELinux can be installed additionally. The attached script xt/set-selinux-labels lets you update and restore such labels on the perl script in a Koha installation. Note that there is more to it to get Koha running with SELinux, but this is a first step.
Created attachment 8087 [details] [review] Patch for xt/set-selinux-labels
Created attachment 8089 [details] [review] Patch for xt/set-selinux-labels Default error: wrong file.
Test this script via command line. Go to root of your Koha clone. Run xt/set-selinux-labels -u Check file labels for some perl scripts with ls -Z Run xt/set-selinux-labels -r Check again with ls -Z
Marcel, Are you sure a file like this should go in xt? xt/ is generally for tests, I think.
(In reply to comment #4) > Are you sure a file like this should go in xt? xt/ is generally for tests, I > think. You are probably right ;) Found a better place for the other two scripts in xt as well. My next candidate is: misc/bin ! Sounds much better, right?
Created attachment 8172 [details] [review] Patch for set-linux-labels.sh Moving the script from xt to misc/bin
Created attachment 8173 [details] [review] Patch for moving the other two xt scripts Just moving two files and eliminating two trailings spaces..
See 4330 comments too. Obsoleting the new attachments, getting back the old one.
Hmm sorry I think I confused you, this should not be in xt/ this is not a release only test, but a script designed to be run as part of an install.
Reviving this one. In the meantime I added: opac/svc/report. For the location I still opt for misc/bin and not just install. I ran this script hundreds of times (in a dev environment when git applies or resets etc.) Another location could be maintenance. But I go for bin. But now somebody with some courage to try this and sign off :)
Created attachment 10984 [details] [review] Patch for 7675 There he goes..
Created attachment 10998 [details] [review] Patch for 7675 Accidentally, submitted the old version again ;)
This didn't break my machine horribly. And it doesn't touch Koha proper, and is only run if people consciously choose to run it, for that reason I'm signing it off. I think a "Are you sure you want to do this?" wouldn't hurt, so you can't accidentally run it.
Created attachment 11821 [details] [review] 7675 New script for changing selinux file labels on perl scripts On some Linux distributions like RedHat, Fedora, CentOS you can use SELinux for enhanced security. Among others, this involves file labeling (security context). In other distributions SELinux can be installed additionally. The attached script lets you update and restore such labels on the perl scripts in a Koha installation. July 18, 2012: Added opac/svc. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> patch applies clean, passing QA... mason@xen1:~/g/head$ koha-qa.pl testing 1 commit(s) (applied to commit 0acebb8) * e254b99 7675 New script for changing selinux file labels on perl scripts misc/bin/set-selinux-labels.sh
Patch pushed to master I don't have selinux, so can't test, but no side-effect risk for users without selinux.