TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
const char *fname = "lease_request.dat";
const char *fname2 = "lease_request.2.dat";
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h, hnew;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle hnew = {{0}};
NTSTATUS status;
const char *fname = "lease_upgrade.dat";
bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
const char *fname = "lease_nobreakself.dat";
bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1, h2;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
NTSTATUS status;
const char *fname = "lease_statopen.dat";
bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_multibreak.dat";
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls;
- struct smb2_handle h1;
+ struct smb2_handle h1 = {{0}};
uint64_t parent = LEASE2;
NTSTATUS status;
const char *fname = "lease_v2_request_parent.dat";
struct smb2_create io;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h1;
+ struct smb2_handle h1 = {{0}};
NTSTATUS status;
const char *fname = "lease_break_twice.dat";
bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io;
struct smb2_lease ls1, ls2, ls2t, ls3, ls4;
- struct smb2_handle h1, h2, h3, h4, h5;
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
+ struct smb2_handle h4 = {{0}};
+ struct smb2_handle h5 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_v2_request.dat";
struct smb2_create io2;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_complex1.dat";
struct smb2_create io2;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h2, h3;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
+ struct smb2_handle h3 = {{0}};
struct smb2_write w;
NTSTATUS status;
const char *fname = "lease_v2_complex1.dat";
struct smb2_create io2;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h2 = {{0}};
struct smb2_request *req2 = NULL;
struct smb2_lease_break_ack ack = {};
NTSTATUS status;
struct smb2_create io;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, hnew, h1b;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle hnew = {{0}};
+ struct smb2_handle h1b = {{0}};
NTSTATUS status;
const char *fname = "lease_timeout.dat";
bool ret = true;
struct smb2_create io;
struct smb2_lease ls1;
struct smb2_lease ls2;
- struct smb2_handle h, h1, h2;
+ struct smb2_handle h = {{0}};
+ struct smb2_handle h1 = {{0}};
+ struct smb2_handle h2 = {{0}};
union smb_setfileinfo sinfo;
const char *fname = "lease_v2_rename_src.dat";
const char *fname_dst = "lease_v2_rename_dst.dat";
options2_1.max_protocol = PROTOCOL_SMB2_10;
/* create a new connection (same client_guid) */
if (!torture_smb2_connection_ext(tctx, 0, &options2_1, &tree_2_1)) {
- torture_warning(tctx, "couldn't reconnect max protocol 2.1, bailing\n");
+ torture_result(tctx, TORTURE_FAIL,
+ __location__ "couldn't reconnect "
+ "max protocol 2.1, bailing\n");
ret = false;
goto done;
}
options3_0.max_protocol = PROTOCOL_SMB3_00;
/* create a new connection (same client_guid) */
if (!torture_smb2_connection_ext(tctx, 0, &options3_0, &tree_3_0)) {
- torture_warning(tctx, "couldn't reconnect max protocol 3.0, bailing\n");
+ torture_result(tctx, TORTURE_FAIL,
+ __location__ "couldn't reconnect "
+ "max protocol 3.0, bailing\n");
ret = false;
goto done;
}
done:
- smb2_util_close(tree_2_1, h);
- smb2_util_close(tree_3_0, h1);
- smb2_util_close(tree_3_0, h2);
+ if (tree_2_1 != NULL) {
+ smb2_util_close(tree_2_1, h);
+ smb2_util_unlink(tree_2_1, fname);
+ }
+ if (tree_3_0 != NULL) {
+ smb2_util_close(tree_3_0, h1);
+ smb2_util_close(tree_3_0, h2);
- smb2_util_unlink(tree_2_1, fname);
- smb2_util_unlink(tree_3_0, fname);
+ smb2_util_unlink(tree_3_0, fname);
+ }
/* Set sharename back. */
lpcfg_set_cmdline(tctx->lp_ctx, "torture:share", orig_share);