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/services.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bus/services.c') diff --git a/bus/services.c b/bus/services.c index 4392daa2..7a22dce7 100644 --- a/bus/services.c +++ b/bus/services.c @@ -319,8 +319,15 @@ bus_registry_acquire_service (BusRegistry *registry, service_name); if (!bus_selinux_allows_acquire_service (connection, sid, - _dbus_string_get_const_data (service_name))) + _dbus_string_get_const_data (service_name), error)) { + + if (dbus_error_is_set (error) && + dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY)) + { + goto out; + } + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "Connection \"%s\" is not allowed to own the service \"%s\" due " "to SELinux policy", -- cgit