Author: jelmer
Date: 2007-12-14 00:27:31 +0000 (Fri, 14 Dec 2007)
New Revision: 26443

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26443

Log:
Remove global_loadparm instances.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/registry/hive.c
   branches/SAMBA_4_0/source/lib/registry/hive.h
   branches/SAMBA_4_0/source/lib/registry/ldb.c
   branches/SAMBA_4_0/source/lib/registry/regf.c
   branches/SAMBA_4_0/source/lib/registry/samba.c
   branches/SAMBA_4_0/source/lib/registry/tests/hive.c
   branches/SAMBA_4_0/source/lib/registry/tests/registry.c
   branches/SAMBA_4_0/source/lib/registry/tools/common.c
   branches/SAMBA_4_0/source/lib/registry/tools/regshell.c
   branches/SAMBA_4_0/source/lib/registry/tools/regtree.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
   branches/SAMBA_4_0/source/ntvfs/print/vfs_print.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/lib/registry/hive.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/hive.c       2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/hive.c       2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -27,6 +27,7 @@
 _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
                              struct auth_session_info *session_info,
                              struct cli_credentials *credentials,
+                             struct loadparm_context *lp_ctx,
                              struct hive_key **root)
 {
        int fd, num;
@@ -51,11 +52,11 @@
 
        if (!strncmp(peek, "regf", 4)) {
                close(fd);
-               return reg_open_regf_file(parent_ctx, location, root);
+               return reg_open_regf_file(parent_ctx, location, lp_ctx, root);
        } else if (!strncmp(peek, "TDB file", 8)) {
                close(fd);
                return reg_open_ldb_file(parent_ctx, location, session_info,
-                                        credentials, root);
+                                        credentials, lp_ctx, root);
        }
 
        return WERR_BADFILE;

Modified: branches/SAMBA_4_0/source/lib/registry/hive.h
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/hive.h       2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/hive.h       2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -144,6 +144,7 @@
 WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
                     struct auth_session_info *session_info,
                     struct cli_credentials *credentials,
+                    struct loadparm_context *lp_ctx,
                     struct hive_key **root);
 WERROR hive_key_get_info(TALLOC_CTX *mem_ctx, const struct hive_key *key,
                         const char **classname, uint32_t *num_subkeys,
@@ -183,10 +184,12 @@
 WERROR reg_open_directory(TALLOC_CTX *parent_ctx,
                          const char *location, struct hive_key **key);
 WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx,
-                         const char *location, struct hive_key **key);
+                         const char *location, struct loadparm_context *lp_ctx,
+                         struct hive_key **key);
 WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
                         struct auth_session_info *session_info,
                         struct cli_credentials *credentials,
+                        struct loadparm_context *lp_ctx,
                         struct hive_key **k);
 
 

Modified: branches/SAMBA_4_0/source/lib/registry/ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/ldb.c        2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/ldb.c        2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -337,6 +337,7 @@
 WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
                         struct auth_session_info *session_info,
                         struct cli_credentials *credentials,
+                        struct loadparm_context *lp_ctx,
                         struct hive_key **k)
 {
        struct ldb_key_data *kd;

Modified: branches/SAMBA_4_0/source/lib/registry/regf.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/regf.c       2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/regf.c       2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -1942,8 +1942,8 @@
        return WERR_OK;
 }
 
-WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx,
-                         const char *location, struct hive_key **key)
+WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location, 
+                         struct loadparm_context *lp_ctx, struct hive_key 
**key)
 {
        struct regf_data *regf;
        struct regf_hdr *regf_hdr;
@@ -1952,7 +1952,7 @@
 
        regf = (struct regf_data *)talloc_zero(NULL, struct regf_data);
 
-       regf->iconv_convenience = lp_iconv_convenience(global_loadparm);
+       regf->iconv_convenience = lp_iconv_convenience(lp_ctx);
 
        W_ERROR_HAVE_NO_MEMORY(regf);
 

Modified: branches/SAMBA_4_0/source/lib/registry/samba.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/samba.c      2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/samba.c      2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -40,11 +40,11 @@
                                   lp_private_dir(lp_ctx),
                                   name);
 
-       error = reg_open_hive(ctx, location, auth_info, creds, &hive);
+       error = reg_open_hive(ctx, location, auth_info, creds, lp_ctx, &hive);
 
        if (W_ERROR_EQUAL(error, WERR_NOT_FOUND))
                error = reg_open_ldb_file(ctx, location, auth_info,
-                                         creds, &hive);
+                                         creds, lp_ctx, &hive);
 
        if (!W_ERROR_IS_OK(error))
                return error;

Modified: branches/SAMBA_4_0/source/lib/registry/tests/hive.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tests/hive.c 2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/tests/hive.c 2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -323,7 +323,7 @@
 
        rmdir(dirname);
 
