summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-15 11:15:19 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-15 13:28:12 +0100
commitcc3eec1681bb6d614e688f51e48bd76f6d513e67 (patch)
treeda515cdebd6a17217828b7438fbf0791253e5ea9 /source4/lib/registry
parent4e6c0e1f6f37a7e04d10dbf7abbf626f52232aaf (diff)
downloadsamba-cc3eec1681bb6d614e688f51e48bd76f6d513e67.tar.gz
samba-cc3eec1681bb6d614e688f51e48bd76f6d513e67.tar.bz2
samba-cc3eec1681bb6d614e688f51e48bd76f6d513e67.zip
s4:registry - util.c - treat unsupported and binary values as the same in the conversion functions
We don't need to provide an extra representation for all available registry types. But if we treat all unsupported types as binary we also get our tools (regtree, regshell, regdiff...) working with them in a basic manner.
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/util.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index ba284de8db..fd75f91aac 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -84,9 +84,6 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
NULL, false);
}
break;
- case REG_BINARY:
- ret = data_blob_hex_string_upper(mem_ctx, &data);
- break;
case REG_DWORD:
if (data.length == sizeof(uint32_t)) {
ret = talloc_asprintf(mem_ctx, "0x%8.8x",
@@ -99,12 +96,9 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
BVAL(data.data, 0));
}
break;
- case REG_MULTI_SZ:
- /* FIXME: We don't support this yet */
- break;
+ case REG_BINARY:
default:
- /* FIXME */
- /* Other datatypes aren't supported -> return "NULL" */
+ ret = data_blob_hex_string_upper(mem_ctx, &data);
break;
}
@@ -159,9 +153,6 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx,
(void **)&data->data,
&data->length, false);
break;
- case REG_BINARY:
- *data = strhex_to_data_blob(mem_ctx, data_str);
- break;
case REG_DWORD: {
uint32_t tmp = strtol(data_str, NULL, 0);
*data = data_blob_talloc(mem_ctx, NULL, sizeof(uint32_t));
@@ -174,13 +165,10 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx,
SBVAL(data->data, 0, tmp);
}
break;
- case REG_MULTI_SZ:
- /* FIXME: We don't support this yet */
- return false;
+ case REG_BINARY:
default:
- /* FIXME */
- /* Other datatypes aren't supported -> return no success */
- return false;
+ *data = strhex_to_data_blob(mem_ctx, data_str);
+ break;
}
return true;
}