r11699: use create_complex_file() to setup a file with a wide range of
authorAndrew Tridgell <tridge@samba.org>
Sat, 12 Nov 2005 08:19:39 +0000 (08:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:46:15 +0000 (13:46 -0500)
different attributes before running the getinfo level scanner, making
it easier to recognise levels
(This used to be commit 5d0cd9d041af71cb1bfb9cb3e0c45e0bbd8193cb)

source4/torture/smb2/scan.c

index 3946d1949662a5fcad68fe1a855cf5e83e87f59a..22d17d530cd4bc424bab9352e22a79edd44f7ee3 100644 (file)
 #include "lib/events/events.h"
 
 
+/*
+  create a complex file using the old SMB protocol, to make it easier to 
+  find fields in SMB2 getinfo levels
+*/
+static BOOL setup_complex_file(const char *fname)
+{
+       struct smbcli_state *cli;
+       int fnum;
+
+       if (!torture_open_connection(&cli)) {
+               return False;
+       }
+
+       fnum = create_complex_file(cli, cli, fname);
+
+       if (DEBUGLVL(1)) {
+               torture_all_info(cli->tree, fname);
+       }
+       
+       talloc_free(cli);
+       return fnum != -1;
+}
+
+
+
 /* 
    scan for valid SMB2 getinfo levels
 */
@@ -52,6 +77,10 @@ BOOL torture_smb2_getinfo_scan(void)
                return False;
        }
 
+       if (!setup_complex_file(fname)) {
+               printf("Failed to setup complex file '%s'\n", fname);
+       }
+
        ZERO_STRUCT(cr);
        cr.in.buffer_code = 0x39;
        cr.in.oplock_flags = 0;