Fix signing problem in the client with transs requests
[samba.git] / source / libsmb / clitrans.c
index 3e3ebc1ce1e97ffd5b1630bdf3ddc5d149124295..441f5a0a8925b493ce27859fe6ee3de552fd0cce 100644 (file)
@@ -44,7 +44,7 @@ BOOL cli_send_trans(struct cli_state *cli, int trans,
        this_ldata = MIN(ldata,cli->max_xmit - (500+lsetup*2+this_lparam));
 
        memset(cli->outbuf,'\0',smb_size);
-       set_message(NULL,cli->outbuf,14+lsetup,0,True);
+       set_message(cli->outbuf,14+lsetup,0,True);
        SCVAL(cli->outbuf,smb_com,trans);
        SSVAL(cli->outbuf,smb_tid, cli->cnum);
        cli_setup_packet(cli);
@@ -113,7 +113,10 @@ BOOL cli_send_trans(struct cli_state *cli, int trans,
                        this_lparam = MIN(lparam-tot_param,cli->max_xmit - 500); /* hack */
                        this_ldata = MIN(ldata-tot_data,cli->max_xmit - (500+this_lparam));
 
-                       set_message(NULL,cli->outbuf,trans==SMBtrans?8:9,0,True);
+                       client_set_trans_sign_state_off(cli, mid);
+                       client_set_trans_sign_state_on(cli, mid);
+
+                       set_message(cli->outbuf,trans==SMBtrans?8:9,0,True);
                        SCVAL(cli->outbuf,smb_com,(trans==SMBtrans ? SMBtranss : SMBtranss2));
                        
                        outparam = smb_buf(cli->outbuf);
@@ -194,15 +197,13 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
         * to a trans call. This is not an error and should not
         * be treated as such. Note that STATUS_NO_MORE_FILES is
         * returned when a trans2 findfirst/next finishes.
-        * When setting up an encrypted transport we can also
-        * see NT_STATUS_MORE_PROCESSING_REQUIRED here.
         */
        status = cli_nt_error(cli);
        
-       if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-               if (NT_STATUS_IS_ERR(status) || NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES)) {
-                       goto out;
-               }
+       if (NT_STATUS_IS_ERR(status) ||
+            NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES) ||
+            NT_STATUS_EQUAL(status,STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) {
+               goto out;
        }
 
        /* parse out the lengths */
@@ -307,10 +308,8 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
                                 CVAL(cli->inbuf,smb_com)));
                        goto out;
                }
-               if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-                       if (NT_STATUS_IS_ERR(cli_nt_error(cli))) {
-                               goto out;
-                       }
+               if (NT_STATUS_IS_ERR(cli_nt_error(cli))) {
+                       goto out;
                }
 
                /* parse out the total lengths again - they can shrink! */
@@ -352,7 +351,7 @@ BOOL cli_send_nt_trans(struct cli_state *cli,
        this_ldata = MIN(ldata,cli->max_xmit - (500+lsetup*2+this_lparam));
 
        memset(cli->outbuf,'\0',smb_size);
-       set_message(NULL,cli->outbuf,19+lsetup,0,True);
+       set_message(cli->outbuf,19+lsetup,0,True);
        SCVAL(cli->outbuf,smb_com,SMBnttrans);
        SSVAL(cli->outbuf,smb_tid, cli->cnum);
        cli_setup_packet(cli);
@@ -413,7 +412,7 @@ BOOL cli_send_nt_trans(struct cli_state *cli,
                        this_lparam = MIN(lparam-tot_param,cli->max_xmit - 500); /* hack */
                        this_ldata = MIN(ldata-tot_data,cli->max_xmit - (500+this_lparam));
 
-                       set_message(NULL,cli->outbuf,18,0,True);
+                       set_message(cli->outbuf,18,0,True);
                        SCVAL(cli->outbuf,smb_com,SMBnttranss);
 
                        /* XXX - these should probably be aligned */