diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-03 00:28:22 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:47:20 +0100 |
commit | bbdfbf8d9d486aee51117976b8f825759a4c4a37 (patch) | |
tree | c0f97e145aae09c3e7e5387471fb3fb0ab839596 /source4/torture/smb2/scan.c | |
parent | 291ddf433685ee5c25e172885045a4b60d7bb1ee (diff) | |
download | samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.tar.gz samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.tar.xz samba-bbdfbf8d9d486aee51117976b8f825759a4c4a37.zip |
r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm.
(This used to be commit a33a5530545086b81a3b205aa109dff11c546926)
Diffstat (limited to 'source4/torture/smb2/scan.c')
-rw-r--r-- | source4/torture/smb2/scan.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c index f3e4d5cd36a..eda753b1ee8 100644 --- a/source4/torture/smb2/scan.c +++ b/source4/torture/smb2/scan.c @@ -37,14 +37,13 @@ */ bool torture_smb2_getinfo_scan(struct torture_context *torture) { - TALLOC_CTX *mem_ctx = talloc_new(NULL); struct smb2_tree *tree; NTSTATUS status; struct smb2_getinfo io; struct smb2_handle fhandle, dhandle; int c, i; - if (!torture_smb2_connection(mem_ctx, &tree)) { + if (!torture_smb2_connection(torture, &tree)) { return false; } @@ -74,7 +73,7 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture) io.in.level = (i<<8) | c; io.in.file.handle = fhandle; - status = smb2_getinfo(tree, mem_ctx, &io); + status = smb2_getinfo(tree, torture, &io); if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS) && !NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER) && !NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { @@ -84,7 +83,7 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture) } io.in.file.handle = dhandle; - status = smb2_getinfo(tree, mem_ctx, &io); + status = smb2_getinfo(tree, torture, &io); if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS) && !NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER) && !NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { @@ -95,8 +94,6 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture) } } - talloc_free(mem_ctx); - return true; } @@ -105,14 +102,13 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture) */ bool torture_smb2_setinfo_scan(struct torture_context *torture) { - TALLOC_CTX *mem_ctx = talloc_new(NULL); struct smb2_tree *tree; NTSTATUS status; struct smb2_setinfo io; struct smb2_handle handle; int c, i; - if (!torture_smb2_connection(mem_ctx, &tree)) { + if (!torture_smb2_connection(torture, &tree)) { return false; } @@ -126,7 +122,7 @@ bool torture_smb2_setinfo_scan(struct torture_context *torture) torture_smb2_testfile(tree, FNAME, &handle); ZERO_STRUCT(io); - io.in.blob = data_blob_talloc_zero(mem_ctx, 1024); + io.in.blob = data_blob_talloc_zero(torture, 1024); for (c=1;c<5;c++) { for (i=0;i<0x100;i++) { @@ -141,8 +137,6 @@ bool torture_smb2_setinfo_scan(struct torture_context *torture) } } - talloc_free(mem_ctx); - return true; } @@ -152,14 +146,13 @@ bool torture_smb2_setinfo_scan(struct torture_context *torture) */ bool torture_smb2_find_scan(struct torture_context *torture) { - TALLOC_CTX *mem_ctx = talloc_new(NULL); struct smb2_tree *tree; NTSTATUS status; struct smb2_find io; struct smb2_handle handle; int i; - if (!torture_smb2_connection(mem_ctx, &tree)) { + if (!torture_smb2_connection(torture, &tree)) { return false; } @@ -179,7 +172,7 @@ bool torture_smb2_find_scan(struct torture_context *torture) io.in.level = i; io.in.file.handle = handle; - status = smb2_find(tree, mem_ctx, &io); + status = smb2_find(tree, torture, &io); if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS) && !NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER) && !NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { @@ -189,8 +182,6 @@ bool torture_smb2_find_scan(struct torture_context *torture) } } - talloc_free(mem_ctx); - return true; } |