summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r--source4/lib/registry/tools/regdiff.c2
-rw-r--r--source4/lib/registry/tools/regpatch.c8
-rw-r--r--source4/lib/registry/tools/regshell.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c
index a9d189c033..307ec3793e 100644
--- a/source4/lib/registry/tools/regdiff.c
+++ b/source4/lib/registry/tools/regdiff.c
@@ -72,7 +72,7 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey,
for(i = 0; W_ERROR_IS_OK(error1 = reg_key_get_value_by_index(mem_ctx, newkey, i, &v1)); i++) {
error2 = reg_key_get_value_by_name(mem_ctx, oldkey, v1->name, &v2);
- if ((W_ERROR_IS_OK(error2) && (v2->data_len != v1->data_len || memcmp(v1->data_blk, v2->data_blk, v1->data_len)))
+ if ((W_ERROR_IS_OK(error2) && data_blob_equal(&v1->data, &v2->data))
|| W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
fprintf(out, "\"%s\"=%s:%s\n", v1->name, str_regtype(v1->data_type), reg_val_data_string(mem_ctx, v1));
}
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index c2f01ce5b4..5f7d4376d4 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -704,9 +704,11 @@ static int nt_apply_reg_command_file(struct registry_context *r, const char *cmd
DEBUG(0, ("Error removing value '%s'\n", val->name));
}
modified = True;
- }
- else {
- if(!W_ERROR_IS_OK(reg_val_set(tmp, val->name, val->type, val->val, strlen(val->val)))) {
+ } else {
+ DATA_BLOB blob;
+ blob.data = (uint8_t *)val->val;
+ blob.length = strlen(val->val);
+ if(!W_ERROR_IS_OK(reg_val_set(tmp, val->name, val->type, blob))) {
DEBUG(0, ("Error adding new value '%s'\n", val->name));
continue;
}
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 108cc17336..496b9dc7e5 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -80,7 +80,7 @@ static struct registry_key *cmd_set(TALLOC_CTX *mem_ctx, struct registry_context
} else {
struct registry_value *val;
if (reg_string_to_val(mem_ctx, argv[2], argv[3], &val)) {
- WERROR error = reg_val_set(cur, argv[1], val->data_type, val->data_blk, val->data_len);
+ WERROR error = reg_val_set(cur, argv[1], val->data_type, val->data);
if (!W_ERROR_IS_OK(error)) {
fprintf(stderr, "Error setting value: %s\n", win_errstr(error));
return NULL;