s4-modules Remove lp_ctx from init functions that no longer need it
authorAndrew Bartlett <abartlet@samba.org>
Mon, 6 Jun 2011 04:58:28 +0000 (14:58 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 6 Jun 2011 07:37:51 +0000 (17:37 +1000)
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

29 files changed:
source4/auth/gensec/gensec.c
source4/auth/gensec/gensec.h
source4/auth/gensec/pygensec.c
source4/client/cifsdd.c
source4/client/client.c
source4/lib/ldb-samba/samba_extensions.c
source4/lib/registry/rpc.c
source4/libcli/ldap/ldap_bind.c
source4/libnet/libnet.c
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc.h
source4/librpc/rpc/pyrpc_util.c
source4/ntptr/ntptr_base.c
source4/ntvfs/ntvfs_base.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/vfs_posix.c
source4/param/param.h
source4/param/util.c
source4/rpc_server/dcerpc_server.c
source4/samba_tool/samba_tool.c
source4/smbd/process_model.c
source4/smbd/server.c
source4/torture/gentest.c
source4/torture/locktest.c
source4/torture/masktest.c
source4/torture/rpc/rpc.c
source4/torture/smbtorture.c
source4/torture/torture.c
source4/utils/ntlm_auth.c

index 9b0dbfffbc6e4e5ee08131b76bf58c96c5fb1d31..b91e790d3cf7648400880ad60b5f81eaffddeedc 100644 (file)
@@ -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);
index 28bed6c3b76afd5821194d7879ce0882d4e5b63e..e42b4aa5d2f65e01d8512773fc2f22fb8f89bbcd 100644 (file)
@@ -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, 
index 004cc4a76e1c9d1b4f4556c99f93d03c7afc22c8..503974aaa3db4671bba83e16d14fcfe2ff8b72bf 100644 (file)
@@ -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);
index 3ce7277614be695ea30282590c43c37969d1ffb0..dd6f1377e820a524de37d20f1e8df47f11d29faf 100644 (file)
@@ -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) {
index 27535a1cd389590b0759d3699e2dc9afe0101ef9..2f353aec4ec0aae38819317c33b8bd81cfa223da 100644 (file)
@@ -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)); 
index 63b0f3df9197cb59d174d86957e907b10afb0298..be9f36a5a7d9d8f1af42df1a152e9ba6bd97194d 100644 (file)
@@ -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);
index f1e14c1b864cfe77310b70f5cc254f42b27f6cc5..42b7374f7adc9d993f34621ae4057e0e5c6377d3 100644 (file)
@@ -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);
index 65659794c5135d87f8ba85005901f0bbd90c5576..f5cf25ec3f7844a38ca6d01773a63a81b8f11a0b 100644 (file)
@@ -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, 
index 53ebb9e34aa3239aeb1e67c6cbcd3e1706a80a4c..32df85d5279d9a4d3ca9a7b07bf4f3a9bc6d9734 100644 (file)
@@ -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);
index cc7286686675c61fa7241cfbcf5c5094479edc81..c199dc700ac93d34058db210a10999da42062469 100644 (file)
@@ -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);
index 5ca6246343d645500b47312ebbff9aff6d0646d1..22afdf880fa15b5620d90c753cb5cd13cb1dc19c 100644 (file)
@@ -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, 
index 7784c81cef576a13985c1732d11ece3b588fea6c..385acc87e59f64d950c2234312c0d65242030810 100644 (file)
@@ -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);
index 268e84b127033f41e980599dd495a61138821e8c..42e7b10d4a6de758c799499cba2449bb3e75f583 100644 (file)
@@ -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);
index 1a83d27843b67af54bf511919e05665f85d84e7b..448d2919df33bda602c357dfa2f50bfd1f6fa1e8 100644 (file)
@@ -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);
index 67b544d4dee550d2961de2ca97009d32c81fe1f6..d7a778e1f7d35e5b28820ab504801a4416084492 100644 (file)
@@ -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);
index 4c1404eec578ff120dc67fd07a29b1a798aa3acc..5b89f1e608d059442ada522f322a1b4279f4e0e8 100644 (file)
@@ -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);
index f8ce15d7b611f0aa7090c2bcf85ab580ee4d7423..4ba9d497f8d4a9e919993123a50507b2a7250128 100644 (file)
@@ -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,
index bcb5be19747a49713ce071d9aed235f92c187534..139a8acc74f022932a6c3d41250f1ff0897a79b1 100644 (file)
@@ -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;
index 394a3511c2f024538bb943d7f1ba2d2422a6a22d..b738c9d5856401f3a4e9bb246d65770c7cd2cf18 100644 (file)
@@ -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);
index 8dfbb832985472f660fac9717ba0dd9d62176529..ce2294442035e9cbc293b547cdffb67e71cd14c4 100644 (file)
@@ -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) {
index af12a7b8cb1f8f8486c00f740cc9e04488bc8ee6..3c4c03ebf2c425c1a7821dae70f5fc13348c7974 100644 (file)
@@ -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);
index 8daf5d4c1184a2536a86155ca4bf0ca3f259511a..53dc20d6367c43217014b0dd39ef4bbf7b550d0f 100644 (file)
@@ -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);
index 6f69460dc8a7305543a30fb99aca462b0d6a3535..37ae2c03e5cc0d602565aacc518e8f488724e4be 100644 (file)
@@ -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);
 
index 445a626e7beaac116462782b4b68c34ebb7389fe..77fcb69eafd045a9170fa05be4c8a3e78d441004 100644 (file)
@@ -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));
index 65c844bc2753430e392630ff7091c0817e321de4..a711634b24c7896ffa5224f4332e077e07648138 100644 (file)
@@ -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);
index 03936f22fff9c4a3753e785ea9034dfe4cd98da3..01ce93f373e7d4092dc7e0ab255b0c910e5b476e 100644 (file)
@@ -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))
index 62cf0abfb7072786deeccc6e6cac38b51d14d215..83816e8be55a25dfaf7c57ab5d39d24429910264 100644 (file)
@@ -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. */
index ffd884a38dbd978975277a0dff0ab7a6cd0251a1..3dae9f586328a34e2618bbfaa6cac3e9be50f940 100644 (file)
@@ -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);
index 24c57641f32ccdc4dc9ce13c2c29b443ffa9330b..d5c385cbc68a9f4660893efe47638729686fb532 100644 (file)
@@ -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);