r26355: Eliminate global_loadparm in more places.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 10 Dec 2007 03:33:16 +0000 (04:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:49:01 +0000 (05:49 +0100)
(This used to be commit 5d589a0d94bd76a9b4c9fc748854e8098ea43c4d)

42 files changed:
source4/client/cifsdd.c
source4/client/client.c
source4/client/smbmount.c
source4/client/smbspool.c
source4/lib/cmdline/popt_common.h
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/tools/cmdline.c
source4/lib/registry/tools/regdiff.c
source4/lib/registry/tools/regpatch.c
source4/lib/registry/tools/regshell.c
source4/lib/registry/tools/regtree.c
source4/libcli/ldap/ldap_bind.c
source4/libcli/ldap/ldap_client.c
source4/libcli/ldap/ldap_client.h
source4/nsswitch/wbinfo.c
source4/ntvfs/common/brlock.c
source4/ntvfs/common/brlock.h
source4/ntvfs/common/brlock_tdb.c
source4/ntvfs/common/opendb.c
source4/ntvfs/ntvfs_base.c
source4/ntvfs/posix/vfs_posix.c
source4/param/share.c
source4/param/share_classic.c
source4/param/tests/share.c
source4/smb_server/smb/service.c
source4/smb_server/smb2/tcon.c
source4/smbd/server.c
source4/torture/gentest.c
source4/torture/ldap/basic.c
source4/torture/ldap/common.c
source4/torture/locktest.c
source4/torture/locktest2.c
source4/torture/masktest.c
source4/torture/rpc/dssync.c
source4/torture/rpc/spoolss_notify.c
source4/torture/smbtorture.c
source4/torture/torture.c
source4/utils/net/net.c
source4/utils/nmblookup.c
source4/utils/ntlm_auth.c
source4/utils/testparm.c
source4/winbind/wb_init_domain.c

index 06a5f79ed79e622471cbe1e48ab0889e023e5f0f..2ce01a222746a1a7aad9fb40db7e3421b62fb233 100644 (file)
@@ -574,7 +574,7 @@ int main(int argc, const char ** argv)
                }
        }
 
-       gensec_init(global_loadparm);
+       gensec_init(cmdline_lp_ctx);
        dump_args();
 
        if (check_arg_numeric("ibs") == 0 || check_arg_numeric("ibs") == 0) {
@@ -595,7 +595,7 @@ int main(int argc, const char ** argv)
 
        CatchSignal(SIGINT, dd_handle_signal);
        CatchSignal(SIGUSR1, dd_handle_signal);
-       return(copy_files(global_loadparm));
+       return(copy_files(cmdline_lp_ctx));
 }
 
 /* vim: set sw=8 sts=8 ts=8 tw=79 : */
index 6842e2e91dbcb75bbf790d0c1d05624e6cec5e2d..9e031cd09ec1a0918cf66448520e60b805ab4a40 100644 (file)
@@ -3181,7 +3181,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c
                }
        }
 
-       gensec_init(global_loadparm);
+       gensec_init(cmdline_lp_ctx);
 
        if(poptPeekArg(pc)) {
                char *s = strdup(poptGetArg(pc)); 
@@ -3220,11 +3220,11 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c
        }
   
        if (query_host) {
-               return do_host_query(global_loadparm, query_host, lp_workgroup(global_loadparm));
+               return do_host_query(cmdline_lp_ctx, query_host, lp_workgroup(cmdline_lp_ctx));
        }
 
        if (message) {
-               return do_message_op(lp_netbios_name(global_loadparm), desthost, dest_ip, name_type, lp_name_resolve_order(global_loadparm), lp_max_xmit(global_loadparm), lp_maxmux(global_loadparm));
+               return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, dest_ip, name_type, lp_name_resolve_order(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx));
        }
        
 
index 0c1c330104b954e179b84f095ff7b47b6f018c9b..9ab6c375f25d07174a4b3236a237fd4e36eb5177 100644 (file)
@@ -897,7 +897,7 @@ static void parse_mount_smb(int argc, char **argv)
                pstrcpy(username,getenv("LOGNAME"));
        }
 
