From e465cad75936af15a1e6020e34a7a2db162d76ca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 12 Nov 2005 08:19:39 +0000 Subject: r11699: use create_complex_file() to setup a file with a wide range of 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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source4/torture/smb2') diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c index 3946d19496..22d17d530c 100644 --- a/source4/torture/smb2/scan.c +++ b/source4/torture/smb2/scan.c @@ -28,6 +28,31 @@ #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; -- cgit