summaryrefslogtreecommitdiff
path: root/bus/driver.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2005-07-16 17:34:08 +0000
committerColin Walters <walters@verbum.org>2005-07-16 17:34:08 +0000
commit9a94a1350bb93ea395812dd3c983e13e17c1bcb1 (patch)
treeb34c1ce977e353368325d7c9e67f6f80016d18f7 /bus/driver.c
parent3b628f920964f078b9afcde9f218c698ad454e12 (diff)
downloaddbus-9a94a1350bb93ea395812dd3c983e13e17c1bcb1.tar.gz
2005-07-16 Colin Walters <walters@verbum.org>
* bus/driver.c (bus_driver_handle_get_connection_selinux_security_context): Renamed from bus_driver_handle_get_connection_unix_security_context. Update for error usage. (message_handlers): Update for renames. * bus/selinux.c (bus_selinux_allows_send): Handle OOM on _dbus_string_init failure correctly. (bus_selinux_append_context): Convert SID to context. Append it as a byte array. (bus_selinux_shutdown): Handle the case where bus_selinux_full_init hasn't been called. * bus/selinux.h: Update prototype. * dbus/dbus-protocol.h (DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN): Renamed from DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN.
Diffstat (limited to 'bus/driver.c')
-rw-r--r--bus/driver.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/bus/driver.c b/bus/driver.c
index 8e8a5366..da4edaa7 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -1015,10 +1015,10 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
}
static dbus_bool_t
-bus_driver_handle_get_connection_unix_security_context (DBusConnection *connection,
- BusTransaction *transaction,
- DBusMessage *message,
- DBusError *error)
+bus_driver_handle_get_connection_selinux_security_context (DBusConnection *connection,
+ BusTransaction *transaction,
+ DBusMessage *message,
+ DBusError *error)
{
const char *service;
DBusString str;
@@ -1062,13 +1062,13 @@ bus_driver_handle_get_connection_unix_security_context (DBusConnection *connecti
if (!context)
{
dbus_set_error (error,
- DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN,
+ DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN,
"Could not determine security context for '%s'", service);
goto failed;
}
- if (! bus_selinux_append_context (reply, context))
- goto oom;
+ if (! bus_selinux_append_context (reply, context, error))
+ goto failed;
if (! bus_transaction_send_from_driver (transaction, connection, reply))
goto oom;
@@ -1167,10 +1167,10 @@ struct
DBUS_TYPE_STRING_AS_STRING,
DBUS_TYPE_UINT32_AS_STRING,
bus_driver_handle_get_connection_unix_process_id },
- { "GetConnectionUnixSecurityContext",
- DBUS_TYPE_STRING_AS_STRING,
+ { "GetConnectionSELinuxSecurityContext",
DBUS_TYPE_STRING_AS_STRING,
- bus_driver_handle_get_connection_unix_security_context },
+ DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BYTE_AS_STRING,
+ bus_driver_handle_get_connection_selinux_security_context },
{ "ReloadConfig",
"",
"",