-       lp_ctx = global_loadparm = loadparm_init(talloc_autofree_context());
+       lp_ctx = loadparm_init(talloc_autofree_context());
 
        if (!lp_load(lp_ctx, dyn_CONFIGFILE)) {
                fprintf(stderr, "Can't load %s - run testparm to debug it\n", 
index 80a11d5f2d839df390a4d79e3867ddf2a555afa2..57050acab8c1630fc1805211bedf4b9fb828cc32 100644 (file)
@@ -177,7 +177,7 @@ static int          smb_print(struct smbcli_state *, char *, FILE *);
 
   setup_logging(argv[0], DEBUG_STDOUT);
 
-  global_loadparm = lp_ctx = loadparm_init(talloc_autofree_context());
+  lp_ctx = loadparm_init(talloc_autofree_context());
 
   if (!lp_load(lp_ctx, dyn_CONFIGFILE)) {
          fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", lp_config_file());
index 7de8027c0b5300a93321e5b2a49d356af3b7b85d..df432bb4757e314600fffbf54f6962c627955096 100644 (file)
@@ -34,5 +34,6 @@ extern struct poptOption popt_common_credentials[];
 #define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
 
 extern struct cli_credentials *cmdline_credentials;
+extern struct loadparm_context *cmdline_lp_ctx;
 
 #endif /* _POPT_COMMON_H */
index 0c0ee629bfc98e94f3f24a08703491a7e40b0155..a834e912d44a2c4078d00315ba427934a9aaaafa 100644 (file)
@@ -756,7 +756,8 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
        }
        module->private_data    = ildb;
        ildb->module            = module;
-       ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "EventContext"));
+       ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "loadparm"), 
+                                         ldb_get_opaque(ldb, "EventContext"));
        if (!ildb->ldap) {
                ldb_oom(ldb);
                goto failed;
@@ -793,7 +794,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
                                goto failed;
                        }
                } else {
-                       status = ldap_bind_sasl(ildb->ldap, creds, global_loadparm);
+                       status = ldap_bind_sasl(ildb->ldap, creds, ldb_get_opaque(ldb, "loadparm"));
                        if (!NT_STATUS_IS_OK(status)) {
                                ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
                                          ldap_errstr(ildb->ldap, module, status));
index aff730c1780f3556fe0202b8e1ff19718833e799..8ee19946158c2b15eb36021baa939493fc49b4d4 100644 (file)
@@ -210,15 +210,15 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb,
 
 #if (_SAMBA_BUILD_ >= 4)
        /* Must be after we have processed command line options */
-       gensec_init(global_loadparm); 
+       gensec_init(cmdline_lp_ctx); 
        
-       if (ldb_set_opaque(ldb, "sessionInfo", system_session(ldb, global_loadparm))) {
+       if (ldb_set_opaque(ldb, "sessionInfo", system_session(ldb, cmdline_lp_ctx))) {
                goto failed;
        }
        if (ldb_set_opaque(ldb, "credentials", cmdline_credentials)) {
                goto failed;
        }
-       if (ldb_set_opaque(ldb, "loadparm", global_loadparm)) {
+       if (ldb_set_opaque(ldb, "loadparm", cmdline_lp_ctx)) {
                goto failed;
        }
 
index ea4b754fe748c94fb4120dc9e8bf22b6b7902bd4..406eaeea3df4f168697c4ce4f83f1bb72c88a1d8 100644 (file)
@@ -116,11 +116,11 @@ int main(int argc, const char **argv)
 
        }
 
-       h1 = open_backend(pc, global_loadparm, backend1, remote1);
+       h1 = open_backend(pc, cmdline_lp_ctx, backend1, remote1);
        if (h1 == NULL)
                return 1;
 
-       h2 = open_backend(pc, global_loadparm, backend2, remote2);
+       h2 = open_backend(pc, cmdline_lp_ctx, backend2, remote2);
        if (h2 == NULL)
                return 1;
 
index 441138832e4934d9110ca30a9bc4adf1b66491a6..ddbedce18a0ff12d1dcdc85512cae04225678443 100644 (file)
@@ -49,9 +49,9 @@ int main(int argc, char **argv)
        }
 
        if (remote) {
-               h = reg_common_open_remote (remote, global_loadparm, cmdline_credentials);
+               h = reg_common_open_remote (remote, cmdline_lp_ctx, cmdline_credentials);
        } else {
-               h = reg_common_open_local (cmdline_credentials, global_loadparm);
+               h = reg_common_open_local (cmdline_credentials, cmdline_lp_ctx);
        }
 
        if (h == NULL)
index 7169d7c9f8bd5f55838d4bdcb1c42daf0132aeab..2c692952fb7040cbc3de0751820b84ab927900ac 100644 (file)
@@ -497,7 +497,7 @@ int main(int argc, char **argv)
        ctx = talloc_zero(NULL, struct regshell_context);
 
        if (remote != NULL) {
-               ctx->registry = reg_common_open_remote(remote, global_loadparm
+               ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx
                                                       cmdline_credentials);
        } else if (file != NULL) {
                ctx->current = reg_common_open_file(file, cmdline_credentials);
@@ -506,7 +506,7 @@ int main(int argc, char **argv)
                ctx->registry = ctx->current->context;
                ctx->path = talloc_strdup(ctx, "");
        } else {
-               ctx->registry = reg_common_open_local(cmdline_credentials, global_loadparm);
+               ctx->registry = reg_common_open_local(cmdline_credentials, cmdline_lp_ctx);
        }
 
        if (ctx->registry == NULL)
index 6c21f2cbad4cda995bcb9045755b8385f0af3b0e..b267e11b43d3dc3f78324583be855f72b49f65ce 100644 (file)
@@ -129,11 +129,11 @@ int main(int argc, char **argv)
        }
 
        if (remote != NULL) {
-               h = reg_common_open_remote(remote, global_loadparm, cmdline_credentials);
+               h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials);
        } else if (file != NULL) {
                start_key = reg_common_open_file(file, cmdline_credentials);
        } else {
-               h = reg_common_open_local(cmdline_credentials, global_loadparm);
+               h = reg_common_open_local(cmdline_credentials, cmdline_lp_ctx);
        }
 
        if (h == NULL && start_key == NULL)
index ba1ae90ebd07c05f7e9f80835bc40bc30edb7411..bd548be38e416f182cb985abd7a8a54ac678833f 100644 (file)
@@ -44,7 +44,7 @@ NTSTATUS ldap_rebind(struct ldap_connection *conn)
        switch (conn->bind.type) {
        case LDAP_BIND_SASL:
                status = ldap_bind_sasl(conn, (struct cli_credentials *)conn->bind.creds,
-                                       global_loadparm);
+                                       conn->lp_ctx);
                break;
                
        case LDAP_BIND_SIMPLE:
index c859b4a4d198e0da6fd3db4a8fdf5e57b9d10647..906e9c2574fdd1917d2d9b5864aff542e81071f7 100644 (file)
 #include "param/param.h"
 
 
-/*
+/**
   create a new ldap_connection stucture. The event context is optional
 */
 struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx, 
-                                           struct event_context *ev)
+                                            struct loadparm_context *lp_ctx,
+                                            struct event_context *ev)
 {
        struct ldap_connection *conn;
 
@@ -61,6 +62,8 @@ struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx,
        conn->next_messageid  = 1;
        conn->event.event_ctx = ev;
 
+       conn->lp_ctx = lp_ctx;
+
        /* set a reasonable request timeout */
        conn->timeout = 60;
 
@@ -352,7 +355,7 @@ struct composite_context *ldap_connect_send(struct ldap_connection *conn,
                }
 
                ctx = socket_connect_send(conn->sock, NULL, unix_addr, 
-                                         0, lp_name_resolve_order(global_loadparm), conn->event.event_ctx);
+                                         0, lp_name_resolve_order(conn->lp_ctx), conn->event.event_ctx);
                ctx->async.fn = ldap_connect_recv_unix_conn;
                ctx->async.private_data = state;
                return result;
