mirror of
https://github.com/samba-team/samba.git
synced 2025-07-29 15:42:04 +03:00
r12500: Use init functions explicitly in a few more places. 'gensec' and 'librpc'
are the only two subsystems left to convert.
(This used to be commit f6bbc72996
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
6aafed9600
commit
09c44f6cae
@ -5,7 +5,8 @@
|
|||||||
ldb.h belong in $INCLUDEDIR
|
ldb.h belong in $INCLUDEDIR
|
||||||
- add register function to smbtorture
|
- add register function to smbtorture
|
||||||
- init functions per shared library / binary
|
- init functions per shared library / binary
|
||||||
- rpc_ndr
|
- gensec
|
||||||
|
- rpc/ndr ??
|
||||||
- list not automatically generated
|
- list not automatically generated
|
||||||
- utility function for 'init mutex'
|
- utility function for 'init mutex'
|
||||||
- install shared modules
|
- install shared modules
|
||||||
|
@ -967,6 +967,7 @@ int main(int argc, char *argv[])
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
gregedit_init_subsystems;
|
gregedit_init_subsystems;
|
||||||
|
registry_init();
|
||||||
lp_load();
|
lp_load();
|
||||||
load_interfaces();
|
load_interfaces();
|
||||||
setup_logging(argv[0], DEBUG_STDERR);
|
setup_logging(argv[0], DEBUG_STDERR);
|
||||||
|
@ -81,7 +81,6 @@ REQUIRED_SUBSYSTEMS = \
|
|||||||
[LIBRARY::REGISTRY]
|
[LIBRARY::REGISTRY]
|
||||||
MAJOR_VERSION = 0
|
MAJOR_VERSION = 0
|
||||||
MINOR_VERSION = 0
|
MINOR_VERSION = 0
|
||||||
INIT_FUNCTION = registry_init
|
|
||||||
DESCRIPTION = Windows-style registry library
|
DESCRIPTION = Windows-style registry library
|
||||||
RELEASE_VERSION = 1
|
RELEASE_VERSION = 1
|
||||||
OBJ_FILES = \
|
OBJ_FILES = \
|
||||||
|
@ -48,6 +48,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
regdiff_init_subsystems;
|
regdiff_init_subsystems;
|
||||||
|
|
||||||
|
registry_init();
|
||||||
|
|
||||||
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
||||||
|
|
||||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
|
@ -46,6 +46,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
regpatch_init_subsystems;
|
regpatch_init_subsystems;
|
||||||
|
|
||||||
|
registry_init();
|
||||||
|
|
||||||
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
||||||
|
|
||||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
|
@ -419,6 +419,8 @@ static char **reg_completion(const char *text, int start, int end)
|
|||||||
|
|
||||||
regshell_init_subsystems;
|
regshell_init_subsystems;
|
||||||
|
|
||||||
|
registry_init();
|
||||||
|
|
||||||
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
||||||
|
|
||||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
|
@ -101,6 +101,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
regtree_init_subsystems;
|
regtree_init_subsystems;
|
||||||
|
|
||||||
|
registry_init();
|
||||||
|
|
||||||
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
|
||||||
|
|
||||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
|
@ -5,6 +5,6 @@ OBJ_FILES = credentials.o \
|
|||||||
session.o \
|
session.o \
|
||||||
smbencrypt.o
|
smbencrypt.o
|
||||||
REQUIRED_SUBSYSTEMS = \
|
REQUIRED_SUBSYSTEMS = \
|
||||||
AUTH SCHANNELDB GENSEC
|
AUTH SCHANNELDB
|
||||||
# End SUBSYSTEM LIBCLI_AUTH
|
# End SUBSYSTEM LIBCLI_AUTH
|
||||||
#################################
|
#################################
|
||||||
|
@ -546,99 +546,118 @@ REQUIRED_SUBSYSTEMS = LIBNDR RPC_RAW LIBSMB NDR_MISC NDR_DCERPC NDR_SCHANNEL NDR
|
|||||||
# End SUBSYSTEM LIBRPC
|
# End SUBSYSTEM LIBRPC
|
||||||
################################################
|
################################################
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_ECHO]
|
[MODULE::RPC_EJS_ECHO]
|
||||||
INIT_FUNCTION = ejs_init_rpcecho
|
INIT_FUNCTION = ejs_init_rpcecho
|
||||||
OBJ_FILES = gen_ndr/ndr_echo_ejs.o
|
OBJ_FILES = gen_ndr/ndr_echo_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_ECHO
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_ECHO
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_MISC]
|
[MODULE::RPC_EJS_MISC]
|
||||||
INIT_FUNCTION = ejs_init_misc
|
INIT_FUNCTION = ejs_init_misc
|
||||||
OBJ_FILES = gen_ndr/ndr_misc_ejs.o
|
OBJ_FILES = gen_ndr/ndr_misc_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_MISC
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_MISC
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_SAMR]
|
[MODULE::RPC_EJS_SAMR]
|
||||||
INIT_FUNCTION = ejs_init_samr
|
INIT_FUNCTION = ejs_init_samr
|
||||||
OBJ_FILES = gen_ndr/ndr_samr_ejs.o
|
OBJ_FILES = gen_ndr/ndr_samr_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SAMR
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SAMR
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_SECURITY]
|
[MODULE::RPC_EJS_SECURITY]
|
||||||
INIT_FUNCTION = ejs_init_security
|
INIT_FUNCTION = ejs_init_security
|
||||||
OBJ_FILES = gen_ndr/ndr_security_ejs.o
|
OBJ_FILES = gen_ndr/ndr_security_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC LIB_SECURITY_NDR
|
REQUIRED_SUBSYSTEMS = LIBRPC LIB_SECURITY_NDR
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_LSA]
|
[MODULE::RPC_EJS_LSA]
|
||||||
INIT_FUNCTION = ejs_init_lsarpc
|
INIT_FUNCTION = ejs_init_lsarpc
|
||||||
OBJ_FILES = gen_ndr/ndr_lsa_ejs.o
|
OBJ_FILES = gen_ndr/ndr_lsa_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_LSA
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_LSA
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_DFS]
|
[MODULE::RPC_EJS_DFS]
|
||||||
INIT_FUNCTION = ejs_init_dfs
|
INIT_FUNCTION = ejs_init_netdfs
|
||||||
OBJ_FILES = gen_ndr/ndr_dfs_ejs.o
|
OBJ_FILES = gen_ndr/ndr_dfs_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_DFS
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_DFS
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_DRSUAPI]
|
[MODULE::RPC_EJS_DRSUAPI]
|
||||||
INIT_FUNCTION = ejs_init_drsuapi
|
INIT_FUNCTION = ejs_init_drsuapi
|
||||||
OBJ_FILES = gen_ndr/ndr_drsuapi_ejs.o
|
OBJ_FILES = gen_ndr/ndr_drsuapi_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
|
ENABLE = NO
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_DRSUAPI
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_DRSUAPI
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_SPOOLSS]
|
[MODULE::RPC_EJS_SPOOLSS]
|
||||||
INIT_FUNCTION = ejs_init_spoolss
|
INIT_FUNCTION = ejs_init_spoolss
|
||||||
OBJ_FILES = gen_ndr/ndr_spoolss_ejs.o
|
OBJ_FILES = gen_ndr/ndr_spoolss_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
|
ENABLE = NO
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SPOOLSS
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SPOOLSS
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_WKSSVC]
|
[MODULE::RPC_EJS_WKSSVC]
|
||||||
INIT_FUNCTION = ejs_init_wkssvc
|
INIT_FUNCTION = ejs_init_wkssvc
|
||||||
OBJ_FILES = gen_ndr/ndr_wkssvc_ejs.o
|
OBJ_FILES = gen_ndr/ndr_wkssvc_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_WKSSVC
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_WKSSVC
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_SRVSVC]
|
[MODULE::RPC_EJS_SRVSVC]
|
||||||
INIT_FUNCTION = ejs_init_srvsvc
|
INIT_FUNCTION = ejs_init_srvsvc
|
||||||
OBJ_FILES = gen_ndr/ndr_srvsvc_ejs.o
|
OBJ_FILES = gen_ndr/ndr_srvsvc_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SRVSVC
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SRVSVC
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_EVENTLOG]
|
[MODULE::RPC_EJS_EVENTLOG]
|
||||||
INIT_FUNCTION = ejs_init_eventlog
|
INIT_FUNCTION = ejs_init_eventlog
|
||||||
OBJ_FILES = gen_ndr/ndr_eventlog_ejs.o
|
OBJ_FILES = gen_ndr/ndr_eventlog_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_EVENTLOG
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_EVENTLOG
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_WINREG]
|
[MODULE::RPC_EJS_WINREG]
|
||||||
INIT_FUNCTION = ejs_init_winreg
|
INIT_FUNCTION = ejs_init_winreg
|
||||||
OBJ_FILES = gen_ndr/ndr_winreg_ejs.o
|
OBJ_FILES = gen_ndr/ndr_winreg_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_WINREG
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_WINREG
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_INITSHUTDOWN]
|
[MODULE::RPC_EJS_INITSHUTDOWN]
|
||||||
INIT_FUNCTION = ejs_init_initshutdown
|
INIT_FUNCTION = ejs_init_initshutdown
|
||||||
OBJ_FILES = gen_ndr/ndr_initshutdown_ejs.o
|
OBJ_FILES = gen_ndr/ndr_initshutdown_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_INITSHUTDOWN
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_INITSHUTDOWN
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_NETLOGON]
|
[MODULE::RPC_EJS_NETLOGON]
|
||||||
INIT_FUNCTION = ejs_init_netlogon
|
INIT_FUNCTION = ejs_init_netlogon
|
||||||
OBJ_FILES = gen_ndr/ndr_netlogon_ejs.o
|
OBJ_FILES = gen_ndr/ndr_netlogon_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
|
ENABLE = NO
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_NETLOGON
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_NETLOGON
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_SVCCTL]
|
[MODULE::RPC_EJS_SVCCTL]
|
||||||
INIT_FUNCTION = ejs_init_svcctl
|
INIT_FUNCTION = ejs_init_svcctl
|
||||||
OBJ_FILES = gen_ndr/ndr_svcctl_ejs.o
|
OBJ_FILES = gen_ndr/ndr_svcctl_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SVCCTL
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_SVCCTL
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
[SUBSYSTEM::RPC_EJS_IRPC]
|
[MODULE::RPC_EJS_IRPC]
|
||||||
INIT_FUNCTION = ejs_init_irpc
|
INIT_FUNCTION = ejs_init_irpc
|
||||||
OBJ_FILES = gen_ndr/ndr_irpc_ejs.o
|
OBJ_FILES = gen_ndr/ndr_irpc_ejs.o
|
||||||
|
SUBSYSTEM = SMBCALLS
|
||||||
REQUIRED_SUBSYSTEMS = LIBRPC NDR_IRPC
|
REQUIRED_SUBSYSTEMS = LIBRPC NDR_IRPC
|
||||||
NOPROTO = YES
|
NOPROTO = YES
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ REQUIRED_SUBSYSTEMS = \
|
|||||||
################################################
|
################################################
|
||||||
# Start SUBSYSTEM NTPTR
|
# Start SUBSYSTEM NTPTR
|
||||||
[SUBSYSTEM::NTPTR]
|
[SUBSYSTEM::NTPTR]
|
||||||
INIT_FUNCTION = ntptr_init
|
|
||||||
OBJ_FILES = \
|
OBJ_FILES = \
|
||||||
ntptr_base.o \
|
ntptr_base.o \
|
||||||
ntptr_interface.o
|
ntptr_interface.o
|
||||||
|
@ -76,7 +76,6 @@ OBJ_FILES = \
|
|||||||
PUBLIC_HEADERS = ntvfs.h
|
PUBLIC_HEADERS = ntvfs.h
|
||||||
MAJOR_VERSION = 0
|
MAJOR_VERSION = 0
|
||||||
MINOR_VERSION = 0
|
MINOR_VERSION = 0
|
||||||
INIT_FUNCTION = ntvfs_init
|
|
||||||
DESCRIPTION = Virtual File System with NTFS semantics
|
DESCRIPTION = Virtual File System with NTFS semantics
|
||||||
RELEASE_VERSION = 1
|
RELEASE_VERSION = 1
|
||||||
OBJ_FILES = \
|
OBJ_FILES = \
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "lib/appweb/ejs/ejs.h"
|
#include "lib/appweb/ejs/ejs.h"
|
||||||
#include "scripting/ejs/smbcalls.h"
|
#include "scripting/ejs/smbcalls.h"
|
||||||
|
#include "smb_build.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
return the type of a variable
|
return the type of a variable
|
||||||
@ -116,6 +117,9 @@ static int ejs_libinclude(int eid, int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
void smb_setup_ejs_functions(void)
|
void smb_setup_ejs_functions(void)
|
||||||
{
|
{
|
||||||
|
init_module_fn static_init[] = STATIC_SMBCALLS_MODULES;
|
||||||
|
init_module_fn *shared_init;
|
||||||
|
|
||||||
smb_setup_ejs_config();
|
smb_setup_ejs_config();
|
||||||
smb_setup_ejs_ldb();
|
smb_setup_ejs_ldb();
|
||||||
smb_setup_ejs_nbt();
|
smb_setup_ejs_nbt();
|
||||||
@ -131,8 +135,16 @@ void smb_setup_ejs_functions(void)
|
|||||||
smb_setup_ejs_samba3();
|
smb_setup_ejs_samba3();
|
||||||
smb_setup_ejs_param();
|
smb_setup_ejs_param();
|
||||||
smb_setup_ejs_datablob();
|
smb_setup_ejs_datablob();
|
||||||
|
|
||||||
ejsnet_setup();
|
ejsnet_setup();
|
||||||
|
|
||||||
|
shared_init = load_samba_modules(NULL, "ejs");
|
||||||
|
|
||||||
|
run_init_functions(static_init);
|
||||||
|
run_init_functions(shared_init);
|
||||||
|
|
||||||
|
talloc_free(shared_init);
|
||||||
|
|
||||||
ejsDefineCFunction(-1, "typeof", ejs_typeof, NULL, MPR_VAR_SCRIPT_HANDLE);
|
ejsDefineCFunction(-1, "typeof", ejs_typeof, NULL, MPR_VAR_SCRIPT_HANDLE);
|
||||||
ejsDefineStringCFunction(-1, "libinclude", ejs_libinclude, NULL, MPR_VAR_SCRIPT_HANDLE);
|
ejsDefineStringCFunction(-1, "libinclude", ejs_libinclude, NULL, MPR_VAR_SCRIPT_HANDLE);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ REQUIRED_SUBSYSTEMS = EXT_LIB_PTHREAD
|
|||||||
################################################
|
################################################
|
||||||
# Start SUBSYSTEM PROCESS_MODEL
|
# Start SUBSYSTEM PROCESS_MODEL
|
||||||
[SUBSYSTEM::PROCESS_MODEL]
|
[SUBSYSTEM::PROCESS_MODEL]
|
||||||
INIT_FUNCTION = process_model_init
|
|
||||||
OBJ_FILES = \
|
OBJ_FILES = \
|
||||||
process_model.o
|
process_model.o
|
||||||
#
|
#
|
||||||
|
@ -217,6 +217,17 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
|
|||||||
|
|
||||||
smbd_init_subsystems;
|
smbd_init_subsystems;
|
||||||
|
|
||||||
|
registry_init(); /* FIXME: maybe run this in the initialization function
|
||||||
|
of the winreg RPC server instead? */
|
||||||
|
|
||||||
|
ntptr_init(); /* FIXME: maybe run this in the initialization function
|
||||||
|
of the spoolss RPC server instead? */
|
||||||
|
|
||||||
|
ntvfs_init(); /* FIXME: maybe run this in the initialization functions
|
||||||
|
of the SMB[,2] server instead? */
|
||||||
|
|
||||||
|
process_model_init();
|
||||||
|
|
||||||
shared_init = load_samba_modules(NULL, "service");
|
shared_init = load_samba_modules(NULL, "service");
|
||||||
|
|
||||||
run_init_functions(static_init);
|
run_init_functions(static_init);
|
||||||
|
@ -85,6 +85,8 @@ BOOL torture_registry(void)
|
|||||||
BOOL ret = True;
|
BOOL ret = True;
|
||||||
TALLOC_CTX *mem_ctx = talloc_init("torture_registry");
|
TALLOC_CTX *mem_ctx = talloc_init("torture_registry");
|
||||||
|
|
||||||
|
registry_init();
|
||||||
|
|
||||||
ret &= test_hive(mem_ctx, "nt4", "TEST.DAT");
|
ret &= test_hive(mem_ctx, "nt4", "TEST.DAT");
|
||||||
ret &= test_hive(mem_ctx, "ldb", "test.ldb");
|
ret &= test_hive(mem_ctx, "ldb", "test.ldb");
|
||||||
ret &= test_hive(mem_ctx, "gconf", ".");
|
ret &= test_hive(mem_ctx, "gconf", ".");
|
||||||
|
Reference in New Issue
Block a user