1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r3413: RemoteActivation updates and fixes

Add torture test for RemoteActivation
The request is now send correctly and we get back a valid response
from Windows but r->in.Interfaces is set to 0 somewhere while parsing
the response...
This commit is contained in:
Jelmer Vernooij 2004-10-31 18:37:59 +00:00 committed by Gerald (Jerry) Carter
parent ff2f2b4273
commit cabec03422
5 changed files with 41 additions and 70 deletions

View File

@ -479,16 +479,6 @@ object,
[out] uint16 *puArgErr);
}
[
object,
uuid("330E9E75-DF48-11CF-8E2C-00A0C90DC94B"),
pointer_default(unique)
]
interface IDcomEchoServ : IDispatch
{
HRESULT EchoPlusOne([in] uint32 x, [out] uint32 *y);
}
[
object,
uuid("00000003-0000-0000-C000-000000000046")

View File

@ -14,17 +14,19 @@
]
interface IRemoteActivation
{
typedef struct {
/* Looks very much like a protocol tower to me, but it appears
to be aligned differently then it is in epmapper -jelmer
*/
uint8 FIXME[12];
} floor_tmp;
typedef enum
{
RPC_C_IMP_LEVEL_DEFAULT = 0,
RPC_C_IMP_LEVEL_ANONYMOUS = 1,
RPC_C_IMP_LEVEL_IDENTIFY = 2,
RPC_C_IMP_LEVEL_IMPERSONATE = 3,
RPC_C_IMP_LEVEL_DELEGATE = 4
} imp_levels;
const uint32 MODE_GET_CLASS_OBJECT = 0xffffffff;
HRESULT RemoteActivation (
[in] ORPCTHIS ORPCthis,
[out] ORPCTHAT ORPCthat,
WERROR RemoteActivation (
[in] ORPCTHIS this,
[out] ORPCTHAT that,
[in] GUID Clsid,
[in, unique] unistr *pwszObjectName,
[in, unique] MInterfacePointer *pObjectStorage,
@ -33,13 +35,13 @@ interface IRemoteActivation
[in] uint32 Interfaces,
[in, unique,size_is(Interfaces)] GUID *pIIDs,
[in] uint16 num_protseqs,
[in, size_is(num_protseqs)] floor_tmp protseq[],
[in, size_is(num_protseqs)] uint16 protseq[],
[out] HYPER_T pOxid,
[out] DUALSTRINGARRAY *pdsaOxidBindings,
[out] IPID ipidRemUnknown,
[out] uint32 pAuthnHint,
[out] COMVERSION pServerVersion,
[out] HRESULT phr,
[out] uint32 AuthnHint,
[out] COMVERSION ServerVersion,
[out] HRESULT hr,
[out,size_is(Interfaces)] MInterfacePointer ifaces[],
[out,size_is(Interfaces)] HRESULT results[]
);

View File

@ -68,6 +68,7 @@ ADD_OBJ_FILES = \
torture/rpc/epmapper.o \
torture/rpc/winreg.o \
torture/rpc/oxidresolve.o \
torture/rpc/remact.o \
torture/rpc/mgmt.o \
torture/rpc/scanner.o \
torture/rpc/autoidl.o \

View File

@ -130,7 +130,8 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct GUID uuid;
const char *uuid_str;
struct policy_handle handle;
int i;
int i, j;
const char *test_bindings[] = { "ncacn_np:", "ncacn_ip_tcp:", "ncalrpc:", "ncadg_ip_udp:" };
ZERO_STRUCT(uuid);
ZERO_STRUCT(handle);
@ -146,58 +147,34 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
printf("epm_Map results for '%s':\n",
idl_pipe_name(uuid_str, twr->tower.floors[0].lhs.info.uuid.version));
twr->tower.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN;
twr->tower.floors[2].lhs.info.lhs_data = data_blob(NULL, 0);
twr->tower.floors[2].rhs.ncacn.minor_version = 0;
for (i = 0; i < ARRAY_SIZE(test_bindings); i++)
{
struct dcerpc_binding binding;
status = dcerpc_parse_binding(mem_ctx, test_bindings[i], &binding);
twr->tower.floors[3].lhs.protocol = EPM_PROTOCOL_TCP;
twr->tower.floors[3].lhs.info.lhs_data = data_blob(NULL, 0);
twr->tower.floors[3].rhs.tcp.port = 0;
if (NT_STATUS_IS_ERR(status)) {
printf("Error parsing binding string '%s'\n", test_bindings[i]);
return False;
}
twr->tower.floors[4].lhs.protocol = EPM_PROTOCOL_IP;
twr->tower.floors[4].lhs.info.lhs_data = data_blob(NULL, 0);
twr->tower.floors[4].rhs.ip.address = 0;
binding.object = twr->tower.floors[0].lhs.info.uuid.uuid;
binding.object_version = twr->tower.floors[0].lhs.info.uuid.version;
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
for (i=0;i<r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
status = dcerpc_binding_build_tower(mem_ctx, &binding, &twr->tower);
if (NT_STATUS_IS_ERR(status)) {
printf("Error parsing binding string '%s'\n", test_bindings[i]);
return False;
}
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
for (j=0;j<r.out.num_towers;j++) {
if (r.out.towers[j].twr) {
display_tower(mem_ctx, &r.out.towers[j].twr->tower);
}
}
}
}
twr->tower.floors[3].lhs.protocol = EPM_PROTOCOL_HTTP;
twr->tower.floors[3].lhs.info.lhs_data = data_blob(NULL, 0);
twr->tower.floors[3].rhs.http.port = 0;
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
for (i=0;i<r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
}
}
}
twr->tower.floors[3].lhs.protocol = EPM_PROTOCOL_SMB;
twr->tower.floors[3].lhs.info.lhs_data = data_blob(NULL, 0);
twr->tower.floors[3].rhs.smb.unc = "";
twr->tower.floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS;
twr->tower.floors[4].lhs.info.lhs_data = data_blob(NULL, 0);
twr->tower.floors[4].rhs.netbios.name = "";
status = dcerpc_epm_Map(p, mem_ctx, &r);
if (NT_STATUS_IS_OK(status) && r.out.result == 0) {
for (i=0;i<r.out.num_towers;i++) {
if (r.out.towers[i].twr) {
display_tower(mem_ctx, &r.out.towers[i].twr->tower);
}
}
}
/* FIXME: Extend to do other protocols as well (ncacn_unix_stream, ncalrpc) */
return True;
}

View File

@ -2493,6 +2493,7 @@ static struct {
{"RPC-EPMAPPER", torture_rpc_epmapper, 0},
{"RPC-WINREG", torture_rpc_winreg, 0},
{"RPC-OXIDRESOLVE", torture_rpc_oxidresolve, 0},
{"RPC-REMACT", torture_rpc_remact, 0},
{"RPC-MGMT", torture_rpc_mgmt, 0},
{"RPC-SCANNER", torture_rpc_scanner, 0},
{"RPC-AUTOIDL", torture_rpc_autoidl, 0},