}
static bool test_setup_copy_chunk(struct torture_context *torture,
- struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
+ struct smb2_tree *src_tree,
+ struct smb2_tree *dst_tree,
+ TALLOC_CTX *mem_ctx,
uint32_t nchunks,
const char *src_name,
struct smb2_handle *src_h,
NTSTATUS status;
enum ndr_err_code ndr_ret;
- ok = test_setup_create_fill(torture, tree, mem_ctx, src_name,
+ ok = test_setup_create_fill(torture, src_tree, mem_ctx, src_name,
src_h, src_size, src_desired_access,
FILE_ATTRIBUTE_NORMAL);
torture_assert(torture, ok, "src file create fill");
- ok = test_setup_create_fill(torture, tree, mem_ctx, dst_name,
+ ok = test_setup_create_fill(torture, dst_tree, mem_ctx, dst_name,
dest_h, dest_size, dest_desired_access,
FILE_ATTRIBUTE_NORMAL);
torture_assert(torture, ok, "dest file create fill");
ioctl->smb2.in.max_response_size = 32;
ioctl->smb2.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL;
- status = smb2_ioctl(tree, mem_ctx, &ioctl->smb2);
+ status = smb2_ioctl(src_tree, mem_ctx, &ioctl->smb2);
torture_assert_ntstatus_ok(torture, status,
"FSCTL_SRV_REQUEST_RESUME_KEY");
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
FNAME,
&src_h, 4096, /* fill 4096 byte src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
2, /* chunks */
FNAME,
&src_h, 8192, /* src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
2, /* chunks */
FNAME,
&src_h, 96, /* src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
2, /* chunks */
FNAME,
&src_h, 8192, /* src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
2, /* chunks */
FNAME,
&src_h, 4096, /* src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* chunks */
FNAME,
&src_h, 4096, /* src file */
struct smb2_lock lck;
struct smb2_lock_element el[1];
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* chunks */
FNAME,
&src_h, 4096, /* src file */
struct smb2_lock lck;
struct smb2_lock_element el[1];
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* chunks */
FNAME,
&src_h, 4096, /* src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1,
FNAME,
&src_h, 4096,
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1,
FNAME,
&src_h, 8192,
bool ok;
/* exceed the vfs_default copy buffer */
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1,
FNAME,
&src_h, 2048 * 2,
enum ndr_err_code ndr_ret;
bool ok;
/* read permission on src */
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx, 1, /* 1 chunk */
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx, 1, /* 1 chunk */
FNAME, &src_h, 4096, /* fill 4096 byte src file */
SEC_FILE_READ_DATA | SEC_FILE_READ_ATTRIBUTE,
FNAME2, &dest_h, 0, /* 0 byte dest file */
smb2_util_close(tree, dest_h);
/* execute permission on src */
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx, 1, /* 1 chunk */
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx, 1, /* 1 chunk */
FNAME, &src_h, 4096, /* fill 4096 byte src file */
SEC_FILE_EXECUTE | SEC_FILE_READ_ATTRIBUTE,
FNAME2, &dest_h, 0, /* 0 byte dest file */
smb2_util_close(tree, dest_h);
/* neither read nor execute permission on src */
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx, 1, /* 1 chunk */
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx, 1, /* 1 chunk */
FNAME, &src_h, 4096, /* fill 4096 byte src file */
SEC_FILE_READ_ATTRIBUTE, FNAME2, &dest_h,
0, /* 0 byte dest file */
/* no write permission on dest */
ok = test_setup_copy_chunk(
- torture, tree, tmp_ctx, 1, /* 1 chunk */
+ torture, tree, tree, tmp_ctx, 1, /* 1 chunk */
FNAME, &src_h, 4096, /* fill 4096 byte src file */
SEC_FILE_READ_DATA | SEC_FILE_READ_ATTRIBUTE, FNAME2, &dest_h,
0, /* 0 byte dest file */
smb2_util_close(tree, dest_h);
/* no read permission on dest */
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx, 1, /* 1 chunk */
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx, 1, /* 1 chunk */
FNAME, &src_h, 4096, /* fill 4096 byte src file */
SEC_FILE_READ_DATA | SEC_FILE_READ_ATTRIBUTE,
FNAME2, &dest_h, 0, /* 0 byte dest file */
bool ok;
/* no read permission on dest with FSCTL_SRV_COPYCHUNK_WRITE */
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
FNAME,
&src_h, 4096, /* fill 4096 byte src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
FNAME,
&src_h, 4096, /* fill 4096 byte src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
2, /* 2 chunks */
FNAME,
&src_h, 8192, /* fill 8192 byte src file */
bool ok;
int i;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
FNAME,
&src_h, 4096, /* fill 4096 byte src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
FNAME,
&src_h, 4096, /* fill 4096 byte src file */
enum ndr_err_code ndr_ret;
bool ok;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
FNAME,
&src_h, 4096, /* fill 4096 byte src file */
enum ndr_err_code ndr_ret;
bool ok = false;
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* 1 chunk */
src_sname,
&src_h, 256, /* fill 256 byte src file */
torture_skip(torture, "Sparse files not supported\n");
}
- ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
+ ok = test_setup_copy_chunk(torture, tree, tree, tmp_ctx,
1, /* chunks */
FNAME,
&src_h, 0, /* src file */