[gnome-settings-daemon/benzea/print-notification-storm: 2/2] print-notifications: Ignore Server* messages from cups notifier



commit 28b6c3bab28e8dc570881d69d3db4d7871ef6819
Author: Benjamin Berg <bberg redhat com>
Date:   Fri Sep 28 17:32:48 2018 +0200

    print-notifications: Ignore Server* messages from cups notifier
    
    In the past there was a bug where querying the notification information
    from cups caused a new ServerAudit notification to be emitted. We are
    only interested in Printer* and Job* notifications, so ignore any
    notification that starts with "Server" preventing a similar storm from
    our side.
    
    Fixes #62

 plugins/print-notifications/gsd-print-notifications-manager.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c 
b/plugins/print-notifications/gsd-print-notifications-manager.c
index 0721903c..3578b96c 100644
--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -352,6 +352,13 @@ on_cups_notification (GDBusConnection *connection,
                       GVariant        *parameters,
                       gpointer         user_data)
 {
+        /* Ignore any signal starting with Server*. This has caused a message
+         * storm through ServerAudit messages in the past, see
+         *  https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/62
+         */
+        if (!signal_name || (strncmp (signal_name, "Server", 6) == 0))
+                return;
+
         process_new_notifications (user_data);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]