summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-12-30 18:12:59 -0500
committerDan Winship <danw@gnome.org>2013-01-02 15:33:00 -0500
commit066ecf70733166c2318ec32238e4cb8b8b79e1cd (patch)
tree4a5ea38903de278beec98435d07280fdc9ef047f /tests
parent289f435ad21b9facab5c8a6a9f11ca055c54930b (diff)
downloadlibsoup-066ecf70733166c2318ec32238e4cb8b8b79e1cd.tar.gz
libsoup-066ecf70733166c2318ec32238e4cb8b8b79e1cd.tar.bz2
libsoup-066ecf70733166c2318ec32238e4cb8b8b79e1cd.zip
ntlm-test-helper: fix
We need to set SOUP_NTLM_AUTH_DEBUG to an empty string (to tell SoupAuthNTLM to always use built-in NTLM), not leave it unset, which will let SoupAuthNTLM use the real ntlm_auth binary. (The effect of this bug was that instead of always using built-in NTLM, ntlm-test-helper would first try to use ntlm_auth, and fail because there were no cached credentials, and then fall back to built-in NTLM, which meant that we were testing the fallback codepath even in the supposed-to-be-non-fallback case. Unless your username was "alice" or "bob" and you had a working winbind configuration, in which case the tests would just fail.) Also, fix up ntlm-test a bit, so that if ntlm-test-helper for some reason tries to authenticate as someone other than alice or bob, it recognizes this, rather than considering everyone who isn't alice to be bob.
Diffstat (limited to 'tests')
-rw-r--r--tests/ntlm-test-helper.c2
-rw-r--r--tests/ntlm-test.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/ntlm-test-helper.c b/tests/ntlm-test-helper.c
index 60dd0490..f2450cae 100644
--- a/tests/ntlm-test-helper.c
+++ b/tests/ntlm-test-helper.c
@@ -39,7 +39,7 @@ main (int argc, char **argv)
SoupAuth *auth;
/* Don't recurse */
- g_unsetenv ("SOUP_NTLM_AUTH_DEBUG");
+ g_setenv ("SOUP_NTLM_AUTH_DEBUG", "", TRUE);
setlocale (LC_ALL, "");
diff --git a/tests/ntlm-test.c b/tests/ntlm-test.c
index ce08f996..e2dc23ad 100644
--- a/tests/ntlm-test.c
+++ b/tests/ntlm-test.c
@@ -28,7 +28,7 @@ static const char *state_name[] = {
#define NTLM_CHALLENGE "TlRMTVNTUAACAAAADAAMADAAAAABAoEAASNFZ4mrze8AAAAAAAAAAGIAYgA8AAAARABPAE0AQQBJAE4AAgAMAEQATwBNAEEASQBOAAEADABTAEUAUgBWAEUAUgAEABQAZABvAG0AYQBpAG4ALgBjAG8AbQADACIAcwBlAHIAdgBlAHIALgBkAG8AbQBhAGkAbgAuAGMAbwBtAAAAAAA="
-#define NTLM_RESPONSE_USER(response) ((response)[86] == 'E' ? NTLM_AUTHENTICATED_ALICE : NTLM_AUTHENTICATED_BOB)
+#define NTLM_RESPONSE_USER(response) ((response)[86] == 'E' ? NTLM_AUTHENTICATED_ALICE : ((response)[86] == 'I' ? NTLM_AUTHENTICATED_BOB : NTLM_UNAUTHENTICATED))
static void
clear_state (gpointer connections, GObject *ex_connection)