summaryrefslogtreecommitdiffstats
path: root/bus/selinux.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2005-07-14 21:45:42 +0000
committerColin Walters <walters@verbum.org>2005-07-14 21:45:42 +0000
commit6c191520c8b33cd7e550a6e3d9d853c25f552f54 (patch)
treee9f849bf2d568ae4cfea76b7065950d0c608bba0 /bus/selinux.c
parent075945f611290f2b9db9a4ed6cf5433f2fd85785 (diff)
2005-07-14 Colin Walters <walters@verbum.org>
* bus/driver.c (bus_driver_handle_get_connection_unix_security_context): New function. (message_handlers): Add. * bus/selinux.c (bus_selinux_append_context): New function; appends security context to message. * bus/selinux.h: Prototype. * dbus/dbus-protocol.h (DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN): New.
Diffstat (limited to 'bus/selinux.c')
-rw-r--r--bus/selinux.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bus/selinux.c b/bus/selinux.c
index c647a77b..9e73cc63 100644
--- a/bus/selinux.c
+++ b/bus/selinux.c
@@ -567,6 +567,19 @@ bus_selinux_allows_send (DBusConnection *sender,
#endif /* HAVE_SELINUX */
}
+dbus_bool_t
+bus_selinux_append_context (DBusMessage *message,
+ BusSELinuxID *context)
+{
+ /* Note if you change how the context is marshalled (e.g. to ay),
+ * you also need to change driver.c for the appropriate return value.
+ */
+ return dbus_message_append_args (message,
+ DBUS_TYPE_STRING,
+ SELINUX_SID_FROM_BUS (context),
+ DBUS_TYPE_INVALID);
+}
+
/**
* Gets the security context of a connection to the bus. It is up to
* the caller to freecon() when they are done.