Kai Blin : secur32: Work around ntlm_auth in Samba 3.0. 28a being broken for cached credentials.

Alexandre Julliard julliard at winehq.org
Tue Apr 14 15:59:59 CDT 2009


Module: wine
Branch: master
Commit: 7788c8ed0d84be2537280c188fb07fb7118b3883
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7788c8ed0d84be2537280c188fb07fb7118b3883

Author: Kai Blin <kai.blin at gmail.com>
Date:   Mon Apr 13 22:39:39 2009 +0200

secur32: Work around ntlm_auth in Samba 3.0.28a being broken for cached credentials.

Samba 3.0.28a (as shipped with Ubuntu 8.04) seems to break when using
cached credentials backed by winbindd, returning a BH error in our test
if we still need to provide a password. Handle this and report a more
correct error.

---

 dlls/secur32/ntlm.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c
index 7e44dd7..5e2450a 100644
--- a/dlls/secur32/ntlm.c
+++ b/dlls/secur32/ntlm.c
@@ -662,8 +662,20 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
                 ret = SEC_E_NO_CREDENTIALS;
                 goto isc_end;
             }
-            else /* Just do a noop on the next run */
+            else
+            {
+                /* Some versions of Samba have a broken ntlm_auth that can
+                 * return "BH" here. Catch this and abort. */
+                if(!strncmp(buffer, "BH", 2))
+                {
+                    ERR("ntlm_auth replied 'BH'. This should not happen. "
+                        "Please fix your ntlm_auth install and try again.\n");
+                    ret = SEC_E_INTERNAL_ERROR;
+                    goto isc_end;
+                }
+                /* Otherwise, just do a noop on the next run */
                 lstrcpynA(buffer, "OK", max_len-1);
+            }
         }
         else
         {




More information about the wine-cvs mailing list