r23792: convert Samba4 to GPLv3
[kai/samba-autobuild/.git] / source4 / torture / basic / scanner.c
index 47da8f7efea0e744c121e145e120c710ea335803..0a1cfc2e01b0e3d693cadfa33920f23253257c61 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"
@@ -242,19 +241,13 @@ static BOOL scan_trans2(struct smbcli_state *cli, int op, int level,
 }
 
 
-BOOL torture_trans2_scan(struct torture_context *torture)
+BOOL torture_trans2_scan(struct torture_context *torture, 
+                                                struct smbcli_state *cli)
 {
-       static struct smbcli_state *cli;
        int op, level;
        const char *fname = "\\scanner.dat";
        int fnum, dnum, qfnum;
 
-       printf("starting trans2 scan test\n");
-
-       if (!torture_open_connection(&cli, 0)) {
-               return False;
-       }
-
        fnum = smbcli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
        if (fnum == -1) {
                printf("file open failed - %s\n", smbcli_errstr(cli->tree));
@@ -299,9 +292,6 @@ BOOL torture_trans2_scan(struct torture_context *torture)
                }
        }
 
-       torture_close_connection(cli);
-
-       printf("trans2 scan finished\n");
        return True;
 }
 
@@ -483,19 +473,13 @@ static BOOL scan_nttrans(struct smbcli_state *cli, int op, int level,
 }
 
 
-BOOL torture_nttrans_scan(struct torture_context *torture)
+BOOL torture_nttrans_scan(struct torture_context *torture, 
+                                                 struct smbcli_state *cli)
 {
-       static struct smbcli_state *cli;
        int op, level;
        const char *fname = "\\scanner.dat";
        int fnum, dnum;
 
-       printf("starting nttrans scan test\n");
-
-       if (!torture_open_connection(&cli, 0)) {
-               return False;
-       }
-
        fnum = smbcli_open(cli->tree, fname, O_RDWR | O_CREAT | O_TRUNC, 
                         DENY_NONE);
        dnum = smbcli_open(cli->tree, "\\", O_RDONLY, DENY_NONE);