@@ -365,7 +368,7 @@ struct composite_context *ldap_connect_send(struct ldap_connection *conn,
                }
                
                ctx = socket_connect_multi_send(state, conn->host, 1, &conn->port,
-                                               lp_name_resolve_order(global_loadparm), conn->event.event_ctx);
+                                               lp_name_resolve_order(conn->lp_ctx), conn->event.event_ctx);
                if (ctx == NULL) goto failed;
 
                ctx->async.fn = ldap_connect_recv_tcp_conn;
@@ -394,7 +397,7 @@ static void ldap_connect_got_sock(struct composite_context *ctx,
        talloc_steal(conn, conn->sock);
        if (conn->ldaps) {
                struct socket_context *tls_socket;
-               char *cafile = private_path(conn->sock, global_loadparm, lp_tls_cafile(global_loadparm));
+               char *cafile = private_path(conn->sock, conn->lp_ctx, lp_tls_cafile(conn->lp_ctx));
 
                if (!cafile || !*cafile) {
                        talloc_free(conn->sock);
index d2a12ee8b5c2607c8a1eeff020e6d07f061965c7..d5ff441afffdbf80471d57cf3801fcc5d11674a4 100644 (file)
@@ -51,6 +51,8 @@ struct ldap_request {
 /* main context for a ldap client connection */
 struct ldap_connection {
        struct socket_context *sock;
+       struct loadparm_context *lp_ctx;
+
        char *host;
        uint16_t port;
        bool ldaps;
index 4303f36e4a6ba1bf49383c176279c42f61d53ff0..144c279279b31464aebdcd0376708be4321f26fb 100644 (file)
@@ -52,7 +52,7 @@ static char winbind_separator_int(bool strict)
                        return 0;
                }
                /* HACK: (this module should not call lp_ funtions) */
-               return *lp_winbind_separator(global_loadparm);
+               return *lp_winbind_separator(cmdline_lp_ctx);
        }
 
        sep = response.data.info.winbind_separator;
@@ -64,7 +64,7 @@ static char winbind_separator_int(bool strict)
                        return 0;
                }
                /* HACK: (this module should not call lp_ funtions) */
-               sep = *lp_winbind_separator(global_loadparm);
+               sep = *lp_winbind_separator(cmdline_lp_ctx);
        }
        
        return sep;
@@ -89,7 +89,7 @@ static const char *get_winbind_domain(void)
                d_fprintf(stderr, "could not obtain winbind domain name!\n");
                
                /* HACK: (this module should not call lp_ funtions) */
-               return lp_workgroup(global_loadparm);
+               return lp_workgroup(cmdline_lp_ctx);
        }
 
        fstrcpy(winbind_domain, response.data.domain_name);
@@ -1218,7 +1218,7 @@ int main(int argc, char **argv, char **envp)
                                        got_error = true;
                                }
 
-                               if (!wbinfo_auth_crap(global_loadparm, string_arg)) {
+                               if (!wbinfo_auth_crap(cmdline_lp_ctx, string_arg)) {
                                        d_fprintf(stderr, "Could not authenticate user %s with "
                                                "challenge/response\n", string_arg);
                                        got_error = true;
index ddf3219a9a0ebc337deb503b91736b4a6e23e282..c87eca8aff3371da5d389c7188c2ca6719ac19da 100644 (file)
@@ -48,12 +48,13 @@ void brl_set_ops(const struct brlock_ops *new_ops)
   need the messaging_ctx to allow for pending lock notifications.
 */
 struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server, 
+                            struct loadparm_context *lp_ctx,
                             struct messaging_context *messaging_ctx)
 {
        if (ops == NULL) {
                brl_tdb_init_ops();
        }
-       return ops->brl_init(mem_ctx, server, messaging_ctx);
+       return ops->brl_init(mem_ctx, server, lp_ctx, messaging_ctx);
 }
 
 struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)
