1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-02 00:23:50 +03:00

r2696: DCOM updates:

- Start working on OXIDResolver interface
 - Add torture test for SimplePing()
This commit is contained in:
Jelmer Vernooij
2004-09-27 16:37:41 +00:00
committed by Gerald (Jerry) Carter
parent ddd74dae8e
commit b54d14a01a
8 changed files with 212 additions and 90 deletions

View File

@@ -34,6 +34,7 @@ SMB_SUBSYSTEM(LIBNDR_RAW,[],
librpc/gen_ndr/ndr_mgmt.o
librpc/gen_ndr/ndr_protected_storage.o
librpc/gen_ndr/ndr_dcom.o
librpc/gen_ndr/ndr_oxidresolver.o
librpc/gen_ndr/ndr_wzcsvc.o
librpc/gen_ndr/ndr_browser.o
librpc/gen_ndr/ndr_w32time.o

View File

@@ -35,9 +35,6 @@ interface ObjectRpcBaseTypes
// Object Identifer
#define OID HYPER_T
// Ping Set Identifier
#define SETID HYPER_T
// Interface Pointer Identifier
#define IPID GUID
@@ -379,82 +376,6 @@ interface IRemUnknown2 : IRemUnknown
);
}
[
uuid(99fcfec4-5260-101b-bbcb-00aa0021347a),
helpstring("Object Exporter ID Resolver"),
pointer_default(unique)
]
interface IOXIDResolver
{
// Method to get the protocol sequences, string bindings
// and machine id for an object server given its OXID.
typedef [public] struct {
DUALSTRINGARRAY *ppdsaOxidBindings;
} ppdsaOxidBindingsArray;
[idempotent] WERROR ResolveOxid (
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
[out, ref] ppdsaOxidBindingsArray *ppdsaOxidBindings,
[out, ref] IPID *pipidRemUnknown,
[out, ref] uint32 *pAuthnHint
);
// Simple ping is used to ping a Set. Client machines use this
// to inform the object exporter that it is still using the
// members of the set.
// Returns S_TRUE if the SetId is known by the object exporter,
// S_FALSE if not.
[idempotent] WERROR SimplePing (
[in] SETID *pSetId // Must not be zero
);
// Complex ping is used to create sets of OIDs to ping. The
// 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] uint16 SequenceNum,
[in] uint16 cAddToSet,
[in] uint16 cDelFromSet,
// add these OIDs to the set
[in, unique, size_is(cAddToSet)] OID AddToSet[],
//remove these OIDs from the set
[in, unique, size_is(cDelFromSet)] OID DelFromSet[],
[out] uint16 *pPingBackoffFactor// 2^factor = multipler
);
// In some cases the client maybe unsure that a particular
// binding will reach the server. (For example, when the oxid
// bindings have more then one TCP/IP binding) This call
// can be used to validate the binding
// from the client.
[idempotent] WERROR ServerAlive ();
// 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.
[idempotent] WERROR ResolveOxid2 (
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)]
uint16 arRequestedProtseqs[],
[out, ref] ppdsaOxidBindingsArray *ppdsaOxidBindings,
[out, ref] IPID *pipidRemUnknown,
[out, ref] uint32 *pAuthnHint,
[out, ref] COMVERSION *pComVersion
);
[idempotent] WERROR ServerAlive2 (
[out] COMVERSION version,
[out] uint8 unknown1[4],
[out] DUALSTRINGARRAY dualstring,
[out] uint8 unknown2[5]);
}
[
uuid(4d9f4ab8-7d1c-11cf-861e-0020af6e7c57),
version(0.0),

View File

@@ -0,0 +1,95 @@
#include "idl_types.h"
/**
DCOM interfaces
http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm
*/
/*
The OXID Resolver can turn a OXID (Object Exporter ID) into a
RPC binding string that can be used to contact an object
(used by DCOM)
*/
[
uuid(99fcfec4-5260-101b-bbcb-00aa0021347a),
helpstring("Object Exporter ID Resolver"),
endpoints(epmapper, TCP-135),
pointer_default(unique)
]
interface IOXIDResolver
{
#define OXID HYPER_T
#define SETID HYPER_T
#define IPID GUID
#define OID GUID
// Method to get the protocol sequences, string bindings
// and machine id for an object server given its OXID.
typedef [public] struct {
DUALSTRINGARRAY *ppdsaOxidBindings;
} ppdsaOxidBindingsArray;
[idempotent] WERROR ResolveOxid (
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
[out, ref] ppdsaOxidBindingsArray *ppdsaOxidBindings,
[out, ref] IPID *pipidRemUnknown,
[out, ref] uint32 *pAuthnHint
);
// Simple ping is used to ping a Set. Client machines use this
// to inform the object exporter that it is still using the
// members of the set.
// Returns S_TRUE if the SetId is known by the object exporter,
// S_FALSE if not.
[idempotent] WERROR SimplePing (
[in] SETID *SetId // Must not be zero
);
// Complex ping is used to create sets of OIDs to ping. The
// 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] uint16 SequenceNum,
[in] uint16 cAddToSet,
[in] uint16 cDelFromSet,
// add these OIDs to the set
[in, size_is(cAddToSet)] OID AddToSet[],
//remove these OIDs from the set
[in, size_is(cDelFromSet)] OID DelFromSet[],
[out] uint16 *pPingBackoffFactor// 2^factor = multipler
);
// In some cases the client maybe unsure that a particular
// binding will reach the server. (For example, when the oxid
// bindings have more then one TCP/IP binding) This call
// can be used to validate the binding
// from the client.
[idempotent] WERROR ServerAlive ();
// 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.
[idempotent] WERROR ResolveOxid2 (
[in] OXID *pOxid,
[in] uint16 cRequestedProtseqs,
[in, size_is(cRequestedProtseqs)]
uint16 arRequestedProtseqs[],
[out, ref] ppdsaOxidBindingsArray *ppdsaOxidBindings,
[out, ref] IPID *pipidRemUnknown,
[out, ref] uint32 *pAuthnHint,
[out, ref] COMVERSION *pComVersion
);
[idempotent] WERROR ServerAlive2 (
[out] COMVERSION version,
[out] uint8 unknown1[4],
[out] DUALSTRINGARRAY dualstring,
[out] uint8 unknown2[5]);
}

