The branch, master has been updated via 82778a6 pidl: fix field2name wireshark dissector test. via 0ee5c99 pidl: Keep case from fieldnames. via 5bbaf81 s4:torture:smb2 prefer torture_comment() to printf(). via 1659225 s4:torture:smb2:acls: prefer torture_comment() to printf(). via dcfe4df s4:torture:smb2:scan: prefer torture_comment() to printf(). via e9e1099 s4:torture:smb2:getinfo: prefer torture_comment() to printf(). via d06d6bd s4:torture:smb2:maxwrite: compile maxwrite test at least. via 240ca83 s4-torture: reformat TORTURE_SMB2 wscript_build list. via 1488f7e s4:torture:smb2:maxwrite: prefer torture_comment() to printf(). via d3e4106 source4/torture/rpc/testjoin.c: prefer torture_comment() over printf(). via 351a5f3 s4:torture:smb2:connect: prefer torture_comment() to printf(). from 839cd98 s4-torture: cleanup torture_suite_add_ndr_pull_validate_test API.
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 82778a6d04580fc05f3f83d44f57f221ad4e8ac4 Author: Günther Deschner <g...@samba.org> Date: Tue Sep 6 22:37:12 2016 +0200 pidl: fix field2name wireshark dissector test. Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Günther Deschner <g...@samba.org> Autobuild-Date(master): Wed Sep 7 16:05:26 CEST 2016 on sn-devel-144 commit 0ee5c9997e6c91f5fdffa36b9abf72883f67545d Author: Günther Deschner <g...@samba.org> Date: Wed May 11 15:41:02 2016 +0200 pidl: Keep case from fieldnames. Change-Id: I5626cfa0487cc88eb65cc349c05ae1762bc953f4 Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-on: https://code.wireshark.org/review/16720 Petri-Dish: Michael Mann <mman...@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-re...@wireshark.org> Reviewed-by: Michael Mann <mman...@netscape.net> Reviewed-by: Stefan Metzmacher <me...@samba.org> commit 5bbaf816122429004101da4e6401ddd12ea52988 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 15:40:50 2016 +0100 s4:torture:smb2 prefer torture_comment() to printf(). Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 16592252cfa7e037edf58736c1f298243d62ea9e Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 16:27:44 2016 +0100 s4:torture:smb2:acls: prefer torture_comment() to printf(). Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit dcfe4df2eef2e6d247da37bc0cf5551e743438e0 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 16:06:51 2016 +0100 s4:torture:smb2:scan: prefer torture_comment() to printf(). Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit e9e109979c557965ed5071abc6b71c66573ca603 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 15:51:06 2016 +0100 s4:torture:smb2:getinfo: prefer torture_comment() to printf(). Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit d06d6bdc8ca6fb4ab8dbb7fcc05d357a2228d106 Author: Günther Deschner <g...@samba.org> Date: Fri Feb 26 17:25:58 2016 +0100 s4:torture:smb2:maxwrite: compile maxwrite test at least. Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 240ca83cc9779e212fb17d11ba9a5628ab0a6505 Author: Günther Deschner <g...@samba.org> Date: Fri Feb 26 17:15:32 2016 +0100 s4-torture: reformat TORTURE_SMB2 wscript_build list. Guenther Signed-off-by: Günther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 1488f7e9445d708b1af2c3375ae410cdd85a55c9 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 15:46:24 2016 +0100 s4:torture:smb2:maxwrite: prefer torture_comment() to printf(). Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit d3e4106420c2108d8f834fda4728a788f28017e9 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 17:39:19 2016 +0100 source4/torture/rpc/testjoin.c: prefer torture_comment() over printf(). Guenther Signed-off-by: Guenther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> commit 351a5f38754ccdcf5dab408813c1bd60e0f7c0c4 Author: Günther Deschner <g...@samba.org> Date: Mon Feb 22 15:30:26 2016 +0100 s4:torture:smb2:connect: prefer torture_comment() to printf(). Guenther Signed-off-by: Günther Deschner <g...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> ----------------------------------------------------------------------- Summary of changes: pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 2 +- pidl/tests/wireshark-ndr.pl | 2 +- source4/torture/rpc/testjoin.c | 90 +++++++++++++++-------------- source4/torture/smb2/acls.c | 4 +- source4/torture/smb2/connect.c | 109 ++++++++++++++++++----------------- source4/torture/smb2/create.c | 2 +- source4/torture/smb2/dir.c | 4 +- source4/torture/smb2/getinfo.c | 38 ++++++------ source4/torture/smb2/maxwrite.c | 43 ++++++++------ source4/torture/smb2/notify.c | 18 +++--- source4/torture/smb2/scan.c | 102 +++++++++++++++----------------- source4/torture/smb2/setinfo.c | 8 +-- source4/torture/smb2/util.c | 92 +++++++++++++++-------------- source4/torture/smb2/wscript_build | 33 +++++++++-- 14 files changed, 292 insertions(+), 255 deletions(-) Changeset truncated at 500 lines: diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index 21ef714..49b0c2c 100644 --- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -61,7 +61,7 @@ sub field2name($) $field =~ s/^(_)*//g; # Remove any starting underscores $field =~ s/_/ /g; # Replace underscores with spaces - $field =~ s/(\w+)/\u\L$1/g; # Capitalise each word + $field =~ s/(\w+)/\u$1/g; # Capitalise each word return $field; } diff --git a/pidl/tests/wireshark-ndr.pl b/pidl/tests/wireshark-ndr.pl index 49ecc5c..229315b 100755 --- a/pidl/tests/wireshark-ndr.pl +++ b/pidl/tests/wireshark-ndr.pl @@ -14,7 +14,7 @@ use strict; use Parse::Pidl::Wireshark::NDR qw(field2name %res PrintIdl StripPrefixes RegisterInterfaceHandoff register_hf_field ProcessImport ProcessInclude find_type DumpEttList DumpEttDeclaration DumpHfList DumpHfDeclaration DumpFunctionTable register_type register_ett); is("Access Mask", field2name("access_mask")); -is("Accessmask", field2name("AccessMask")); +is("AccessMask", field2name("AccessMask")); my $x = new Parse::Pidl::Wireshark::NDR(); $x->PrintIdl("foo\nbar\n"); diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c index 7fbf301..2252dce 100644 --- a/source4/torture/rpc/testjoin.c +++ b/source4/torture/rpc/testjoin.c @@ -51,7 +51,8 @@ struct test_join { }; -static NTSTATUS DeleteUser_byname(struct dcerpc_binding_handle *b, +static NTSTATUS DeleteUser_byname(struct torture_context *tctx, + struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *name) { @@ -89,11 +90,11 @@ static NTSTATUS DeleteUser_byname(struct dcerpc_binding_handle *b, status = dcerpc_samr_OpenUser_r(b, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - printf("OpenUser(%s) failed - %s\n", name, nt_errstr(status)); + torture_comment(tctx, "OpenUser(%s) failed - %s\n", name, nt_errstr(status)); return status; } if (!NT_STATUS_IS_OK(r.out.result)) { - printf("OpenUser(%s) failed - %s\n", name, nt_errstr(r.out.result)); + torture_comment(tctx, "OpenUser(%s) failed - %s\n", name, nt_errstr(r.out.result)); return r.out.result; } @@ -116,7 +117,7 @@ static NTSTATUS DeleteUser_byname(struct dcerpc_binding_handle *b, when finished */ -struct test_join *torture_create_testuser_max_pwlen(struct torture_context *torture, +struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tctx, const char *username, const char *domain, uint16_t acct_type, @@ -142,7 +143,7 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort int policy_min_pw_len = 0; struct test_join *join; char *random_pw; - const char *dc_binding = torture_setting_string(torture, "dc_binding", NULL); + const char *dc_binding = torture_setting_string(tctx, "dc_binding", NULL); struct dcerpc_binding_handle *b = NULL; join = talloc(NULL, struct test_join); @@ -152,17 +153,17 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort ZERO_STRUCTP(join); - printf("Connecting to SAMR\n"); + torture_comment(tctx, "Connecting to SAMR\n"); if (dc_binding) { status = dcerpc_pipe_connect(join, &join->p, dc_binding, &ndr_table_samr, - cmdline_credentials, NULL, torture->lp_ctx); + cmdline_credentials, NULL, tctx->lp_ctx); } else { - status = torture_rpc_connection(torture, + status = torture_rpc_connection(tctx, &join->p, &ndr_table_samr); } @@ -178,17 +179,17 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort status = dcerpc_samr_Connect_r(b, join, &c); if (!NT_STATUS_IS_OK(status)) { const char *errstr = nt_errstr(status); - printf("samr_Connect failed - %s\n", errstr); + torture_comment(tctx, "samr_Connect failed - %s\n", errstr); return NULL; } if (!NT_STATUS_IS_OK(c.out.result)) { const char *errstr = nt_errstr(c.out.result); - printf("samr_Connect failed - %s\n", errstr); + torture_comment(tctx, "samr_Connect failed - %s\n", errstr); return NULL; } if (domain) { - printf("Opening domain %s\n", domain); + torture_comment(tctx, "Opening domain %s\n", domain); name.string = domain; l.in.connect_handle = &handle; @@ -197,11 +198,11 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort status = dcerpc_samr_LookupDomain_r(b, join, &l); if (!NT_STATUS_IS_OK(status)) { - printf("LookupDomain failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "LookupDomain failed - %s\n", nt_errstr(status)); goto failed; } if (!NT_STATUS_IS_OK(l.out.result)) { - printf("LookupDomain failed - %s\n", nt_errstr(l.out.result)); + torture_comment(tctx, "LookupDomain failed - %s\n", nt_errstr(l.out.result)); goto failed; } } else { @@ -219,15 +220,15 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort status = dcerpc_samr_EnumDomains_r(b, join, &e); if (!NT_STATUS_IS_OK(status)) { - printf("EnumDomains failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "EnumDomains failed - %s\n", nt_errstr(status)); goto failed; } if (!NT_STATUS_IS_OK(e.out.result)) { - printf("EnumDomains failed - %s\n", nt_errstr(e.out.result)); + torture_comment(tctx, "EnumDomains failed - %s\n", nt_errstr(e.out.result)); goto failed; } if ((num_entries != 2) || (sam && sam->count != 2)) { - printf("unexpected number of domains\n"); + torture_comment(tctx, "unexpected number of domains\n"); goto failed; } for (i=0; i < 2; i++) { @@ -237,7 +238,7 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort } } if (domain) { - printf("Opening domain %s\n", domain); + torture_comment(tctx, "Opening domain %s\n", domain); name.string = domain; l.in.connect_handle = &handle; @@ -246,15 +247,15 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort status = dcerpc_samr_LookupDomain_r(b, join, &l); if (!NT_STATUS_IS_OK(status)) { - printf("LookupDomain failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "LookupDomain failed - %s\n", nt_errstr(status)); goto failed; } if (!NT_STATUS_IS_OK(l.out.result)) { - printf("LookupDomain failed - %s\n", nt_errstr(l.out.result)); + torture_comment(tctx, "LookupDomain failed - %s\n", nt_errstr(l.out.result)); goto failed; } } else { - printf("cannot proceed without domain name\n"); + torture_comment(tctx, "cannot proceed without domain name\n"); goto failed; } } @@ -271,15 +272,15 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tort status = dcerpc_samr_OpenDomain_r(b, join, &o); if (!NT_STATUS_IS_OK(status)) { - printf("OpenDomain failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "OpenDomain failed - %s\n", nt_errstr(status)); goto failed; } if (!NT_STATUS_IS_OK(o.out.result)) { - printf("OpenDomain failed - %s\n", nt_errstr(o.out.result)); + torture_comment(tctx, "OpenDomain failed - %s\n", nt_errstr(o.out.result)); goto failed; } - printf("Creating account %s\n", username); + torture_comment(tctx, "Creating account %s\n", username); again: name.string = username; @@ -293,19 +294,19 @@ again: status = dcerpc_samr_CreateUser2_r(b, join, &r); if (!NT_STATUS_IS_OK(status)) { - printf("CreateUser2 failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "CreateUser2 failed - %s\n", nt_errstr(status)); goto failed; } if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_USER_EXISTS)) { - status = DeleteUser_byname(b, join, &join->domain_handle, name.string); + status = DeleteUser_byname(tctx, b, join, &join->domain_handle, name.string); if (NT_STATUS_IS_OK(status)) { goto again; } } if (!NT_STATUS_IS_OK(r.out.result)) { - printf("CreateUser2 failed - %s\n", nt_errstr(r.out.result)); + torture_comment(tctx, "CreateUser2 failed - %s\n", nt_errstr(r.out.result)); goto failed; } @@ -321,7 +322,7 @@ again: random_pw = generate_random_password(join, MAX(8, policy_min_pw_len), max_pw_len); - printf("Setting account password '%s'\n", random_pw); + torture_comment(tctx, "Setting account password '%s'\n", random_pw); ZERO_STRUCT(u); s.in.user_handle = &join->user_handle; @@ -333,9 +334,9 @@ again: status = dcerpc_fetch_session_key(join->p, &session_key); if (!NT_STATUS_IS_OK(status)) { - printf("SetUserInfo level %u - no session key - %s\n", + torture_comment(tctx, "SetUserInfo level %u - no session key - %s\n", s.in.level, nt_errstr(status)); - torture_leave_domain(torture, join); + torture_leave_domain(tctx, join); goto failed; } @@ -343,11 +344,11 @@ again: status = dcerpc_samr_SetUserInfo_r(b, join, &s); if (!NT_STATUS_IS_OK(status)) { - printf("SetUserInfo failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "SetUserInfo failed - %s\n", nt_errstr(status)); goto failed; } if (!NT_STATUS_IS_OK(s.out.result)) { - printf("SetUserInfo failed - %s\n", nt_errstr(s.out.result)); + torture_comment(tctx, "SetUserInfo failed - %s\n", nt_errstr(s.out.result)); goto failed; } @@ -369,18 +370,18 @@ again: u.info21.description.string = talloc_asprintf(join, "Samba4 torture account created by host %s: %s", - lpcfg_netbios_name(torture->lp_ctx), + lpcfg_netbios_name(tctx->lp_ctx), timestring(join, time(NULL))); - printf("Resetting ACB flags, force pw change time\n"); + torture_comment(tctx, "Resetting ACB flags, force pw change time\n"); status = dcerpc_samr_SetUserInfo_r(b, join, &s); if (!NT_STATUS_IS_OK(status)) { - printf("SetUserInfo failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "SetUserInfo failed - %s\n", nt_errstr(status)); goto failed; } if (!NT_STATUS_IS_OK(s.out.result)) { - printf("SetUserInfo failed - %s\n", nt_errstr(s.out.result)); + torture_comment(tctx, "SetUserInfo failed - %s\n", nt_errstr(s.out.result)); goto failed; } @@ -391,7 +392,7 @@ again: return join; failed: - torture_leave_domain(torture, join); + torture_leave_domain(tctx, join); return NULL; } @@ -484,7 +485,8 @@ NTSTATUS torture_delete_testuser(struct torture_context *torture, { NTSTATUS status; - status = DeleteUser_byname(join->p->binding_handle, + status = DeleteUser_byname(torture, + join->p->binding_handle, torture, &join->domain_handle, username); @@ -608,10 +610,10 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx, status = dcerpc_samr_SetUserInfo_r(tj->p->binding_handle, tj, &s); if (!NT_STATUS_IS_OK(status)) { - printf("SetUserInfo (non-critical) failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "SetUserInfo (non-critical) failed - %s\n", nt_errstr(status)); } if (!NT_STATUS_IS_OK(s.out.result)) { - printf("SetUserInfo (non-critical) failed - %s\n", nt_errstr(s.out.result)); + torture_comment(tctx, "SetUserInfo (non-critical) failed - %s\n", nt_errstr(s.out.result)); } *machine_credentials = cli_credentials_init(tj); @@ -722,7 +724,7 @@ static NTSTATUS torture_leave_ads_domain(struct torture_context *torture, leave the domain, deleting the machine acct */ -_PUBLIC_ void torture_leave_domain(struct torture_context *torture, struct test_join *join) +_PUBLIC_ void torture_leave_domain(struct torture_context *tctx, struct test_join *join) { struct samr_DeleteUser d; NTSTATUS status; @@ -736,17 +738,17 @@ _PUBLIC_ void torture_leave_domain(struct torture_context *torture, struct test_ /* Delete machine account */ status = dcerpc_samr_DeleteUser_r(join->p->binding_handle, join, &d); if (!NT_STATUS_IS_OK(status)) { - printf("DeleteUser failed\n"); + torture_comment(tctx, "DeleteUser failed\n"); } else if (!NT_STATUS_IS_OK(d.out.result)) { - printf("Delete of machine account %s failed\n", + torture_comment(tctx, "Delete of machine account %s failed\n", join->netbios_name); } else { - printf("Delete of machine account %s was successful.\n", + torture_comment(tctx, "Delete of machine account %s was successful.\n", join->netbios_name); } if (join->libnet_r) { - status = torture_leave_ads_domain(torture, join, join->libnet_r); + status = torture_leave_ads_domain(tctx, join, join->libnet_r); } talloc_free(join); diff --git a/source4/torture/smb2/acls.c b/source4/torture/smb2/acls.c index 8066bc9..d4c575b 100644 --- a/source4/torture/smb2/acls.c +++ b/source4/torture/smb2/acls.c @@ -1887,8 +1887,8 @@ static bool torture_smb2_con_share(struct torture_context *tctx, lpcfg_gensec_settings(tctx, tctx->lp_ctx) ); if (!NT_STATUS_IS_OK(status)) { - printf("Failed to connect to SMB2 share \\\\%s\\%s - %s\n", - host, share, nt_errstr(status)); + torture_comment(tctx, "Failed to connect to SMB2 share \\\\%s\\%s - %s\n", + host, share, nt_errstr(status)); return false; } return true; diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c index 6340430..ecb4871 100644 --- a/source4/torture/smb2/connect.c +++ b/source4/torture/smb2/connect.c @@ -28,7 +28,9 @@ /* send a close */ -static NTSTATUS torture_smb2_close(struct smb2_tree *tree, struct smb2_handle handle) +static NTSTATUS torture_smb2_close(struct torture_context *tctx, + struct smb2_tree *tree, + struct smb2_handle handle) { struct smb2_close io; NTSTATUS status; @@ -39,19 +41,19 @@ static NTSTATUS torture_smb2_close(struct smb2_tree *tree, struct smb2_handle ha io.in.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION; status = smb2_close(tree, &io); if (!NT_STATUS_IS_OK(status)) { - printf("close failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "close failed - %s\n", nt_errstr(status)); return status; } if (DEBUGLVL(1)) { - printf("Close gave:\n"); - printf("create_time = %s\n", nt_time_string(tmp_ctx, io.out.create_time)); - printf("access_time = %s\n", nt_time_string(tmp_ctx, io.out.access_time)); - printf("write_time = %s\n", nt_time_string(tmp_ctx, io.out.write_time)); - printf("change_time = %s\n", nt_time_string(tmp_ctx, io.out.change_time)); - printf("alloc_size = %lld\n", (long long)io.out.alloc_size); - printf("size = %lld\n", (long long)io.out.size); - printf("file_attr = 0x%x\n", io.out.file_attr); + torture_comment(tctx, "Close gave:\n"); + torture_comment(tctx, "create_time = %s\n", nt_time_string(tmp_ctx, io.out.create_time)); + torture_comment(tctx, "access_time = %s\n", nt_time_string(tmp_ctx, io.out.access_time)); + torture_comment(tctx, "write_time = %s\n", nt_time_string(tmp_ctx, io.out.write_time)); + torture_comment(tctx, "change_time = %s\n", nt_time_string(tmp_ctx, io.out.change_time)); + torture_comment(tctx, "alloc_size = %lld\n", (long long)io.out.alloc_size); + torture_comment(tctx, "size = %lld\n", (long long)io.out.size); + torture_comment(tctx, "file_attr = 0x%x\n", io.out.file_attr); } talloc_free(tmp_ctx); @@ -75,7 +77,7 @@ static NTSTATUS torture_smb2_write(struct torture_context *tctx, struct smb2_tre data = data_blob_talloc(tree, NULL, size); if (size != data.length) { - printf("data_blob_talloc(%u) failed\n", (unsigned int)size); + torture_comment(tctx, "data_blob_talloc(%u) failed\n", (unsigned int)size); return NT_STATUS_NO_MEMORY; } @@ -90,26 +92,26 @@ static NTSTATUS torture_smb2_write(struct torture_context *tctx, struct smb2_tre status = smb2_write(tree, &w); if (!NT_STATUS_IS_OK(status)) { - printf("write 1 failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "write 1 failed - %s\n", nt_errstr(status)); return status; } - torture_smb2_all_info(tree, handle); + torture_smb2_all_info(tctx, tree, handle); status = smb2_write(tree, &w); if (!NT_STATUS_IS_OK(status)) { - printf("write 2 failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "write 2 failed - %s\n", nt_errstr(status)); return status; } - torture_smb2_all_info(tree, handle); + torture_smb2_all_info(tctx, tree, handle); ZERO_STRUCT(f); f.in.file.handle = handle; status = smb2_flush(tree, &f); if (!NT_STATUS_IS_OK(status)) { - printf("flush failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "flush failed - %s\n", nt_errstr(status)); return status; } @@ -120,13 +122,13 @@ static NTSTATUS torture_smb2_write(struct torture_context *tctx, struct smb2_tre status = smb2_read(tree, tree, &r); if (!NT_STATUS_IS_OK(status)) { - printf("read failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "read failed - %s\n", nt_errstr(status)); return status; } if (data.length != r.out.data.length || memcmp(data.data, r.out.data.data, data.length) != 0) { - printf("read data mismatch\n"); + torture_comment(tctx, "read data mismatch\n"); return NT_STATUS_NET_WRITE_FAULT; } @@ -137,9 +139,10 @@ static NTSTATUS torture_smb2_write(struct torture_context *tctx, struct smb2_tre /* send a create */ -static NTSTATUS torture_smb2_createfile(struct smb2_tree *tree, - const char *fname, - struct smb2_handle *handle) +NTSTATUS torture_smb2_createfile(struct torture_context *tctx, + struct smb2_tree *tree, + const char *fname, + struct smb2_handle *handle) { struct smb2_create io; NTSTATUS status; @@ -160,21 +163,22 @@ static NTSTATUS torture_smb2_createfile(struct smb2_tree *tree, status = smb2_create(tree, tmp_ctx, &io); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(tmp_ctx); + torture_comment(tctx, "create1 failed - %s\n", nt_errstr(status)); return status; } if (DEBUGLVL(1)) { - printf("Open gave:\n"); - printf("oplock_flags = 0x%x\n", io.out.oplock_level); - printf("create_action = 0x%x\n", io.out.create_action); - printf("create_time = %s\n", nt_time_string(tmp_ctx, io.out.create_time)); - printf("access_time = %s\n", nt_time_string(tmp_ctx, io.out.access_time)); - printf("write_time = %s\n", nt_time_string(tmp_ctx, io.out.write_time)); - printf("change_time = %s\n", nt_time_string(tmp_ctx, io.out.change_time)); - printf("alloc_size = %lld\n", (long long)io.out.alloc_size); - printf("size = %lld\n", (long long)io.out.size); - printf("file_attr = 0x%x\n", io.out.file_attr); - printf("handle = %016llx%016llx\n", + torture_comment(tctx, "Open gave:\n"); + torture_comment(tctx, "oplock_flags = 0x%x\n", io.out.oplock_level); + torture_comment(tctx, "create_action = 0x%x\n", io.out.create_action); + torture_comment(tctx, "create_time = %s\n", nt_time_string(tmp_ctx, io.out.create_time)); + torture_comment(tctx, "access_time = %s\n", nt_time_string(tmp_ctx, io.out.access_time)); + torture_comment(tctx, "write_time = %s\n", nt_time_string(tmp_ctx, io.out.write_time)); + torture_comment(tctx, "change_time = %s\n", nt_time_string(tmp_ctx, io.out.change_time)); + torture_comment(tctx, "alloc_size = %lld\n", (long long)io.out.alloc_size); + torture_comment(tctx, "size = %lld\n", (long long)io.out.size); + torture_comment(tctx, "file_attr = 0x%x\n", io.out.file_attr); + torture_comment(tctx, "handle = %016llx%016llx\n", (long long)io.out.file.handle.data[0], -- Samba Shared Repository