summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-21 17:17:37 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-21 17:17:37 +0100
commitc38c2765d1059b33f044a42c6555f3d10d339911 (patch)
treea97496f0b1cf0294900dfcad47675eef1b8f4ec8 /source4/lib
parentd63321a41e5e7d39a8a4e79a980cf92b1da7dfc0 (diff)
downloadsamba-c38c2765d1059b33f044a42c6555f3d10d339911.tar.gz
samba-c38c2765d1059b33f044a42c6555f3d10d339911.tar.bz2
samba-c38c2765d1059b33f044a42c6555f3d10d339911.zip
Remove yet more uses of global_loadparm.
(This used to be commit e01c1e87c0fe9709df7eb5b863f7ce85564174cd)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/hive.c3
-rw-r--r--source4/lib/registry/hive.h3
-rw-r--r--source4/lib/registry/regf.c10
-rw-r--r--source4/lib/registry/tests/hive.c4
4 files changed, 13 insertions, 7 deletions
diff --git a/source4/lib/registry/hive.c b/source4/lib/registry/hive.c
index 5d56a30b3e..ad6a6421ab 100644
--- a/source4/lib/registry/hive.c
+++ b/source4/lib/registry/hive.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "hive.h"
#include "system/filesys.h"
+#include "param/param.h"
/** Open a registry file/host/etc */
_PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
@@ -52,7 +53,7 @@ _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
if (!strncmp(peek, "regf", 4)) {
close(fd);
- return reg_open_regf_file(parent_ctx, location, lp_ctx, root);
+ return reg_open_regf_file(parent_ctx, location, lp_iconv_convenience(lp_ctx), root);
} else if (!strncmp(peek, "TDB file", 8)) {
close(fd);
return reg_open_ldb_file(parent_ctx, location, session_info,
diff --git a/source4/lib/registry/hive.h b/source4/lib/registry/hive.h
index 6d9a69c7c5..87f335663d 100644
--- a/source4/lib/registry/hive.h
+++ b/source4/lib/registry/hive.h
@@ -188,7 +188,7 @@ WERROR hive_key_flush(struct hive_key *key);
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 loadparm_context *lp_ctx,
+ const char *location, struct smb_iconv_convenience *iconv_convenience,
struct hive_key **key);
WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
struct auth_session_info *session_info,
@@ -200,6 +200,7 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
WERROR reg_create_directory(TALLOC_CTX *parent_ctx,
const char *location, struct hive_key **key);
WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
+ struct smb_iconv_convenience *iconv_convenience,
const char *location,
int major_version,
struct hive_key **key);
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c
index 15b60745f0..cf3e564c0e 100644
--- a/source4/lib/registry/regf.c
+++ b/source4/lib/registry/regf.c
@@ -1863,7 +1863,9 @@ static WERROR regf_save_hbin(struct regf_data *regf)
return WERR_OK;
}
-WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, const char *location,
+WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
+ struct smb_iconv_convenience *iconv_convenience,
+ const char *location,
int minor_version, struct hive_key **key)
{
struct regf_data *regf;
@@ -1874,7 +1876,7 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, const char *location,
regf = (struct regf_data *)talloc_zero(NULL, struct regf_data);
- regf->iconv_convenience = lp_iconv_convenience(global_loadparm);
+ regf->iconv_convenience = iconv_convenience;
W_ERROR_HAVE_NO_MEMORY(regf);
@@ -1950,7 +1952,7 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, const char *location,
}
WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location,
- struct loadparm_context *lp_ctx, struct hive_key **key)
+ struct smb_iconv_convenience *iconv_convenience, struct hive_key **key)
{
struct regf_data *regf;
struct regf_hdr *regf_hdr;
@@ -1959,7 +1961,7 @@ WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location,
regf = (struct regf_data *)talloc_zero(NULL, struct regf_data);
- regf->iconv_convenience = lp_iconv_convenience(lp_ctx);
+ regf->iconv_convenience = iconv_convenience;
W_ERROR_HAVE_NO_MEMORY(regf);
diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c
index 4d27e83a74..1dcb464d80 100644
--- a/source4/lib/registry/tests/hive.c
+++ b/source4/lib/registry/tests/hive.c
@@ -25,6 +25,7 @@
#include "torture/torture.h"
#include "librpc/gen_ndr/winreg.h"
#include "system/filesys.h"
+#include "param/param.h"
static bool test_del_nonexistant_key(struct torture_context *tctx,
const void *test_data)
@@ -349,7 +350,8 @@ static bool hive_setup_regf(struct torture_context *tctx, void **data)
rmdir(dirname);
- error = reg_create_regf_file(tctx, dirname, 5, &key);
+ error = reg_create_regf_file(tctx, lp_iconv_convenience(tctx->lp_ctx),
+ dirname, 5, &key);
if (!W_ERROR_IS_OK(error)) {
fprintf(stderr, "Unable to create new regf file\n");
return false;