summaryrefslogtreecommitdiff
path: root/source4/torture/smb2
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-11 12:37:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:12 -0500
commit2e753f851885930000eadbd4b69660d85124c716 (patch)
tree078827c8b09c6673892f5b53560875fda14f22b9 /source4/torture/smb2
parent006da4c52add1e448eb3f72896ca37d644294a24 (diff)
downloadsamba-2e753f851885930000eadbd4b69660d85124c716.tar.gz
samba-2e753f851885930000eadbd4b69660d85124c716.tar.bz2
samba-2e753f851885930000eadbd4b69660d85124c716.zip
r11679: opening/creating files in SMB2 now works. Lots of unknown parameters
in the call tho. (This used to be commit 548fbd86b3b114493943b50669bdcba2f4ed87f2)
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r--source4/torture/smb2/connect.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c
index 39131a74f2..955df4c890 100644
--- a/source4/torture/smb2/connect.c
+++ b/source4/torture/smb2/connect.c
@@ -188,11 +188,40 @@ static struct smb2_tree *torture_smb2_tree(struct smb2_session *session,
return NULL;
}
- printf("Tree connect gave tid = 0x%016llx\n", io.out.tid);
+ printf("Tree connect gave tid = 0x%x\n", io.out.tid);
+
+ tree->tid = io.out.tid;
return tree;
}
+/*
+ send a create
+*/
+static struct smb2_handle torture_smb2_create(struct smb2_tree *tree,
+ const char *fname)
+{
+ struct smb2_create io;
+ NTSTATUS status;
+
+ ZERO_STRUCT(io);
+ io.in.unknown1 = 0x09000039;
+ io.in.access_mask = SEC_RIGHTS_FILE_ALL;
+ io.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+ io.in.open_disposition = NTCREATEX_DISP_OVERWRITE_IF;
+ io.in.fname = fname;
+ status = smb2_create(tree, &io);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("create failed - %s\n", nt_errstr(status));
+ return io.out.handle;
+ }
+
+ printf("Open gave handle:\n");
+ dump_data(0, io.out.handle.data, 20);
+
+ return io.out.handle;
+}
+
/*
basic testing of SMB2 connection calls
*/
@@ -205,12 +234,15 @@ BOOL torture_smb2_connect(void)
const char *host = lp_parm_string(-1, "torture", "host");
const char *share = lp_parm_string(-1, "torture", "share");
struct cli_credentials *credentials = cmdline_credentials;
+ struct smb2_handle h;
transport = torture_smb2_negprot(mem_ctx, host);
session = torture_smb2_session(transport, credentials);
- session = torture_smb2_session(transport, credentials);
- tree = torture_smb2_tree(session, share);
tree = torture_smb2_tree(session, share);
+ h = torture_smb2_create(tree, "test2.dat");
+ h = torture_smb2_create(tree, "test3.dat");
+ h = torture_smb2_create(tree, "test4.dat");
+ h = torture_smb2_create(tree, "test5.dat");
talloc_free(mem_ctx);