summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions-run.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-10-28 13:53:34 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-10-28 13:53:34 -0400
commit2cfc60b975075f5c4a46e80ed26daeb9256f907b (patch)
tree2e437f46b51e1896fd3055e5654309cb029d4e22 /pts-core/functions/pts-functions-run.php
parent2fc63d8c13c29490b56a97cb68a92099a2eaeee3 (diff)
downloadphoronix-test-suite-upstream-2cfc60b975075f5c4a46e80ed26daeb9256f907b.tar.gz
phoronix-test-suite-upstream-2cfc60b975075f5c4a46e80ed26daeb9256f907b.tar.xz
phoronix-test-suite-upstream-2cfc60b975075f5c4a46e80ed26daeb9256f907b.zip
pts-core: Add support for checking if SELinux is enabled/running
Diffstat (limited to 'pts-core/functions/pts-functions-run.php')
-rw-r--r--pts-core/functions/pts-functions-run.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php
index 9a4a7e2..358f1c9 100644
--- a/pts-core/functions/pts-functions-run.php
+++ b/pts-core/functions/pts-functions-run.php
@@ -194,6 +194,24 @@ function pts_generate_test_notes($test_type)
pts_add_test_note(pts_process_running_string($check_processes));
+ // Check if Security Enhanced Linux was enforcing, permissive, or disabled
+ if(is_file("/etc/sysconfig/selinux"))
+ {
+ $selinux_file = file_get_contents("/etc/sysconfig/selinux");
+ if(stripos($selinux_file, "selinux=disabled") === false)
+ {
+ pts_add_test_note("SELinux was enabled.");
+ }
+ }
+ else if(is_file("/boot/grub/menu.lst"))
+ {
+ $grub_file = file_get_contents("/boot/grub/menu.lst");
+ if(stripos($grub_file, "selinux=1") !== false)
+ {
+ pts_add_test_note("SELinux was enabled.");
+ }
+ }
+
// Power Saving Technologies?
pts_add_test_note(pts_processor_power_savings_enabled());
pts_add_test_note(system_power_mode());