*/
NTSTATUS gensec_init(void)
{
+ static BOOL initialized = False;
+
init_module_fn static_init[] = STATIC_GENSEC_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "gensec");
+ if (initialized) return NT_STATUS_OK;
+ initialized = False;
+
run_init_functions(static_init);
run_init_functions(shared_init);
"LDFLAGS" => "list",
},
"SUBSYSTEM" => {
- "INIT_FUNCTION" => "string",
"OBJ_FILES" => "list",
"REQUIRED_SUBSYSTEMS" => "list",
"MINOR_VERSION" => "string",
"RELEASE_VERSION" => "string",
- "INIT_FUNCTION" => "string",
"OBJ_FILES" => "list",
"DESCRIPTION" => "string",
{
my $depend = shift;
my @defines = ();
- my %declared = ();
my $output = "";
- #
- # loop over all binaries
- #
- foreach my $key (values %{$depend}) {
- next if ($key->{TYPE} ne "BINARY");
-
- my $NAME = $key->{NAME};
- my $DEFINE = ();
- my $name = lc($NAME);
-
- #
- # Static modules
- #
- $DEFINE->{COMMENT} = "BINARY $NAME INIT";
- $DEFINE->{KEY} = $name . "_init_subsystems";
- $DEFINE->{VAL} = "do { \\\n";
- foreach my $subkey (@{$key->{SUBSYSTEM_INIT_FUNCTIONS}}) {
- next if defined($declared{$subkey});
- $output .= "NTSTATUS $subkey(void);\n";
- $declared{$subkey} = 1;
- }
-
- foreach my $subkey (@{$key->{SUBSYSTEM_INIT_FUNCTIONS}}) {
- $DEFINE->{VAL} .= "\t\tif (NT_STATUS_IS_ERR($subkey())) exit(1); \\\n";
- }
- $DEFINE->{VAL} .= "\t} while(0)";
-
- push(@defines,$DEFINE);
- }
-
foreach my $key (values %{$depend}) {
my $DEFINE = ();
next if ($key->{TYPE} ne "LIBRARY" and $key->{TYPE} ne "SUBSYSTEM");
#include "dlinklist.h"
#include "system/readline.h"
#include "pstring.h"
-#include "smb_build.h"
+#include "auth/gensec/gensec.h"
static struct smbcli_state *cli;
static int port = 0;
}
}
- smbclient_init_subsystems;
+ gensec_init();
if(poptPeekArg(pc)) {
pstrcpy(service,poptGetArg(pc));
#include "librpc/gen_ndr/ndr_mgmt.h"
#include "gtk/common/gtk-smb.h"
#include "auth/gensec/gensec.h"
-#include "smb_build.h"
/*
* Show:
int main(int argc, char **argv)
{
- gepdump_init_subsystems;
+ dcerpc_init();
lp_load();
setup_logging(argv[0], DEBUG_STDERR);
#include "includes.h"
#include "lib/registry/registry.h"
#include "gtk/common/gtk-smb.h"
-#include "smb_build.h"
static GtkTreeStore *store_keys;
static GtkListStore *store_vals;
{
int ret;
- gregedit_init_subsystems;
registry_init();
+
lp_load();
setup_logging(argv[0], DEBUG_STDERR);
#include "includes.h"
#include "librpc/gen_ndr/ndr_atsvc.h"
#include "gtk/common/gtk-smb.h"
-#include "smb_build.h"
static struct dcerpc_pipe *at_pipe = NULL;
static GtkWidget *mainwin;
}
-
- int main(int argc, char **argv)
+int main(int argc, char **argv)
{
- gwcrontab_init_subsystems;
+ dcerpc_init();
lp_load();
setup_logging(argv[0], DEBUG_STDERR);
#include "librpc/gen_ndr/ndr_samr.h"
#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
-#include "smb_build.h"
struct policy_handle sam_handle;
struct dcerpc_pipe *sam_pipe = NULL;
return mainwin;
}
-
-
- int main(int argc, char **argv)
+int main(int argc, char **argv)
{
- gwsam_init_subsystems;
lp_load();
setup_logging(argv[0], DEBUG_STDERR);
[SUBSYSTEM::COM]
-INIT_FUNCTION = com_init
OBJ_FILES = \
tables.o \
rot.o \
NTSTATUS com_init(void)
{
- init_module_fn static_init[] = STATIC_COM_MODULES;
- init_module_fn *shared_init = load_samba_modules(NULL, "com");
+ static BOOL initialized = False;
+
+ init_module_fn static_init[] = STATIC_COM_MODULES;
+ init_module_fn *shared_init;
+
+ if (initialized) return NT_STATUS_OK;
+ initialized = True;
+
+ shared_init = load_samba_modules(NULL, "com");
run_init_functions(static_init);
run_init_functions(shared_init);
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
#include "lib/cmdline/popt_common.h"
-#include "smb_build.h"
#include "auth/auth.h"
#endif
};
#ifdef _SAMBA_BUILD_
- ldbsearch_init_subsystems;
+ gensec_init();
+
r = ldb_register_samba_handlers(ldb);
if (r != 0) {
goto failed;
NTSTATUS registry_rpc_init(void)
{
+ dcerpc_init();
return registry_register(®_backend_rpc);
}
#include "includes.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
-#include "smb_build.h"
int main(int argc, char **argv)
{
POPT_TABLEEND
};
- regdiff_init_subsystems;
-
registry_init();
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
#include "includes.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
-#include "smb_build.h"
int main(int argc, char **argv)
{
POPT_TABLEEND
};
- regpatch_init_subsystems;
-
registry_init();
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "system/time.h"
-#include "smb_build.h"
/*
* ck/cd - change key
POPT_TABLEEND
};
- regshell_init_subsystems;
-
registry_init();
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
#include "includes.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
-#include "smb_build.h"
static void print_tree(int l, struct registry_key *p, int fullpath, int novals)
{
POPT_TABLEEND
};
- regtree_init_subsystems;
-
registry_init();
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
@$(PERL) librpc/tables.pl --output=librpc/gen_ndr/tables.c \
librpc/gen_ndr/ndr_*.h
-[SUBSYSTEM::NDR_IFACE_TABLE]
-NOPROTO = YES
-OBJ_FILES = gen_ndr/tables.o
-
[SUBSYSTEM::NDR_ALL]
-INIT_FUNCTION = dcerpc_table_init
-OBJ_FILES = rpc/table.o
-REQUIRED_SUBSYSTEMS = NDR_IFACE_TABLE NDR_AUDIOSRV NDR_ECHO NDR_DCERPC NDR_EXCHANGE \
+OBJ_FILES = rpc/table.o gen_ndr/tables.o
+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_UNIXINFO NDR_SAMR NDR_SPOOLSS NDR_WKSSVC NDR_SRVSVC NDR_ATSVC \
NDR_EVENTLOG NDR_EPMAPPER NDR_DBGIDL NDR_DSSETUP NDR_MSGSVC NDR_WINS \
#include "libcli/composite/composite.h"
#include "auth/gensec/gensec.h"
+NTSTATUS dcerpc_init(void)
+{
+ gensec_init();
+
+ return NT_STATUS_OK;
+}
+
static void dcerpc_ship_next_request(struct dcerpc_connection *c);
/* destroy a dcerpc connection */
NTSTATUS dcerpc_table_init(void)
{
+ static BOOL initialized = False;
+
+ if (initialized) return NT_STATUS_OK;
+ initialized = True;
+
$init_fns
return NT_STATUS_OK;
return ret;
}
+ /* We need the full DCE/RPC interface table */
+ dcerpc_table_init();
+
return ret;
}
*/
int ejs_rpc_init(struct MprVar *obj, const char *name)
{
+ dcerpc_table_init();
+
mprSetStringCFunction(obj, "connect", ejs_rpc_connect);
if (mprGetProperty(obj, "pipe_name", NULL) == NULL) {
mprSetVar(obj, "pipe_name", mprString(name));
#include "lib/appweb/ejs/ejs.h"
#include "lib/appweb/ejs/ejsInternal.h"
#include "scripting/ejs/smbcalls.h"
-#include "smb_build.h"
+#include "auth/gensec/gensec.h"
static EjsId eid;
int exit_status, i;
fault_setup(argv[0]);
- smbscript_init_subsystems;
+ gensec_init();
mprSetCtx(mem_ctx);
lp_load();
#include "registry/registry.h"
#include "ntvfs/ntvfs.h"
#include "ntptr/ntptr.h"
+#include "auth/gensec/gensec.h"
/*
recursively delete a directory tree
exit(1);
}
- smbd_init_subsystems;
+ gensec_init();
registry_init(); /* FIXME: maybe run this in the initialization function
of the winreg RPC server instead? */
char test_data[5];
int i;
+ com_init();
+
com_init_ctx(&ctx, NULL);
dcom_client_init(ctx, cmdline_credentials);
#include "request.h"
#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/ndr_security.h"
-#include "smb_build.h"
+#include "auth/gensec/gensec.h"
#define NSERVERS 2
#define NINSTANCES 2
}
}
- gentest_init_subsystems;
+ gensec_init();
if (username_count == 0) {
usage();
#include "system/filesys.h"
#include "system/time.h"
#include "pstring.h"
-#include "smb_build.h"
+#include "auth/gensec/gensec.h"
static int numops = 1000;
static BOOL showall;
servers[1] = servers[0];
}
- locktest_init_subsystems;
+ gensec_init();
argc -= optind;
argv += optind;
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
#include "pstring.h"
-#include "smb_build.h"
+#include "auth/gensec/gensec.h"
static struct cli_credentials *credentials;
static BOOL showall = False;
}
}
- masktest_init_subsystems;
+ gensec_init();
argc -= optind;
argv += optind;
#include "system/wait.h"
#include "system/filesys.h"
#include "ioctl.h"
-#include "smb_build.h"
int torture_nprocs=4;
int torture_numops=10;
alarm(max_runtime);
}
- smbtorture_init_subsystems;
+ dcerpc_init();
dcerpc_table_init();
#include "lib/cmdline/popt_common.h"
#include "system/iconv.h"
#include "system/filesys.h"
-#include "smb_build.h"
static const struct dcerpc_interface_call *find_function(
const struct dcerpc_interface_table *p,
#include "includes.h"
#include "utils/net/net.h"
#include "lib/cmdline/popt_common.h"
-#include "smb_build.h"
/*
run a function from a function table. If not found then
return net_usage(ctx, argc, argv);
}
- net_init_subsystems;
+ dcerpc_init();
mem_ctx = talloc_init("net_context");
ctx = talloc(mem_ctx, struct net_context);
#include "lib/cmdline/popt_common.h"
#include "auth/auth.h"
#include "pstring.h"
-#include "smb_build.h"
#define SQUID_BUFFER_SIZE 2010
return 1;
}
- ntlm_auth_init_subsystems;
-
+ gensec_init();
if (opt_domain == NULL) {
opt_domain = lp_workgroup();