r26272: Remove global_loadparm in some more places.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 3 Dec 2007 22:33:22 +0000 (23:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:47:55 +0000 (05:47 +0100)
(This used to be commit 1ab76ecc5311fa863e5d04899b6f110899818f55)

12 files changed:
source4/auth/credentials/credentials_files.c
source4/client/cifsdd.c
source4/lib/charset/charcnv.c
source4/param/share_classic.c
source4/rpc_server/samr/samr_password.c
source4/smbd/server.c
source4/torture/libnet/libnet_BecomeDC.c
source4/torture/locktest.c
source4/torture/rpc/drsuapi.c
source4/torture/rpc/drsuapi_cracknames.c
source4/web_server/http.c
source4/winbind/wb_server.c

index 1f4b46737165083451ac870fc6aab0e4557c9e2e..e7435f56f8660970a9be26d4652778989b4333da 100644 (file)
@@ -346,7 +346,8 @@ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cred)
  * @param cred Credentials structure to fill in
  * @retval NTSTATUS error detailing any failure
  */
-NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred)
+NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred,
+                                   struct loadparm_context *lp_ctx)
 {
        char *filter;
        /* Bleh, nasty recursion issues: We are setting a machine
@@ -356,7 +357,7 @@ NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred)
        filter = talloc_asprintf(cred, SECRETS_KRBTGT_SEARCH,
                                       cli_credentials_get_realm(cred),
                                       cli_credentials_get_domain(cred));
-       return cli_credentials_set_secrets(cred, global_loadparm, NULL, 
+       return cli_credentials_set_secrets(cred, lp_ctx, NULL, 
                                           SECRETS_PRINCIPALS_DN,
                                           filter);
 }
index aa63edcd7aa2d27dd827658fa30bff3657a472f1..06a5f79ed79e622471cbe1e48ab0889e023e5f0f 100644 (file)
@@ -426,10 +426,10 @@ static int copy_files(struct loadparm_context *lp_ctx)
                return(EOM_EXIT_CODE);
        }
 
-       set_max_xmit(global_loadparm, MAX(ibs, obs));
+       set_max_xmit(lp_ctx, MAX(ibs, obs));
 
        DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
-                       (unsigned long long)iomax, lp_max_xmit(global_loadparm)));
+                       (unsigned long long)iomax, lp_max_xmit(lp_ctx)));
 
        if (!(ifile = open_file("if"))) {
                return(FILESYS_EXIT_CODE);
@@ -443,7 +443,7 @@ static int copy_files(struct loadparm_context *lp_ctx)
        ifile->io_seek(ifile, check_arg_numeric("skip") * ibs);
        ofile->io_seek(ofile, check_arg_numeric("seek") * obs);
 
-       DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit(global_loadparm)));
+       DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit(lp_ctx)));
 
        for (data_size = 0;;) {
 
index 804358d06be21eda10cb2d5f430426f1caeaf942..6bb72af8e1b5e577ad81ed3ed2cc9509e409a8cd 100644 (file)
@@ -274,7 +274,8 @@ _PUBLIC_ ssize_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_
        if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
                /* conversion not supported, return -1*/
                DEBUG(3, ("convert_string_talloc: conversion from %s to %s not supported!\n",
-                         charset_name(global_loadparm, from), charset_name(global_loadparm, to)));
+                         charset_name(global_loadparm, from), 
+                         charset_name(global_loadparm, to)));
                return -1;
        }
 
index 2dc40e3e251af1814158a92cfae7c2915909bfa0..7a0c2873f4db998b153aee750d56e501385b8c5f 100644 (file)
@@ -23,7 +23,9 @@
 #include "param/share.h"
 #include "param/param.h"
 
-static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct share_context **ctx)
+static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, 
+                             const struct share_ops *ops, 
+                             struct share_context **ctx)
 {
        *ctx = talloc(mem_ctx, struct share_context);
        if (!*ctx) {
@@ -37,7 +39,9 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops,
        return NT_STATUS_OK;
 }
 
-static const char *sclassic_string_option(struct share_config *scfg, const char *opt_name, const char *defval)
+static const char *sclassic_string_option(struct share_config *scfg, 
+                                         const char *opt_name, 
+                                         const char *defval)
 {
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
                                                     struct loadparm_service);
index 97ccf3067938675c0f1bdf61fb3fa728329a6663..ccd99075142db84859fd8352fb7b0d6aca59fa47 100644 (file)
@@ -38,8 +38,9 @@
 /* 
   samr_ChangePasswordUser 
 */
-NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-                                struct samr_ChangePasswordUser *r)
+NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, 
+                                       TALLOC_CTX *mem_ctx,
+                                       struct samr_ChangePasswordUser *r)
 {
        struct dcesrv_handle *h;
        struct samr_account_state *a_state;
index a62846b091100002c9b7982f38bd79dbf2d99ae2..434f8882c1661ca2c1d5bfad3d1f8877ffb654f7 100644 (file)
@@ -334,7 +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, global_loadparm, model, 
+                                       lp_server_services(global_loadparm));
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
                return 1;
index 9f05380b488c2bc266036c2c7774b7693d8b27ae..6044e358c48ea3d5a6da7179382fe825d2700edf 100644 (file)
@@ -254,7 +254,8 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
 
        talloc_free(s->ldb);
 
