diff options
47 files changed, 41 insertions, 418 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c index 58075b4c75..cd59190a42 100644 --- a/source4/auth/auth.c +++ b/source4/auth/auth.c @@ -411,7 +411,7 @@ static int num_backends; The 'name' can be later used by other backends to find the operations structure for this backend. */ -static NTSTATUS auth_register(const void *_ops) +NTSTATUS auth_register(const void *_ops) { const struct auth_operations *ops = _ops; struct auth_operations *new_ops; @@ -477,24 +477,6 @@ const struct auth_critical_sizes *auth_interface_version(void) return &critical_sizes; } -/* - initialise the AUTH subsystem -*/ -NTSTATUS auth_init(void) -{ - NTSTATUS status; - - status = register_subsystem("auth", auth_register); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - auth_init_static_modules; - - DEBUG(3,("AUTH subsystem version %d initialised\n", AUTH_INTERFACE_VERSION)); - return status; -} - NTSTATUS server_service_auth_init(void) { return NT_STATUS_OK; diff --git a/source4/auth/auth_builtin.c b/source4/auth/auth_builtin.c index c67b9b6835..56c465cfae 100644 --- a/source4/auth/auth_builtin.c +++ b/source4/auth/auth_builtin.c @@ -177,7 +177,7 @@ NTSTATUS auth_builtin_init(void) ops.name = "guest"; ops.init = auth_init_guest; - ret = register_backend("auth", &ops); + ret = auth_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' auth backend!\n", ops.name)); @@ -187,7 +187,7 @@ NTSTATUS auth_builtin_init(void) #ifdef DEVELOPER ops.name = "name_to_ntstatus"; ops.init = auth_init_name_to_ntstatus; - ret = register_backend("auth", &ops); + ret = auth_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' auth backend!\n", ops.name)); @@ -196,7 +196,7 @@ NTSTATUS auth_builtin_init(void) ops.name = "fixed_challenge"; ops.init = auth_init_fixed_challenge; - ret = register_backend("auth", &ops); + ret = auth_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' auth backend!\n", ops.name)); diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c index 636935e0b9..7cba6e83b3 100644 --- a/source4/auth/auth_sam.c +++ b/source4/auth/auth_sam.c @@ -631,7 +631,7 @@ NTSTATUS auth_sam_init(void) ops.name = "sam"; ops.init = auth_init_sam; - ret = register_backend("auth", &ops); + ret = auth_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' auth backend!\n", ops.name)); @@ -640,7 +640,7 @@ NTSTATUS auth_sam_init(void) ops.name = "sam_ignoredomain"; ops.init = auth_init_sam_ignoredomain; - ret = register_backend("auth", &ops); + ret = auth_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' auth backend!\n", ops.name)); diff --git a/source4/auth/auth_winbind.c b/source4/auth/auth_winbind.c index 2d8cdb72c9..6607295033 100644 --- a/source4/auth/auth_winbind.c +++ b/source4/auth/auth_winbind.c @@ -151,7 +151,7 @@ NTSTATUS auth_winbind_init(void) ops.name = "winbind"; ops.init = auth_init_winbind; - ret = register_backend("auth", &ops); + ret = auth_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' auth backend!\n", ops.name)); diff --git a/source4/auth/config.mk b/source4/auth/config.mk index 65c24ca897..cf794e30a9 100644 --- a/source4/auth/config.mk +++ b/source4/auth/config.mk @@ -37,7 +37,6 @@ REQUIRED_SUBSYSTEMS = \ ####################### # Start SUBSYSTEM AUTH [SUBSYSTEM::AUTH] -INIT_FUNCTION = auth_init INIT_OBJ_FILES = \ auth/auth.o ADD_OBJ_FILES = \ diff --git a/source4/build/pidl/proxy.pm b/source4/build/pidl/proxy.pm index b6d9733419..fabf7cc97e 100644 --- a/source4/build/pidl/proxy.pm +++ b/source4/build/pidl/proxy.pm @@ -66,7 +66,7 @@ sub ParseRegFunc($) GUID_from_string(DCERPC_" . (uc $interface->{NAME}) . "_UUID, &iface.iid); iface.proxy_vtable = talloc_memdup(NULL, &proxy, sizeof(struct dcom_$interface->{NAME}_vtable)); - return register_backend(\"dcom_interface\", &iface); + return dcom_register_interface(&iface); }\n\n"; } diff --git a/source4/build/pidl/server.pm b/source4/build/pidl/server.pm index 6a9ea157a9..2a838ccf48 100644 --- a/source4/build/pidl/server.pm +++ b/source4/build/pidl/server.pm @@ -190,7 +190,7 @@ NTSTATUS dcerpc_server_$name\_init(void) ep_server.interface_by_name = $name\__op_interface_by_name; /* register ourselves with the DCERPC subsystem. */ - ret = register_backend(\"dcerpc\", &ep_server); + ret = dcerpc_register_ep_server(&ep_server); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,(\"Failed to register \'$name\' endpoint server!\\n\")); diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 11e994407e..d0e00c7565 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -98,15 +98,8 @@ sub create_output($) push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); push(@{$part->{LINK_FLAGS}},@{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); - push(@{$part->{MODULE_INIT_FUNCTIONS}}, @{$elem->{INIT_FUNCTION}}) if - $elem->{TYPE} eq "MODULE" and - defined($elem->{INIT_FUNCTION}) and - $elem->{INIT_FUNCTION} ne "" and - $elem->{SUBSYSTEM} eq $part->{NAME}; - push(@{$part->{SUBSYSTEM_INIT_FUNCTIONS}}, @{$elem->{INIT_FUNCTION}}) if $part->{OUTPUT_TYPE} eq "BINARY" and - $elem->{TYPE} eq "SUBSYSTEM" and defined($elem->{INIT_FUNCTION}) and $elem->{INIT_FUNCTION} ne ""; } diff --git a/source4/build/smb_build/smb_build_h.pm b/source4/build/smb_build/smb_build_h.pm index 0f1411dde1..f074f92199 100644 --- a/source4/build/smb_build/smb_build_h.pm +++ b/source4/build/smb_build/smb_build_h.pm @@ -28,34 +28,6 @@ sub _prepare_smb_build_h($) my @defines = (); # - # loop over all subsystems - # - foreach my $key (values %{$depend}) { - next if $key->{TYPE} ne "SUBSYSTEM"; - - my $NAME = $key->{NAME}; - my $DEFINE = (); - my $name = lc($NAME); - - # - # Static modules - # - $DEFINE->{COMMENT} = "SUBSYSTEM $NAME INIT"; - $DEFINE->{KEY} = $name . "_init_static_modules"; - $DEFINE->{VAL} = "do { \\\n"; - foreach my $subkey (@{$key->{MODULE_INIT_FUNCTIONS}}) { - $DEFINE->{VAL} .= "\t\textern NTSTATUS $subkey(void); \\\n"; - } - - foreach my $subkey (@{$key->{MODULE_INIT_FUNCTIONS}}) { - $DEFINE->{VAL} .= "\t\t$subkey(); \\\n"; - } - $DEFINE->{VAL} .= "\t} while(0)"; - - push(@defines,$DEFINE); - } - - # # loop over all binaries # foreach my $key (values %{$depend}) { diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk index 68f41db089..7360eddf94 100644 --- a/source4/lib/basic.mk +++ b/source4/lib/basic.mk @@ -66,7 +66,6 @@ ADD_OBJ_FILES = \ lib/select.o \ lib/pam_errors.o \ intl/lang_tdb.o \ - lib/module.o \ lib/mutex.o \ lib/events.o \ lib/server_mutex.o \ diff --git a/source4/lib/dcom/common/tables.c b/source4/lib/dcom/common/tables.c index d6b7cfa78f..f9f1c49380 100644 --- a/source4/lib/dcom/common/tables.c +++ b/source4/lib/dcom/common/tables.c @@ -72,7 +72,7 @@ const void *dcom_proxy_vtable_by_iid(const struct GUID *iid) return iface->proxy_vtable; } -static NTSTATUS dcom_register_interface(const void *_iface) +NTSTATUS dcom_register_interface(const void *_iface) { const struct dcom_interface *iface = _iface; struct interface_list *l = talloc_zero_p(interfaces, struct interface_list); @@ -84,7 +84,7 @@ static NTSTATUS dcom_register_interface(const void *_iface) return NT_STATUS_OK; } -static NTSTATUS dcom_register_class(const void *_class) +NTSTATUS dcom_register_class(const void *_class) { const struct dcom_class *class = _class; struct class_list *l = talloc_zero_p(classes, struct class_list); @@ -95,20 +95,3 @@ static NTSTATUS dcom_register_class(const void *_class) return NT_STATUS_OK; } - -NTSTATUS libdcom_init(void) -{ - NTSTATUS status; - - status = register_subsystem("dcom_interface", dcom_register_interface); - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - register_subsystem("dcom_class", dcom_register_class); - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - return status; -} diff --git a/source4/lib/dcom/config.mk b/source4/lib/dcom/config.mk index 6ebf16324f..21d90024d4 100644 --- a/source4/lib/dcom/config.mk +++ b/source4/lib/dcom/config.mk @@ -1,7 +1,6 @@ ################################################ # Start SUBSYSTEM LIBDCOM [SUBSYSTEM::LIBDCOM] -INIT_FUNCTION = libdcom_init INIT_OBJ_FILES = \ lib/dcom/common/main.o \ lib/dcom/common/tables.o diff --git a/source4/lib/iconv.c b/source4/lib/iconv.c index 085ec0ec2f..045ed36320 100644 --- a/source4/lib/iconv.c +++ b/source4/lib/iconv.c @@ -73,7 +73,7 @@ static const struct charset_functions builtin_functions[] = { static struct charset_functions *charsets = NULL; -static NTSTATUS charset_register_backend(const void *_funcs) +NTSTATUS charset_register_backend(const void *_funcs) { struct charset_functions *funcs = memdup(_funcs,sizeof(struct charset_functions)); struct charset_functions *c = charsets; @@ -92,22 +92,6 @@ static NTSTATUS charset_register_backend(const void *_funcs) return NT_STATUS_OK; } -static void lazy_initialize_iconv(void) -{ - static BOOL initialized = False; - int i; - - if (!initialized) { - initialized = True; - register_subsystem("charset", charset_register_backend); - - charset_init_static_modules; - - for(i = 0; builtin_functions[i].name; i++) - register_backend("charset", &builtin_functions[i]); - } -} - #ifdef HAVE_NATIVE_ICONV /* if there was an error then reset the internal state, this ensures that we don't have a shift state remaining for @@ -179,7 +163,6 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode) smb_iconv_t ret; struct charset_functions *from, *to; - lazy_initialize_iconv(); from = charsets; to = charsets; diff --git a/source4/lib/module.c b/source4/lib/module.c deleted file mode 100644 index 80360e4e72..0000000000 --- a/source4/lib/module.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - Unix SMB/CIFS implementation. - module loading system - - Copyright (C) Jelmer Vernooij 2002-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" -#include "system/dir.h" -#include "system/filesys.h" -#include "dlinklist.h" - -#ifdef HAVE_DLOPEN - -/* Load module (or directory with modules) recursively. - * Includes running the init_module() function */ -NTSTATUS smb_load_module(const char *module_name) -{ - void *handle; - init_module_function init; - NTSTATUS status; - const char *error; - struct stat st; - DIR *dir; - struct dirent *dirent; - - if(stat(module_name, &st) < 0) { - DEBUG(0, ("Can't stat module '%s'\n", module_name)); - return NT_STATUS_UNSUCCESSFUL; - } - - /* If the argument is a directory, recursively load all files / - * directories in it */ - - /* How about symlinks pointing to themselves - wouldn't we rather - * want to use wildcards here? */ - if(S_ISDIR(st.st_mode)) { - dir = opendir(module_name); - while ((dirent = readdir(dir))) { - smb_load_module(dirent->d_name); - } - } - - /* Always try to use LAZY symbol resolving; if the plugin has - * backwards compatibility, there might be symbols in the - * plugin referencing to old (removed) functions - */ - handle = sys_dlopen(module_name, RTLD_LAZY); - - if(!handle) { - DEBUG(0, ("Error loading module '%s': %s\n", module_name, sys_dlerror())); - return NT_STATUS_UNSUCCESSFUL; - } - - init = (init_module_function)sys_dlsym(handle, "init_module"); - - /* we must check sys_dlerror() to determine if it worked, because - sys_dlsym() can validly return NULL */ - error = sys_dlerror(); - if (error) { - DEBUG(0, ("Error trying to resolve symbol 'init_module' in %s: %s\n", module_name, error)); - return NT_STATUS_UNSUCCESSFUL; - } - - status = init(); - - DEBUG(2, ("Module '%s' loaded\n", module_name)); - - return status; -} - -/* Load all modules in list and return number of - * modules that has been successfully loaded */ -int smb_load_modules(const char **modules) -{ - int i; - int success = 0; - - for(i = 0; modules[i]; i++){ - if(NT_STATUS_IS_OK(smb_load_module(modules[i]))) { - success++; - } - } - - DEBUG(2, ("%d modules successfully loaded\n", success)); - - return success; -} - -#else /* HAVE_DLOPEN */ - -NTSTATUS smb_load_module(const char *module_name) -{ - DEBUG(0,("This samba executable has not been built with plugin support\n")); - return NT_STATUS_NOT_SUPPORTED; -} - -int smb_load_modules(const char **modules) -{ - DEBUG(0,("This samba executable has not been built with plugin support\n")); - return -1; -} - -#endif /* HAVE_DLOPEN */ - -void init_modules(void) -{ - if(lp_preload_modules()) - smb_load_modules(lp_preload_modules()); -} - -struct subsystem { - char *name; - register_backend_function callback; - struct subsystem *prev, *next; -}; - -static struct subsystem *subsystems = NULL; - -NTSTATUS register_subsystem(const char *name, register_backend_function callback) -{ - struct subsystem *s; - struct subsystem *t = subsystems; - - while(t) { - if(!strcmp(name, t->name)) { - /* its already registered! */ - DEBUG(0,("Subsystem '%s' already registered\n", name)); - return NT_STATUS_OBJECT_NAME_COLLISION; - } - t = t->next; - } - - s = smb_xmalloc(sizeof(struct subsystem)); - - s->name = smb_xstrdup(name); - s->callback = callback; - s->prev = s->next = NULL; - - DLIST_ADD(subsystems, s); - - return NT_STATUS_OK; -} - -NTSTATUS register_backend(const char *subsystem, const void *args) -{ - /* Find the specified subsystem */ - struct subsystem *s = subsystems; - - while(s) { - if(!strcmp(subsystem, s->name)) return s->callback(args); - s = s->next; - } - - DEBUG(0, ("Unable to register backend for subsystem '%s'\n", subsystem)); - - return NT_STATUS_NOT_IMPLEMENTED; -} diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index 0399fc26aa..77440cea0f 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -59,21 +59,6 @@ NTSTATUS registry_register(const void *_function) return NT_STATUS_OK; } -NTSTATUS registry_init(void) -{ - NTSTATUS status; - - status = register_subsystem("registry", registry_register); - if (NT_STATUS_IS_ERR(status)) { - DEBUG(0, ("Error registering registry subsystem: %s\n", nt_errstr(status))); - return status; - } - - registry_init_static_modules; - - return NT_STATUS_OK; -} - /* Find a backend in the list of available backends */ static struct reg_init_function_entry *reg_find_backend_entry(const char *name) { diff --git a/source4/lib/registry/config.mk b/source4/lib/registry/config.mk index 9c6ed24148..ec9dbec7db 100644 --- a/source4/lib/registry/config.mk +++ b/source4/lib/registry/config.mk @@ -68,7 +68,6 @@ REQUIRED_SUBSYSTEMS = \ ################################################ # Start SUBSYSTEM REGISTRY [SUBSYSTEM::REGISTRY] -INIT_FUNCTION = registry_init INIT_OBJ_FILES = \ lib/registry/common/reg_interface.o ADD_OBJ_FILES = \ diff --git a/source4/lib/registry/reg_backend_dir/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir/reg_backend_dir.c index 247d723252..8712e7ce7c 100644 --- a/source4/lib/registry/reg_backend_dir/reg_backend_dir.c +++ b/source4/lib/registry/reg_backend_dir/reg_backend_dir.c @@ -144,5 +144,5 @@ static struct registry_operations reg_backend_dir = { NTSTATUS registry_dir_init(void) { - return register_backend("registry", ®_backend_dir); + return registry_register(®_backend_dir); } diff --git a/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c b/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c index 382bc6dba5..fd258ca285 100644 --- a/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c +++ b/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c @@ -189,5 +189,5 @@ static struct registry_operations reg_backend_gconf = { NTSTATUS registry_gconf_init(void) { - return register_backend("registry", ®_backend_gconf); + return registry_register(®_backend_gconf); } diff --git a/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c index 22c81018c7..bdebe34ff4 100644 --- a/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c +++ b/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c @@ -214,5 +214,5 @@ static struct registry_operations reg_backend_ldb = { NTSTATUS registry_ldb_init(void) { - return register_backend("registry", ®_backend_ldb); + return registry_register(®_backend_ldb); } diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c index c1b9b43445..aac6e548a8 100644 --- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c +++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c @@ -1743,5 +1743,5 @@ static struct registry_operations reg_backend_nt4 = { NTSTATUS registry_nt4_init(void) { - return register_backend("registry", ®_backend_nt4); + return registry_register(®_backend_nt4); } diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c index 954e7684bb..47afc31d96 100644 --- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c +++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c @@ -401,5 +401,5 @@ static struct registry_operations reg_backend_rpc = { NTSTATUS registry_rpc_init(void) { - return register_backend("registry", ®_backend_rpc); + return registry_register(®_backend_rpc); } diff --git a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c index 72ec882b8a..fb73e9052c 100644 --- a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c +++ b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c @@ -352,5 +352,5 @@ static struct registry_operations reg_backend_w95 = { NTSTATUS registry_w95_init(void) { - return register_backend("registry", ®_backend_w95); + return registry_register(®_backend_w95); } diff --git a/source4/lib/tdb/config.mk b/source4/lib/tdb/config.mk index bfcd462453..96c2c590cb 100644 --- a/source4/lib/tdb/config.mk +++ b/source4/lib/tdb/config.mk @@ -37,6 +37,7 @@ REQUIRED_SUBSYSTEMS = \ ################################################ # Start BINARY tdbtool [BINARY::tdbtool] +ENABLE = NO OBJ_FILES= \ lib/tdb/tools/tdbtool.o REQUIRED_SUBSYSTEMS = \ diff --git a/source4/libcli/auth/gensec.c b/source4/libcli/auth/gensec.c index 88b1081b11..360a69c0e0 100644 --- a/source4/libcli/auth/gensec.c +++ b/source4/libcli/auth/gensec.c @@ -751,7 +751,7 @@ NTSTATUS gensec_get_password(struct gensec_security *gensec_security, The 'name' can be later used by other backends to find the operations structure for this backend. */ -static NTSTATUS gensec_register(const void *_ops) +NTSTATUS gensec_register(const void *_ops) { const struct gensec_security_ops *ops = _ops; @@ -803,15 +803,6 @@ const struct gensec_critical_sizes *gensec_interface_version(void) */ NTSTATUS gensec_init(void) { - NTSTATUS status = register_subsystem("gensec", gensec_register); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - gensec_init_static_modules; - gensec_dcerpc_schannel_init(); - - DEBUG(3,("GENSEC subsystem version %d initialised\n", GENSEC_INTERFACE_VERSION)); return NT_STATUS_OK; } diff --git a/source4/libcli/auth/gensec_ntlmssp.c b/source4/libcli/auth/gensec_ntlmssp.c index e774efe94e..ee8d1aa79c 100644 --- a/source4/libcli/auth/gensec_ntlmssp.c +++ b/source4/libcli/auth/gensec_ntlmssp.c @@ -419,7 +419,7 @@ static const struct gensec_security_ops gensec_ntlmssp_security_ops = { NTSTATUS gensec_ntlmssp_init(void) { NTSTATUS ret; - ret = register_backend("gensec", &gensec_ntlmssp_security_ops); + ret = gensec_register(&gensec_ntlmssp_security_ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' gensec backend!\n", gensec_ntlmssp_security_ops.name)); diff --git a/source4/libcli/auth/spnego.c b/source4/libcli/auth/spnego.c index ab3aff32bb..bafbf64294 100644 --- a/source4/libcli/auth/spnego.c +++ b/source4/libcli/auth/spnego.c @@ -714,7 +714,7 @@ static const struct gensec_security_ops gensec_spnego_security_ops = { NTSTATUS gensec_spnego_init(void) { NTSTATUS ret; - ret = register_backend("gensec", &gensec_spnego_security_ops); + ret = gensec_register(&gensec_spnego_security_ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' gensec backend!\n", gensec_spnego_security_ops.name)); diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index 1e1bdb8227..4016f2d5d6 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -521,7 +521,7 @@ static const struct gensec_security_ops gensec_dcerpc_schannel_security_ops = { NTSTATUS gensec_dcerpc_schannel_init(void) { NTSTATUS ret; - ret = register_backend("gensec", &gensec_dcerpc_schannel_security_ops); + ret = gensec_register(&gensec_dcerpc_schannel_security_ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register '%s' gensec backend!\n", gensec_dcerpc_schannel_security_ops.name)); diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index ea169b7ee6..bfba31b46f 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -872,7 +872,7 @@ NTSTATUS ntvfs_cifs_init(void) /* register ourselves with the NTVFS subsystem. We register under the name 'cifs'. */ - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register CIFS backend!\n")); diff --git a/source4/ntvfs/config.mk b/source4/ntvfs/config.mk index 14215004ea..43157a8c66 100644 --- a/source4/ntvfs/config.mk +++ b/source4/ntvfs/config.mk @@ -61,7 +61,6 @@ INIT_OBJ_FILES = \ ################################################ # Start SUBSYSTEM NTVFS [SUBSYSTEM::NTVFS] -INIT_FUNCTION = ntvfs_init INIT_OBJ_FILES = \ ntvfs/ntvfs_base.o ADD_OBJ_FILES = \ diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 271be09ac3..a53accd533 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -756,7 +756,7 @@ NTSTATUS ntvfs_ipc_init(void) ops.cancel = ipc_cancel; /* register ourselves with the NTVFS subsystem. */ - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register IPC backend!\n")); diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c index 1bcfda1371..560f4a646b 100644 --- a/source4/ntvfs/nbench/vfs_nbench.c +++ b/source4/ntvfs/nbench/vfs_nbench.c @@ -924,7 +924,7 @@ NTSTATUS ntvfs_nbench_init(void) ops.trans2 = NULL; /* register ourselves with the NTVFS subsystem. */ - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register nbench backend!\n")); diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c index c168467eae..136ef14e4c 100644 --- a/source4/ntvfs/ntvfs_base.c +++ b/source4/ntvfs/ntvfs_base.c @@ -45,7 +45,7 @@ static int num_backends; The 'type' is used to specify whether this is for a disk, printer or IPC$ share */ -static NTSTATUS ntvfs_register(const void *_ops) +NTSTATUS ntvfs_register(const void *_ops) { const struct ntvfs_ops *ops = _ops; struct ntvfs_ops *new_ops; @@ -117,25 +117,6 @@ const struct ntvfs_critical_sizes *ntvfs_interface_version(void) /* - initialise the NTVFS subsystem -*/ -NTSTATUS ntvfs_init(void) -{ - NTSTATUS status; - - status = register_subsystem("ntvfs", ntvfs_register); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - ntvfs_init_static_modules; - - DEBUG(3,("NTVFS subsystem version %d initialised\n", NTVFS_INTERFACE_VERSION)); - return status; -} - - -/* initialise a connection structure to point at a NTVFS backend */ NTSTATUS ntvfs_init_connection(struct smbsrv_request *req, enum ntvfs_type type) diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 39f6717cae..e5712e3e7d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -252,10 +252,10 @@ NTSTATUS ntvfs_posix_init(void) under the name 'default' as we wish to be the default backend, and also register as 'posix' */ ops.name = "default"; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); ops.name = "posix"; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register POSIX backend!\n")); diff --git a/source4/ntvfs/print/vfs_print.c b/source4/ntvfs/print/vfs_print.c index 372f64e982..4e2dfad0ca 100644 --- a/source4/ntvfs/print/vfs_print.c +++ b/source4/ntvfs/print/vfs_print.c @@ -107,7 +107,7 @@ NTSTATUS ntvfs_print_init(void) /* register ourselves with the NTVFS subsystem. We register under the name 'default' as we wish to be the default backend */ - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register PRINT backend!\n")); diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 807f51a43d..57d626465a 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -1006,7 +1006,7 @@ NTSTATUS ntvfs_simple_init(void) ops.type = NTVFS_DISK; ops.name = "simple"; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register simple backend with name: %s!\n", diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c index 7f8f8acf99..4520df59fc 100644 --- a/source4/ntvfs/unixuid/vfs_unixuid.c +++ b/source4/ntvfs/unixuid/vfs_unixuid.c @@ -803,15 +803,15 @@ NTSTATUS ntvfs_unixuid_init(void) /* we register under all 3 backend types, as we are not type specific */ ops.type = NTVFS_DISK; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) goto failed; ops.type = NTVFS_PRINT; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) goto failed; ops.type = NTVFS_IPC; - ret = register_backend("ntvfs", &ops); + ret = ntvfs_register(&ops); if (!NT_STATUS_IS_OK(ret)) goto failed; failed: diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk index 4326120e57..401d8c62fb 100644 --- a/source4/rpc_server/config.mk +++ b/source4/rpc_server/config.mk @@ -190,7 +190,6 @@ 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 83c0872ba7..67baa6281c 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -1100,7 +1100,7 @@ static int num_ep_servers; The 'type' is used to specify whether this is for a disk, printer or IPC$ share */ -static NTSTATUS dcerpc_register_ep_server(const void *_ep_server) +NTSTATUS dcerpc_register_ep_server(const void *_ep_server) { const struct dcesrv_endpoint_server *ep_server = _ep_server; @@ -1166,24 +1166,6 @@ const struct dcesrv_critical_sizes *dcerpc_module_version(void) return &critical_sizes; } -/* - initialise the DCERPC subsystem -*/ -NTSTATUS dcerpc_server_init(void) -{ - NTSTATUS status; - - status = register_subsystem("dcerpc", dcerpc_register_ep_server); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - dcerpc_init_static_modules; - - DEBUG(3,("DCERPC subsystem version %d initialised\n", DCERPC_MODULE_VERSION)); - return NT_STATUS_OK; -} - static const struct server_service_ops dcesrv_ops = { .name = "rpc", .service_init = dcesrv_init, diff --git a/source4/rpc_server/dcom/remact.c b/source4/rpc_server/dcom/remact.c index ce7c9c0c23..e133cb745d 100644 --- a/source4/rpc_server/dcom/remact.c +++ b/source4/rpc_server/dcom/remact.c @@ -75,14 +75,6 @@ static WERROR RemoteActivation(struct dcesrv_call_state *dce_call, TALLOC_CTX *m } -static NTSTATUS register_dcom_class(const void *_c) -{ - const struct dcom_class *class = _c; - /* FIXME */ - - return NT_STATUS_NOT_SUPPORTED; -} - NTSTATUS dcerpc_server_dcom_init(void) { NTSTATUS status; @@ -96,11 +88,6 @@ NTSTATUS dcerpc_server_dcom_init(void) return status; } - status = register_subsystem("dcom", register_dcom_class); - if (NT_STATUS_IS_ERR(status)) { - return status; - } - return NT_STATUS_OK; } diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index fbd6f65a1a..957f5aa1b2 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -200,7 +200,7 @@ NTSTATUS dcerpc_server_remote_init(void) ep_server.interface_by_name = remote_op_interface_by_name; /* register ourselves with the DCERPC subsystem. */ - ret = register_backend("dcerpc", &ep_server); + ret = dcerpc_register_ep_server(&ep_server); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register 'remote' endpoint server!\n")); return ret; diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk index 52e8e69c30..df421326d8 100644 --- a/source4/smbd/config.mk +++ b/source4/smbd/config.mk @@ -43,7 +43,6 @@ REQUIRED_SUBSYSTEMS = \ ####################### # Start SUBSYSTEM SERVICE [SUBSYSTEM::SERVER_SERVICE] -INIT_FUNCTION = server_service_init INIT_OBJ_FILES = \ smbd/service.o REQUIRED_SUBSYSTEMS = \ diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c index 69e321e0c2..2a3efe2088 100644 --- a/source4/smbd/process_model.c +++ b/source4/smbd/process_model.c @@ -54,7 +54,7 @@ static int num_models; The 'name' can be later used by other backends to find the operations structure for this backend. */ -static NTSTATUS register_process_model(const void *_ops) +NTSTATUS register_process_model(const void *_ops) { const struct model_ops *ops = _ops; @@ -114,21 +114,3 @@ const struct process_model_critical_sizes *process_model_version(void) return &critical_sizes; } - -/* - initialise the PROCESS_MODEL subsystem -*/ -NTSTATUS process_model_init(void) -{ - NTSTATUS status; - - status = register_subsystem("process_model", register_process_model); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - process_model_init_static_modules; - - DEBUG(3,("PROCESS subsystem version %d initialised\n", PROCESS_MODEL_VERSION)); - return NT_STATUS_OK; -} diff --git a/source4/smbd/process_model.mk b/source4/smbd/process_model.mk index 70ccddd828..f110cbb8fa 100644 --- a/source4/smbd/process_model.mk +++ b/source4/smbd/process_model.mk @@ -34,7 +34,6 @@ REQUIRED_SUBSYSTEMS = EXT_LIB_PTHREAD ################################################ # Start SUBSYSTEM PROCESS_MODEL [SUBSYSTEM::PROCESS_MODEL] -INIT_FUNCTION = process_model_init INIT_OBJ_FILES = \ smbd/process_model.o # diff --git a/source4/smbd/process_single.c b/source4/smbd/process_single.c index 02d025b29c..da23470303 100644 --- a/source4/smbd/process_single.c +++ b/source4/smbd/process_single.c @@ -111,7 +111,7 @@ NTSTATUS process_model_single_init(void) ops.get_id = single_get_id; /* register ourselves with the PROCESS_MODEL subsystem. */ - ret = register_backend("process_model", &ops); + ret = register_process_model(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register process_model 'single'!\n")); return ret; diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index c794605dc5..3612c6a7f4 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -148,7 +148,7 @@ NTSTATUS process_model_standard_init(void) ops.get_id = standard_get_id; /* register ourselves with the PROCESS_MODEL subsystem. */ - ret = register_backend("process_model", &ops); + ret = register_process_model(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register process_model 'standard'!\n")); return ret; diff --git a/source4/smbd/process_thread.c b/source4/smbd/process_thread.c index 0eead7f33c..8e8ee23aaf 100644 --- a/source4/smbd/process_thread.c +++ b/source4/smbd/process_thread.c @@ -474,7 +474,7 @@ NTSTATUS process_model_thread_init(void) ops.get_id = thread_get_id; /* register ourselves with the PROCESS_MODEL subsystem. */ - ret = register_backend("process_model", &ops); + ret = register_process_model(&ops); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,("Failed to register process_model 'thread'!\n")); return ret; diff --git a/source4/smbd/service.c b/source4/smbd/service.c index fdbd5d0c80..a15bf0105c 100644 --- a/source4/smbd/service.c +++ b/source4/smbd/service.c @@ -313,31 +313,12 @@ const struct server_service_ops *server_service_byname(const char *name) return NULL; } -static NTSTATUS register_server_service_ops(const void *_ops) +NTSTATUS register_server_service_ops(const void *_ops) { return NT_STATUS_NOT_IMPLEMENTED; } /* - initialise the SERVER SERVICE subsystem -*/ -NTSTATUS server_service_init(void) -{ - NTSTATUS status; - - status = register_subsystem("service", register_server_service_ops); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - server_service_init_static_modules; - - DEBUG(3,("SERVER SERVICE subsystem version %d initialised\n", SERVER_SERVICE_VERSION)); - return NT_STATUS_OK; -} - - -/* close all listening sockets. This is called by process models that fork, to ensure that the listen sockets from the parent are closed */ |