diff options
-rw-r--r-- | source4/librpc/idl/oxidresolver.idl | 7 | ||||
-rw-r--r-- | source4/torture/rpc/oxidresolve.c | 41 |
2 files changed, 40 insertions, 8 deletions
diff --git a/source4/librpc/idl/oxidresolver.idl b/source4/librpc/idl/oxidresolver.idl index d8ec3f56da..4da6f9aa20 100644 --- a/source4/librpc/idl/oxidresolver.idl +++ b/source4/librpc/idl/oxidresolver.idl @@ -54,7 +54,7 @@ interface IOXIDResolver /* whole set can subsequently be pinged using SimplePing, */ /* thus reducing network traffic. */ [idempotent] WERROR ComplexPing ( - [in, out] SETID *pSetId, /* In of 0 on first call for new set. */ + [in, out, ref] SETID *SetId, /* In of 0 on first call for new set. */ [in] uint16 SequenceNum, [in] uint16 cAddToSet, [in] uint16 cDelFromSet, @@ -62,7 +62,7 @@ interface IOXIDResolver [in, size_is(cAddToSet)] OID AddToSet[], /*remove these OIDs from the set */ [in, size_is(cDelFromSet)] OID DelFromSet[], - [out] uint16 *pPingBackoffFactor/* 2^factor = multipler */ + [out] uint16 pPingBackoffFactor/* 2^factor = multipler */ ); /* In some cases the client maybe unsure that a particular */ @@ -75,7 +75,8 @@ interface IOXIDResolver /* Method to get the protocol sequences, string bindings, */ /* RemoteUnknown IPID and COM version for an object server */ /* given its OXID. Supported by DCOM */ - /* version 5.2 and above. */ + /* version 5.2 and above. Looks like that means + * Windows 2003/XP and above */ [idempotent] WERROR ResolveOxid2 ( [in] OXID *pOxid, [in] uint16 cRequestedProtseqs, diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c index 4acaaeecc0..a4ad897baa 100644 --- a/source4/torture/rpc/oxidresolve.c +++ b/source4/torture/rpc/oxidresolve.c @@ -21,13 +21,12 @@ #include "includes.h" -static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T setid) { struct SimplePing r; NTSTATUS status; - HYPER_T h = 10; - r.in.SetId = &h; + r.in.SetId = &setid; status = dcerpc_SimplePing(p, mem_ctx, &r); if(NT_STATUS_IS_ERR(status)) { @@ -43,6 +42,34 @@ static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) return 1; } +static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T *setid) +{ + struct ComplexPing r; + NTSTATUS status; + + *setid = 0; + ZERO_STRUCT(r.in); + + r.in.SequenceNum = 0; + r.in.SetId = setid; + r.out.SetId = setid; + + status = dcerpc_ComplexPing(p, mem_ctx, &r); + if(NT_STATUS_IS_ERR(status)) { + fprintf(stderr, "ComplexPing: %s\n", nt_errstr(status)); + return 0; + } + + if(!W_ERROR_IS_OK(r.out.result)) { + fprintf(stderr, "ComplexPing: %s\n", win_errstr(r.out.result)); + return 0; + } + + + + return 1; +} + static int test_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct ServerAlive r; @@ -88,6 +115,7 @@ BOOL torture_rpc_oxidresolve(void) struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; BOOL ret = True; + HYPER_T setid; mem_ctx = talloc_init("torture_rpc_oxidresolve"); @@ -100,10 +128,13 @@ BOOL torture_rpc_oxidresolve(void) return False; } - if(!test_SimplePing(p, mem_ctx)) + if(!test_ServerAlive(p, mem_ctx)) ret = False; - if(!test_ServerAlive(p, mem_ctx)) + if(!test_ComplexPing(p, mem_ctx, &setid)) + ret = False; + + if(!test_SimplePing(p, mem_ctx, setid)) ret = False; if(!test_ServerAlive2(p, mem_ctx)) |