Commit 25b04730 authored by Richard Hughes's avatar Richard Hughes Committed by David Zeuthen

work when SELinux is disabled

I've compiled with selinux and have it turned off. The attached patch
stops the warnings for me.

Richard.
parent 07b101ec
......@@ -604,12 +604,16 @@ polkit_caller_new_from_pid (DBusConnection *con, pid_t pid, DBusError *error)
uid = statbuf.st_uid;
#ifdef HAVE_SELINUX
if (getpidcon (pid, &secon) != 0) {
g_warning ("Cannot lookup SELinux context for pid %d: %s", pid, strerror (errno));
goto out;
}
selinux_context = g_strdup (secon);
freecon (secon);
/* only get the context if we are enabled */
selinux_context = NULL;
if (is_selinux_enabled () != 0) {
if (getpidcon (pid, &secon) != 0) {
g_warning ("Cannot lookup SELinux context for pid %d: %s", pid, strerror (errno));
goto out;
}
selinux_context = g_strdup (secon);
freecon (secon);
}
#else
selinux_context = NULL;
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment