Blame SOURCES/dbus-1.6.12-avoid-selinux-context-translation.patch

275029
From a82e1be24d0211d4358d8ff3b8cd06dae71a9993 Mon Sep 17 00:00:00 2001
275029
From: David King <dking@redhat.com>
275029
Date: Mon, 22 Aug 2016 09:43:29 +0100
275029
Subject: [PATCH] Use _raw() calls to avoid SELinux context translation
275029
275029
When the credentials obtained from the client socket are used in future
275029
security checks, no context translation should be performed, so
275029
getpeercon() should be replaced with getpeercon_raw(), and similar
275029
changes should me be made for other calls such as avc_sid_to_context()
275029
and getcon().
275029
275029
https://bugzilla.redhat.com/show_bug.cgi?id=1356141
275029
---
275029
 bus/selinux.c | 10 +++++-----
275029
 1 file changed, 5 insertions(+), 5 deletions(-)
275029
275029
diff --git a/bus/selinux.c b/bus/selinux.c
275029
index 2fb4a8b..13361aa 100644
275029
--- a/bus/selinux.c
275029
+++ b/bus/selinux.c
275029
@@ -412,14 +412,14 @@ bus_selinux_full_init (void)
275029
   bus_context = NULL;
275029
   bus_sid = SECSID_WILD;
275029
 
275029
-  if (getcon (&bus_context) < 0)
275029
+  if (getcon_raw (&bus_context) < 0)
275029
     {
275029
       _dbus_verbose ("Error getting context of bus: %s\n",
275029
                      _dbus_strerror (errno));
275029
       return FALSE;
275029
     }
275029
       
275029
-  if (avc_context_to_sid (bus_context, &bus_sid) < 0)
275029
+  if (avc_context_to_sid_raw (bus_context, &bus_sid) < 0)
275029
     {
275029
       _dbus_verbose ("Error getting SID from bus context: %s\n",
275029
                      _dbus_strerror (errno));
275029
@@ -713,7 +713,7 @@ bus_selinux_append_context (DBusMessage    *message,
275029
 #ifdef HAVE_SELINUX
275029
   char *context;
275029
 
275029
-  if (avc_sid_to_context (SELINUX_SID_FROM_BUS (sid), &context) < 0)
275029
+  if (avc_sid_to_context_raw (SELINUX_SID_FROM_BUS (sid), &context) < 0)
275029
     {
275029
       if (errno == ENOMEM)
275029
         BUS_SET_OOM (error);
275029
@@ -766,7 +766,7 @@ bus_connection_read_selinux_context (DBusConnection     *connection,
275029
       return FALSE;
275029
     }
275029
   
275029
-  if (getpeercon (fd, con) < 0)
275029
+  if (getpeercon_raw (fd, con) < 0)
275029
     {
275029
       _dbus_verbose ("Error getting context of socket peer: %s\n",
275029
                      _dbus_strerror (errno));
275029
@@ -901,7 +901,7 @@ bus_selinux_init_connection_id (DBusConnection *connection,
275029
 
275029
   _dbus_verbose ("Converting context to SID to store on connection\n");
275029
 
275029
-  if (avc_context_to_sid (con, &sid) < 0)
275029
+  if (avc_context_to_sid_raw (con, &sid) < 0)
275029
     {
275029
       if (errno == ENOMEM)
275029
         BUS_SET_OOM (error);
275029
-- 
275029
2.7.4
275029