summaryrefslogtreecommitdiff
path: root/source4/lib/registry/patchfile_dotreg.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-21 16:01:19 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-21 16:01:19 +0100
commit48307b54f95395fbd201d92d738b482f80cd15ef (patch)
treefde46141ad4c47fe726718a19e68743227ef56c0 /source4/lib/registry/patchfile_dotreg.c
parent263a77c5618daddb0c1e4f0ad0a922bca55faf0d (diff)
downloadsamba-48307b54f95395fbd201d92d738b482f80cd15ef.tar.gz
samba-48307b54f95395fbd201d92d738b482f80cd15ef.tar.bz2
samba-48307b54f95395fbd201d92d738b482f80cd15ef.zip
Remove more uses of global_loadparm.
(This used to be commit 3430cc60972b94d0d238bc39f473feed96949c5d)
Diffstat (limited to 'source4/lib/registry/patchfile_dotreg.c')
-rw-r--r--source4/lib/registry/patchfile_dotreg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c
index ebcafc92af..46ea7c0008 100644
--- a/source4/lib/registry/patchfile_dotreg.c
+++ b/source4/lib/registry/patchfile_dotreg.c
@@ -26,6 +26,7 @@
#include "lib/registry/patchfile.h"
#include "lib/registry/registry.h"
#include "system/filesys.h"
+#include "param/param.h"
/**
* @file
@@ -36,6 +37,7 @@
struct dotreg_data {
int fd;
+ struct smb_iconv_convenience *iconv_convenience;
};
static WERROR reg_dotreg_diff_add_key(void *_data, const char *key_name)
@@ -64,7 +66,7 @@ static WERROR reg_dotreg_diff_set_value(void *_data, const char *path,
fdprintf(data->fd, "\"%s\"=%s:%s\n",
value_name, str_regtype(value_type),
- reg_val_data_string(NULL, value_type, value));
+ reg_val_data_string(NULL, data->iconv_convenience, value_type, value));
return WERR_OK;
}
@@ -107,6 +109,8 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
data = talloc_zero(ctx, struct dotreg_data);
*callback_data = data;
+ data->iconv_convenience = lp_iconv_convenience(global_loadparm);
+
if (filename) {
data->fd = open(filename, O_CREAT, 0755);
if (data->fd == -1) {
@@ -135,6 +139,7 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
* Load diff file
*/
_PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
+ struct smb_iconv_convenience *iconv_convenience,
const struct reg_diff_callbacks *callbacks,
void *callback_data)
{
@@ -239,7 +244,8 @@ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
q++;
}
- reg_string_to_val(line, q?p:"REG_SZ", q?q:p,
+ reg_string_to_val(line, iconv_convenience,
+ q?p:"REG_SZ", q?q:p,
&value_type, &value);
error = callbacks->set_value(callback_data, curkey, line,