[libsoup/mcatanzaro/#184] negotiate: add warning comment about something that doesn't look right




commit 8cc0f7132daaf259c0847e983f3db1cb62a4caa4
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed May 4 16:01:20 2022 -0500

    negotiate: add warning comment about something that doesn't look right
    
    I do not understand this code, but I have a suspicion that something is
    not right.

 libsoup/auth/soup-auth-negotiate.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/libsoup/auth/soup-auth-negotiate.c b/libsoup/auth/soup-auth-negotiate.c
index c0756cd4..1f122912 100644
--- a/libsoup/auth/soup-auth-negotiate.c
+++ b/libsoup/auth/soup-auth-negotiate.c
@@ -355,6 +355,10 @@ check_server_response (SoupMessage *msg, gpointer auth)
        if (auth != soup_message_get_auth (msg))
                return;
 
+       /* XXX: If we get 401 Unauthorized, we're supposed to keep processing
+        * the authentication data. Why do we return early here? This seems
+        * wrong?
+        */
        if (soup_message_get_status (msg) == SOUP_STATUS_UNAUTHORIZED)
                return;
 
@@ -362,7 +366,7 @@ check_server_response (SoupMessage *msg, gpointer auth)
        auth_headers = soup_message_headers_get_one_common (soup_message_get_response_headers (msg),
                                                             SOUP_HEADER_WWW_AUTHENTICATE);
        if (!auth_headers || g_ascii_strncasecmp (auth_headers, "Negotiate ", 10) != 0) {
-               if (soup_message_get_status (msg) == SOUP_STATUS_SUCCESS) {
+               if (soup_message_get_status (msg) == SOUP_STATUS_OK) {
                        /* The server *may* supply final authentication data to
                         * the client, but doesn't have to. We are not
                         * authenticating the server, so just ignore missing


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