Skip to content

Commit

Permalink
s4-modules Remove lp_ctx from init functions that no longer need it
Browse files Browse the repository at this point in the history
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
  • Loading branch information
abartlet committed Jun 6, 2011
1 parent f67a149 commit 907cdb5
Show file tree
Hide file tree
Showing 29 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions source4/auth/gensec/gensec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/auth/gensec/gensec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions source4/auth/gensec/pygensec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/client/cifsdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion source4/client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion source4/lib/ldb-samba/samba_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/lib/registry/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/libcli/ldap/ldap_bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion source4/libnet/libnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source4/librpc/rpc/dcerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/librpc/rpc/dcerpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion source4/librpc/rpc/pyrpc_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source4/ntptr/ntptr_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/ntvfs/ntvfs_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source4/ntvfs/posix/pvfs_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/ntvfs/posix/vfs_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/param/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion source4/param/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source4/rpc_server/dcerpc_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/samba_tool/samba_tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion source4/smbd/process_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions source4/smbd/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,17 @@ 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
of the SMB[,2] server instead? */

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);
Expand Down
2 changes: 1 addition & 1 deletion source4/torture/gentest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion source4/torture/locktest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion source4/torture/masktest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/torture/rpc/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion source4/torture/smbtorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion source4/torture/torture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source4/utils/ntlm_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 907cdb5

Please sign in to comment.