From ea243223446d47dd5bfaffbbbd4c2762310609b8 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Fri, 31 Aug 2018 12:49:39 +0200 Subject: [PATCH] Set a DBusError in all failing paths of bus_selinux_check() https://bugs.freedesktop.org/show_bug.cgi?id=105330 --- bus/selinux.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bus/selinux.c b/bus/selinux.c index 4db9b8ac..614495f6 100644 --- a/bus/selinux.c +++ b/bus/selinux.c @@ -421,13 +421,16 @@ bus_selinux_check (BusSELinuxID *sender_sid, switch (errno) { case EACCES: - _dbus_verbose ("SELinux denying due to security policy.\n"); + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, + "SELinux denying due to security policy."); return FALSE; case EINVAL: - _dbus_verbose ("SELinux denying due to invalid security context.\n"); + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, + "SELinux denying due to invalid security context."); return FALSE; default: - _dbus_verbose ("SELinux denying due to: %s\n", _dbus_strerror (errno)); + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, + "SELinux denying due to: %s", _dbus_strerror (errno)); return FALSE; } } -- 2.19.0.rc1