[gnome-settings-daemon/gnome-3-14] print-notifications: Do not block because of authentication



commit ac90a86b3ae0347812aafc43ba887e2cedfae129
Author: Marek Kasik <mkasik redhat com>
Date:   Wed Apr 15 16:17:26 2015 +0200

    print-notifications: Do not block because of authentication
    
    Set a password callback for CUPS returning NULL to not block g-s-d
    on password request when handling subscriptions.
    We don't have a better solution right now (a better one would be to show
    a password dialog to user).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725440

 .../gsd-print-notifications-manager.c              |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c 
b/plugins/print-notifications/gsd-print-notifications-manager.c
index 8c4b520..1e519b6 100644
--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -107,6 +107,16 @@ G_DEFINE_TYPE (GsdPrintNotificationsManager, gsd_print_notifications_manager, G_
 
 static gpointer manager_object = NULL;
 
+static const char *
+password_cb (const char *prompt,
+             http_t     *http,
+             const char *method,
+             const char *resource,
+             void       *user_data)
+{
+  return NULL;
+}
+
 static char *
 get_dest_attr (const char *dest_name,
                const char *attr,
@@ -1305,6 +1315,11 @@ gsd_print_notifications_manager_start_idle (gpointer data)
 
         manager->priv->printing_printers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
+        /*
+         * Set a password callback which cancels authentication
+         * before we prepare a correct solution (see bug #725440).
+         */
+        cupsSetPasswordCB2 (password_cb, NULL);
 
         if (server_is_local (cupsServer ())) {
                 manager->priv->num_dests = cupsGetDests (&manager->priv->dests);


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