aboutsummaryrefslogtreecommitdiff
path: root/modules/computer
diff options
context:
space:
mode:
Diffstat (limited to 'modules/computer')
-rw-r--r--modules/computer/os.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/computer/os.c b/modules/computer/os.c
index 49210307..5872ff82 100644
--- a/modules/computer/os.c
+++ b/modules/computer/os.c
@@ -490,3 +490,30 @@ computer_get_os(void)
return os;
}
+
+const gchar *
+computer_get_selinux(void)
+{
+ int r;
+ gboolean spawned = g_spawn_command_line_sync("selinuxenabled",
+ NULL, NULL, &r, NULL);
+
+ if (!spawned)
+ return _("Not installed");
+
+ if (r == 0)
+ return _("Enabled");
+
+ return _("Disabled");
+}
+
+gchar *
+computer_get_lsm(void)
+{
+ gchar *contents;
+
+ if (!g_file_get_contents("/sys/kernel/security/lsm", &contents, NULL, NULL))
+ return g_strdup(_("Unknown"));
+
+ return contents;
+}