diff options
author | Tim Potter <tpot@samba.org> | 2005-08-09 03:09:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:31:33 -0500 |
commit | 2fa50ab671ba4a7e552e001f0dfde3a7cc330f8e (patch) | |
tree | 9bcfa1d68b66e662b7088a8b1cf423fc8e129b03 /source4/torture/rpc | |
parent | c0e8144c5d1e402b36ebe04b843eba62e7ab9958 (diff) | |
download | samba-2fa50ab671ba4a7e552e001f0dfde3a7cc330f8e.tar.gz samba-2fa50ab671ba4a7e552e001f0dfde3a7cc330f8e.tar.bz2 samba-2fa50ab671ba4a7e552e001f0dfde3a7cc330f8e.zip |
r9222: Rename smb_tree_connect() to smb_raw_tcon() to match other raw function
names.
(This used to be commit 26b191b3c9529b2dae5d004819dab46657064408)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/eventlog.c | 46 | ||||
-rw-r--r-- | source4/torture/rpc/xplogin.c | 2 |
2 files changed, 26 insertions, 22 deletions
diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index 5ce0652729..eebf485e5c 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -54,41 +54,45 @@ static BOOL test_GetNumRecords(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } static BOOL test_ReadEventLog(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - struct policy_handle *handle, uint32_t offset) + struct policy_handle *handle) { NTSTATUS status; struct eventlog_ReadEventLogW r; printf("\ntesting ReadEventLog\n"); + r.in.offset = 0; r.in.handle = handle; r.in.flags = EVENTLOG_BACKWARDS_READ|EVENTLOG_SEQUENTIAL_READ; - r.in.offset = 0; - r.in.number_of_bytes = 0; - status = dcerpc_eventlog_ReadEventLogW(p, mem_ctx, &r); + while (1) { + r.in.number_of_bytes = 0; + r.out.data = NULL; - if (NT_STATUS_IS_OK(r.out.result)) { - /* No data */ - return True; - } + status = dcerpc_eventlog_ReadEventLogW(p, mem_ctx, &r); - if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_BUFFER_TOO_SMALL)) { - printf("ReadEventLog failed - %s\n", nt_errstr(r.out.result)); - return False; - } + if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_END_OF_FILE)) { + break; + } - r.in.number_of_bytes = r.out.real_size; - r.out.data = talloc_size(mem_ctx, r.in.number_of_bytes); + if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_BUFFER_TOO_SMALL)) { + printf("ReadEventLog failed - %s\n", nt_errstr(r.out.result)); + return False; + } + + r.in.number_of_bytes = r.out.real_size; + r.out.data = talloc_size(mem_ctx, r.in.number_of_bytes); - status = dcerpc_eventlog_ReadEventLogW(p, mem_ctx, &r); + status = dcerpc_eventlog_ReadEventLogW(p, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("ReadEventLog failed - %s\n", nt_errstr(status)); - return False; + if (!NT_STATUS_IS_OK(status)) { + printf("ReadEventLog failed - %s\n", nt_errstr(status)); + return False; + } + + r.in.offset++; } - return True; } @@ -168,7 +172,7 @@ static BOOL test_OpenEventLog(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, unknown0.unknown1 = 0x0001; r.in.unknown0 = &unknown0; - init_lsa_String(&r.in.logname, "system"); + init_lsa_String(&r.in.logname, "dns server"); init_lsa_String(&r.in.servername, NULL); r.in.unknown2 = 0x00000001; r.in.unknown3 = 0x00000001; @@ -221,7 +225,7 @@ BOOL torture_rpc_eventlog(void) ret &= test_GetNumRecords(p, mem_ctx, &handle); - ret &= test_ReadEventLog(p, mem_ctx, &handle, 0); + ret &= test_ReadEventLog(p, mem_ctx, &handle); ret &= test_FlushEventLog(p, mem_ctx, &handle); diff --git a/source4/torture/rpc/xplogin.c b/source4/torture/rpc/xplogin.c index acf7a41657..3efbc03f46 100644 --- a/source4/torture/rpc/xplogin.c +++ b/source4/torture/rpc/xplogin.c @@ -147,7 +147,7 @@ static NTSTATUS anon_ipc(struct smbcli_transport *transport, transport->called.name); tcon.tconx.in.device = "IPC"; - status = smb_tree_connect(tree, mem_ctx, &tcon); + status = smb_raw_tcon(tree, mem_ctx, &tcon); if (!NT_STATUS_IS_OK(status)) { talloc_free(tree); |