s3: NT_STATUS_MORE_PROCESSING_REQUIRED is a valid sesssetup return value
authorVolker Lendecke <vl@samba.org>
Sat, 2 Jan 2010 17:14:59 +0000 (18:14 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 3 Jan 2010 10:38:22 +0000 (11:38 +0100)
source3/libsmb/async_smb.c

index 8b9cf091c67d86ebda5f51c71eec91ed8cc9476b..f5000e47308edaf958ceb35a1f101014a52a2da4 100644 (file)
@@ -815,16 +815,30 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, uint8_t min_wct,
 
        status = cli_pull_error((char *)state->inbuf);
 
-       if (!have_andx_command((char *)state->inbuf, wct_ofs)
-           && NT_STATUS_IS_ERR(status)) {
-               /*
-                * The last command takes the error code. All further commands
-                * down the requested chain will get a
-                * NT_STATUS_REQUEST_ABORTED.
-                */
-               return status;
+       if (!have_andx_command((char *)state->inbuf, wct_ofs)) {
+
+               if ((cmd == SMBsesssetupX)
+                   && NT_STATUS_EQUAL(
+                           status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+                       /*
+                        * NT_STATUS_MORE_PROCESSING_REQUIRED is a
+                        * valid return code for session setup
+                        */
+                       goto no_err;
+               }
+
+               if (NT_STATUS_IS_ERR(status)) {
+                       /*
+                        * The last command takes the error code. All
+                        * further commands down the requested chain
+                        * will get a NT_STATUS_REQUEST_ABORTED.
+                        */
+                       return status;
+               }
        }
 
+no_err:
+
        wct = CVAL(state->inbuf, wct_ofs);
        bytes_offset = wct_ofs + 1 + wct * sizeof(uint16_t);
        num_bytes = SVAL(state->inbuf, bytes_offset);
@@ -856,7 +870,7 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, uint8_t min_wct,
                *pbytes = (uint8_t *)state->inbuf + bytes_offset + 2;
        }
 
-       return NT_STATUS_OK;
+       return status;
 }
 
 size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs)