diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-02-13 17:03:49 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-02-13 17:03:49 +0100 |
commit | 05d58f49df30791e205799366666804d4a9bf47d (patch) | |
tree | 97503bbd04ae20a7aeab14759c96c0eedee13010 /source4/torture | |
parent | 11bc6056ea2eec9eb9a206fa5ae2a2b6b3efe21a (diff) | |
parent | 60e205c34c4a28060f47ba1aa7c7592d33d302bc (diff) | |
download | samba-05d58f49df30791e205799366666804d4a9bf47d.tar.gz samba-05d58f49df30791e205799366666804d4a9bf47d.tar.bz2 samba-05d58f49df30791e205799366666804d4a9bf47d.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-trivial
(This used to be commit b14d61a3b8055b7a8172e18e5bd69e7cab6eacdb)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/eventlog.c | 10 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss.c | 22 | ||||
-rw-r--r-- | source4/torture/smb2/connect.c | 10 | ||||
-rw-r--r-- | source4/torture/smb2/lock.c | 8 | ||||
-rw-r--r-- | source4/torture/smb2/util.c | 40 |
5 files changed, 52 insertions, 38 deletions
diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 047146edaf..feeeb9330b 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -67,11 +67,14 @@ static bool test_GetNumRecords(struct torture_context *tctx, struct dcerpc_pipe struct eventlog_GetNumRecords r; struct eventlog_CloseEventLog cr; struct policy_handle handle; + uint32_t number = 0; if (!get_policy_handle(tctx, p, &handle)) return false; + ZERO_STRUCT(r); r.in.handle = &handle; + r.out.number = &number; torture_assert_ntstatus_ok(tctx, dcerpc_eventlog_GetNumRecords(p, tctx, &r), @@ -98,6 +101,7 @@ static bool test_ReadEventLog(struct torture_context *tctx, if (!get_policy_handle(tctx, p, &handle)) return false; + ZERO_STRUCT(r); r.in.offset = 0; r.in.handle = &handle; r.in.flags = EVENTLOG_BACKWARDS_READ|EVENTLOG_SEQUENTIAL_READ; @@ -107,11 +111,15 @@ static bool test_ReadEventLog(struct torture_context *tctx, struct eventlog_Record rec; struct ndr_pull *ndr; enum ndr_err_code ndr_err; + uint32_t sent_size = 0; + uint32_t real_size = 0; /* Read first for number of bytes in record */ r.in.number_of_bytes = 0; r.out.data = NULL; + r.out.sent_size = &sent_size; + r.out.real_size = &real_size; status = dcerpc_eventlog_ReadEventLogW(p, tctx, &r); @@ -119,8 +127,6 @@ static bool test_ReadEventLog(struct torture_context *tctx, break; } - torture_assert_ntstatus_ok(tctx, status, "ReadEventLog failed"); - torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_BUFFER_TOO_SMALL, "ReadEventLog failed"); diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 23b4aad30b..4a6ff480c4 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1178,16 +1178,23 @@ static bool test_EnumPrinterData(struct torture_context *tctx, struct dcerpc_pip NTSTATUS status; struct spoolss_EnumPrinterData r; + ZERO_STRUCT(r); r.in.handle = handle; r.in.enum_index = 0; do { - uint32_t data_size; - - r.in.value_offered = 0; - data_size = 0; - r.in.data_size = &data_size; - r.out.data_size = &data_size; + uint32_t value_size = 0; + uint32_t data_size = 0; + uint32_t printerdata_type = 0; + DATA_BLOB data = data_blob(NULL,0); + + r.in.value_offered = value_size; + r.out.value_needed = &value_size; + r.in.data_offered = data_size; + r.out.data_needed = &data_size; + + r.out.printerdata_type = &printerdata_type; + r.out.buffer = &data; torture_comment(tctx, "Testing EnumPrinterData\n"); @@ -1195,7 +1202,8 @@ static bool test_EnumPrinterData(struct torture_context *tctx, struct dcerpc_pip torture_assert_ntstatus_ok(tctx, status, "EnumPrinterData failed"); - r.in.value_offered = r.out.value_needed; + r.in.value_offered = value_size; + r.in.data_offered = data_size; status = dcerpc_spoolss_EnumPrinterData(p, tctx, &r); diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c index f1bc63dbbb..0004ea958e 100644 --- a/source4/torture/smb2/connect.c +++ b/source4/torture/smb2/connect.c @@ -147,10 +147,10 @@ static struct smb2_handle torture_smb2_create(struct smb2_tree *tree, TALLOC_CTX *tmp_ctx = talloc_new(tree); ZERO_STRUCT(io); - io.in.oplock_flags = 0; - io.in.access_mask = SEC_RIGHTS_FILE_ALL; - io.in.file_attr = FILE_ATTRIBUTE_NORMAL; - io.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.in.oplock_level = 0; + io.in.desired_access = SEC_RIGHTS_FILE_ALL; + io.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + io.in.create_disposition = NTCREATEX_DISP_OPEN_IF; io.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -166,7 +166,7 @@ static struct smb2_handle torture_smb2_create(struct smb2_tree *tree, if (DEBUGLVL(1)) { printf("Open gave:\n"); - printf("oplock_flags = 0x%x\n", io.out.oplock_flags); + 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)); diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c index 98e412817b..3cf2e93ee0 100644 --- a/source4/torture/smb2/lock.c +++ b/source4/torture/smb2/lock.c @@ -238,10 +238,10 @@ static bool test_lock_read_write(struct torture_context *torture, CHECK_VALUE(lck.out.unknown1, 0); ZERO_STRUCT(cr); - cr.in.oplock_flags = 0; - cr.in.access_mask = SEC_RIGHTS_FILE_ALL; - cr.in.file_attr = FILE_ATTRIBUTE_NORMAL; - cr.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + cr.in.oplock_level = 0; + cr.in.desired_access = SEC_RIGHTS_FILE_ALL; + cr.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + cr.in.create_disposition = NTCREATEX_DISP_OPEN_IF; cr.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c index fe88296a32..219c2140d3 100644 --- a/source4/torture/smb2/util.c +++ b/source4/torture/smb2/util.c @@ -55,9 +55,9 @@ NTSTATUS smb2_util_unlink(struct smb2_tree *tree, const char *fname) NTSTATUS status; ZERO_STRUCT(io); - io.in.access_mask = SEC_RIGHTS_FILE_ALL; - io.in.file_attr = FILE_ATTRIBUTE_NORMAL; - io.in.open_disposition = NTCREATEX_DISP_OPEN; + io.in.desired_access = SEC_RIGHTS_FILE_ALL; + io.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + io.in.create_disposition = NTCREATEX_DISP_OPEN; io.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -107,9 +107,9 @@ static NTSTATUS smb2_create_complex(struct smb2_tree *tree, const char *fname, smb2_util_unlink(tree, fname); ZERO_STRUCT(io); - io.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; - io.in.file_attr = FILE_ATTRIBUTE_NORMAL; - io.in.open_disposition = NTCREATEX_DISP_OVERWRITE_IF; + io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED; + io.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + io.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF; io.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -119,8 +119,8 @@ static NTSTATUS smb2_create_complex(struct smb2_tree *tree, const char *fname, if (dir) { io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; io.in.share_access &= ~NTCREATEX_SHARE_ACCESS_DELETE; - io.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; - io.in.open_disposition = NTCREATEX_DISP_CREATE; + io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY; + io.in.create_disposition = NTCREATEX_DISP_CREATE; } if (strchr(fname, ':') == NULL) { @@ -334,10 +334,10 @@ NTSTATUS torture_smb2_testfile(struct smb2_tree *tree, const char *fname, NTSTATUS status; ZERO_STRUCT(io); - io.in.oplock_flags = 0; - io.in.access_mask = SEC_RIGHTS_FILE_ALL; - io.in.file_attr = FILE_ATTRIBUTE_NORMAL; - io.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.in.oplock_level = 0; + io.in.desired_access = SEC_RIGHTS_FILE_ALL; + io.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + io.in.create_disposition = NTCREATEX_DISP_OPEN_IF; io.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -370,10 +370,10 @@ NTSTATUS torture_smb2_testdir(struct smb2_tree *tree, const char *fname, NTSTATUS status; ZERO_STRUCT(io); - io.in.oplock_flags = 0; - io.in.access_mask = SEC_RIGHTS_DIR_ALL; - io.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; - io.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.in.oplock_level = 0; + io.in.desired_access = SEC_RIGHTS_DIR_ALL; + io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY; + io.in.create_disposition = NTCREATEX_DISP_OPEN_IF; io.in.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE; io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; io.in.fname = fname; @@ -422,10 +422,10 @@ NTSTATUS smb2_util_roothandle(struct smb2_tree *tree, struct smb2_handle *handle NTSTATUS status; ZERO_STRUCT(io); - io.in.oplock_flags = 0; - io.in.access_mask = SEC_STD_SYNCHRONIZE | SEC_DIR_READ_ATTRIBUTE | SEC_DIR_LIST; - io.in.file_attr = 0; - io.in.open_disposition = NTCREATEX_DISP_OPEN; + io.in.oplock_level = 0; + io.in.desired_access = SEC_STD_SYNCHRONIZE | SEC_DIR_READ_ATTRIBUTE | SEC_DIR_LIST; + io.in.file_attributes = 0; + io.in.create_disposition = NTCREATEX_DISP_OPEN; io.in.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_DELETE; io.in.create_options = NTCREATEX_OPTIONS_ASYNC_ALERT; io.in.fname = ""; |