[glib] GDBus: If an authentication method fail, don't give up, just try the next one



commit e38ef14e8b8d2fed909d92514b665bb8c3c99e6c
Author: David Zeuthen <davidz redhat com>
Date:   Wed Apr 13 18:40:47 2011 -0400

    GDBus: If an authentication method fail, don't give up, just try the next one
    
    This problem was reported in bug 647602.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647602
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 gio/gdbusauth.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index f190469..29e229a 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -663,7 +663,8 @@ _g_dbus_auth_run_client (GDBusAuth     *auth,
           if (line == NULL)
             goto out;
           debug_print ("CLIENT: WaitingForReject, read '%s'", line);
-        foobar:
+
+        choose_mechanism:
           if (!g_str_has_prefix (line, "REJECTED "))
             {
               g_set_error (error,
@@ -739,7 +740,7 @@ _g_dbus_auth_run_client (GDBusAuth     *auth,
             }
           else if (g_str_has_prefix (line, "REJECTED "))
             {
-              goto foobar;
+              goto choose_mechanism;
             }
           else
             {
@@ -841,6 +842,13 @@ _g_dbus_auth_run_client (GDBusAuth     *auth,
                 }
               state = CLIENT_STATE_WAITING_FOR_OK;
             }
+          else if (g_str_has_prefix (line, "REJECTED "))
+            {
+              /* could be the chosen authentication method just doesn't work. Try
+               * another one...
+               */
+              goto choose_mechanism;
+            }
           else
             {
               g_set_error (error,



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