summaryrefslogtreecommitdiff
path: root/src/selinux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/selinux.cpp')
-rw-r--r--src/selinux.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/selinux.cpp b/src/selinux.cpp
index 6bfee5a..f9eaddf 100644
--- a/src/selinux.cpp
+++ b/src/selinux.cpp
@@ -15,11 +15,11 @@ static gboolean has_selinux;
static gboolean load_selinux(void)
{
- return load_symbols("libselinux.so.1",
- "getpidcon", &getpidcon,
- "freecon", &freecon,
- "is_selinux_enabled", &is_selinux_enabled,
- NULL);
+ return load_symbols("libselinux.so.1",
+ "getpidcon", &getpidcon,
+ "freecon", &freecon,
+ "is_selinux_enabled", &is_selinux_enabled,
+ NULL);
}
@@ -27,12 +27,12 @@ static gboolean load_selinux(void)
void
get_process_selinux_context (ProcInfo *info)
{
- char *con;
+ char *con;
- if (has_selinux && !getpidcon (info->pid, &con)) {
- info->security_context = g_strdup (con);
- freecon (con);
- }
+ if (has_selinux && !getpidcon (info->pid, &con)) {
+ info->security_context = g_strdup (con);
+ freecon (con);
+ }
}
@@ -40,25 +40,25 @@ get_process_selinux_context (ProcInfo *info)
gboolean
can_show_security_context_column (void)
{
- if (!(has_selinux = load_selinux()))
- return FALSE;
+ if (!(has_selinux = load_selinux()))
+ return FALSE;
- switch (is_selinux_enabled()) {
- case 1:
- /* We're running on an SELinux kernel */
- return TRUE;
+ switch (is_selinux_enabled()) {
+ case 1:
+ /* We're running on an SELinux kernel */
+ return TRUE;
- case -1:
- /* Error; hide the security context column */
+ case -1:
+ /* Error; hide the security context column */
- case 0:
- /* We're not running on an SELinux kernel:
- hide the security context column */
+ case 0:
+ /* We're not running on an SELinux kernel:
+ hide the security context column */
- default:
- g_warning("SELinux was found but is not enabled.\n");
- return FALSE;
- }
+ default:
+ g_warning("SELinux was found but is not enabled.\n");
+ return FALSE;
+ }
}