c260e0
From 8683703ef3978983e61329801aecc554aec06055 Mon Sep 17 00:00:00 2001
c260e0
From: Daniel Stenberg <daniel@haxx.se>
c260e0
Date: Tue, 7 Jan 2014 09:33:54 +0100
c260e0
Subject: [PATCH] ConnectionExists: fix NTLM check for new connection
c260e0
c260e0
When the requested authentication bitmask includes NTLM, we cannot
c260e0
re-use a connection for another username/password as we then risk
c260e0
re-using NTLM (connection-based auth).
c260e0
c260e0
This has the unfortunate downside that if you include NTLM as a possible
c260e0
auth, you cannot re-use connections for other usernames/passwords even
c260e0
if NTLM doesn't end up the auth type used.
c260e0
c260e0
Reported-by: Paras S
c260e0
Patched-by: Paras S
c260e0
Bug: http://curl.haxx.se/mail/lib-2014-01/0046.html
c260e0
c260e0
[upstream commit 8ae35102c43d8d06572c3a1292eb6e27e663c78d]
c260e0
c260e0
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
c260e0
---
c260e0
 lib/url.c |    4 ++--
c260e0
 1 files changed, 2 insertions(+), 2 deletions(-)
c260e0
c260e0
diff --git a/lib/url.c b/lib/url.c
c260e0
index bddbd91..313ec3e 100644
c260e0
--- a/lib/url.c
c260e0
+++ b/lib/url.c
c260e0
@@ -2782,8 +2782,8 @@ ConnectionExists(struct SessionHandle *data,
c260e0
   struct connectdata *check;
c260e0
   struct connectdata *chosen = 0;
c260e0
   bool canPipeline = IsPipeliningPossible(data, needle);
c260e0
-  bool wantNTLM = (data->state.authhost.want==CURLAUTH_NTLM) ||
c260e0
-                  (data->state.authhost.want==CURLAUTH_NTLM_WB) ? TRUE : FALSE;
c260e0
+  bool wantNTLM = (data->state.authhost.want & CURLAUTH_NTLM) ||
c260e0
+    (data->state.authhost.want & CURLAUTH_NTLM_WB) ? TRUE : FALSE;
c260e0
   struct connectbundle *bundle;
c260e0
 
c260e0
   /* Look up the bundle with all the connections to this
c260e0
-- 
c260e0
1.7.1
c260e0