mirror of
https://github.com/samba-team/samba.git
synced 2025-03-24 10:50:22 +03:00
s4-modules Remove lp_ctx from init functions that no longer need it
Now that we don't allow the smb.conf to change the modules dir, many functions that simply load modules or initialise a subsytem that may load modules no longer need an lp_ctx. Andrew Bartlett
This commit is contained in:
parent
f67a14976b
commit
907cdb5de7
@ -1406,7 +1406,7 @@ bool gensec_setting_bool(struct gensec_settings *settings, const char *mechanism
|
||||
/*
|
||||
initialise the GENSEC subsystem
|
||||
*/
|
||||
_PUBLIC_ NTSTATUS gensec_init(struct loadparm_context *lp_ctx)
|
||||
_PUBLIC_ NTSTATUS gensec_init(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
@ -1417,7 +1417,7 @@ _PUBLIC_ NTSTATUS gensec_init(struct loadparm_context *lp_ctx)
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
||||
shared_init = load_samba_modules(NULL, lp_ctx, "gensec");
|
||||
shared_init = load_samba_modules(NULL, "gensec");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -242,7 +242,7 @@ NTSTATUS gensec_start_mech_by_oid(struct gensec_security *gensec_security,
|
||||
const char *mech_oid);
|
||||
const char *gensec_get_name_by_oid(struct gensec_security *gensec_security, const char *oid_string);
|
||||
struct cli_credentials *gensec_get_credentials(struct gensec_security *gensec_security);
|
||||
NTSTATUS gensec_init(struct loadparm_context *lp_ctx);
|
||||
NTSTATUS gensec_init(void);
|
||||
NTSTATUS gensec_unseal_packet(struct gensec_security *gensec_security,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint8_t *data, size_t length,
|
||||
|
@ -127,7 +127,7 @@ static PyObject *py_gensec_start_client(PyTypeObject *type, PyObject *args, PyOb
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = gensec_init(settings->lp_ctx);
|
||||
status = gensec_init();
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
PyObject_DEL(self);
|
||||
@ -210,7 +210,7 @@ static PyObject *py_gensec_start_server(PyTypeObject *type, PyObject *args, PyOb
|
||||
}
|
||||
}
|
||||
|
||||
status = gensec_init(settings->lp_ctx);
|
||||
status = gensec_init();
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
PyObject_DEL(self);
|
||||
|
@ -597,7 +597,7 @@ int main(int argc, const char ** argv)
|
||||
|
||||
ev = s4_event_context_init(talloc_autofree_context());
|
||||
|
||||
gensec_init(cmdline_lp_ctx);
|
||||
gensec_init();
|
||||
dump_args();
|
||||
|
||||
if (check_arg_numeric("ibs") == 0 || check_arg_numeric("ibs") == 0) {
|
||||
|
@ -3233,7 +3233,7 @@ static int do_message_op(const char *netbios_name, const char *desthost,
|
||||
}
|
||||
}
|
||||
|
||||
gensec_init(cmdline_lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
if(poptPeekArg(pc)) {
|
||||
char *s = strdup(poptGetArg(pc));
|
||||
|
@ -82,7 +82,7 @@ static int extensions_hook(struct ldb_context *ldb, enum ldb_module_hook_type t)
|
||||
if (r != LDB_SUCCESS) {
|
||||
return ldb_operr(ldb);
|
||||
}
|
||||
gensec_init(cmdline_lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
if (ldb_set_opaque(ldb, "sessionInfo", system_session(cmdline_lp_ctx))) {
|
||||
return ldb_operr(ldb);
|
||||
|
@ -485,7 +485,7 @@ _PUBLIC_ WERROR reg_open_remote(struct registry_context **ctx,
|
||||
struct dcerpc_pipe *p;
|
||||
struct rpc_registry_context *rctx;
|
||||
|
||||
dcerpc_init(lp_ctx);
|
||||
dcerpc_init();
|
||||
|
||||
rctx = talloc(NULL, struct rpc_registry_context);
|
||||
W_ERROR_HAVE_NO_MEMORY(rctx);
|
||||
|
@ -221,7 +221,7 @@ _PUBLIC_ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
|
||||
NULL
|
||||
};
|
||||
|
||||
gensec_init(lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
status = gensec_client_start(conn, &conn->gensec,
|
||||
conn->event.event_ctx,
|
||||
|
@ -43,7 +43,7 @@ struct libnet_context *libnet_context_init(struct tevent_context *ev,
|
||||
ctx->lp_ctx = lp_ctx;
|
||||
|
||||
/* make sure dcerpc is initialized */
|
||||
dcerpc_init(lp_ctx);
|
||||
dcerpc_init();
|
||||
|
||||
/* name resolution methods */
|
||||
ctx->resolve_ctx = lpcfg_resolve_context(lp_ctx);
|
||||
|
@ -76,9 +76,9 @@ struct rpc_request {
|
||||
} async;
|
||||
};
|
||||
|
||||
_PUBLIC_ NTSTATUS dcerpc_init(struct loadparm_context *lp_ctx)
|
||||
_PUBLIC_ NTSTATUS dcerpc_init()
|
||||
{
|
||||
return gensec_init(lp_ctx);
|
||||
return gensec_init();
|
||||
}
|
||||
|
||||
static void dcerpc_connection_dead(struct dcecli_connection *conn, NTSTATUS status);
|
||||
|
@ -198,7 +198,7 @@ NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
|
||||
struct loadparm_context *lp_ctx,
|
||||
uint8_t auth_level);
|
||||
struct tevent_context *dcerpc_event_context(struct dcerpc_pipe *p);
|
||||
NTSTATUS dcerpc_init(struct loadparm_context *lp_ctx);
|
||||
NTSTATUS dcerpc_init(void);
|
||||
struct smbcli_tree *dcerpc_smb_tree(struct dcecli_connection *c);
|
||||
uint16_t dcerpc_smb_fnum(struct dcecli_connection *c);
|
||||
NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
|
||||
|
@ -119,7 +119,7 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = dcerpc_init(lp_ctx);
|
||||
status = dcerpc_init();
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
talloc_free(mem_ctx);
|
||||
|
@ -68,12 +68,12 @@ NTSTATUS ntptr_register(const void *_ops)
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
NTSTATUS ntptr_init(struct loadparm_context *lp_ctx)
|
||||
NTSTATUS ntptr_init(void)
|
||||
{
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_ntptr_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_ntptr_MODULES };
|
||||
init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "ntptr");
|
||||
init_module_fn *shared_init = load_samba_modules(NULL, "ntptr");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -235,7 +235,7 @@ NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
||||
shared_init = load_samba_modules(NULL, lp_ctx, "ntvfs");
|
||||
shared_init = load_samba_modules(NULL, "ntvfs");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -89,7 +89,7 @@ const struct pvfs_acl_ops *pvfs_acl_backend_byname(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NTSTATUS pvfs_acl_init(struct loadparm_context *lp_ctx)
|
||||
NTSTATUS pvfs_acl_init(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
@ -100,7 +100,7 @@ NTSTATUS pvfs_acl_init(struct loadparm_context *lp_ctx)
|
||||
if (initialized) return NT_STATUS_OK;
|
||||
initialized = true;
|
||||
|
||||
shared_init = load_samba_modules(NULL, lp_ctx, "pvfs_acl");
|
||||
shared_init = load_samba_modules(NULL, "pvfs_acl");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -212,7 +212,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
|
||||
* TODO: call this from ntvfs_posix_init()
|
||||
* but currently we don't have a lp_ctx there
|
||||
*/
|
||||
status = pvfs_acl_init(ntvfs->ctx->lp_ctx);
|
||||
status = pvfs_acl_init();
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
pvfs = talloc_zero(ntvfs, struct pvfs_state);
|
||||
|
@ -324,7 +324,7 @@ bool run_init_functions(init_module_fn *fns);
|
||||
*
|
||||
* Will return an array of function pointers to initialization functions
|
||||
*/
|
||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem);
|
||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem);
|
||||
const char *lpcfg_imessaging_path(TALLOC_CTX *mem_ctx,
|
||||
struct loadparm_context *lp_ctx);
|
||||
struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx,
|
||||
|
@ -272,7 +272,7 @@ bool run_init_functions(init_module_fn *fns)
|
||||
* Will return an array of function pointers to initialization functions
|
||||
*/
|
||||
|
||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem)
|
||||
init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem)
|
||||
{
|
||||
char *path = modules_path(mem_ctx, subsystem);
|
||||
init_module_fn *ret;
|
||||
|
@ -1235,7 +1235,7 @@ void dcerpc_server_init(struct loadparm_context *lp_ctx)
|
||||
}
|
||||
initialized = true;
|
||||
|
||||
shared_init = load_samba_modules(NULL, lp_ctx, "dcerpc_server");
|
||||
shared_init = load_samba_modules(NULL, "dcerpc_server");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -299,7 +299,7 @@ static int binary_net(int argc, const char **argv)
|
||||
|
||||
setlinebuf(stdout);
|
||||
|
||||
dcerpc_init(cmdline_lp_ctx);
|
||||
dcerpc_init();
|
||||
|
||||
ev = s4_event_context_init(NULL);
|
||||
if (!ev) {
|
||||
|
@ -111,7 +111,7 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
|
||||
}
|
||||
initialised = true;
|
||||
|
||||
shared_init = load_samba_modules(NULL, lp_ctx, "process_model");
|
||||
shared_init = load_samba_modules(NULL, "process_model");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -401,9 +401,9 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
|
||||
}
|
||||
}
|
||||
|
||||
gensec_init(cmdline_lp_ctx); /* FIXME: */
|
||||
gensec_init(); /* FIXME: */
|
||||
|
||||
ntptr_init(cmdline_lp_ctx); /* FIXME: maybe run this in the initialization function
|
||||
ntptr_init(); /* FIXME: maybe run this in the initialization function
|
||||
of the spoolss RPC server instead? */
|
||||
|
||||
ntvfs_init(cmdline_lp_ctx); /* FIXME: maybe run this in the initialization functions
|
||||
@ -411,7 +411,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
|
||||
|
||||
process_model_init(cmdline_lp_ctx);
|
||||
|
||||
shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "service");
|
||||
shared_init = load_samba_modules(NULL, "service");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -3247,7 +3247,7 @@ static bool split_unc_name(const char *unc, char **server, char **share)
|
||||
|
||||
ev = s4_event_context_init(talloc_autofree_context());
|
||||
|
||||
gensec_init(lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
ret = start_gentest(ev, lp_ctx);
|
||||
|
||||
|
@ -644,7 +644,7 @@ static void usage(poptContext pc)
|
||||
|
||||
ev = s4_event_context_init(talloc_autofree_context());
|
||||
|
||||
gensec_init(lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
DEBUG(0,("seed=%u base=%d range=%d min_length=%d\n",
|
||||
seed, lock_base, lock_range, min_length));
|
||||
|
@ -360,7 +360,7 @@ static void usage(poptContext pc)
|
||||
|
||||
ev = s4_event_context_init(mem_ctx);
|
||||
|
||||
gensec_init(lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
lpcfg_smbcli_options(lp_ctx, &options);
|
||||
lpcfg_smbcli_session_options(lp_ctx, &session_options);
|
||||
|
@ -75,7 +75,7 @@ _PUBLIC_ NTSTATUS torture_rpc_connection(struct torture_context *tctx,
|
||||
NTSTATUS status;
|
||||
struct dcerpc_binding *binding;
|
||||
|
||||
dcerpc_init(tctx->lp_ctx);
|
||||
dcerpc_init();
|
||||
|
||||
status = torture_rpc_binding(tctx, &binding);
|
||||
if (NT_STATUS_IS_ERR(status))
|
||||
|
@ -686,7 +686,7 @@ int main(int argc,char *argv[])
|
||||
|
||||
torture->lp_ctx = cmdline_lp_ctx;
|
||||
|
||||
gensec_init(cmdline_lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
if (shell) {
|
||||
/* In shell mode, just ignore any remaining test names. */
|
||||
|
@ -62,7 +62,7 @@ _PUBLIC_ int torture_init(void)
|
||||
#define _MODULE_PROTO(init) extern NTSTATUS init(void);
|
||||
STATIC_smbtorture_MODULES_PROTO;
|
||||
init_module_fn static_init[] = { STATIC_smbtorture_MODULES };
|
||||
init_module_fn *shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "smbtorture");
|
||||
init_module_fn *shared_init = load_samba_modules(NULL, "smbtorture");
|
||||
|
||||
run_init_functions(static_init);
|
||||
run_init_functions(shared_init);
|
||||
|
@ -1103,7 +1103,7 @@ int main(int argc, const char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
gensec_init(cmdline_lp_ctx);
|
||||
gensec_init();
|
||||
|
||||
if (opt_domain == NULL) {
|
||||
opt_domain = lpcfg_workgroup(cmdline_lp_ctx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user