index 50f30ec27683460966d216aac0c7651830a8aa4f..aff30d138e1fc7aea97726702b542659c9c87245 100644 (file)
@@ -23,6 +23,7 @@
 
 struct brlock_ops {
        struct brl_context *(*brl_init)(TALLOC_CTX *, struct server_id , 
+                                       struct loadparm_context *lp_ctx,
                                        struct messaging_context *);
        struct brl_handle *(*brl_create_handle)(TALLOC_CTX *, struct ntvfs_handle *, DATA_BLOB *);
        NTSTATUS (*brl_lock)(struct brl_context *,
index 25642d5f5c74c69bb67e3ea2725db872e2436473..362a6d01e24d6c24af0d5de59a89c2cfcacdca2e 100644 (file)
@@ -86,6 +86,7 @@ struct brl_handle {
   pending lock notifications.
 */
 static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id server, 
+                                       struct loadparm_context *lp_ctx,
                                    struct messaging_context *messaging_ctx)
 {
        struct brl_context *brl;
@@ -95,7 +96,7 @@ static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id se
                return NULL;
        }
 
-       brl->db = db_tmp_open(brl, global_loadparm, "brlock.tdb", TDB_DEFAULT);
+       brl->db = db_tmp_open(brl, lp_ctx, "brlock.tdb", TDB_DEFAULT);
        if (brl->db == NULL) {
                talloc_free(brl);
                return NULL;
index 59990d2fc143f3699b7125a4bfacdd34501d7d5e..4826ca5c267a25ada8e02d2fcb5917f542b4ce21 100644 (file)
@@ -62,7 +62,7 @@ _PUBLIC_ struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
                                      struct ntvfs_context *ntvfs_ctx)
 {
        if (ops == NULL) {
-               if (lp_parm_bool(global_loadparm, NULL, "ctdb", "opendb", false)) {
+               if (lp_parm_bool(ntvfs_ctx->lp_ctx, NULL, "ctdb", "opendb", false)) {
                        odb_ctdb_init_ops();
                } else {
                        odb_tdb_init_ops();
index 9172fe1580b9b90d35e2f4dd1abb3959768022b0..3873afbdfad27d66249eea880593fb45ceb1b761 100644 (file)
@@ -199,10 +199,10 @@ NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, e
        return NT_STATUS_OK;
 }
 
-NTSTATUS ntvfs_init(void)
+NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
 {
        init_module_fn static_init[] = STATIC_ntvfs_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "ntvfs");
+       init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "ntvfs");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index c1e15976d227940367b6c4c9df4cce7faea320a2..8e5e5a6942b1ff6ec577c19c56dcf45842de0eb2 100644 (file)
@@ -199,6 +199,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
 
        pvfs->brl_context = brl_init(pvfs, 
                                     pvfs->ntvfs->ctx->server_id,
+                                    pvfs->ntvfs->ctx->lp_ctx,
                                     pvfs->ntvfs->ctx->msg_ctx);
        if (pvfs->brl_context == NULL) {
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
index 5bf587929050e90b391003f3c115dcce43dd685a..7ee1d8037a0136c0c5eaaddd8578314c9062737a 100644 (file)
@@ -149,15 +149,11 @@ NTSTATUS share_get_context(TALLOC_CTX *mem_ctx, struct share_context **ctx)
 /*
   initialise the SHARE subsystem
 */
-NTSTATUS share_init(struct loadparm_context *lp_ctx)
+NTSTATUS share_init(void)
 {
        init_module_fn static_init[] = STATIC_share_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "share");
 
        run_init_functions(static_init);
-       run_init_functions(shared_init);
-
-       talloc_free(shared_init);
 
        return NT_STATUS_OK;
 }
index ab1b4bf904a2405e44816223fde34644011750b3..4a7fbcb263a1bce05dcfaf8764de8bd8f12c9be9 100644 (file)
@@ -45,6 +45,8 @@ static const char *sclassic_string_option(struct share_config *scfg,
 {
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
                                                     struct loadparm_service);
+       struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
+                                                         struct loadparm_context);
        char *parm, *val;
        const char *ret;
 
@@ -57,7 +59,7 @@ static const char *sclassic_string_option(struct share_config *scfg,
                *val = '\0';
                val++;
 
-               ret = lp_parm_string(global_loadparm, s, parm, val);
+               ret = lp_parm_string(lp_ctx, s, parm, val);
                if (!ret) {
                        ret = defval;
                }
@@ -105,6 +107,8 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name,
 {
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
                                                     struct loadparm_service);
+       struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
+                                                         struct loadparm_context);
        char *parm, *val;
        int ret;
 
@@ -117,7 +121,7 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name,
                *val = '\0';
                val++;
 
-               ret = lp_parm_int(global_loadparm, s, parm, val, defval);
+               ret = lp_parm_int(lp_ctx, s, parm, val, defval);
                if (!ret) {
                        ret = defval;
                }
@@ -161,6 +165,8 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name
 {
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
                                                     struct loadparm_service);
+       struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
+                                                         struct loadparm_context);
        char *parm, *val;
        bool ret;
 
@@ -173,7 +179,7 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name
                *val = '\0';
                val++;
 
-               ret = lp_parm_bool(global_loadparm, s, parm, val, defval);
+               ret = lp_parm_bool(lp_ctx, s, parm, val, defval);
                talloc_free(parm);
                return ret;
        }
@@ -228,6 +234,8 @@ static const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct shar
 {
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
                                                     struct loadparm_service);
+       struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
+                                                         struct loadparm_context);
        char *parm, *val;
        const char **ret;
 
@@ -240,7 +248,7 @@ static const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct shar
                *val = '\0';
                val++;
 
-               ret = lp_parm_string_list(mem_ctx, global_loadparm, s, parm, val, ",;");
+               ret = lp_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
                talloc_free(parm);
                return ret;
        }
index 26af71d06f8a28462f4dab99ffa1cd75c6da5ebf..1f8ecb2d8442a0ce31905a36b42f0bac7253a3ac 100644 (file)
@@ -197,7 +197,7 @@ struct torture_suite *torture_local_share(TALLOC_CTX *mem_ctx)
        struct torture_suite *suite = torture_suite_create(mem_ctx, "SHARE");
        struct torture_tcase *tcase;
 
-       share_init(global_loadparm);
+       share_init();
 
        tcase = torture_suite_add_tcase(suite, "ldb");
        torture_tcase_set_fixture(tcase, setup_ldb, teardown);
index 467cbca41826fbde36bc8cd31a039fdf08e9125d..35b3653026190f4c2b83a632efd9d80d30171bd3 100644 (file)
@@ -49,7 +49,7 @@ static NTSTATUS make_connection_scfg(struct smbsrv_request *req,
                                       req->smb_conn->negotiate.protocol,
                                       req->smb_conn->connection->event.ctx,
                                       req->smb_conn->connection->msg_ctx,
-                                      global_loadparm,
+                                      req->smb_conn->lp_ctx,
                                       req->smb_conn->connection->server_id,
                                       &tcon->ntvfs);
        if (!NT_STATUS_IS_OK(status)) {
index 4393d38c0db04d48c6cd3d7508e765e124fdfbb0..6d0d98554c8c2525376741c7fbe72a72a1464134 100644 (file)
@@ -294,7 +294,7 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon
                                       req->smb_conn->negotiate.protocol,
                                       req->smb_conn->connection->event.ctx,
                                       req->smb_conn->connection->msg_ctx,
-                                      global_loadparm,
+                                      req->smb_conn->lp_ctx,
                                       req->smb_conn->connection->server_id,
                                       &tcon->ntvfs);
        if (!NT_STATUS_IS_OK(status)) {
index 434f8882c1661ca2c1d5bfad3d1f8877ffb654f7..e7d7d1a7fc1a3cd073f2cee5db6480c27813f8c3 100644 (file)
@@ -267,36 +267,36 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
                become_daemon(true);
        }
 
