r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[abartlet/samba.git/.git] / source3 / libsmb / clitrans.c
index 33fddae2023319d9252bfc5c4004e0b2cd87f100..752983377cac3ca315044d0ea86ca52d8819f9f2 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -44,7 +43,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(cli->outbuf,14+lsetup,0,True);
+       set_message(NULL,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 +112,7 @@ 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(cli->outbuf,trans==SMBtrans?8:9,0,True);
+                       set_message(NULL,cli->outbuf,trans==SMBtrans?8:9,0,True);
                        SCVAL(cli->outbuf,smb_com,(trans==SMBtrans ? SMBtranss : SMBtranss2));
                        
                        outparam = smb_buf(cli->outbuf);
@@ -196,11 +195,18 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
         * returned when a trans2 findfirst/next finishes.
         * When setting up an encrypted transport we can also
         * see NT_STATUS_MORE_PROCESSING_REQUIRED here.
+         *
+         * Vista returns NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT if the folder
+         * "<share>/Users/All Users" is enumerated.  This is a special pseudo
+         * folder, and the response does not have parameters (nor a parameter
+         * length).
         */
        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)) {
+               if (NT_STATUS_IS_ERR(status) ||
+                    NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES) ||
+                    NT_STATUS_EQUAL(status,NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) {
                        goto out;
                }
        }
@@ -352,7 +358,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(cli->outbuf,19+lsetup,0,True);
+       set_message(NULL,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 +419,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(cli->outbuf,18,0,True);
+                       set_message(NULL,cli->outbuf,18,0,True);
                        SCVAL(cli->outbuf,smb_com,SMBnttranss);
 
                        /* XXX - these should probably be aligned */