View File

@@ -15,5 +15,6 @@ SMB_MODULE_MK(dcerpc_winreg,DCERPC,STATIC,rpc_server/config.mk)
SMB_MODULE_MK(dcerpc_netlogon,DCERPC,STATIC,rpc_server/config.mk)
SMB_MODULE_MK(dcerpc_lsarpc,DCERPC,STATIC,rpc_server/config.mk)
SMB_MODULE_MK(dcerpc_spoolss,DCERPC,STATIC,rpc_server/config.mk)
SMB_MODULE_MK(dcerpc_IOXIDResolver,DCERPC,STATIC,rpc_server/config.mk)
SMB_SUBSYSTEM_MK(DCERPC,rpc_server/config.mk)

View File

@@ -11,6 +11,18 @@ ADD_OBJ_FILES = \
# End SUBSYSTEM DCERPC_COMMON
################################################
################################################
# Start MODULE dcerpc_IOXIDResolver
[MODULE::dcerpc_IOXIDResolver]
INIT_OBJ_FILES = \
rpc_server/dcom/oxidresolver.o
REQUIRED_SUBSYSTEMS = \
DCERPC_COMMON
# End MODULE dcerpc_IOXIDResolver
################################################
################################################
# Start SUBSYSTEM SAMDB
[SUBSYSTEM::SAMDB]

View File