-       cleanup_tmp_files(global_loadparm);
+       cleanup_tmp_files(cmdline_lp_ctx);
 
-       if (!directory_exist(lp_lockdir(global_loadparm))) {
-               mkdir(lp_lockdir(global_loadparm), 0755);
+       if (!directory_exist(lp_lockdir(cmdline_lp_ctx))) {
+               mkdir(lp_lockdir(cmdline_lp_ctx), 0755);
        }
 
-       pidfile_create(lp_piddir(global_loadparm), binary_name);
+       pidfile_create(lp_piddir(cmdline_lp_ctx), binary_name);
 
        /* Do *not* remove this, until you have removed
         * passdb/secrets.c, and proved that Samba still builds... */
        /* Setup the SECRETS subsystem */
-       if (!secrets_init(global_loadparm)) {
+       if (!secrets_init(cmdline_lp_ctx)) {
                exit(1);
        }
 
        ldb_global_init(); /* FIXME: */
 
-       share_init(global_loadparm);
+       share_init();
 
-       gensec_init(global_loadparm); /* FIXME: */
+       gensec_init(cmdline_lp_ctx); /* FIXME: */
 
-       ntptr_init(global_loadparm);    /* FIXME: maybe run this in the initialization function 
+       ntptr_init(cmdline_lp_ctx);     /* FIXME: maybe run this in the initialization function 
                                                of the spoolss RPC server instead? */
 
-       ntvfs_init();   /* FIXME: maybe run this in the initialization functions 
+       ntvfs_init(cmdline_lp_ctx);     /* FIXME: maybe run this in the initialization functions 
                                                of the SMB[,2] server instead? */
 
-       process_model_init(global_loadparm); 
+       process_model_init(cmdline_lp_ctx); 
 
-       shared_init = load_samba_modules(NULL, global_loadparm, "service");
+       shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "service");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
@@ -313,7 +313,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
        }
 
        /* initialise clustering if needed */
-       cluster_ctdb_init(global_loadparm, event_ctx, model);
+       cluster_ctdb_init(cmdline_lp_ctx, event_ctx, model);
 
        if (opt_interactive) {
                /* catch EOF on stdin */
@@ -334,8 +334,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
        }
 
        DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