-       error = reg_open_ldb_file(tctx, dirname, NULL, NULL, &key);
+       error = reg_open_ldb_file(tctx, dirname, NULL, NULL, tctx->lp_ctx, 
&key);
        if (!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to initialize ldb hive\n");
                return false;

Modified: branches/SAMBA_4_0/source/lib/registry/tests/registry.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tests/registry.c     2007-12-13 
23:23:31 UTC (rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/tests/registry.c     2007-12-14 
00:27:31 UTC (rev 26443)
@@ -547,7 +547,7 @@
        torture_assert_ntstatus_ok(tctx, status, "Creating temp dir failed");
 
        filename = talloc_asprintf(tctx, "%s/classes_root.ldb", tempdir);
-       error = reg_open_ldb_file(tctx, filename, NULL, NULL, &hive_key);
+       error = reg_open_ldb_file(tctx, filename, NULL, NULL, tctx->lp_ctx, 
&hive_key);
        torture_assert_werr_ok(tctx, error, "Opening classes_root file failed");
 
        error = reg_mount_hive(rctx, hive_key, HKEY_CLASSES_ROOT, NULL);

Modified: branches/SAMBA_4_0/source/lib/registry/tools/common.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tools/common.c       2007-12-13 
23:23:31 UTC (rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/tools/common.c       2007-12-14 
00:27:31 UTC (rev 26443)
@@ -42,13 +42,14 @@
 }
 
 struct registry_key *reg_common_open_file(const char *path,
+                                         struct loadparm_context *lp_ctx,
                                          struct cli_credentials *creds)
 {
        struct hive_key *hive_root;
        struct registry_context *h;
        WERROR error;
 
-       error = reg_open_hive(NULL, path, NULL, creds, &hive_root);
+       error = reg_open_hive(NULL, path, NULL, creds, lp_ctx, &hive_root);
 
        if(!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to open '%s': %s \n",

Modified: branches/SAMBA_4_0/source/lib/registry/tools/regshell.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tools/regshell.c     2007-12-13 
23:23:31 UTC (rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/tools/regshell.c     2007-12-14 
00:27:31 UTC (rev 26443)
@@ -500,7 +500,7 @@
                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);
+               ctx->current = reg_common_open_file(file, cmdline_lp_ctx, 
cmdline_credentials);
                if (ctx->current == NULL)
                        return 1;
                ctx->registry = ctx->current->context;

Modified: branches/SAMBA_4_0/source/lib/registry/tools/regtree.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tools/regtree.c      2007-12-13 
23:23:31 UTC (rev 26442)
+++ branches/SAMBA_4_0/source/lib/registry/tools/regtree.c      2007-12-14 
00:27:31 UTC (rev 26443)
@@ -131,7 +131,7 @@
        if (remote != NULL) {
                h = reg_common_open_remote(remote, cmdline_lp_ctx, 
cmdline_credentials);
        } else if (file != NULL) {
-               start_key = reg_common_open_file(file, cmdline_credentials);
+               start_key = reg_common_open_file(file, cmdline_lp_ctx, 
cmdline_credentials);
        } else {
                h = reg_common_open_local(cmdline_credentials, cmdline_lp_ctx);
        }

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c        2007-12-13 
23:23:31 UTC (rev 26442)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c        2007-12-14 
00:27:31 UTC (rev 26443)
@@ -257,7 +257,7 @@
 
        while (*p) {
                size_t c_size;
-               codepoint_t c = 
next_codepoint(lp_iconv_convenience(global_loadparm), p, &c_size);
+               codepoint_t c = 
next_codepoint(lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), p, &c_size);
                switch (c) {
                case '\\':
                        if (name->has_wildcard) {

Modified: branches/SAMBA_4_0/source/ntvfs/print/vfs_print.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/print/vfs_print.c   2007-12-13 23:23:31 UTC 
(rev 26442)
+++ branches/SAMBA_4_0/source/ntvfs/print/vfs_print.c   2007-12-14 00:27:31 UTC 
(rev 26443)
@@ -83,8 +83,8 @@
 
                p = (char *)io->ioctl.out.blob.data;
                SSVAL(p,0, 1 /* REWRITE: fsp->rap_print_jobid */);
-               push_string(lp_iconv_convenience(global_loadparm), p+2, 
lp_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII);
-               push_string(lp_iconv_convenience(global_loadparm), p+18, 
ntvfs->ctx->config->name, 13, STR_TERMINATE|STR_ASCII);
+               push_string(lp_iconv_convenience(ntvfs->ctx->lp_ctx), p+2, 
lp_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII);
+               push_string(lp_iconv_convenience(ntvfs->ctx->lp_ctx), p+18, 
ntvfs->ctx->config->name, 13, STR_TERMINATE|STR_ASCII);
                return NT_STATUS_OK;
        }
 

Reply via email to