Don't re-initialize a token when we already have one. This fixes the build farm failu...
authorJeremy Allison <jra@samba.org>
Fri, 22 Aug 2008 20:49:46 +0000 (13:49 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 22 Aug 2008 20:49:46 +0000 (13:49 -0700)
This one took a *lot* of tracking down :-).
Jeremy.
(This used to be commit dca827791276906436452c650062164eb819dfe0)

source3/smbd/sesssetup.c
source3/winbindd/winbindd_cm.c

index 041596b9530d6b4b99e1a6263bd5f70cbc475b77..9c9d0a97bca41ad342a4bb0a20a92ffe7ae06c0e 100644 (file)
@@ -1738,16 +1738,19 @@ void reply_sesssetup_and_X(struct smb_request *req)
                return;
        }
 
-       nt_status = create_local_token(server_info);
-       if (!NT_STATUS_IS_OK(nt_status)) {
-               DEBUG(10, ("create_local_token failed: %s\n",
-                          nt_errstr(nt_status)));
-               data_blob_free(&nt_resp);
-               data_blob_free(&lm_resp);
-               data_blob_clear_free(&plaintext_password);
-               reply_nterror(req, nt_status_squash(nt_status));
-               END_PROFILE(SMBsesssetupX);
-               return;
+       if (!server_info->ptok) {
+               nt_status = create_local_token(server_info);
+
+               if (!NT_STATUS_IS_OK(nt_status)) {
+                       DEBUG(10, ("create_local_token failed: %s\n",
+                                  nt_errstr(nt_status)));
+                       data_blob_free(&nt_resp);
+                       data_blob_free(&lm_resp);
+                       data_blob_clear_free(&plaintext_password);
+                       reply_nterror(req, nt_status_squash(nt_status));
+                       END_PROFILE(SMBsesssetupX);
+                       return;
+               }
        }
 
        data_blob_clear_free(&plaintext_password);
index 6db45f72c3163040e7845aab507a9e9c15a34617..a8c0166d2710ef7ac6c5a16cee150e0b3dd5aba8 100644 (file)
@@ -937,6 +937,9 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
  anon_fallback:
 
        /* Fall back to anonymous connection, this might fail later */
+       DEBUG(10,("cm_prepare_connection: falling back to anonymous "
+               "connection for DC %s\n",
+               controller ));
 
        if (NT_STATUS_IS_OK(cli_session_setup(*cli, "", NULL, 0,
                                              NULL, 0, ""))) {