-       DEBUG(0,("Open the SAM LDB with system credentials: %s\n", s->path.samdb_ldb));
+       DEBUG(0,("Open the SAM LDB with system credentials: %s\n", 
+                s->path.samdb_ldb));
 
        s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
                                  system_session(s, global_loadparm),
index 7d111be12b2495f3b12d8087cf871695cf7b48ba..381abaebc616f8f06e8dd34af334d5996a6de846 100644 (file)
@@ -105,7 +105,8 @@ static struct record *recorded;
 /***************************************************** 
 return a connection to a server
 *******************************************************/
-static struct smbcli_state *connect_one(char *share, int snum, int conn)
+static struct smbcli_state *connect_one(struct loadparm_context *lp_ctx,
+                                       char *share, int snum, int conn)
 {
        struct smbcli_state *c;
        fstring server, myname;
@@ -124,7 +125,7 @@ static struct smbcli_state *connect_one(char *share, int snum, int conn)
                char **unc_list = NULL;
                int num_unc_names;
                const char *p;
-               p = lp_parm_string(global_loadparm, NULL, "torture", "unclist");
+               p = lp_parm_string(lp_ctx, NULL, "torture", "unclist");
                if (p) {
                        char *h, *s;
                        unc_list = file_lines_load(p, &num_unc_names, NULL);
@@ -183,7 +184,8 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum
                        }
                        talloc_free(cli[server][conn]);
                }
-               cli[server][conn] = connect_one(share[server], server, conn);
+               cli[server][conn] = connect_one(global_loadparm, share[server], 
+                                               server, conn);
                if (!cli[server][conn]) {
                        DEBUG(0,("Failed to connect to %s\n", share[server]));
                        exit(1);
index 7fc2406bbf7b1fa6aa0be963928685eb9b3f9954..5e01c2050c1d3ea29a76c2838e681bc6a9d64255 100644 (file)
@@ -719,7 +719,7 @@ bool torture_rpc_drsuapi(struct torture_context *torture)
 #endif
        ret &= test_DsGetDomainControllerInfo(p, torture, &priv);
 
-       ret &= test_DsCrackNames(p, torture, &priv);
+       ret &= test_DsCrackNames(torture, p, torture, &priv);
 
        ret &= test_DsWriteAccountSpn(p, torture, &priv);
 
@@ -771,7 +771,7 @@ bool torture_rpc_drsuapi_cracknames(struct torture_context *torture)
                /* We don't care if this fails, we just need some info from it */
                test_DsGetDomainControllerInfo(p, torture, &priv);
                
-               ret &= test_DsCrackNames(p, torture, &priv);
+               ret &= test_DsCrackNames(torture, p, torture, &priv);
                
                ret &= test_DsUnbind(p, torture, &priv);
        }
index ac3eebfa68d113c016f85bc350b21b610d1484af..89d9b7bd34ff853a18b621cb7ce90713abcd7931 100644 (file)
@@ -204,8 +204,9 @@ static bool test_DsCrackNamesMatrix(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        return ret;
 }
 
-bool test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
-                             struct DsPrivate *priv)
+bool test_DsCrackNames(struct torture_context *tctx,
+                      struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
+                      struct DsPrivate *priv)
 {
        NTSTATUS status;
        struct drsuapi_DsCrackNames r;
@@ -589,7 +590,7 @@ bool test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                                .comment = "display name for Microsoft Support Account",
                                .status = DRSUAPI_DS_NAME_STATUS_OK,
                                .alternate_status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE,
-                               .skip = lp_parm_bool(global_loadparm, NULL, "torture", "samba4", false)
+                               .skip = torture_setting_bool(tctx, "samba4", false)
                        },
                        {
                                .format_offered = DRSUAPI_DS_NAME_FORMAT_GUID,
index 558cc79eb91b2674c917b6e3cd1f4b47eb637fa7..bd6efa9262aac42ecd7b6d7769ccc62af91bfc94 100644 (file)
@@ -139,7 +139,8 @@ static int http_readFile(EspHandle handle,
                          const char *path,
                          const char *base_dir)
 {
-       struct websrv_context *web = talloc_get_type(handle, struct websrv_context);
+       struct websrv_context *web = talloc_get_type(handle, 
+                                                    struct websrv_context);
        int fd = -1;
        struct stat st;
        *buf = NULL;
@@ -169,12 +170,11 @@ failed:
        return -1;
 }
 
-static int http_readFileFromSwatDir(EspHandle handle,
-                                       char **buf,
-                                       int *len,
+static int http_readFileFromSwatDir(EspHandle handle, char **buf, int *len,
                                        const char *path)
 {
-    return http_readFile(handle, buf, len, path, lp_swat_directory(global_loadparm));
+    return http_readFile(handle, buf, len, path, 
+                        lp_swat_directory(global_loadparm));
 }
 
 
index 87ffc5b98ebd4438b0c0bca71c91aedaa7c64be9..c9c6516732ecc033f2e12df5b9f2194c471ab36d 100644 (file)
@@ -60,7 +60,7 @@ static void wbsrv_accept(struct stream_connection *conn)
        }
        wbconn->conn          = conn;
        wbconn->listen_socket = listen_socket;
-       wbconn->lp_ctx        = global_loadparm;
+       wbconn->lp_ctx        = listen_socket->service->task->lp_ctx;
        conn->private         = wbconn;
 
        wbconn->packet = packet_init(wbconn);