summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-06 23:23:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:36 -0500
commit71db46ea665606384f2be1be708c74c97c9adfb2 (patch)
tree24c84e12f4fc925f3ec1e69348493d7222df1e44 /source4/rpc_server
parentb012ab557b8f8a2f58dfbbe8b7818f3e6d8cf38f (diff)
downloadsamba-71db46ea665606384f2be1be708c74c97c9adfb2.tar.gz
samba-71db46ea665606384f2be1be708c74c97c9adfb2.tar.bz2
samba-71db46ea665606384f2be1be708c74c97c9adfb2.zip
r3586: Fix some of the issues with the module init functions.
Both subsystems and modules can now have init functions, which can be specified in .mk files (INIT_FUNCTION = ...) The build system will define : - SUBSYSTEM_init_static_modules that calls the init functions of all statically compiled modules. Failing to load will generate an error which is not fatal - BINARY_init_subsystems that calls the init functions (if defined) for the subsystems the binary depends on This removes the hack with the "static bool Initialised = " and the "lazy_init" functions (This used to be commit 7a8244761bfdfdfb48f8264d76951ebdfbf7bd8a)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/config.mk14
-rw-r--r--source4/rpc_server/dcerpc_server.c9
-rw-r--r--source4/rpc_server/remote/dcesrv_remote.c2
3 files changed, 19 insertions, 6 deletions
diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk
index 784665c80b..a513377077 100644
--- a/source4/rpc_server/config.mk
+++ b/source4/rpc_server/config.mk
@@ -14,6 +14,7 @@ ADD_OBJ_FILES = \
################################################
# Start MODULE dcerpc_IOXIDResolver
[MODULE::dcerpc_IOXIDResolver]
+INIT_FUNCTION = dcerpc_server_IOXIDResolver_init
INIT_OBJ_FILES = \
rpc_server/dcom/oxidresolver.o
REQUIRED_SUBSYSTEMS = \
@@ -24,6 +25,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_IRemoteActivation
[MODULE::dcerpc_IRemoteActivation]
+INIT_FUNCTION = dcerpc_server_IRemoteActivation_init
INIT_OBJ_FILES = \
rpc_server/dcom/remact.o
REQUIRED_SUBSYSTEMS = \
@@ -59,6 +61,7 @@ INIT_OBJ_FILES = \
################################################
# Start MODULE dcerpc_rpcecho
[MODULE::dcerpc_rpcecho]
+INIT_FUNCTION = dcerpc_server_rpcecho_init
INIT_OBJ_FILES = \
rpc_server/echo/rpc_echo.o
# End MODULE dcerpc_rpcecho
@@ -67,6 +70,7 @@ INIT_OBJ_FILES = \
################################################
# Start MODULE dcerpc_epmapper
[MODULE::dcerpc_epmapper]
+INIT_FUNCTION = dcerpc_server_epmapper_init
INIT_OBJ_FILES = \
rpc_server/epmapper/rpc_epmapper.o
# End MODULE dcerpc_epmapper
@@ -75,6 +79,7 @@ INIT_OBJ_FILES = \
################################################
# Start MODULE dcerpc_remote
[MODULE::dcerpc_remote]
+INIT_FUNCTION = dcerpc_server_remote_init
INIT_OBJ_FILES = \
rpc_server/remote/dcesrv_remote.o
REQUIRED_SUBSYSTEMS = \
@@ -85,6 +90,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_srvsvc
[MODULE::dcerpc_srvsvc]
+INIT_FUNCTION = dcerpc_server_srvsvc_init
INIT_OBJ_FILES = \
rpc_server/srvsvc/dcesrv_srvsvc.o
REQUIRED_SUBSYSTEMS = \
@@ -95,6 +101,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_wkssvc
[MODULE::dcerpc_wkssvc]
+INIT_FUNCTION = dcerpc_server_wkssvc_init
INIT_OBJ_FILES = \
rpc_server/wkssvc/dcesrv_wkssvc.o
REQUIRED_SUBSYSTEMS = \
@@ -105,6 +112,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_samr
[MODULE::dcerpc_samr]
+INIT_FUNCTION = dcerpc_server_samr_init
INIT_OBJ_FILES = \
rpc_server/samr/dcesrv_samr.o
ADD_OBJ_FILES = \
@@ -118,6 +126,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_winreg
[MODULE::dcerpc_winreg]
+INIT_FUNCTION = dcerpc_server_winreg_init
INIT_OBJ_FILES = \
rpc_server/winreg/rpc_winreg.o
REQUIRED_SUBSYSTEMS = \
@@ -128,6 +137,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_netlogon
[MODULE::dcerpc_netlogon]
+INIT_FUNCTION = dcerpc_server_netlogon_init
INIT_OBJ_FILES = \
rpc_server/netlogon/dcerpc_netlogon.o
REQUIRED_SUBSYSTEMS = \
@@ -139,6 +149,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_lsa
[MODULE::dcerpc_lsarpc]
+INIT_FUNCTION = dcerpc_server_lsarpc_init
INIT_OBJ_FILES = \
rpc_server/lsa/dcesrv_lsa.o
REQUIRED_SUBSYSTEMS = \
@@ -150,6 +161,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_spoolss
[MODULE::dcerpc_spoolss]
+INIT_FUNCTION = dcerpc_server_spoolss_init
INIT_OBJ_FILES = \
rpc_server/spoolss/dcesrv_spoolss.o \
rpc_server/spoolss/spoolssdb.o
@@ -161,6 +173,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start MODULE dcerpc_drsuapi
[MODULE::dcerpc_drsuapi]
+INIT_FUNCTION = dcerpc_server_drsuapi_init
INIT_OBJ_FILES = \
rpc_server/drsuapi/dcesrv_drsuapi.o
ADD_OBJ_FILES = \
@@ -174,6 +187,7 @@ REQUIRED_SUBSYSTEMS = \
################################################
# Start SUBSYSTEM DCERPC
[SUBSYSTEM::DCERPC]
+INIT_FUNCTION = dcerpc_server_init
INIT_OBJ_FILES = \
rpc_server/dcerpc_server.o
ADD_OBJ_FILES = \
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 3aeb7033d1..70b7d18f39 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -1165,20 +1165,19 @@ const struct dcesrv_critical_sizes *dcerpc_module_version(void)
/*
initialise the DCERPC subsystem
*/
-BOOL subsystem_dcerpc_init(void)
+NTSTATUS dcerpc_server_init(void)
{
NTSTATUS status;
status = register_subsystem("dcerpc", dcerpc_register_ep_server);
if (!NT_STATUS_IS_OK(status)) {
- return False;
+ return status;
}
- /* FIXME: Perhaps panic if a basic endpoint server, such as EPMAPPER, fails to initialise? */
- static_init_dcerpc;
+ dcerpc_init_static_modules;
DEBUG(3,("DCERPC subsystem version %d initialised\n", DCERPC_MODULE_VERSION));
- return True;
+ return NT_STATUS_OK;
}
static const struct server_service_ops dcesrv_ops = {
diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c
index 7bb461bd6f..fbd6f65a1a 100644
--- a/source4/rpc_server/remote/dcesrv_remote.c
+++ b/source4/rpc_server/remote/dcesrv_remote.c
@@ -183,7 +183,7 @@ static BOOL remote_op_interface_by_name(struct dcesrv_interface *iface, const ch
return False;
}
-NTSTATUS dcerpc_remote_init(void)
+NTSTATUS dcerpc_server_remote_init(void)
{
NTSTATUS ret;
struct dcesrv_endpoint_server ep_server;