From b1c70d49c9f8e99997fe3c9228e92db5e6ad3ad4 Mon Sep 17 00:00:00 2001 From: Wilco Baan Hofman Date: Sun, 28 Mar 2010 16:46:30 +0200 Subject: Revert "s4:registry - util.c - treat unsupported and binary values as the same in the conversion functions" This reverts commit cc3eec1681bb6d614e688f51e48bd76f6d513e67. Conflicts: source4/lib/registry/util.c Signed-off-by: Jelmer Vernooij --- source4/lib/registry/util.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'source4') diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index 35d2025411..2b96797adc 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -84,6 +84,9 @@ _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: case REG_DWORD_BIG_ENDIAN: if (data.length == sizeof(uint32_t)) { @@ -97,9 +100,12 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, BVAL(data.data, 0)); } break; - case REG_BINARY: + case REG_MULTI_SZ: + /* FIXME: We don't support this yet */ + break; default: - ret = data_blob_hex_string_upper(mem_ctx, &data); + /* FIXME */ + /* Other datatypes aren't supported -> return "NULL" */ break; } @@ -154,7 +160,10 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, (void **)&data->data, &data->length, false); break; - case REG_DWORD: + case REG_BINARY: + *data = strhex_to_data_blob(mem_ctx, data_str); + break; + case REG_DWORD: { case REG_DWORD_BIG_ENDIAN: { uint32_t tmp = strtol(data_str, NULL, 0); *data = data_blob_talloc(mem_ctx, NULL, sizeof(uint32_t)); @@ -169,10 +178,13 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, SBVAL(data->data, 0, tmp); } break; - case REG_BINARY: + case REG_MULTI_SZ: + /* FIXME: We don't support this yet */ + return false; default: - *data = strhex_to_data_blob(mem_ctx, data_str); - break; + /* FIXME */ + /* Other datatypes aren't supported -> return no success */ + return false; } return true; } -- cgit