From 44656f538f69e8f8709ddb6ab285db29f65f62dd Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Wed, 13 Apr 2005 14:27:11 +0000 Subject: 2005-04-13 David Zeuthen * bus/selinux.c: Add c-file-style to top of file (log_audit_callback): Don't free the data here anymore (bus_selinux_check): Don't take spid and tpid since appending that to auxdata may OOM. (bus_selinux_allows_acquire_service): Handle OOM and signal back to the caller if we are OOM by taking an error object. (bus_selinux_allows_send): -do- * bus/selinux.h: Fix prototypes for bus_selinux_allows_acquire_service and bus_selinux_allows_send * bus/bus.c (bus_context_check_security_policy): Pass error and pass on OOM thrown by bus_selinux_allows_send() * bus/services.c (bus_registry_acquire_service): Pass error and pass on OOM thrown by bus_selinux_allows_acquire_service() --- bus/bus.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bus/bus.c') diff --git a/bus/bus.c b/bus/bus.c index cd2a0401..0340dd3c 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -1139,8 +1139,16 @@ bus_context_check_security_policy (BusContext *context, dbus_message_get_interface (message), dbus_message_get_member (message), dbus_message_get_error_name (message), - dest ? dest : DBUS_SERVICE_DBUS)) + dest ? dest : DBUS_SERVICE_DBUS, error)) { + + if (dbus_error_is_set (error) && + dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY)) + { + return FALSE; + } + + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "An SELinux policy prevents this sender " "from sending this message to this recipient " -- cgit