-       status = server_service_startup(event_ctx, global_loadparm, model, 
-                                       lp_server_services(global_loadparm));
+       status = server_service_startup(event_ctx, cmdline_lp_ctx, model, 
+                                       lp_server_services(cmdline_lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
                return 1;
index e8e531a119efeb054b5e1ff8c680fb571e7c71fc..25512b95673375c8e6fdd27e66b8df353d56baad 100644 (file)
@@ -2197,7 +2197,7 @@ static bool split_unc_name(const char *unc, char **server, char **share)
        argc -= NSERVERS;
        argv += NSERVERS;
 
-       global_loadparm = lp_ctx = loadparm_init(talloc_autofree_context());
+       lp_ctx = loadparm_init(talloc_autofree_context());
        lp_load(lp_ctx, dyn_CONFIGFILE);
 
        servers[0].credentials = cli_credentials_init(talloc_autofree_context());
index 76d412a7cd81d3b6d721243dcc902384acbda77f..358bf535905b869c776ce02be1587b6a34017117 100644 (file)
@@ -42,14 +42,15 @@ static bool test_bind_simple(struct ldap_connection *conn, const char *userdn, c
        return ret;
 }
 
-static bool test_bind_sasl(struct ldap_connection *conn, struct cli_credentials *creds)
+static bool test_bind_sasl(struct torture_context *tctx,
+                          struct ldap_connection *conn, struct cli_credentials *creds)
 {
        NTSTATUS status;
        bool ret = true;
 
        printf("Testing sasl bind as user\n");
 
-       status = torture_ldap_bind_sasl(conn, creds, global_loadparm);
+       status = torture_ldap_bind_sasl(conn, creds, tctx->lp_ctx);
        if (!NT_STATUS_IS_OK(status)) {
                ret = false;
        }
@@ -205,7 +206,7 @@ bool torture_ldap_basic(struct torture_context *torture)
 
        url = talloc_asprintf(mem_ctx, "ldap://%s/", host);
 
-       status = torture_ldap_connection(mem_ctx, &conn, url);
+       status = torture_ldap_connection(torture, &conn, url);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
@@ -220,7 +221,7 @@ bool torture_ldap_basic(struct torture_context *torture)
                ret = false;
        }
 
-       if (!test_bind_sasl(conn, cmdline_credentials)) {
+       if (!test_bind_sasl(torture, conn, cmdline_credentials)) {
                ret = false;
        }
 
index b03a6d81131298fe56eecb8dc7bd4b35a640496c..11b11dcc00de2bdb52911d7f10217f6e9ce81a84 100644 (file)
@@ -54,8 +54,9 @@ _PUBLIC_ NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn,
 }
 
 /* open a ldap connection to a server */
-_PUBLIC_ NTSTATUS torture_ldap_connection(TALLOC_CTX *mem_ctx, struct ldap_connection **conn, 
-                               const char *url)
+_PUBLIC_ NTSTATUS torture_ldap_connection(struct torture_context *tctx, 
+                                         struct ldap_connection **conn, 
+                                         const char *url)
 {
        NTSTATUS status;
 
@@ -64,7 +65,7 @@ _PUBLIC_ NTSTATUS torture_ldap_connection(TALLOC_CTX *mem_ctx, struct ldap_conne
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       *conn = ldap4_new_connection(mem_ctx, NULL);
+       *conn = ldap4_new_connection(tctx, tctx->lp_ctx, NULL);
 
        status = ldap_connect(*conn, url);
        if (!NT_STATUS_IS_OK(status)) {
@@ -76,17 +77,17 @@ _PUBLIC_ NTSTATUS torture_ldap_connection(TALLOC_CTX *mem_ctx, struct ldap_conne
 }
 
 /* open a ldap connection to a server */
-NTSTATUS torture_ldap_connection2(TALLOC_CTX *mem_ctx, struct ldap_connection **conn, 
+NTSTATUS torture_ldap_connection2(struct torture_context *tctx, struct ldap_connection **conn, 
                                const char *url, const char *userdn, const char *password)
 {
         NTSTATUS status;
 
-       status = torture_ldap_connection(mem_ctx, conn, url);
+       status = torture_ldap_connection(tctx, conn, url);
        NT_STATUS_NOT_OK_RETURN(status);
 
        status = ldap_bind_simple(*conn, userdn, password);
        if (!NT_STATUS_IS_OK(status)) {
-               printf("Failed a simple ldap bind - %s\n", ldap_errstr(*conn, mem_ctx, status));
+               printf("Failed a simple ldap bind - %s\n", ldap_errstr(*conn, tctx, status));
        }
  
        return status;
index d51c2692d72f13a4e4314c46d8b43745e4c654f2..82e9b416b3cb64c12a511ce486e2a1fdd1edde71 100644 (file)
@@ -565,7 +565,7 @@ static void usage(void)
        argc -= NSERVERS;
        argv += NSERVERS;
 
-       global_loadparm = lp_ctx = loadparm_init(talloc_autofree_context());
+       lp_ctx = loadparm_init(talloc_autofree_context());
        lp_load(lp_ctx, dyn_CONFIGFILE);
 
        servers[0] = cli_credentials_init(talloc_autofree_context());
index 19629d87707bcc53d6e494a4fe8ed00017808f31..1dfefc15ed88464ddd46e4047f4b19c34f7294bd 100644 (file)
@@ -484,7 +484,7 @@ static void usage(void)
        argc -= 4;
        argv += 4;
 
-       global_loadparm = lp_ctx = loadparm_init(talloc_autofree_context());
+       lp_ctx = loadparm_init(talloc_autofree_context());
        lp_load(lp_ctx, dyn_CONFIGFILE);
 
        if (getenv("USER")) {
index 612b96e4f7f9d6b3b7faeab1c2ba1f48140a59ff..dab81937537084da5f7a118c7abc36decdefeb93 100644 (file)
@@ -303,7 +303,7 @@ static void usage(void)
        argc -= 1;
        argv += 1;
 
-       lp_ctx = global_loadparm = loadparm_init(talloc_autofree_context());
+       lp_ctx = loadparm_init(talloc_autofree_context());
        lp_load(lp_ctx, dyn_CONFIGFILE);
 
        credentials = cli_credentials_init(talloc_autofree_context());
index 8f15f6f096cb0fc9353bc6ab867ced584cb8037f..4417285e04d3f4c748d1597d877b29770701f5e7 100644 (file)
@@ -173,7 +173,8 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx)
        return ctx;
 }
 
-static bool _test_DsBind(struct DsSyncTest *ctx, struct cli_credentials *credentials, struct DsSyncBindInfo *b)
+static bool _test_DsBind(struct torture_context *tctx,
+                        struct DsSyncTest *ctx, struct cli_credentials *credentials, struct DsSyncBindInfo *b)
 {
        NTSTATUS status;
        bool ret = true;
@@ -182,7 +183,7 @@ static bool _test_DsBind(struct DsSyncTest *ctx, struct cli_credentials *credent
        status = dcerpc_pipe_connect_b(ctx,
                                       &b->pipe, ctx->drsuapi_binding, 
                                       &ndr_table_drsuapi,
-                                      credentials, event, global_loadparm);
+                                      credentials, event, tctx->lp_ctx);
        
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to connect to server as a BDC: %s\n", nt_errstr(status));
@@ -223,12 +224,13 @@ static bool _test_DsBind(struct DsSyncTest *ctx, struct cli_credentials *credent
        return ret;
 }
 
-static bool test_LDAPBind(struct DsSyncTest *ctx, struct cli_credentials *credentials, struct DsSyncLDAPInfo *l)
+static bool test_LDAPBind(struct torture_context *tctx, struct DsSyncTest *ctx, 
+                         struct cli_credentials *credentials, struct DsSyncLDAPInfo *l)
 {
        NTSTATUS status;
        bool ret = true;
 
-       status = torture_ldap_connection(ctx, &l->conn, ctx->ldap_url);
+       status = torture_ldap_connection(tctx, &l->conn, ctx->ldap_url);
        if (!NT_STATUS_IS_OK(status)) {
                printf("failed to connect to LDAP: %s\n", ctx->ldap_url);
                return false;
@@ -236,7 +238,7 @@ static bool test_LDAPBind(struct DsSyncTest *ctx, struct cli_credentials *creden
 
        printf("connected to LDAP: %s\n", ctx->ldap_url);
 
-       status = torture_ldap_bind_sasl(l->conn, credentials, global_loadparm);
+       status = torture_ldap_bind_sasl(l->conn, credentials, tctx->lp_ctx);
        if (!NT_STATUS_IS_OK(status)) {
                printf("failed to bind to LDAP:\n");
                return false;
@@ -811,16 +813,16 @@ bool torture_rpc_dssync(struct torture_context *torture)
        mem_ctx = talloc_init("torture_rpc_dssync");
        ctx = test_create_context(torture);
        
-       ret &= _test_DsBind(ctx, ctx->admin.credentials, &ctx->admin.drsuapi);
+       ret &= _test_DsBind(torture, ctx, ctx->admin.credentials, &ctx->admin.drsuapi);
        if (!ret) {
                return ret;
        }
-       ret &= test_LDAPBind(ctx, ctx->admin.credentials, &ctx->admin.ldap);
+       ret &= test_LDAPBind(torture, ctx, ctx->admin.credentials, &ctx->admin.ldap);
        if (!ret) {
                return ret;
        }
        ret &= test_GetInfo(torture, ctx);
-       ret &= _test_DsBind(ctx, ctx->new_dc.credentials, &ctx->new_dc.drsuapi);
+       ret &= _test_DsBind(torture, ctx, ctx->new_dc.credentials, &ctx->new_dc.drsuapi);
        if (!ret) {
                return ret;
        }
index 5e7a4469e444f697bfd2d74bcac46b36e1368c85..bdbdc6b0c690e2ca5afe7c7a529af027424ab246 100644 (file)
@@ -289,7 +289,7 @@ struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx)
        struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, 
                                                        "notify", &ndr_table_spoolss);
 
-       ntvfs_init();
+       ntvfs_init(global_loadparm);
        torture_rpc_tcase_add_test(tcase, "testRFFPCNEx", test_RFFPCNEx);
        
        return suite;
index 33e80a4b97031f8d41eb5b7350c7961ce5a90632..b35e62361036d0fcbbc0f0e972245c863280c89e 100644 (file)
@@ -572,36 +572,36 @@ int main(int argc,char *argv[])
        while((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
                case OPT_LOADFILE:
-                       lp_set_cmdline(global_loadparm, "torture:loadfile", poptGetOptArg(pc));
+                       lp_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc));
                        break;
                case OPT_UNCLIST:
-                       lp_set_cmdline(global_loadparm, "torture:unclist", poptGetOptArg(pc));
+                       lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
                        break;
                case OPT_TIMELIMIT:
-                       lp_set_cmdline(global_loadparm, "torture:timelimit", poptGetOptArg(pc));
+                       lp_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc));
                        break;
                case OPT_NUMPROGS:
-                       lp_set_cmdline(global_loadparm, "torture:nprocs", poptGetOptArg(pc));
+                       lp_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc));
                        break;
                case OPT_DNS:
-                       parse_dns(global_loadparm, poptGetOptArg(pc));
+                       parse_dns(cmdline_lp_ctx, poptGetOptArg(pc));
                        break;
                case OPT_DANGEROUS:
-                       lp_set_cmdline(global_loadparm, "torture:dangerous", "Yes");
+                       lp_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes");
                        break;
                case OPT_ASYNC:
-                       lp_set_cmdline(global_loadparm, "torture:async", "Yes");
+                       lp_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes");
                        break;
                case OPT_SMB_PORTS:
-                       lp_set_cmdline(global_loadparm, "smb ports", poptGetOptArg(pc));
+                       lp_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc));
                        break;
                }
        }
 
        if (strcmp(target, "samba3") == 0) {
-               lp_set_cmdline(global_loadparm, "torture:samba3", "true");
+               lp_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true");
        } else if (strcmp(target, "samba4") == 0) {
-               lp_set_cmdline(global_loadparm, "torture:samba4", "true");
+               lp_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true");
        }
 
        if (max_runtime) {
@@ -658,7 +658,7 @@ int main(int argc,char *argv[])
                exit(1);
        }
 
-       if (!parse_target(global_loadparm, argv_new[1])) {
+       if (!parse_target(cmdline_lp_ctx, argv_new[1])) {
                usage(pc);
                exit(1);
        }
@@ -690,7 +690,7 @@ int main(int argc,char *argv[])
                torture->outputdir = pwd;
        }
 
-       torture->lp_ctx = global_loadparm;
+       torture->lp_ctx = cmdline_lp_ctx;
 
        if (argc_new == 0) {
                printf("You must specify a test to run, or 'ALL'\n");
index 44a0d3b4c2dc50eb80ed675ef2cff142a5acb0d9..f0538c03623687cbb5667dfb18e5bd95b3c27f8b 100644 (file)
@@ -65,7 +65,7 @@ struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx,
 int torture_init(void)
 {
        init_module_fn static_init[] = STATIC_torture_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "torture");
+       init_module_fn *shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "torture");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 2741f485cc38c75dba49905bb7b488dbd470f6f2..2c95e9033dd9b6c9232a6fcdb2485ac9e9cf73dc 100644 (file)
@@ -193,7 +193,7 @@ static int binary_net(int argc, const char **argv)
 
        ZERO_STRUCTP(ctx);
        ctx->mem_ctx = mem_ctx;
-       ctx->lp_ctx = global_loadparm;
+       ctx->lp_ctx = cmdline_lp_ctx;
        ctx->credentials = cmdline_credentials;
 
        rc = net_run_function(ctx, argc_new-1, argv_new+1, net_functable, net_usage);
index 9f121390f6d5f4c901ca9feeef328cc893add7b5..a3e33e27488daff94cc0a3e5df10378c0159aace 100644 (file)
@@ -179,7 +179,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock,
 }
 
 
