PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Wed Aug 22 12:40:39 PDT 2007


 polkit-dbus/polkit-dbus.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
diff-tree 25b04730781d2ea560696f1212f661765438ad28 (from 07b101ecc84ced454200a21bdcbacd450568753d)
Author: Richard Hughes <hughsient at gmail.com>
Date:   Wed Aug 22 15:36:15 2007 -0400

    work when SELinux is disabled
    
    I've compiled with selinux and have it turned off. The attached patch
    stops the warnings for me.
    
    Richard.

diff --git a/polkit-dbus/polkit-dbus.c b/polkit-dbus/polkit-dbus.c
index 4c1f34b..ce6573c 100644
--- a/polkit-dbus/polkit-dbus.c
+++ b/polkit-dbus/polkit-dbus.c
@@ -604,12 +604,16 @@ polkit_caller_new_from_pid (DBusConnecti
         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


More information about the hal-commit mailing list