Allow us to cope correctly with NT_STATUS_MORE_PROCESSING_REQUIRED when downgrading...
authorJeremy Allison <jra@samba.org>
Thu, 3 Jun 2010 18:50:08 +0000 (11:50 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 3 Jun 2010 18:50:08 +0000 (11:50 -0700)
Jeremy.

source3/smbd/smb2_sesssetup.c

index 757618ea2d2aed03696c0dbfd562a40a5b9e36be..af9157107ec6f829716d9f4ec64cab498d49e7e3 100644 (file)
@@ -770,7 +770,8 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
        status = auth_ntlmssp_update(session->auth_ntlmssp_state,
                                     auth,
                                     &auth_out);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (!NT_STATUS_IS_OK(status) &&
+                       !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
                auth_ntlmssp_end(&session->auth_ntlmssp_state);
                data_blob_free(&auth);
                TALLOC_FREE(session);
@@ -793,6 +794,11 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
 
        *out_session_id = session->vuid;
 
+       if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+               return NT_STATUS_MORE_PROCESSING_REQUIRED;
+       }
+
+       /* We're done - claim the session. */
        return smbd_smb2_common_ntlmssp_auth_return(session,
                                                smb2req,
                                                in_security_mode,