-static bool process_one(const char *name, int nbt_port)
+static bool process_one(struct loadparm_context *lp_ctx, const char *name, int nbt_port)
 {
        TALLOC_CTX *tmp_ctx = talloc_new(NULL);
        enum nbt_name_type node_type = NBT_NAME_CLIENT;
@@ -241,9 +241,9 @@ static bool process_one(const char *name, int nbt_port)
                status = do_node_query(nbtsock, options.unicast_address, 
                                       nbt_port, node_name, node_type, false);
        } else {
-               int i, num_interfaces = iface_count(global_loadparm);
+               int i, num_interfaces = iface_count(lp_ctx);
                for (i=0;i<num_interfaces;i++) {
-                       const char *bcast = iface_n_bcast(global_loadparm, i);
+                       const char *bcast = iface_n_bcast(lp_ctx, i);
                        if (bcast == NULL) continue;
                        status = do_node_query(nbtsock, bcast, nbt_port, 
                                               node_name, node_type, true);
@@ -353,7 +353,7 @@ int main(int argc, const char *argv[])
        while (poptPeekArg(pc)) {
                const char *name = poptGetArg(pc);
 
-               ret &= process_one(name, lp_nbt_port(global_loadparm));
+               ret &= process_one(cmdline_lp_ctx, name, lp_nbt_port(cmdline_lp_ctx));
        }
 
        poptFreeContext(pc);
index cb2fbd63c157d6ce93aa17394bccac2b75cfbe5c..93d1909a56a0cd0827aa3bac99b4085af6132b5f 100644 (file)
@@ -77,7 +77,8 @@ static void manage_ntlm_server_1_request (enum stdio_helper_mode stdio_helper_mo
                                          char *buf, int length, void **private,
                                          unsigned int mux_id, void **private2);
 
-static void manage_squid_request(enum stdio_helper_mode helper_mode, 
+static void manage_squid_request(struct loadparm_context *lp_ctx,
+                                enum stdio_helper_mode helper_mode, 
                                 stdio_helper_function fn, void **private2);
 
 static const struct {
@@ -329,7 +330,7 @@ static const char *get_password(struct cli_credentials *credentials)
        mux_printf((unsigned int)credentials->priv_data, "PW\n");
        credentials->priv_data = NULL;
 
-       manage_squid_request(NUM_HELPER_MODES /* bogus */, manage_gensec_get_pw_request, (void **)&password);
+       manage_squid_request(cmdline_lp_ctx, NUM_HELPER_MODES /* bogus */, manage_gensec_get_pw_request, (void **)&password);
        return password;
 }
 
@@ -897,7 +898,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
        }
 }
 
-static void manage_squid_request(enum stdio_helper_mode helper_mode, 
+static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_helper_mode helper_mode, 
                                 stdio_helper_function fn, void **private2) 
 {
        char *buf;
@@ -1000,17 +1001,18 @@ static void manage_squid_request(enum stdio_helper_mode helper_mode,
                private = &normal_private;
        }
 
-       fn(helper_mode, global_loadparm, c, length, private, mux_id, private2);
+       fn(helper_mode, lp_ctx, c, length, private, mux_id, private2);
        talloc_free(buf);
 }
 
-static void squid_stream(enum stdio_helper_mode stdio_mode, 
+static void squid_stream(struct loadparm_context *lp_ctx, 
+                        enum stdio_helper_mode stdio_mode, 
                         stdio_helper_function fn) {
        /* initialize FDescs */
        x_setbuf(x_stdout, NULL);
        x_setbuf(x_stderr, NULL);
        while(1) {
-               manage_squid_request(stdio_mode, fn, NULL);
+               manage_squid_request(lp_ctx, stdio_mode, fn, NULL);
        }
 }
 
@@ -1093,17 +1095,17 @@ int main(int argc, const char **argv)
                return 1;
        }
 
-       gensec_init(global_loadparm);
+       gensec_init(cmdline_lp_ctx);
 
        if (opt_domain == NULL) {
-               opt_domain = lp_workgroup(global_loadparm);
+               opt_domain = lp_workgroup(cmdline_lp_ctx);
        }
 
        if (helper_protocol) {
                int i;
                for (i=0; i<NUM_HELPER_MODES; i++) {
                        if (strcmp(helper_protocol, stdio_helper_protocols[i].name) == 0) {
-                               squid_stream(stdio_helper_protocols[i].mode, stdio_helper_protocols[i].fn);
+                               squid_stream(cmdline_lp_ctx, stdio_helper_protocols[i].mode, stdio_helper_protocols[i].fn);
                                exit(0);
                        }
                }
@@ -1123,7 +1125,7 @@ int main(int argc, const char **argv)
        }
 
        if (opt_workstation == NULL) {
-               opt_workstation = lp_netbios_name(global_loadparm);
+               opt_workstation = lp_netbios_name(cmdline_lp_ctx);
        }
 
        if (!opt_password) {
@@ -1133,7 +1135,7 @@ int main(int argc, const char **argv)
        {
                char *user;
 
-               asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(global_loadparm), opt_username);
+               asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(cmdline_lp_ctx), opt_username);
                if (!check_plaintext_auth(user, opt_password, true)) {
                        return 1;
                }
index fe8cc7124a08ff2346a1a3199d94897737f91f17..a4ff5221866ec50e3a6b68e47d6a1dd0a782a0d1 100644 (file)
@@ -234,7 +234,7 @@ static int do_share_checks(struct loadparm_context *lp_ctx, const char *cname, c
        }
 */
 
-       lp_ctx = global_loadparm;
+       lp_ctx = cmdline_lp_ctx;
        
        /* We need this to force the output */
        lp_set_cmdline(lp_ctx, "log level", "2");
index 6545805e8a04cd9d607fff47cebf6bf18cf4a21d..cee7e5c3e7837c7a2d998f11730399ebf3728a59 100644 (file)
@@ -405,7 +405,7 @@ static void init_domain_recv_samr(struct composite_context *ctx)
        state->domain->libnet_ctx->samr.sid = state->domain->info->sid;
 
        state->domain->ldap_conn =
-               ldap4_new_connection(state->domain, state->ctx->event_ctx);
+               ldap4_new_connection(state->domain, state->domain->libnet_ctx->lp_ctx, state->ctx->event_ctx);
        composite_nomem(state->domain->ldap_conn, state->ctx);
 
        ldap_url = talloc_asprintf(state, "ldap://%s/",