[libsoup] soup-auth-manager-ntlm.c: don't include the default domain in the response



commit 501d327ad2312a97fb585369f3537563b8d296fc
Author: Dan Winship <danw gnome org>
Date:   Tue Oct 16 10:55:18 2012 -0400

    soup-auth-manager-ntlm.c: don't include the default domain in the response
    
    If the user didn't specify a domain in their username, then send ""
    for the domain in the response, rather than echoing back the default
    domain. This is apparently more compatible with what other apps do.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=624613

 libsoup/soup-auth-manager-ntlm.c |    5 ++---
 tests/ntlm-test.c                |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/libsoup/soup-auth-manager-ntlm.c b/libsoup/soup-auth-manager-ntlm.c
index f2b67d1..ecb9c7c 100644
--- a/libsoup/soup-auth-manager-ntlm.c
+++ b/libsoup/soup-auth-manager-ntlm.c
@@ -459,7 +459,7 @@ ssofailure:
 		*slash = '\0';
 		username = slash + 1;
 	} else
-		domain = conn->domain;
+		domain = g_strdup ("");
 
 	conn->response_header = soup_ntlm_response (conn->nonce,
 						    username, password,
@@ -470,8 +470,7 @@ ssofailure:
 	soup_session_requeue_message (priv->session, msg);
 
 done:
-	if (domain != conn->domain)
-		g_free (domain);
+	g_free (domain);
 	g_free (conn->domain);
 	conn->domain = NULL;
 	g_free (conn->nonce);
diff --git a/tests/ntlm-test.c b/tests/ntlm-test.c
index 00222e8..e473ba6 100644
--- a/tests/ntlm-test.c
+++ b/tests/ntlm-test.c
@@ -24,7 +24,7 @@ typedef enum {
 
 #define NTLM_CHALLENGE "TlRMTVNTUAACAAAADAAMADAAAAABAoEAASNFZ4mrze8AAAAAAAAAAGIAYgA8AAAARABPAE0AQQBJAE4AAgAMAEQATwBNAEEASQBOAAEADABTAEUAUgBWAEUAUgAEABQAZABvAG0AYQBpAG4ALgBjAG8AbQADACIAcwBlAHIAdgBlAHIALgBkAG8AbQBhAGkAbgAuAGMAbwBtAAAAAAA="
 
-#define NTLM_RESPONSE_USER(response) ((response)[102] == 'E' ? NTLM_AUTHENTICATED_ALICE : NTLM_AUTHENTICATED_BOB)
+#define NTLM_RESPONSE_USER(response) ((response)[86] == 'E' ? NTLM_AUTHENTICATED_ALICE : NTLM_AUTHENTICATED_BOB)
 
 static void
 clear_state (gpointer connections, GObject *ex_connection)



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