@@ -78,7 +78,7 @@ static void add_socket_rpc(struct server_service *service,
continue;
}
/* remeber the enpoint of this socket */
/* remember the endpoint of this socket */
dcesrv_sock->endpoint = e;
dcesrv_sock->dcesrv_ctx = dce_ctx;

View File

@@ -0,0 +1,87 @@
/*
Unix SMB/CIFS implementation.
endpoint server for the IOXIDResolver pipe
Copyright (C) Jelmer Vernooij 2004
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "includes.h"
/*
ResolveOxid
*/
static WERROR ResolveOxid(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct ResolveOxid *r)
{
return WERR_NOT_SUPPORTED;
}
/*
SimplePing
*/
static WERROR SimplePing(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct SimplePing *r)
{
return WERR_NOT_SUPPORTED;
}
/*
ComplexPing
*/
static WERROR ComplexPing(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct ComplexPing *r)
{
return WERR_NOT_SUPPORTED;
}
/*
ServerAlive
*/
static WERROR ServerAlive(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct ServerAlive *r)
{
return WERR_NOT_SUPPORTED;
}
/*
ResolveOxid2
*/
static WERROR ResolveOxid2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct ResolveOxid2 *r)
{
return WERR_NOT_SUPPORTED;
}
/*
ServerAlive2
*/
static WERROR ServerAlive2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct ServerAlive2 *r)
{
return WERR_NOT_SUPPORTED;
}
/* include the generated boilerplate */
#include "librpc/gen_ndr/ndr_oxidresolver_s.c"

View File

@@ -52,7 +52,12 @@ static NTSTATUS winreg_bind(struct dcesrv_call_state *dc, const struct dcesrv_in
struct _privatedata *data;
WERROR error;
data = talloc_p(dc->conn, struct _privatedata);
error = reg_open(&data->registry, "dir", "/tmp/reg", "");
error = reg_create(&data->registry);
/* FIXME: This should happen somewhere after configuration... */
reg_import_hive(data->registry, "nt4", "NTUSER.DAT", "", "HKEY_CURRENT_USER");
reg_import_hive(data->registry, "ldb", "ldb:///", "", "HKEY_LOCAL_MACHINE");
if(!W_ERROR_IS_OK(error)) return werror_to_ntstatus(error);
dc->conn->private = data;
return NT_STATUS_OK;
@@ -76,15 +81,15 @@ static NTSTATUS winreg_bind(struct dcesrv_call_state *dc, const struct dcesrv_in
return WERR_OK; \
}
func_winreg_OpenHive(HKCR,"\\HKEY_CLASSES_ROOT")
func_winreg_OpenHive(HKCU,"\\HKEY_CURRENT_USER")
func_winreg_OpenHive(HKLM,"\\HKEY_LOCAL_MACHINE")
func_winreg_OpenHive(HKPD,"\\HKEY_PERFORMANCE_DATA")
func_winreg_OpenHive(HKU,"\\HKEY_USERS")
func_winreg_OpenHive(HKCC,"\\HKEY_CC")
func_winreg_OpenHive(HKDD,"\\HKEY_DD")
func_winreg_OpenHive(HKPT,"\\HKEY_PT")
func_winreg_OpenHive(HKPN,"\\HKEY_PN")
func_winreg_OpenHive(HKCR,"HKEY_CLASSES_ROOT")
func_winreg_OpenHive(HKCU,"HKEY_CURRENT_USER")
func_winreg_OpenHive(HKLM,"HKEY_LOCAL_MACHINE")
func_winreg_OpenHive(HKPD,"HKEY_PERFORMANCE_DATA")
func_winreg_OpenHive(HKU,"HKEY_USERS")
func_winreg_OpenHive(HKCC,"HKEY_CC")
func_winreg_OpenHive(HKDD,"HKEY_DD")
func_winreg_OpenHive(HKPT,"HKEY_PT")
func_winreg_OpenHive(HKPN,"HKEY_PN")
/*
winreg_CloseKey