summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-09 09:22:31 +0100
committerStefan Metzmacher <metze@samba.org>2008-12-09 13:59:02 +0100
commit03dba698a01e5562bf961a8948fb6e5b2d61fa40 (patch)
treebe9772fb23c1a5e6c2d962d28183b0770b72a646 /source4
parent8608fd87b0ba43e128b984e314047589e607f377 (diff)
downloadsamba-03dba698a01e5562bf961a8948fb6e5b2d61fa40.tar.gz
samba-03dba698a01e5562bf961a8948fb6e5b2d61fa40.tar.bz2
samba-03dba698a01e5562bf961a8948fb6e5b2d61fa40.zip
s4:rpc_server: initialize rpc server module also for the named pipe case
This fixes bug #5878. metze
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/config.mk26
-rw-r--r--source4/rpc_server/dcerpc_server.c34
-rw-r--r--source4/rpc_server/service_rpc.c22
3 files changed, 49 insertions, 33 deletions
diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk
index 2149d682aa..76aa6b938a 100644
--- a/source4/rpc_server/config.mk
+++ b/source4/rpc_server/config.mk
@@ -17,7 +17,7 @@ PUBLIC_HEADERS += $(rpc_serversrcdir)/common/common.h
# Start MODULE dcerpc_rpcecho
[MODULE::dcerpc_rpcecho]
INIT_FUNCTION = dcerpc_server_rpcecho_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = NDR_ECHO
# End MODULE dcerpc_rpcecho
################################################
@@ -28,7 +28,7 @@ dcerpc_rpcecho_OBJ_FILES = $(rpc_serversrcdir)/echo/rpc_echo.o
# Start MODULE dcerpc_epmapper
[MODULE::dcerpc_epmapper]
INIT_FUNCTION = dcerpc_server_epmapper_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = NDR_EPMAPPER
# End MODULE dcerpc_epmapper
################################################
@@ -39,7 +39,7 @@ dcerpc_epmapper_OBJ_FILES = $(rpc_serversrcdir)/epmapper/rpc_epmapper.o
# Start MODULE dcerpc_remote
[MODULE::dcerpc_remote]
INIT_FUNCTION = dcerpc_server_remote_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
LIBCLI_SMB NDR_TABLE
# End MODULE dcerpc_remote
@@ -51,7 +51,7 @@ dcerpc_remote_OBJ_FILES = $(rpc_serversrcdir)/remote/dcesrv_remote.o
# Start MODULE dcerpc_srvsvc
[MODULE::dcerpc_srvsvc]
INIT_FUNCTION = dcerpc_server_srvsvc_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON NDR_SRVSVC share
# End MODULE dcerpc_srvsvc
@@ -66,7 +66,7 @@ $(eval $(call proto_header_template,$(rpc_serversrcdir)/srvsvc/proto.h,$(dcerpc_
# Start MODULE dcerpc_wkssvc
[MODULE::dcerpc_wkssvc]
INIT_FUNCTION = dcerpc_server_wkssvc_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON NDR_WKSSVC
# End MODULE dcerpc_wkssvc
@@ -78,7 +78,7 @@ dcerpc_wkssvc_OBJ_FILES = $(rpc_serversrcdir)/wkssvc/dcesrv_wkssvc.o
# Start MODULE dcerpc_unixinfo
[MODULE::dcerpc_unixinfo]
INIT_FUNCTION = dcerpc_server_unixinfo_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON \
SAMDB \
@@ -94,7 +94,7 @@ dcerpc_unixinfo_OBJ_FILES = $(rpc_serversrcdir)/unixinfo/dcesrv_unixinfo.o
# Start MODULE dcesrv_samr
[MODULE::dcesrv_samr]
INIT_FUNCTION = dcerpc_server_samr_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
SAMDB \
DCERPC_COMMON \
@@ -110,7 +110,7 @@ $(eval $(call proto_header_template,$(rpc_serversrcdir)/samr/proto.h,$(dcesrv_sa
# Start MODULE dcerpc_winreg
[MODULE::dcerpc_winreg]
INIT_FUNCTION = dcerpc_server_winreg_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
OUTPUT_TYPE = MERGED_OBJ
PRIVATE_DEPENDENCIES = \
registry NDR_WINREG
@@ -123,7 +123,7 @@ dcerpc_winreg_OBJ_FILES = $(rpc_serversrcdir)/winreg/rpc_winreg.o
# Start MODULE dcerpc_netlogon
[MODULE::dcerpc_netlogon]
INIT_FUNCTION = dcerpc_server_netlogon_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON \
SCHANNELDB \
@@ -138,7 +138,7 @@ dcerpc_netlogon_OBJ_FILES = $(rpc_serversrcdir)/netlogon/dcerpc_netlogon.o
# Start MODULE dcerpc_lsa
[MODULE::dcerpc_lsarpc]
INIT_FUNCTION = dcerpc_server_lsa_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
SAMDB \
DCERPC_COMMON \
@@ -157,7 +157,7 @@ $(eval $(call proto_header_template,$(rpc_serversrcdir)/lsa/proto.h,$(dcerpc_lsa
# Start MODULE dcerpc_spoolss
[MODULE::dcerpc_spoolss]
INIT_FUNCTION = dcerpc_server_spoolss_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
OUTPUT_TYPE = MERGED_OBJ
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON \
@@ -173,7 +173,7 @@ dcerpc_spoolss_OBJ_FILES = $(rpc_serversrcdir)/spoolss/dcesrv_spoolss.o
# Start MODULE dcerpc_drsuapi
[MODULE::dcerpc_drsuapi]
INIT_FUNCTION = dcerpc_server_drsuapi_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
SAMDB \
DCERPC_COMMON \
@@ -187,7 +187,7 @@ dcerpc_drsuapi_OBJ_FILES = $(rpc_serversrcdir)/drsuapi/dcesrv_drsuapi.o
# Start MODULE dcerpc_browser
[MODULE::dcerpc_browser]
INIT_FUNCTION = dcerpc_server_browser_init
-SUBSYSTEM = DCESRV
+SUBSYSTEM = dcerpc_server
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON \
NDR_BROWSER
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 063e3ff3bd..5d95cb8c87 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -1422,6 +1422,38 @@ const struct dcesrv_endpoint_server *dcesrv_ep_server_byname(const char *name)
return NULL;
}
+void dcerpc_server_init(struct loadparm_context *lp_ctx)
+{
+ static bool initialized;
+ extern NTSTATUS dcerpc_server_wkssvc_init(void);
+ extern NTSTATUS dcerpc_server_drsuapi_init(void);
+ extern NTSTATUS dcerpc_server_winreg_init(void);
+ extern NTSTATUS dcerpc_server_spoolss_init(void);
+ extern NTSTATUS dcerpc_server_epmapper_init(void);
+ extern NTSTATUS dcerpc_server_srvsvc_init(void);
+ extern NTSTATUS dcerpc_server_netlogon_init(void);
+ extern NTSTATUS dcerpc_server_rpcecho_init(void);
+ extern NTSTATUS dcerpc_server_unixinfo_init(void);
+ extern NTSTATUS dcerpc_server_samr_init(void);
+ extern NTSTATUS dcerpc_server_remote_init(void);
+ extern NTSTATUS dcerpc_server_lsa_init(void);
+ extern NTSTATUS dcerpc_server_browser_init(void);
+ init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
+ init_module_fn *shared_init;
+
+ if (initialized) {
+ return;
+ }
+ initialized = true;
+
+ shared_init = load_samba_modules(NULL, lp_ctx, "dcerpc_server");
+
+ run_init_functions(static_init);
+ run_init_functions(shared_init);
+
+ talloc_free(shared_init);
+}
+
/*
return the DCERPC module version, and the size of some critical types
This can be used by endpoint server modules to either detect compilation errors, or provide
@@ -1454,6 +1486,8 @@ _PUBLIC_ NTSTATUS dcesrv_init_ipc_context(TALLOC_CTX *mem_ctx, struct loadparm_c
NTSTATUS status;
struct dcesrv_context *dce_ctx;
+ dcerpc_server_init(lp_ctx);
+
status = dcesrv_init_context(mem_ctx, lp_ctx, lp_dcerpc_endpoint_servers(lp_ctx), &dce_ctx);
NT_STATUS_NOT_OK_RETURN(status);
diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c
index 8b9020d8e7..6c19b2346b 100644
--- a/source4/rpc_server/service_rpc.c
+++ b/source4/rpc_server/service_rpc.c
@@ -425,26 +425,8 @@ static void dcesrv_task_init(struct task_server *task)
NTSTATUS status;
struct dcesrv_context *dce_ctx;
struct dcesrv_endpoint *e;
- extern NTSTATUS dcerpc_server_wkssvc_init(void);
- extern NTSTATUS dcerpc_server_drsuapi_init(void);
- extern NTSTATUS dcerpc_server_winreg_init(void);
- extern NTSTATUS dcerpc_server_spoolss_init(void);
- extern NTSTATUS dcerpc_server_epmapper_init(void);
- extern NTSTATUS dcerpc_server_srvsvc_init(void);
- extern NTSTATUS dcerpc_server_netlogon_init(void);
- extern NTSTATUS dcerpc_server_rpcecho_init(void);
- extern NTSTATUS dcerpc_server_unixinfo_init(void);
- extern NTSTATUS dcerpc_server_samr_init(void);
- extern NTSTATUS dcerpc_server_remote_init(void);
- extern NTSTATUS dcerpc_server_lsa_init(void);
- extern NTSTATUS dcerpc_server_browser_init(void);
- init_module_fn static_init[] = { STATIC_DCESRV_MODULES };
- init_module_fn *shared_init = load_samba_modules(NULL, task->lp_ctx, "dcerpc_server");
-
- run_init_functions(static_init);
- run_init_functions(shared_init);
-
- talloc_free(shared_init);
+
+ dcerpc_server_init(task->lp_ctx);
task_server_set_title(task, "task[dcesrv]");