r25446: Merge some changes I made on the way home from SFO:
authorJelmer Vernooij <jelmer@samba.org>
Mon, 1 Oct 2007 18:52:55 +0000 (18:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:34 +0000 (15:07 -0500)
2007-09-29 More higher-level passing around of lp_ctx.
2007-09-29 Fix warning.
2007-09-29 Pass loadparm contexts on a higher level.
2007-09-29 Avoid using global loadparm context.
(This used to be commit 3468952e771ab31f90b6c374ade01c5550810f42)

63 files changed:
source4/auth/auth.c
source4/auth/auth_sam.c
source4/auth/auth_server.c
source4/auth/credentials/credentials_files.c
source4/auth/gensec/gensec.c
source4/auth/gensec/schannel_state.c
source4/auth/kerberos/krb5_init_context.c
source4/cluster/local.c
source4/dsdb/samdb/samdb.c
source4/ldap_server/ldap_backend.c
source4/lib/cmdline/popt_credentials.c
source4/lib/db_wrap.c
source4/lib/db_wrap.h
source4/lib/dbwrap/dbwrap_tdb.c
source4/lib/events/events.c
source4/lib/gencache/gencache.c
source4/lib/messaging/irpc.h
source4/lib/messaging/messaging.c
source4/lib/registry/ldb.c
source4/lib/registry/samba.c
source4/lib/tls/tls.c
source4/libcli/cliconnect.c
source4/libcli/finddcs.c
source4/libcli/smb2/connect.c
source4/libcli/smb_composite/connect.c
source4/libcli/smb_composite/sesssetup.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_join.c
source4/libnet/libnet_lookup.c
source4/libnet/libnet_samsync_ldb.c
source4/libnet/libnet_unbecome_dc.c
source4/nbt_server/wins/winsdb.c
source4/ntptr/ntptr_base.c
source4/ntptr/simple_ldb/ntptr_simple_ldb.c
source4/ntvfs/ntvfs_base.c
source4/ntvfs/sysdep/sys_notify.c
source4/param/secrets.c
source4/param/share.c
source4/param/share_ldb.c
source4/param/util.c
source4/rpc_server/service_rpc.c
source4/scripting/ejs/smbcalls.c
source4/scripting/ejs/smbcalls_auth.c
source4/scripting/ejs/smbcalls_ldb.c
source4/scripting/ejs/smbcalls_rpc.c
source4/smb_server/smb/negprot.c
source4/smbd/process_model.c
source4/smbd/server.c
source4/smbd/service_stream.c
source4/smbd/service_task.c
source4/torture/ldap/schema.c
source4/torture/ldap/uptodatevector.c
source4/torture/libnet/libnet_BecomeDC.c
source4/torture/local/dbspeed.c
source4/torture/local/irpc.c
source4/torture/local/messaging.c
source4/torture/rpc/spoolss.c
source4/torture/torture.c
source4/torture/winbind/struct_based.c
source4/utils/ntlm_auth.c
source4/winbind/wb_samba3_cmd.c
source4/winbind/wb_server.c
source4/wrepl_server/wrepl_server.c

index 7a3f9f82cb20fb2ec1df731794e141c291b7399e..20524b34a4fe1e1b3e7268e5e465644e40bb0061 100644 (file)
@@ -519,7 +519,7 @@ NTSTATUS auth_init(void)
        if (initialized) return NT_STATUS_OK;
        initialized = True;
        
-       shared_init = load_samba_modules(NULL, "auth");
+       shared_init = load_samba_modules(NULL, global_loadparm, "auth");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index be8225f0dced66a35227acb14ead0216902dc6fe..da1ffb5c851ffeb5e8f7f89baf8d19b8f16e6bbc 100644 (file)
@@ -342,14 +342,16 @@ static NTSTATUS authsam_want_check(struct auth_method_context *ctx,
                                   TALLOC_CTX *mem_ctx,
                                   const struct auth_usersupplied_info *user_info)
 {
-       BOOL is_local_name, is_my_domain;
+       bool is_local_name, is_my_domain;
 
        if (!user_info->mapped.account_name || !*user_info->mapped.account_name) {
                return NT_STATUS_NOT_IMPLEMENTED;
        }
 
-       is_local_name = is_myname(user_info->mapped.domain_name);
-       is_my_domain  = strequal(user_info->mapped.domain_name, lp_workgroup(global_loadparm));
+       is_local_name = lp_is_myname(global_loadparm, 
+                                 user_info->mapped.domain_name);
+       is_my_domain  = lp_is_mydomain(global_loadparm, 
+                                      user_info->mapped.domain_name); 
 
        /* check whether or not we service this domain/workgroup name */
        switch (lp_server_role(global_loadparm)) {
index 5d4c33969fd8ff267bcea7b519598cacfa552688..1513228bd94912399c6cc95783976bdba9d11830 100644 (file)
@@ -195,8 +195,8 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
        struct smbcli_state *cli;
        static uint8_t badpass[24];
        static fstring baduser; 
-       static BOOL tested_password_server = False;
-       static BOOL bad_password_server = False;
+       static bool tested_password_server = false;
+       static bool bad_password_server = false;
        NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
        BOOL locally_made_cli = False;
 
@@ -206,7 +206,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
         * password file.
         */
 
-       if(is_myname(user_info->domain.str)) {
+       if (lp_is_myname(global_loadparm, user_info->domain.str)) {
                DEBUG(3,("check_smbserver_security: Requested domain was for this machine.\n"));
                return NT_STATUS_LOGON_FAILURE;
        }
index 5770dbf05706809a13a3b075fd496edbab144562..2aefb7c52fad4c62192aa6883f369d096d6cc04d 100644 (file)
@@ -308,7 +308,7 @@ NTSTATUS cli_credentials_set_secrets(struct cli_credentials *cred,
        } else {
                keytab = ldb_msg_find_attr_as_string(msgs[0], "privateKeytab", NULL);
                if (keytab) {
-                       keytab = talloc_asprintf(mem_ctx, "FILE:%s", private_path(mem_ctx, keytab));
+                       keytab = talloc_asprintf(mem_ctx, "FILE:%s", private_path(mem_ctx, global_loadparm, keytab));
                        if (keytab) {
                                cli_credentials_set_keytab_name(cred, keytab, CRED_SPECIFIED);
                        }
index 541c1ff181c0f1f84563a9d8e1db6828ec2d6108..9bbf31a7c797f52399b344f47f9cb64db6768afa 100644 (file)
@@ -1269,7 +1269,7 @@ NTSTATUS gensec_init(void)
        if (initialized) return NT_STATUS_OK;
        initialized = True;
        
-       shared_init = load_samba_modules(NULL, "gensec");
+       shared_init = load_samba_modules(NULL, global_loadparm, "gensec");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index afbbd618eb8efa1685a5eb0f3727b2e4d57d709b..46fb48ffd3f1ec3e7339c7fbbe35e55498531954 100644 (file)
@@ -41,14 +41,15 @@ struct ldb_context *schannel_db_connect(TALLOC_CTX *mem_ctx)
                "computerName: CASE_INSENSITIVE\n" \
                "flatname: CASE_INSENSITIVE\n";
 
-       path = smbd_tmp_path(mem_ctx, "schannel.ldb");
+       path = smbd_tmp_path(mem_ctx, global_loadparm, "schannel.ldb");
        if (!path) {
                return NULL;
        }
 
        existed = file_exist(path);
        
-       ldb = ldb_wrap_connect(mem_ctx, path, system_session(mem_ctx), 
+       ldb = ldb_wrap_connect(mem_ctx, global_loadparm, path, 
+                              system_session(mem_ctx), 
                               NULL, LDB_FLG_NOSYNC, NULL);
        talloc_free(path);
        if (!ldb) {
index d604c33233daf2768ce7909784d8580a786f8651..68e60dcdc545d3b07e3720b19e60bbf3446c00c2 100644 (file)
@@ -393,7 +393,7 @@ krb5_error_code smb_krb5_init_context(void *parent_ctx,
 
        talloc_set_destructor(*smb_krb5_context, smb_krb5_context_destroy_1);
 
-       config_file = config_path(tmp_ctx, "krb5.conf");
+       config_file = config_path(tmp_ctx, global_loadparm, "krb5.conf");
        if (!config_file) {
                talloc_free(tmp_ctx);
                return ENOMEM;
index be6d857d7b885a28241e05c621fafede0554a168..2abe422d5a9478e3d0617170c8759833cc5564c2 100644 (file)
@@ -58,7 +58,7 @@ static struct tdb_wrap *local_tdb_tmp_open(struct cluster_ops *ops,
                                           TALLOC_CTX *mem_ctx, const char *dbname, 
                                           int flags)
 {
-       char *path = smbd_tmp_path(mem_ctx, dbname);
+       char *path = smbd_tmp_path(mem_ctx, global_loadparm, dbname);
        struct tdb_wrap *w;
        w = tdb_wrap_open(mem_ctx, path, 0, flags,
                          O_RDWR|O_CREAT, 0600);
index 38be2825ea56bcd9a0ad07eedc9bd9be145bce90..2f755d6c791fb21b8678f37ba6cfd4262440add5 100644 (file)
@@ -45,7 +45,8 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
                                  struct auth_session_info *session_info)
 {
        struct ldb_context *ldb;
-       ldb = ldb_wrap_connect(mem_ctx, lp_sam_url(global_loadparm), session_info,
+       ldb = ldb_wrap_connect(mem_ctx, global_loadparm, 
+                              lp_sam_url(global_loadparm), session_info,
                               NULL, 0, NULL);
        if (!ldb) {
                return NULL;
index ae0fd207b520708cfaaeef1559c16da00b1a9da6..25d19a5a588f6df70fb33455e5b6c18811c12801 100644 (file)
@@ -55,7 +55,9 @@ static int map_ldb_error(struct ldb_context *ldb, int err, const char **errstrin
 */
 NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn) 
 {
-       conn->ldb = ldb_wrap_connect(conn, lp_sam_url(global_loadparm), conn->session_info,
+       conn->ldb = ldb_wrap_connect(conn, 
+                                    global_loadparm,
+                                    lp_sam_url(global_loadparm), conn->session_info,
                                     NULL, conn->global_catalog ? LDB_FLG_RDONLY : 0, NULL);
        if (conn->ldb == NULL) {
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
index b913e6a53a9a27c0a68914daab494578fb332328..49ef4f0aaf841a7ab29105e34e8210cfe901649b 100644 (file)
@@ -37,7 +37,7 @@
  */
 
 
-static BOOL dont_ask;
+static bool dont_ask;
 
 enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS };
 
index 4c0a06cf2c8b01d9f9341c3b86b688cc5c61ec4a..c33786a1e43a8c0b83b8259c9972357e23ff33d6 100644 (file)
@@ -103,6 +103,7 @@ static int ldb_wrap_destructor(struct ldb_context *ldb)
   TODO:  We need an error_string parameter
  */
 struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
+                                    struct loadparm_context *lp_ctx,
                                     const char *url,
                                     struct auth_session_info *session_info,
                                     struct cli_credentials *credentials,
@@ -121,7 +122,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
        }
 
        ldb_set_modules_dir(ldb, 
-                           talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(global_loadparm)));
+                           talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(lp_ctx)));
 
        /* we want to use the existing event context if possible. This
           relies on the fact that in smbd, everything is a child of
@@ -143,7 +144,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
                return NULL;
        }
        
-       if (strcmp(lp_sam_url(global_loadparm), url) == 0) {
+       if (strcmp(lp_sam_url(lp_ctx), url) == 0) {
                dsdb_set_global_schema(ldb);
        }
 
@@ -157,14 +158,14 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
 
        ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
 
-       real_url = private_path(ldb, url);
+       real_url = private_path(ldb, lp_ctx, url);
        if (real_url == NULL) {
                talloc_free(ldb);
                return NULL;
        }
 
        /* allow admins to force non-sync ldb for all databases */
-       if (lp_parm_bool(global_loadparm, NULL, "ldb", "nosync", false)) {
+       if (lp_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) {
                flags |= LDB_FLG_NOSYNC;
        }
 
index 4ead9f30103177a32f742481888cf36da2885f7b..b45a05c24f5741f1566e4924d0148ab76b06e7fb 100644 (file)
@@ -31,5 +31,6 @@ struct auth_session_info;
 struct ldb_message;
 struct ldb_dn;
 struct cli_credentials;
+struct loadparm_context;
 
 #include "lib/db_wrap_proto.h"
index b6af8abadd8da8f0ffc1df228a512f5db77b4e71..b256b6ccc4d2f9c18983111261acc98d8fab58cf 100644 (file)
@@ -241,7 +241,7 @@ struct db_context *db_tmp_open_tdb(TALLOC_CTX *mem_ctx, const char *name, int td
 
        /* the name passed in should not be a full path, it should be
           just be the db name */
-       path = smbd_tmp_path(result, name);
+       path = smbd_tmp_path(result, global_loadparm, name);
 
        db_tdb->wtdb = tdb_wrap_open(db_tdb, path, 0, tdb_flags,
                                     O_CREAT|O_RDWR, 0666);
index c1e57a3d323bc18aa6e4f2a8d053efa716165958..060f72f79315f4e9bf20d60befd0a1b998f60b5e 100644 (file)
@@ -105,7 +105,7 @@ static void event_backend_init(void)
        init_module_fn static_init[] = STATIC_LIBEVENTS_MODULES;
        init_module_fn *shared_init;
        if (event_backends) return;
-       shared_init = load_samba_modules(NULL, "LIBEVENTS");
+       shared_init = load_samba_modules(NULL, global_loadparm, "LIBEVENTS");
        run_init_functions(static_init);
        run_init_functions(shared_init);
 #else
index 08ff55b211185723bbe4dbe9eb050e4be70c34b4..30bb1d86eddda684533594bdc04f2199d163b728 100644 (file)
@@ -55,7 +55,7 @@ BOOL gencache_init(void)
        /* skip file open if it's already opened */
        if (cache) return True;
 
-       cache_fname = lock_path(mem_ctx, "gencache.tdb");
+       cache_fname = lock_path(mem_ctx, global_loadparm, "gencache.tdb");
        if (cache_fname != NULL) {
                DEBUG(5, ("Opening cache file at %s\n", cache_fname));
        } else {
index bcfc1f1ab4afda2d232269f5abde39777bc81572..989e5d4255de1c72088351f9aa1306d8621e45ca 100644 (file)
@@ -76,13 +76,12 @@ struct irpc_request {
        } async;
 };
 
+struct loadparm_context;
+
 typedef void (*msg_callback_t)(struct messaging_context *msg, void *private, 
                               uint32_t msg_type, 
                               struct server_id server_id, DATA_BLOB *data);
 
-struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
-                                        struct server_id server_id, 
-                                        struct event_context *ev);
 NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, 
                        uint32_t msg_type, DATA_BLOB *data);
 NTSTATUS messaging_register(struct messaging_context *msg, void *private,
@@ -91,9 +90,11 @@ NTSTATUS messaging_register(struct messaging_context *msg, void *private,
 NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private,
                                msg_callback_t fn, uint32_t *msg_type);
 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
+                                        const char *dir,
                                         struct server_id server_id, 
                                         struct event_context *ev);
 struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, 
+                                        const char *dir,
                                         struct event_context *ev);
 NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, 
                            uint32_t msg_type, void *ptr);
index e398b16d726101b8f331b44281d813628228c001..36cf9aa60948d3953bee4f037bd7d5796983eafd 100644 (file)
@@ -530,13 +530,13 @@ static int messaging_destructor(struct messaging_context *msg)
   create the listening socket and setup the dispatcher
 */
 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
+                                        const char *dir,
                                         struct server_id server_id, 
                                         struct event_context *ev)
 {
        struct messaging_context *msg;
        NTSTATUS status;
        struct socket_address *path;
-       char *dir;
 
        msg = talloc_zero(mem_ctx, struct messaging_context);
        if (msg == NULL) {
@@ -555,11 +555,9 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
        }
 
        /* create the messaging directory if needed */
-       dir = smbd_tmp_path(msg, "messaging");
        mkdir(dir, 0700);
-       talloc_free(dir);
 
-       msg->base_path     = smbd_tmp_path(msg, "messaging");
+       msg->base_path     = talloc_reference(msg, dir);
        msg->path          = messaging_path(msg, server_id);
        msg->server_id     = server_id;
        msg->idr           = idr_init(msg);
@@ -610,12 +608,13 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
    A hack, for the short term until we get 'client only' messaging in place 
 */
 struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, 
+                                               const char *dir,
                                                struct event_context *ev)
 {
        struct server_id id;
        ZERO_STRUCT(id);
        id.id = random() % 0x10000000;
-       return messaging_init(mem_ctx, id, ev);
+       return messaging_init(mem_ctx, dir, id, ev);
 }
 /*
   a list of registered irpc server functions
index 5ecbfa04077f3536c4d49fa3f69b7ffdbf48fd7d..e9daf31f9bc3dd86453dc8d72a2f3b194ab0c3ac 100644 (file)
@@ -23,6 +23,7 @@
 #include "lib/ldb/include/ldb_errors.h"
 #include "db_wrap.h"
 #include "librpc/gen_ndr/winreg.h"
+#include "param/param.h"
 
 static struct hive_operations reg_backend_ldb;
 
@@ -317,9 +318,9 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct hive_key *h,
 }
 
 WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location, 
-                                                               struct auth_session_info *session_info,
-                                                               struct cli_credentials *credentials,
-                                                               struct hive_key **k)
+                        struct auth_session_info *session_info,
+                        struct cli_credentials *credentials,
+                        struct hive_key **k)
 {
        struct ldb_key_data *kd;
        struct ldb_context *wrap;
@@ -327,7 +328,8 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
        if (location == NULL) 
                return WERR_INVALID_PARAM;
 
-       wrap = ldb_wrap_connect(parent_ctx, location, session_info, credentials, 0, NULL);
+       wrap = ldb_wrap_connect(parent_ctx, global_loadparm, 
+                               location, session_info, credentials, 0, NULL);
 
        if (wrap == NULL) {
                DEBUG(1, (__FILE__": unable to connect\n"));
index 48eb043306879074913a947493ff4dcfaa4b0168..18bbcb8299593809ca227c362dd7ac40b4f15195 100644 (file)
  * @brief Samba-specific registry functions
  */
 
-static WERROR mount_samba_hive(struct registry_context *ctx,
-                                               struct auth_session_info *auth_info,
-                                               struct cli_credentials *creds,
-                                               const char *name, 
-                                               uint32_t hive_id)
+static WERROR mount_samba_hive(struct registry_context *ctx, 
+                              struct auth_session_info *auth_info,
+                              struct cli_credentials *creds,
+                              const char *name, 
+                              uint32_t hive_id)
 {
        WERROR error;
        struct hive_key *hive;
index 8be818433dc23d760815744344b9a2620e538c17..d2f6d6f740606c052bca205aa8ec9bfcdd1b6aad 100644 (file)
@@ -357,11 +357,11 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx)
        struct tls_params *params;
        int ret;
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
-       const char *keyfile = private_path(tmp_ctx, lp_tls_keyfile(global_loadparm));
-       const char *certfile = private_path(tmp_ctx, lp_tls_certfile(global_loadparm));
-       const char *cafile = private_path(tmp_ctx, lp_tls_cafile(global_loadparm));
-       const char *crlfile = private_path(tmp_ctx, lp_tls_crlfile(global_loadparm));
-       const char *dhpfile = private_path(tmp_ctx, lp_tls_dhpfile(global_loadparm));
+       const char *keyfile = private_path(tmp_ctx, global_loadparm, lp_tls_keyfile(global_loadparm));
+       const char *certfile = private_path(tmp_ctx, global_loadparm, lp_tls_certfile(global_loadparm));
+       const char *cafile = private_path(tmp_ctx, global_loadparm, lp_tls_cafile(global_loadparm));
+       const char *crlfile = private_path(tmp_ctx, global_loadparm, lp_tls_crlfile(global_loadparm));
+       const char *dhpfile = private_path(tmp_ctx, global_loadparm, lp_tls_dhpfile(global_loadparm));
        void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *);
 
        params = talloc(mem_ctx, struct tls_params);
@@ -565,7 +565,7 @@ struct socket_context *tls_init_client(struct socket_context *socket,
        }
        new_sock->private_data    = tls;
 
-       cafile = private_path(tls, lp_tls_cafile(global_loadparm));
+       cafile = private_path(tls, global_loadparm, lp_tls_cafile(global_loadparm));
        if (!cafile || !*cafile) {
                goto failed;
        }
index 715eb875fee0045fa6ad0d9bee2018cb3063b941..96946da7fec91cdd8640096252fdb7b5a169d1fa 100644 (file)
@@ -57,7 +57,8 @@ BOOL smbcli_transport_establish(struct smbcli_state *cli,
 /* wrapper around smb_raw_negotiate() */
 NTSTATUS smbcli_negprot(struct smbcli_state *cli)
 {
-       return smb_raw_negotiate(cli->transport, lp_cli_maxprotocol(global_loadparm));
+       return smb_raw_negotiate(cli->transport, 
+                                lp_cli_maxprotocol(global_loadparm));
 }
 
 /* wrapper around smb_raw_sesssetup() */
index 2ac1358197f3aef55fcaaca79b0df78346b34ad7..e00697fe17ae21cae1e66a07248e85490ddff00e 100644 (file)
@@ -147,7 +147,7 @@ static void finddcs_name_resolved(struct composite_context *ctx)
        state->r.in.ip_address = state->dcs[0].address;
        state->r.in.my_computername = lp_netbios_name(global_loadparm);
        state->r.in.my_accountname = talloc_asprintf(state, "%s$",
-                                                    lp_netbios_name(global_loadparm));
+                                       lp_netbios_name(global_loadparm));
        if (composite_nomem(state->r.in.my_accountname, state->ctx)) return;
        state->r.in.account_control = ACB_WSTRUST;
        state->r.in.domain_sid = state->domain_sid;
index 6a2e9d09e99afa38468d44c1bc5006ce74838c50..bb70311c56a9c8af852215e4b0fcfa7971037dc1 100644 (file)
@@ -187,7 +187,8 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
        ZERO_STRUCT(name);
        name.name = host;
 
-       creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order(global_loadparm));
+       creq = resolve_name_send(&name, c->event_ctx, 
+                                lp_name_resolve_order(global_loadparm));
        composite_continue(c, creq, continue_resolve, c);
        return c;
 }
index 22b2cdb0e2106d86023163b8c76896433ddddc2b..23974619d611eac68f050d85736e9e380cbf7564 100644 (file)
@@ -63,7 +63,8 @@ static NTSTATUS connect_send_negprot(struct composite_context *c,
 {
        struct connect_state *state = talloc_get_type(c->private_data, struct connect_state);
 
-       state->req = smb_raw_negotiate_send(state->transport, lp_cli_maxprotocol(global_loadparm));
+       state->req = smb_raw_negotiate_send(state->transport, 
+                                           lp_cli_maxprotocol(global_loadparm));
        NT_STATUS_HAVE_NO_MEMORY(state->req);
 
        state->req->async.fn = request_handler;
@@ -172,7 +173,8 @@ static NTSTATUS connect_session_setup(struct composite_context *c,
 
                state->io_setup->in.credentials = cli_credentials_init(state);
                NT_STATUS_HAVE_NO_MEMORY(state->io_setup->in.credentials);
-               cli_credentials_set_conf(state->io_setup->in.credentials, global_loadparm);
+               cli_credentials_set_conf(state->io_setup->in.credentials, 
+                                        global_loadparm);
                cli_credentials_set_anonymous(state->io_setup->in.credentials);
 
                /* If the preceding attempt was with extended security, we
@@ -459,7 +461,8 @@ struct composite_context *smb_composite_connect_send(struct smb_composite_connec
 
        state->stage = CONNECT_RESOLVE;
        make_nbt_name_server(&name, io->in.dest_host);
-       state->creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order(global_loadparm));
+       state->creq = resolve_name_send(&name, c->event_ctx, 
+                                       lp_name_resolve_order(global_loadparm));
 
        if (state->creq == NULL) goto failed;
        state->creq->async.private_data = c;
index 6f9e6b0de3c16dfe52c1da3aca801f004ffefba8..622367e746e3241693eb78ed431668d6f73b1747 100644 (file)
@@ -418,7 +418,7 @@ static NTSTATUS session_setup_spnego(struct composite_context *c,
                }
        }
 
-       if (chosen_oid == GENSEC_OID_SPNEGO) {
+       if ((const void *)chosen_oid == (const void *)GENSEC_OID_SPNEGO) {
                status = gensec_update(session->gensec, state,
                                       session->transport->negotiate.secblob,
                                       &state->setup.spnego.in.secblob);
index 76984bf5b1414ce92cd4001de91a32d35ca2da27..cd782066dbe3e420893acfaf3f867b2dce80b2da 100644 (file)
@@ -790,7 +790,7 @@ static NTSTATUS becomeDC_ldap_connect(struct libnet_BecomeDC_state *s, struct be
        url = talloc_asprintf(s, "ldap://%s/", s->source_dsa.dns_name);
        NT_STATUS_HAVE_NO_MEMORY(url);
 
-       ldap->ldb = ldb_wrap_connect(s, url,
+       ldap->ldb = ldb_wrap_connect(s, global_loadparm, url,
                                     NULL,
                                     s->libnet->cred,
                                     0, NULL);
index 553bde615be3e07df2978b6998a865e8ed164e0f..1fd84146debbab4bec8c0b44b5414c05dbd63af1 100644 (file)
@@ -228,7 +228,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
                return NT_STATUS_NO_MEMORY;
        }
 
-       remote_ldb = ldb_wrap_connect(tmp_ctx, remote_ldb_url, 
+       remote_ldb = ldb_wrap_connect(tmp_ctx, global_loadparm, 
+                                     remote_ldb_url, 
                                      NULL, ctx->cred, 0, NULL);
        if (!remote_ldb) {
                r->out.error_string = NULL;
index 6856156734e002fafc5173ed7102b15117310e80..cac7086a60c7c05c2d9cba214ee95d3381089f53 100644 (file)
@@ -34,6 +34,8 @@
 #include "librpc/gen_ndr/lsa.h"
 #include "librpc/gen_ndr/ndr_lsa_c.h"
 
+#include "param/param.h"
+
 struct lookup_state {
        struct nbt_name hostname;
        const char *address;
@@ -189,7 +191,8 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx,
                                                struct libnet_LookupDCs *io)
 {
        struct composite_context *c;
-       struct messaging_context *msg_ctx = messaging_client_init(mem_ctx, ctx->event_ctx);
+       struct messaging_context *msg_ctx = 
+               messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, global_loadparm), ctx->event_ctx);
 
        c = finddcs_send(mem_ctx, io->in.domain_name, io->in.name_type,
                         NULL, ctx->name_res_methods, ctx->event_ctx, msg_ctx);
index 9511989e8c23eed6b78072a323dac7b5c0bf93c0..c49d800d40c87895c0ff75476cf15669c868ac90 100644 (file)
@@ -1191,7 +1191,9 @@ static NTSTATUS libnet_samsync_ldb_init(TALLOC_CTX *mem_ctx,
                }
                ldap_url = talloc_asprintf(state, "ldap://%s", server);
                
-               state->remote_ldb = ldb_wrap_connect(mem_ctx, ldap_url, 
+               state->remote_ldb = ldb_wrap_connect(mem_ctx, 
+                                                    global_loadparm, 
+                                                    ldap_url, 
                                                     NULL, state->samsync_state->machine_net_ctx->cred,
                                                     0, NULL);
                if (!state->remote_ldb) {
@@ -1217,7 +1219,9 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str
        state->secrets         = NULL;
        state->trusted_domains = NULL;
 
-       state->sam_ldb         = ldb_wrap_connect(mem_ctx, lp_sam_url(global_loadparm), 
+       state->sam_ldb         = ldb_wrap_connect(mem_ctx, 
+                                                 global_loadparm, 
+                                                 lp_sam_url(global_loadparm), 
                                                  r->in.session_info,
                                                  ctx->cred, 0, NULL);
 
index 643b97bc8b675d6ec15538045cb062a06f6f8a12..40b1aab2152e0bac7eca0c471b1bcaeb8cbf8b6d 100644 (file)
@@ -27,6 +27,7 @@
 #include "dsdb/samdb/samdb.h"
 #include "dsdb/common/flags.h"
 #include "librpc/gen_ndr/ndr_drsuapi_c.h"
+#include "param/param.h"
 
 /*****************************************************************************
  * Windows 2003 (w2k3) does the following steps when changing the server role
@@ -307,7 +308,7 @@ static NTSTATUS unbecomeDC_ldap_connect(struct libnet_UnbecomeDC_state *s)
        url = talloc_asprintf(s, "ldap://%s/", s->source_dsa.dns_name);
        NT_STATUS_HAVE_NO_MEMORY(url);
 
-       s->ldap.ldb = ldb_wrap_connect(s, url,
+       s->ldap.ldb = ldb_wrap_connect(s, global_loadparm, url,
                                       NULL,
                                       s->libnet->cred,
                                       0, NULL);
index 299d5be89418721348f10720e40df8282dcddb0c..2789873c59faa8c194f8547b915c4ae45c232620 100644 (file)
@@ -992,7 +992,7 @@ static BOOL winsdb_check_or_add_module_list(struct winsdb_handle *h)
                flags |= LDB_FLG_NOSYNC;
        }
 
-       h->ldb = ldb_wrap_connect(h, lock_path(h, lp_wins_url(global_loadparm)),
+       h->ldb = ldb_wrap_connect(h, global_loadparm, lock_path(h, global_loadparm, lp_wins_url(global_loadparm)),
                                  NULL, NULL, flags, NULL);
        if (!h->ldb) goto failed;
 
@@ -1025,7 +1025,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, enum winsdb_handle_cal
                flags |= LDB_FLG_NOSYNC;
        }
 
-       h->ldb = ldb_wrap_connect(h, lock_path(h, lp_wins_url(global_loadparm)),
+       h->ldb = ldb_wrap_connect(h, global_loadparm, lock_path(h, global_loadparm, lp_wins_url(global_loadparm)),
                                  NULL, NULL, flags, NULL);
        if (!h->ldb) goto failed;       
 
index 5735dbe9363c987d44d72c6c0eb9dcb7694239f8..379c4e54134a44021a870d21ec875fe486f59fb1 100644 (file)
@@ -72,7 +72,7 @@ NTSTATUS ntptr_register(const void *_ops)
 NTSTATUS ntptr_init(void)
 {
        init_module_fn static_init[] = STATIC_ntptr_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, "ntptr");
+       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "ntptr");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 02808bfbc8ba9ac0ed3689a4e76367c94dda7e2d..4046c1bdbd6d24f99806d58cfea6b648dd8173e9 100644 (file)
@@ -43,7 +43,7 @@
  */
 static struct ldb_context *sptr_db_connect(TALLOC_CTX *mem_ctx)
 {
-       return ldb_wrap_connect(mem_ctx, lp_spoolss_url(global_loadparm), system_session(mem_ctx), 
+       return ldb_wrap_connect(mem_ctx, global_loadparm, lp_spoolss_url(global_loadparm), system_session(mem_ctx), 
                                NULL, 0, NULL);
 }
 
index 39e4ca73ea7298abfafddbcb80aed2d9b466af68..c837e5898b73f432d2acb6033619894f75376e27 100644 (file)
@@ -200,7 +200,7 @@ NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, e
 NTSTATUS ntvfs_init(void)
 {
        init_module_fn static_init[] = STATIC_ntvfs_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, "ntvfs");
+       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "ntvfs");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 53ac7faa7e2eb985f83b4fa7a0b8b39da0af9a78..a13d02c12e490dbd8c5cf62d7b5be0b830c79104 100644 (file)
@@ -131,7 +131,7 @@ _PUBLIC_ NTSTATUS sys_notify_init(void)
        if (initialized) return NT_STATUS_OK;
        initialized = True;
 
-       shared_init = load_samba_modules(NULL, "sys_notify");
+       shared_init = load_samba_modules(NULL, global_loadparm, "sys_notify");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 4107526d758bd8b4dbcdf37ca66f411c545ad2b7..829341a5f99a63da6e5c6b6e6c7b192c921ddda3 100644 (file)
@@ -108,7 +108,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
                return NULL;
        }
 
-       path = private_path(mem_ctx, url);
+       path = private_path(mem_ctx, global_loadparm, url);
        if (!path) {
                return NULL;
        }
@@ -117,7 +117,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
 
        /* Secrets.ldb *must* always be local.  If we call for a
         * system_session() we will recurse */
-       ldb = ldb_wrap_connect(mem_ctx, path, NULL, NULL, 0, NULL);
+       ldb = ldb_wrap_connect(mem_ctx, global_loadparm, path, NULL, NULL, 0, NULL);
        talloc_free(path);
        if (!ldb) {
                return NULL;
index dabd4e8d268eaf473f929e499f06feec337a070b..d0a570eeca78f71a0589785fd5d9162ca5436e55 100644 (file)
@@ -152,7 +152,7 @@ NTSTATUS share_get_context(TALLOC_CTX *mem_ctx, struct share_context **ctx)
 NTSTATUS share_init(void)
 {
        init_module_fn static_init[] = STATIC_share_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, "share");
+       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "share");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 586000f50320eb360be38bb7f458417ae50c2fd2..5ddf0e3511f885c6588c418c2c071d9eb93b9664 100644 (file)
@@ -37,10 +37,10 @@ static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, stru
                return NT_STATUS_NO_MEMORY;
        }
        
-       sdb = ldb_wrap_connect( *ctx,
-                               private_path(*ctx, "share.ldb"),
-                               system_session(*ctx),
-                               NULL, 0, NULL);
+       sdb = ldb_wrap_connect(*ctx, global_loadparm, 
+                              private_path(*ctx, global_loadparm, "share.ldb"),
+                              system_session(*ctx),
+                              NULL, 0, NULL);
 
        if (!sdb) {
                talloc_free(*ctx);
@@ -569,22 +569,21 @@ done:
        return ret;
 }
 
+static const struct share_ops ops = {
+       .name = "ldb",
+       .init = sldb_init,
+       .string_option = sldb_string_option,
+       .int_option = sldb_int_option,
+       .bool_option = sldb_bool_option,
+       .string_list_option = sldb_string_list_option,
+       .list_all = sldb_list_all,
+       .get_config = sldb_get_config,
+       .create = sldb_create,
+       .set = sldb_set,
+       .remove = sldb_remove
+};
+
 NTSTATUS share_ldb_init(void)
 {
-       static struct share_ops ops = {
-               .name = "ldb",
-               .init = sldb_init,
-               .string_option = sldb_string_option,
-               .int_option = sldb_int_option,
-               .bool_option = sldb_bool_option,
-               .string_list_option = sldb_string_list_option,
-               .list_all = sldb_list_all,
-               .get_config = sldb_get_config,
-               .create = sldb_create,
-               .set = sldb_set,
-               .remove = sldb_remove
-       };
-
        return share_register(&ops);
 }
-
index 25959c491980464ed3d60f392fc825c66eeeb6c7..9c682a7791d17750f29b2dafc7cdb175f4a19d2a 100644 (file)
  */
 
 
+_PUBLIC_ bool lp_is_mydomain(struct loadparm_context *lp_ctx, 
+                            const char *domain)
+{
+       return strequal(lp_workgroup(lp_ctx), domain);
+}
+
 /**
   see if a string matches either our primary or one of our secondary 
   netbios aliases. do a case insensitive match
 */
-_PUBLIC_ bool is_myname(const char *name)
+_PUBLIC_ bool lp_is_myname(struct loadparm_context *lp_ctx, const char *name)
 {
        const char **aliases;
        int i;
 
-       if (strcasecmp(name, lp_netbios_name(global_loadparm)) == 0) {
+       if (strcasecmp(name, lp_netbios_name(lp_ctx)) == 0) {
                return True;
        }
 
-       aliases = lp_netbios_aliases(global_loadparm);
+       aliases = lp_netbios_aliases(lp_ctx);
        for (i=0; aliases && aliases[i]; i++) {
                if (strcasecmp(name, aliases[i]) == 0) {
                        return True;
@@ -62,7 +68,8 @@ _PUBLIC_ bool is_myname(const char *name)
 /**
  A useful function for returning a path in the Samba lock directory.
 **/
-_PUBLIC_ char *lock_path(TALLOC_CTX* mem_ctx, const char *name)
+_PUBLIC_ char *lock_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
+                        const char *name)
 {
        char *fname, *dname;
        if (name == NULL) {
@@ -72,29 +79,7 @@ _PUBLIC_ char *lock_path(TALLOC_CTX* mem_ctx, const char *name)
                return talloc_strdup(mem_ctx, name);
        }
 
-       dname = talloc_strdup(mem_ctx, lp_lockdir(global_loadparm));
-       trim_string(dname,"","/");
-       
-       if (!directory_exist(dname)) {
-               mkdir(dname,0755);
-       }
-       
-       fname = talloc_asprintf(mem_ctx, "%s/%s", dname, name);
-
-       talloc_free(dname);
-
-       return fname;
-}
-
-
-/**
- A useful function for returning a path in the Samba piddir directory.
-**/
-static char *pid_path(TALLOC_CTX* mem_ctx, const char *name)
-{
-       char *fname, *dname;
-
-       dname = talloc_strdup(mem_ctx, lp_piddir(global_loadparm));
+       dname = talloc_strdup(mem_ctx, lp_lockdir(lp_ctx));
        trim_string(dname,"","/");
        
        if (!directory_exist(dname)) {
@@ -108,22 +93,6 @@ static char *pid_path(TALLOC_CTX* mem_ctx, const char *name)
        return fname;
 }
 
-
-/**
- * @brief Returns an absolute path to a file in the Samba lib directory.
- *
- * @param name File to find, relative to DATADIR.
- *
- * @retval Pointer to a talloc'ed string containing the full path.
- **/
-
-_PUBLIC_ char *data_path(TALLOC_CTX* mem_ctx, const char *name)
-{
-       char *fname;
-       fname = talloc_asprintf(mem_ctx, "%s/%s", dyn_DATADIR, name);
-       return fname;
-}
-
 /**
  * @brief Returns an absolute path to a file in the directory containing the current config file
  *
@@ -132,10 +101,11 @@ _PUBLIC_ char *data_path(TALLOC_CTX* mem_ctx, const char *name)
  * @retval Pointer to a talloc'ed string containing the full path.
  **/
 
-_PUBLIC_ char *config_path(TALLOC_CTX* mem_ctx, const char *name)
+_PUBLIC_ char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
+                          const char *name)
 {
        char *fname, *config_dir, *p;
-       config_dir = talloc_strdup(mem_ctx, lp_configfile(global_loadparm));
+       config_dir = talloc_strdup(mem_ctx, lp_configfile(lp_ctx));
        p = strrchr(config_dir, '/');
        if (!p) {
                return NULL;
@@ -154,7 +124,9 @@ _PUBLIC_ char *config_path(TALLOC_CTX* mem_ctx, const char *name)
  *
  * @retval Pointer to a talloc'ed string containing the full path.
  **/
-_PUBLIC_ char *private_path(TALLOC_CTX* mem_ctx, const char *name)
+_PUBLIC_ char *private_path(TALLOC_CTX* mem_ctx, 
+                           struct loadparm_context *lp_ctx,
+                           const char *name)
 {
        char *fname;
        if (name == NULL) {
@@ -163,7 +135,7 @@ _PUBLIC_ char *private_path(TALLOC_CTX* mem_ctx, const char *name)
        if (name[0] == 0 || name[0] == '/' || strstr(name, ":/")) {
                return talloc_strdup(mem_ctx, name);
        }
-       fname = talloc_asprintf(mem_ctx, "%s/%s", lp_private_dir(global_loadparm), name);
+       fname = talloc_asprintf(mem_ctx, "%s/%s", lp_private_dir(lp_ctx), name);
        return fname;
 }
 
@@ -172,11 +144,13 @@ _PUBLIC_ char *private_path(TALLOC_CTX* mem_ctx, const char *name)
   for smbd go. If NULL is passed for name then return the directory 
   path itself
 */
-_PUBLIC_ char *smbd_tmp_path(TALLOC_CTX *mem_ctx, const char *name)
+_PUBLIC_ char *smbd_tmp_path(TALLOC_CTX *mem_ctx, 
+                            struct loadparm_context *lp_ctx, 
+                            const char *name)
 {
        char *fname, *dname;
 
-       dname = pid_path(mem_ctx, "smbd.tmp");
+       dname = private_path(mem_ctx, lp_ctx, "smbd.tmp");
        if (!directory_exist(dname)) {
                mkdir(dname,0755);
        }
@@ -276,12 +250,13 @@ _PUBLIC_ bool run_init_functions(init_module_fn *fns)
        return ret;
 }
 
-static char *modules_path(TALLOC_CTX* mem_ctx, const char *name)
+static char *modules_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
+                         const char *name)
 {
        const char *env_moduledir = getenv("LD_SAMBA_MODULE_PATH");
        return talloc_asprintf(mem_ctx, "%s/%s", 
-                                                  env_moduledir?env_moduledir:lp_modulesdir(global_loadparm), 
-                                                  name);
+                              env_moduledir?env_moduledir:lp_modulesdir(lp_ctx), 
+                              name);
 }
 
 /**
@@ -290,9 +265,9 @@ static char *modules_path(TALLOC_CTX* mem_ctx, const char *name)
  * Will return an array of function pointers to initialization functions
  */
 
-_PUBLIC_ init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem)
+_PUBLIC_ init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *subsystem)
 {
-       char *path = modules_path(mem_ctx, subsystem);
+       char *path = modules_path(mem_ctx, lp_ctx, subsystem);
        init_module_fn *ret;
 
        ret = load_modules(mem_ctx, path);
@@ -302,4 +277,9 @@ _PUBLIC_ init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *sub
        return ret;
 }
 
+_PUBLIC_ const char *lp_messaging_path(TALLOC_CTX *mem_ctx, 
+                                      struct loadparm_context *lp_ctx)
+{
+       return smbd_tmp_path(mem_ctx, lp_ctx, "messaging");
+}
 
index 62666b09baa9a94e3137f40b38f03f2880b6c39d..802c8b6df833b42aa8251b0f64411bc4dee66e1f 100644 (file)
@@ -446,7 +446,7 @@ static NTSTATUS dcesrv_init(struct event_context *event_context,
 NTSTATUS server_service_rpc_init(void)
 {
        init_module_fn static_init[] = STATIC_dcerpc_server_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, "dcerpc_server");
+       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "dcerpc_server");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 91e58873df28a1ad996cf0488381214e02f59158..8a3ce245d2ad1f36208f92864554593696341955 100644 (file)
@@ -184,7 +184,7 @@ void smb_setup_ejs_functions(void (*exception_handler)(const char *))
        smb_setup_ejs_param();
         smb_setup_ejs_literal();
        
-       shared_init = load_samba_modules(NULL, "smbcalls");
+       shared_init = load_samba_modules(NULL, global_loadparm, "smbcalls");
        
        run_init_functions(static_init);
        run_init_functions(shared_init);
index dcb0f7390905ea074c0cd86483a87c709b259450..e5b1aab3c249a3bc77284c4a1531f62d89796054 100644 (file)
 #include "libcli/security/security.h"
 
 static int ejs_doauth(MprVarHandle eid,
-                     TALLOC_CTX *tmp_ctx, struct MprVar *auth, const char *username, 
-                     const char *password, const char *domain, const char *workstation,
-                     struct socket_address *remote_host, const char **auth_types)
+                     TALLOC_CTX *tmp_ctx, struct MprVar *auth, 
+                     const char *username, const char *password, 
+                     const char *domain, const char *workstation,
+                     struct socket_address *remote_host, 
+                     const char **auth_types)
 {
        struct auth_usersupplied_info *user_info = NULL;
        struct auth_serversupplied_info *server_info = NULL;
@@ -54,7 +56,7 @@ static int ejs_doauth(MprVarHandle eid,
        } else {
                /* Hope we can find the event context somewhere up there... */
                ev = event_context_find(tmp_ctx);
-               msg = messaging_client_init(tmp_ctx, ev);
+               msg = messaging_client_init(tmp_ctx, global_loadparm, ev);
        }
 
        if (auth_types) {
index 1e55d1c563ad97483296ea5160ddbbf0fe488eb8..42105e7965e116a537fb33246499fa777169cd3c 100644 (file)
@@ -452,7 +452,7 @@ static int ejs_ldbConnect(MprVarHandle eid, int argc, char **argv)
 
        dbfile = argv[0];
 
-       ldb = ldb_wrap_connect(mprMemCtx(), dbfile, 
+       ldb = ldb_wrap_connect(mprMemCtx(), global_loadparm, dbfile, 
                               session_info, creds,
                               0, (const char **)(argv+1));
        if (ldb == NULL) {
index b95681d4ef319f6263bd1f92a21611335125a378..5d7c6742089de69c744be9cbdbc505f52e0eb5f5 100644 (file)
@@ -78,7 +78,9 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv)
        /* create a messaging context, looping as we have no way to
           allocate temporary server ids automatically */
        for (i=0;i<10000;i++) {
-               p->msg_ctx = messaging_init(p, cluster_id(EJS_ID_BASE + i), ev);
+               p->msg_ctx = messaging_init(p, 
+                                           lp_messaging_path(p, global_loadparm),
+                                           cluster_id(EJS_ID_BASE + i), ev);
                if (p->msg_ctx) break;
        }
        if (p->msg_ctx == NULL) {
index a35f86367b9aed2007064dd070df9371225949e4..835aa6730206ef5d937bce1955b68f18a9d47344 100644 (file)
@@ -281,7 +281,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
                capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS;
        }
 
-       large_test_path = lock_path(req, "large_test.dat");
+       large_test_path = lock_path(req, global_loadparm, "large_test.dat");
        if (large_file_support(large_test_path)) {
                capabilities |= CAP_LARGE_FILES;
        }
index e11e6193fe8a5f592e726b272a8cbc047b89ee62..bb4d3a53bbfc1fb635ed7982bef75582e99d8c9e 100644 (file)
@@ -83,7 +83,7 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops)
 NTSTATUS process_model_init(void)
 {
        init_module_fn static_init[] = STATIC_process_model_MODULES;
-       init_module_fn *shared_init = load_samba_modules(NULL, "process_model");
+       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "process_model");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 7d84ffe81297de281d61649d4205f907bc74031d..e86ddc910b5eb94707e9ae47e5139f817125525c 100644 (file)
@@ -93,7 +93,7 @@ static void cleanup_tmp_files(void)
        char *path;
        TALLOC_CTX *mem_ctx = talloc_new(NULL);
 
-       path = smbd_tmp_path(mem_ctx, NULL);
+       path = smbd_tmp_path(mem_ctx, global_loadparm, NULL);
 
        recursive_delete(path);
        talloc_free(mem_ctx);
@@ -296,7 +296,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
 
        process_model_init(); 
 
-       shared_init = load_samba_modules(NULL, "service");
+       shared_init = load_samba_modules(NULL, global_loadparm, "service");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index 1f1f92b4955dd68ced3d64d801decfb3bc800a7d..31107df032563e4ef6f4e8aa113fb0fcf1473992 100644 (file)
@@ -181,7 +181,9 @@ static void stream_new_connection(struct event_context *ev,
        }
 
        /* setup to receive internal messages on this connection */
-       srv_conn->msg_ctx = messaging_init(srv_conn, srv_conn->server_id, ev);
+       srv_conn->msg_ctx = messaging_init(srv_conn, 
+                                          lp_messaging_path(srv_conn, global_loadparm),
+                                          srv_conn->server_id, ev);
        if (!srv_conn->msg_ctx) {
                stream_terminate_connection(srv_conn, "messaging_init() failed");
                return;
index cab5c7e11288d7c99de26e89862f99fed4f8766d..c77cae4185e0cbf968fe05328793df15e070a992 100644 (file)
@@ -25,6 +25,7 @@
 #include "smbd/service.h"
 #include "smbd/service_task.h"
 #include "lib/messaging/irpc.h"
+#include "param/param.h"
 
 /*
   terminate a task service
@@ -64,7 +65,9 @@ static void task_server_callback(struct event_context *event_ctx,
        task->model_ops = state->model_ops;
        task->server_id = server_id;
 
-       task->msg_ctx = messaging_init(task, task->server_id, task->event_ctx);
+       task->msg_ctx = messaging_init(task, 
+                                      lp_messaging_path(task, global_loadparm),
+                                      task->server_id, task->event_ctx);
        if (!task->msg_ctx) {
                task_server_terminate(task, "messaging_init() failed");
                return;
index f754880d0bda42afc418c3d3086e2b3ac8cdc956..4da758cac465ae000e947ba4b438626abc3690a3 100644 (file)
@@ -31,6 +31,8 @@
 #include "torture/torture.h"
 #include "torture/ldap/proto.h"
 
+#include "param/param.h"
+
 struct test_rootDSE {
        const char *defaultdn;
        const char *rootdn;
@@ -374,7 +376,7 @@ BOOL torture_ldap_schema(struct torture_context *torture)
 
        url = talloc_asprintf(torture, "ldap://%s/", host);
 
-       ldb = ldb_wrap_connect(torture, url,
+       ldb = ldb_wrap_connect(torture, global_loadparm, url,
                               NULL,
                               cmdline_credentials,
                               0, NULL);
index 0ff9948cad58bd2c96030e575116f8187177dac3..f8d00eaa4d800e6ce9795332523348ff125032e5 100644 (file)
@@ -34,6 +34,8 @@
 #include "librpc/ndr/libndr.h"
 #include "librpc/gen_ndr/ndr_drsblobs.h"
 
+#include "param/param.h"
+
 static bool test_check_uptodatevector(struct torture_context *torture,
                                      struct ldb_context *ldb,
                                      struct ldb_dn *partition_dn)
@@ -158,7 +160,7 @@ BOOL torture_ldap_uptodatevector(struct torture_context *torture)
        url = talloc_asprintf(torture, "ldap://%s/", host);
        if (!url) goto failed;
 
-       ldb = ldb_wrap_connect(torture, url,
+       ldb = ldb_wrap_connect(torture, global_loadparm, url,
                               NULL,
                               cmdline_credentials,
                               0, NULL);
index c5372eff08950c1413833413a7037a0982ca609d..5738e5c620acf96cf455596467abf42853a2f2f6 100644 (file)
@@ -256,7 +256,7 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
 
        DEBUG(0,("Open the SAM LDB with system credentials: %s\n", s->path.samdb_ldb));
 
-       s->ldb = ldb_wrap_connect(s, s->path.samdb_ldb,
+       s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
                                  system_session(s),
                                  NULL, 0, NULL);
        if (!s->ldb) {
@@ -484,7 +484,7 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s,
        s->schema = NULL;
 
        DEBUG(0,("Reopen the SAM LDB with system credentials and a already stored schema: %s\n", s->path.samdb_ldb));
-       s->ldb = ldb_wrap_connect(s, s->path.samdb_ldb,
+       s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
                                  system_session(s),
                                  NULL, 0, NULL);
        if (!s->ldb) {
@@ -817,7 +817,7 @@ BOOL torture_net_become_dc(struct torture_context *torture)
        s->schema = NULL;
 
        DEBUG(0,("Reopen the SAM LDB with system credentials and all replicated data: %s\n", s->path.samdb_ldb));
-       s->ldb = ldb_wrap_connect(s, s->path.samdb_ldb,
+       s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
                                  system_session(s),
                                  NULL, 0, NULL);
        if (!s->ldb) {
index fb4e5c3c3ad9b109326ce33104e5f0b773d0a3a4..b6c1a43d483eab20e1cdceaa7176419232048344 100644 (file)
@@ -26,6 +26,7 @@
 #include "lib/ldb/include/ldb_errors.h"
 #include "lib/db_wrap.h"
 #include "torture/torture.h"
+#include "param/param.h"
 
 float tdb_speed;
 
@@ -174,7 +175,7 @@ static BOOL test_ldb_speed(struct torture_context *torture, const void *_data)
 
        torture_comment(torture, "Testing ldb speed for sidmap\n");
 
-       ldb = ldb_wrap_connect(tmp_ctx, "tdb://test.ldb", 
+       ldb = ldb_wrap_connect(tmp_ctx, global_loadparm, "tdb://test.ldb", 
                                NULL, NULL, LDB_FLG_NOSYNC, NULL);
        if (!ldb) {
                unlink("./test.ldb");
index ad1b22ca6fb2b4a8ab51700f0d9fdbda502aa0b5..70f9ac1e5f244eebc47ad7c6925515f505861d58 100644 (file)
@@ -220,11 +220,13 @@ static BOOL irpc_setup(struct torture_context *tctx, void **_data)
        data->ev = tctx->ev;
        torture_assert(tctx, data->msg_ctx1 = 
                       messaging_init(tctx, 
+                                     lp_messaging_path(tctx, global_loadparm), 
                                      cluster_id(MSG_ID1), data->ev),
                       "Failed to init first messaging context");
 
        torture_assert(tctx, data->msg_ctx2 = 
                       messaging_init(tctx, 
+                                     lp_messaging_path(tctx, global_loadparm),
                                      cluster_id(MSG_ID2), data->ev),
                       "Failed to init second messaging context");
 
index 6834c82fae01eb3e32433017414a96860e086ab4..bf2b83a0e439e0d7f914812415aa246238781034 100644 (file)
@@ -72,16 +72,21 @@ static bool test_ping_speed(struct torture_context *tctx)
 
        ev = tctx->ev;
 
-       msg_server_ctx = messaging_init(mem_ctx, cluster_id(1), ev);
+       msg_server_ctx = messaging_init(mem_ctx, 
+                                       lp_messaging_path(tctx, global_loadparm), 
+                                       cluster_id(1), ev);
        
        torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
                
        messaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping);
        messaging_register_tmp(msg_server_ctx, mem_ctx, exit_message, &msg_exit);
 
-       msg_client_ctx = messaging_init(mem_ctx, cluster_id(2), ev);
+       msg_client_ctx = messaging_init(mem_ctx, 
+                                       lp_messaging_path(mem_ctx, global_loadparm), 
+                                       cluster_id(2), ev);
 
-       torture_assert(tctx, msg_client_ctx != NULL, "msg_client_ctx messaging_init() failed");
+       torture_assert(tctx, msg_client_ctx != NULL, 
+                      "msg_client_ctx messaging_init() failed");
 
        messaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong);
 
index 0a0abc57409400d33d374aa7f64e1940e283d3b6..278228f731505ec0f46e3d260866a769559cbc6e 100644 (file)
@@ -68,7 +68,7 @@ struct test_spoolss_context {
 #endif
 
 #define COMPARE_UINT32(tctx, c, r, e) do {\
-       _CHECK_FIELD_SIZE(c, r, e,uint32_t); \
+       _CHECK_FIELD_SIZE(c, r, e, uint32_t); \
        torture_assert_int_equal(tctx, c.e, r.e, "invalid value"); \
 } while(0)
 
index 2a1e731303c431628dcb4be6109c523b3def81fd..44a0d3b4c2dc50eb80ed675ef2cff142a5acb0d9 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, "torture");
+       init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "torture");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index a3751580600256eb0131fb4d53a0ac913538ae3f..d7e7c164b622be0ee80d5bf10d13f6d7424017c0 100644 (file)
@@ -141,7 +141,8 @@ static bool torture_winbind_struct_priv_pipe_dir(struct torture_context *torture
 
        torture_assert(torture, got_dir, "NULL WINBINDD_PRIV_PIPE_DIR\n");
 
-       default_dir = lock_path(torture, WINBINDD_PRIV_SOCKET_SUBDIR);
+       default_dir = lock_path(torture, global_loadparm, 
+                               WINBINDD_PRIV_SOCKET_SUBDIR);
        expected_dir = torture_setting_string(torture,
                                              "winbindd private pipe dir",
                                              default_dir);
index 8d9ff4ff0cd7cc1e77699ddaac98f158450c037e..2fa393a9d46a592efd1226f973ede4a81f7f0413 100644 (file)
@@ -461,7 +461,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
                        if (!ev) {
                                exit(1);
                        }
-                       msg = messaging_client_init(state, ev);
+                       msg = messaging_client_init(state, global_loadparm, ev);
                        if (!msg) {
                                exit(1);
                        }
index 3ca2b02f4ab7f2bc7adbd22eb702bc7822c9a326..4c8a9f9355d7c654a6c02e952320209d390ff7b7 100644 (file)
@@ -112,7 +112,7 @@ NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call)
 {
        s3call->response.result                 = WINBINDD_OK;
        s3call->response.extra_data.data =
-               smbd_tmp_path(s3call, WINBINDD_SAMBA3_PRIVILEGED_SOCKET);
+               smbd_tmp_path(s3call, global_loadparm, WINBINDD_SAMBA3_PRIVILEGED_SOCKET);
        NT_STATUS_HAVE_NO_MEMORY(s3call->response.extra_data.data);
        return NT_STATUS_OK;
 }
index 161168e049214342563b217476442f0d6eb3326a..3e27f31429130ff3054738ba1af3a0934d56a51e 100644 (file)
@@ -166,7 +166,7 @@ static void winbind_task_init(struct task_server *task)
        listen_socket = talloc(service, struct wbsrv_listen_socket);
        if (!listen_socket) goto nomem;
        listen_socket->socket_path      =
-               smbd_tmp_path(listen_socket,
+               smbd_tmp_path(listen_socket, global_loadparm, 
                              WINBINDD_SAMBA3_PRIVILEGED_SOCKET);
        if (!listen_socket->socket_path) goto nomem;
        listen_socket->service          = service;
index 9e7e87887aef79c6e7a35db5cfba35cfc20927d6..f4b48ae916edab1024e806df4cdb342fa8a457aa 100644 (file)
@@ -35,8 +35,9 @@
 
 static struct ldb_context *wins_config_db_connect(TALLOC_CTX *mem_ctx)
 {
-       return ldb_wrap_connect(mem_ctx, private_path(mem_ctx, 
-                                                     lp_wins_config_url(global_loadparm)),
+       return ldb_wrap_connect(mem_ctx, global_loadparm, private_path(mem_ctx, 
+                               global_loadparm, 
+                               lp_wins_config_url(global_loadparm)),
                                system_session(mem_ctx), NULL, 0, NULL);
 }