From 8cbe86da9089901c574387e4032f0858e8249c79 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 12 Dec 2008 16:58:06 -0500 Subject: [PATCH] Add message type to security syslog entries It's part of the security check, we should have it in the log. --- bus/bus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bus/bus.c b/bus/bus.c index 195a6fd..ab986b9 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -1348,11 +1348,12 @@ bus_context_check_security_policy (BusContext *context, { const char *dest; const char *msg = "Rejected send message, %d matched rules; " - "sender=\"%s\" interface=\"%s\" member=\"%s\" error name=\"%s\" destination=\"%s\")"; + "type=\"%s\", sender=\"%s\" interface=\"%s\" member=\"%s\" error name=\"%s\" destination=\"%s\")"; dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, msg, toggles, + dbus_message_type_to_string (dbus_message_get_type (message)), sender_name ? sender_name : "(unset)", dbus_message_get_interface (message) ? dbus_message_get_interface (message) : "(unset)", @@ -1364,6 +1365,7 @@ bus_context_check_security_policy (BusContext *context, /* Needs to be duplicated to avoid calling malloc and having to handle OOM */ bus_context_log_security (context, msg, toggles, + dbus_message_type_to_string (dbus_message_get_type (message)), sender_name ? sender_name : "(unset)", dbus_message_get_interface (message) ? dbus_message_get_interface (message) : "(unset)", @@ -1385,12 +1387,13 @@ bus_context_check_security_policy (BusContext *context, message, &toggles)) { const char *msg = "Rejected receive message, %d matched rules; " - "sender=\"%s\" interface=\"%s\" member=\"%s\" error name=\"%s\" destination=\"%s\" reply serial=%u requested_reply=%d)"; + "type=\"%s\" sender=\"%s\" interface=\"%s\" member=\"%s\" error name=\"%s\" destination=\"%s\" reply serial=%u requested_reply=%d)"; const char *dest; dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, msg, toggles, + dbus_message_type_to_string (dbus_message_get_type (message)), sender_name ? sender_name : "(unset)", dbus_message_get_interface (message) ? dbus_message_get_interface (message) : "(unset)", @@ -1404,6 +1407,7 @@ bus_context_check_security_policy (BusContext *context, /* Needs to be duplicated to avoid calling malloc and having to handle OOM */ bus_context_log_security (context, msg, toggles, + dbus_message_type_to_string (dbus_message_get_type (message)), sender_name ? sender_name : "(unset)", dbus_message_get_interface (message) ? dbus_message_get_interface (message) : "(unset)", -- 2.7.4