svn commit: samba r3413 - in branches/SAMBA_4_0/source: librpc/idl
torture torture/rpc
jelmer at samba.org
jelmer at samba.org
Sun Oct 31 18:38:00 GMT 2004
Author: jelmer
Date: 2004-10-31 18:37:59 +0000 (Sun, 31 Oct 2004)
New Revision: 3413
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3413
Log:
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...
Modified:
branches/SAMBA_4_0/source/librpc/idl/dcom.idl
branches/SAMBA_4_0/source/librpc/idl/remact.idl
branches/SAMBA_4_0/source/torture/config.mk
branches/SAMBA_4_0/source/torture/rpc/epmapper.c
branches/SAMBA_4_0/source/torture/torture.c
Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/dcom.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/dcom.idl 2004-10-31 18:35:47 UTC (rev 3412)
+++ branches/SAMBA_4_0/source/librpc/idl/dcom.idl 2004-10-31 18:37:59 UTC (rev 3413)
@@ -480,16 +480,6 @@
}
[
-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")
] interface IMarshal : IUnknown
Modified: branches/SAMBA_4_0/source/librpc/idl/remact.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/remact.idl 2004-10-31 18:35:47 UTC (rev 3412)
+++ branches/SAMBA_4_0/source/librpc/idl/remact.idl 2004-10-31 18:37:59 UTC (rev 3413)
@@ -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 @@
[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[]
);
Modified: branches/SAMBA_4_0/source/torture/config.mk
===================================================================
--- branches/SAMBA_4_0/source/torture/config.mk 2004-10-31 18:35:47 UTC (rev 3412)
+++ branches/SAMBA_4_0/source/torture/config.mk 2004-10-31 18:37:59 UTC (rev 3413)
@@ -68,6 +68,7 @@
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 \
Modified: branches/SAMBA_4_0/source/torture/rpc/epmapper.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/epmapper.c 2004-10-31 18:35:47 UTC (rev 3412)
+++ branches/SAMBA_4_0/source/torture/rpc/epmapper.c 2004-10-31 18:37:59 UTC (rev 3413)
@@ -130,7 +130,8 @@
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 @@
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;
-
- 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;
-
- 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);
- }
+ if (NT_STATUS_IS_ERR(status)) {
+ printf("Error parsing binding string '%s'\n", test_bindings[i]);
+ return False;
}
- }
- 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;
+ 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;
+ }
- 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);
+ 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);
+ }
}
}
}
-
- /* FIXME: Extend to do other protocols as well (ncacn_unix_stream, ncalrpc) */
return True;
}
Modified: branches/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.c 2004-10-31 18:35:47 UTC (rev 3412)
+++ branches/SAMBA_4_0/source/torture/torture.c 2004-10-31 18:37:59 UTC (rev 3413)
@@ -2493,6 +2493,7 @@
{"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},
More information about the samba-cvs
mailing list