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:50:53 +0000 (13:50 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 28 Aug 2008 14:07:06 +0000 (16:07 +0200)
This one took a *lot* of tracking down :-).
Jeremy.
(cherry picked from commit f845c95dcfa0b1630a0057c62941bb8a72ebdd83)

source/smbd/sesssetup.c
source/winbindd/winbindd_cm.c

index 33a54dd0deeade52de0317eb8c81771d715543d5..98594b0769f80215a9a97da6f68f6cd96081aa70 100644 (file)
@@ -1735,16 +1735,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;
+               }
        }
 
        if (server_info->user_session_key.data) {
index ab8287a01a170f68fd419171e9a9d1e1ef7552ef..cd05c361ce8cc8d4fbb6e5900b4b9c5f68791d4d 100644 (file)
@@ -908,6 +908,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, ""))) {