From 6c191520c8b33cd7e550a6e3d9d853c25f552f54 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 14 Jul 2005 21:45:42 +0000 Subject: 2005-07-14 Colin Walters * 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. --- bus/selinux.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bus/selinux.c') 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. -- cgit