diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-09-27 16:37:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:24 -0500 |
commit | fc3c05e63f4fedb1532e86d9421490fda6435c79 (patch) | |
tree | f92acca1dfb09c9c299031339c1f4639bb5d4169 | |
parent | eac532ee3af95654b62d4db57feea0df6abab345 (diff) | |
download | samba-fc3c05e63f4fedb1532e86d9421490fda6435c79.tar.gz samba-fc3c05e63f4fedb1532e86d9421490fda6435c79.tar.bz2 samba-fc3c05e63f4fedb1532e86d9421490fda6435c79.zip |
r2696: DCOM updates:
- Start working on OXIDResolver interface
- Add torture test for SimplePing()
(This used to be commit b54d14a01a71082251ff926ab57974c6eb3c0a41)
-rw-r--r-- | source4/librpc/config.m4 | 1 | ||||
-rw-r--r-- | source4/librpc/idl/dcom.idl | 79 | ||||
-rw-r--r-- | source4/librpc/idl/oxidresolver.idl | 95 | ||||
-rw-r--r-- | source4/rpc_server/config.m4 | 1 | ||||
-rw-r--r-- | source4/rpc_server/config.mk | 12 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_tcp.c | 2 | ||||
-rw-r--r-- | source4/rpc_server/dcom/oxidresolver.c | 87 | ||||
-rw-r--r-- | source4/rpc_server/winreg/rpc_winreg.c | 25 |
8 files changed, 212 insertions, 90 deletions
diff --git a/source4/librpc/config.m4 b/source4/librpc/config.m4 index 2b349fe9dc..0cc0a72df5 100644 --- a/source4/librpc/config.m4 +++ b/source4/librpc/config.m4 @@ -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 diff --git a/source4/librpc/idl/dcom.idl b/source4/librpc/idl/dcom.idl index c537a01509..df0bcbc80e 100644 --- a/source4/librpc/idl/dcom.idl +++ b/source4/librpc/idl/dcom.idl @@ -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), diff --git a/source4/librpc/idl/oxidresolver.idl b/source4/librpc/idl/oxidresolver.idl new file mode 100644 index 0000000000..57c5cd439f --- /dev/null +++ b/source4/librpc/idl/oxidresolver.idl @@ -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]); +} diff --git a/source4/rpc_server/config.m4 b/source4/rpc_server/config.m4 index 73cae66456..d4e45177aa 100644 --- a/source4/rpc_server/config.m4 +++ b/source4/rpc_server/config.m4 @@ -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) diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk index dbe8b8344e..779bf997ed 100644 --- a/source4/rpc_server/config.mk +++ b/source4/rpc_server/config.mk @@ -12,6 +12,18 @@ ADD_OBJ_FILES = \ ################################################ ################################################ +# 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] INIT_OBJ_FILES = \ diff --git a/source4/rpc_server/dcerpc_tcp.c b/source4/rpc_server/dcerpc_tcp.c index 9a22c5eb5e..9cbcea5a36 100644 --- a/source4/rpc_server/dcerpc_tcp.c +++ b/source4/rpc_server/dcerpc_tcp.c @@ -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; diff --git a/source4/rpc_server/dcom/oxidresolver.c b/source4/rpc_server/dcom/oxidresolver.c new file mode 100644 index 0000000000..23de6a5d66 --- /dev/null +++ b/source4/rpc_server/dcom/oxidresolver.c @@ -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" diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index 081df230b8..8e7635c894 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -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 |