From a62ade362ff6b4fdf949b31d99199e509cb8d643 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 21 Feb 2005 13:13:21 +0000 Subject: r5487: - Allow disabling modules - Disable all current DCOM functionality (I hope to commit a large bunch of COM and DCOM changes later today) - Make remact and oxidresolver depend on orpc rather then dcom (This used to be commit f298f2a5478a905fe385b8d68318db92ee984374) --- source4/build/smb_build/input.pm | 5 ++ source4/librpc/config.mk | 16 ++-- source4/librpc/ndr/ndr_dcom.c | 173 --------------------------------------- source4/librpc/ndr/ndr_orpc.c | 173 +++++++++++++++++++++++++++++++++++++++ source4/rpc_server/config.mk | 1 + source4/torture/config.mk | 4 +- source4/torture/torture.c | 13 --- 7 files changed, 189 insertions(+), 196 deletions(-) delete mode 100644 source4/librpc/ndr/ndr_dcom.c create mode 100644 source4/librpc/ndr/ndr_orpc.c (limited to 'source4') diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm index c076202ae4..c574b5d4a5 100644 --- a/source4/build/smb_build/input.pm +++ b/source4/build/smb_build/input.pm @@ -77,6 +77,11 @@ sub check_module($$) return; } + if ($mod->{ENABLE} ne "YES") + { + $mod->{CHOSEN_BUILD} = "NOT"; + } + if (not defined($mod->{CHOSEN_BUILD}) or $mod->{CHOSEN_BUILD} eq "DEFAULT") { $mod->{CHOSEN_BUILD} = $mod->{DEFAULT_BUILD}; } diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 95d618227a..086a232343 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -200,32 +200,32 @@ INIT_OBJ_FILES = librpc/gen_ndr/ndr_protected_storage.o NOPROTO = YES REQUIRED_SUBSYSTEMS = LIBNDR -[SUBSYSTEM::NDR_DCOM_MANUAL] -INIT_OBJ_FILES = librpc/ndr/ndr_dcom.o - [SUBSYSTEM::NDR_DCOM] INIT_FUNCTION = dcerpc_dcom_init INIT_OBJ_FILES = librpc/gen_ndr/ndr_dcom.o NOPROTO = YES -REQUIRED_SUBSYSTEMS = LIBNDR NDR_DCOM_MANUAL NDR_ORPC +REQUIRED_SUBSYSTEMS = LIBNDR NDR_ORPC + +[SUBSYSTEM::NDR_ORPC_MANUAL] +INIT_OBJ_FILES = librpc/ndr/ndr_orpc.o [SUBSYSTEM::NDR_ORPC] INIT_FUNCTION = dcerpc_orpc_init INIT_OBJ_FILES = librpc/gen_ndr/ndr_orpc.o NOPROTO = YES -REQUIRES_SUBSYSTEMS = LIBNDR +REQUIRED_SUBSYSTEMS = LIBNDR NDR_ORPC_MANUAL [SUBSYSTEM::NDR_OXIDRESOLVER] INIT_FUNCTION = dcerpc_oxidresolver_init INIT_OBJ_FILES = librpc/gen_ndr/ndr_oxidresolver.o NOPROTO = YES -REQUIRED_SUBSYSTEMS = LIBNDR NDR_DCOM +REQUIRED_SUBSYSTEMS = LIBNDR NDR_ORPC [SUBSYSTEM::NDR_REMACT] INIT_FUNCTION = dcerpc_remact_init INIT_OBJ_FILES = librpc/gen_ndr/ndr_remact.o NOPROTO = YES -REQUIRED_SUBSYSTEMS = LIBNDR NDR_DCOM +REQUIRED_SUBSYSTEMS = LIBNDR NDR_ORPC [SUBSYSTEM::NDR_WZCSVC] INIT_FUNCTION = dcerpc_wzcsvc_init @@ -311,7 +311,7 @@ REQUIRED_SUBSYSTEMS = NDR_AUDIOSRV NDR_ECHO NDR_DCERPC NDR_EXCHANGE \ NDR_DSBACKUP NDR_EFS NDR_MISC NDR_LSA NDR_DFS NDR_DRSUAPI \ NDR_POLICYAGENT NDR_SAMR NDR_SPOOLSS NDR_WKSSVC NDR_SRVSVC NDR_ATSVC \ NDR_EVENTLOG NDR_EPMAPPER NDR_DBGIDL NDR_DSSETUP NDR_MSGSVC NDR_WINS \ - NDR_WINREG NDR_MGMT NDR_PROTECTED_STORAGE NDR_DCOM NDR_OXIDRESOLVER \ + NDR_WINREG NDR_MGMT NDR_PROTECTED_STORAGE NDR_OXIDRESOLVER \ NDR_REMACT NDR_WZCSVC NDR_BROWSER NDR_W32TIME NDR_SCERPC NDR_NTSVCS \ NDR_NETLOGON NDR_TRKWKS NDR_KEYSVC NDR_KRB5PAC NDR_XATTR NDR_SCHANNEL \ NDR_ROT NDR_DRSBLOBS NDR_SVCCTL NDR_NBT NDR_WINSREPL LIB_SECURITY_NDR diff --git a/source4/librpc/ndr/ndr_dcom.c b/source4/librpc/ndr/ndr_dcom.c deleted file mode 100644 index 2a28db4178..0000000000 --- a/source4/librpc/ndr/ndr_dcom.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - routines for marshalling/unmarshalling DCOM string arrays - - 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" - -NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar) -{ - uint16_t num_entries, security_offset; - uint16_t towerid; - uint32_t towernum = 0, conformant_size; - - if (!(ndr_flags & NDR_SCALARS)) { - return NT_STATUS_OK; - } - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &conformant_size)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &security_offset)); - - ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, num_entries); - ar->stringbindings[0] = NULL; - - do { - /* 'Peek' */ - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); - - if (towerid > 0) { - ndr->offset -= 2; - ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2); - ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING); - NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum])); - towernum++; - } - } while (towerid != 0); - - ar->stringbindings[towernum] = NULL; - towernum = 0; - - ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, num_entries); - ar->securitybindings[0] = NULL; - - do { - /* 'Peek' */ - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); - - if (towerid > 0) { - ndr->offset -= 2; - ar->securitybindings = talloc_realloc(ndr, ar->securitybindings, struct SECURITYBINDING *, towernum+2); - ar->securitybindings[towernum] = talloc(ndr, struct SECURITYBINDING); - NDR_CHECK(ndr_pull_SECURITYBINDING(ndr, ndr_flags, ar->securitybindings[towernum])); - towernum++; - } - } while (towerid != 0); - - ar->securitybindings[towernum] = NULL; - - return NT_STATUS_OK; -} - -NTSTATUS ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar) -{ - return NT_STATUS_NOT_SUPPORTED; -} - -/* - print a dom_sid -*/ -void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, struct DUALSTRINGARRAY *ar) -{ - int i; - ndr->print(ndr, "%-25s: DUALSTRINGARRAY", name); - ndr->depth++; - ndr->print(ndr, "STRING BINDINGS"); - ndr->depth++; - for (i=0;ar->stringbindings[i];i++) { - char *idx = NULL; - asprintf(&idx, "[%d]", i); - if (idx) { - ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); - free(idx); - } - } - ndr->depth--; - ndr->print(ndr, "SECURITY BINDINGS"); - ndr->depth++; - for (i=0;ar->securitybindings[i];i++) { - char *idx = NULL; - asprintf(&idx, "[%d]", i); - if (idx) { - ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]); - free(idx); - } - } - ndr->depth--; -} - -NTSTATUS ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRINGARRAY *ar) -{ - uint16_t towerid; - uint32_t towernum = 0; - uint16_t num_entries; - - if (!(ndr_flags & NDR_SCALARS)) { - return NT_STATUS_OK; - } - - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); - - ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, 1); - ar->stringbindings[0] = NULL; - - do { - /* 'Peek' */ - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); - - if (towerid > 0) { - ndr->offset -= 2; - ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2); - ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING); - NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum])); - towernum++; - } - } while (towerid != 0); - - ar->stringbindings[towernum] = NULL; - towernum = 0; - - return NT_STATUS_OK; -} - -NTSTATUS ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct STRINGARRAY *ar) -{ - return NT_STATUS_NOT_SUPPORTED; -} - -/* - print a dom_sid -*/ -void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, struct STRINGARRAY *ar) -{ - int i; - ndr->print(ndr, "%-25s: STRINGARRAY", name); - ndr->depth++; - for (i=0;ar->stringbindings[i];i++) { - char *idx = NULL; - asprintf(&idx, "[%d]", i); - if (idx) { - ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); - free(idx); - } - } - ndr->depth--; -} diff --git a/source4/librpc/ndr/ndr_orpc.c b/source4/librpc/ndr/ndr_orpc.c new file mode 100644 index 0000000000..2a28db4178 --- /dev/null +++ b/source4/librpc/ndr/ndr_orpc.c @@ -0,0 +1,173 @@ +/* + Unix SMB/CIFS implementation. + + routines for marshalling/unmarshalling DCOM string arrays + + 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" + +NTSTATUS ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar) +{ + uint16_t num_entries, security_offset; + uint16_t towerid; + uint32_t towernum = 0, conformant_size; + + if (!(ndr_flags & NDR_SCALARS)) { + return NT_STATUS_OK; + } + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &conformant_size)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &security_offset)); + + ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, num_entries); + ar->stringbindings[0] = NULL; + + do { + /* 'Peek' */ + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); + + if (towerid > 0) { + ndr->offset -= 2; + ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2); + ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING); + NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum])); + towernum++; + } + } while (towerid != 0); + + ar->stringbindings[towernum] = NULL; + towernum = 0; + + ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, num_entries); + ar->securitybindings[0] = NULL; + + do { + /* 'Peek' */ + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); + + if (towerid > 0) { + ndr->offset -= 2; + ar->securitybindings = talloc_realloc(ndr, ar->securitybindings, struct SECURITYBINDING *, towernum+2); + ar->securitybindings[towernum] = talloc(ndr, struct SECURITYBINDING); + NDR_CHECK(ndr_pull_SECURITYBINDING(ndr, ndr_flags, ar->securitybindings[towernum])); + towernum++; + } + } while (towerid != 0); + + ar->securitybindings[towernum] = NULL; + + return NT_STATUS_OK; +} + +NTSTATUS ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + print a dom_sid +*/ +void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, struct DUALSTRINGARRAY *ar) +{ + int i; + ndr->print(ndr, "%-25s: DUALSTRINGARRAY", name); + ndr->depth++; + ndr->print(ndr, "STRING BINDINGS"); + ndr->depth++; + for (i=0;ar->stringbindings[i];i++) { + char *idx = NULL; + asprintf(&idx, "[%d]", i); + if (idx) { + ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); + free(idx); + } + } + ndr->depth--; + ndr->print(ndr, "SECURITY BINDINGS"); + ndr->depth++; + for (i=0;ar->securitybindings[i];i++) { + char *idx = NULL; + asprintf(&idx, "[%d]", i); + if (idx) { + ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]); + free(idx); + } + } + ndr->depth--; +} + +NTSTATUS ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRINGARRAY *ar) +{ + uint16_t towerid; + uint32_t towernum = 0; + uint16_t num_entries; + + if (!(ndr_flags & NDR_SCALARS)) { + return NT_STATUS_OK; + } + + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); + + ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, 1); + ar->stringbindings[0] = NULL; + + do { + /* 'Peek' */ + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); + + if (towerid > 0) { + ndr->offset -= 2; + ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2); + ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING); + NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum])); + towernum++; + } + } while (towerid != 0); + + ar->stringbindings[towernum] = NULL; + towernum = 0; + + return NT_STATUS_OK; +} + +NTSTATUS ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, struct STRINGARRAY *ar) +{ + return NT_STATUS_NOT_SUPPORTED; +} + +/* + print a dom_sid +*/ +void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, struct STRINGARRAY *ar) +{ + int i; + ndr->print(ndr, "%-25s: STRINGARRAY", name); + ndr->depth++; + for (i=0;ar->stringbindings[i];i++) { + char *idx = NULL; + asprintf(&idx, "[%d]", i); + if (idx) { + ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); + free(idx); + } + } + ndr->depth--; +} diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk index 929cc52db6..f58cbd0ac3 100644 --- a/source4/rpc_server/config.mk +++ b/source4/rpc_server/config.mk @@ -14,6 +14,7 @@ ADD_OBJ_FILES = \ ################################################ # Start MODULE dcerpc_dcom [MODULE::dcerpc_dcom] +ENABLE = NO INIT_FUNCTION = dcerpc_server_dcom_init SUBSYSTEM = DCERPC INIT_OBJ_FILES = \ diff --git a/source4/torture/config.mk b/source4/torture/config.mk index 7b61fb9a9a..2a81ac1c7c 100644 --- a/source4/torture/config.mk +++ b/source4/torture/config.mk @@ -106,7 +106,8 @@ REQUIRED_SUBSYSTEMS = \ RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL \ RPC_NDR_MGMT RPC_NDR_NETLOGON RPC_NDR_ATSVC RPC_NDR_DRSUAPI \ RPC_NDR_LSA RPC_NDR_EPMAPPER RPC_NDR_DFS RPC_NDR_SPOOLSS \ - RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP + RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP \ + RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER # End SUBSYSTEM TORTURE_RPC ################################# @@ -190,7 +191,6 @@ REQUIRED_SUBSYSTEMS = \ TORTURE_BASIC \ TORTURE_RAW \ TORTURE_RPC \ - TORTURE_DCOM \ TORTURE_RAP \ TORTURE_AUTH \ TORTURE_LOCAL \ diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 9a1256fc35..ac9af7ed4b 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -123,16 +123,6 @@ BOOL torture_close_connection(struct smbcli_state *c) return ret; } -/* initialise a DCOM context */ -NTSTATUS torture_dcom_init(struct dcom_context **ctx) -{ - dcom_init(ctx, lp_parm_string(-1, "torture", "userdomain"), - lp_parm_string(-1, "torture", "username"), - lp_parm_string(-1, "torture", "password")); - - return NT_STATUS_OK; -} - /* open a rpc connection to the chosen binding string */ NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p, const char *pipe_name, @@ -2417,9 +2407,6 @@ static struct { {"RPC-DSSETUP", torture_rpc_dssetup, 0}, {"RPC-ALTERCONTEXT", torture_rpc_alter_context, 0}, - /* Distributed COM testers */ - {"DCOM-SIMPLE", torture_dcom_simple, 0}, - /* local (no server) testers */ {"LOCAL-NTLMSSP", torture_ntlmssp_self_check, 0}, {"LOCAL-ICONV", torture_local_iconv, 0}, -- cgit