From b4546f08ecbce2161a4f598f29f3ef982e33fd93 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 5 Mar 2013 15:50:04 +0100 Subject: [PATCH] registry... --- source4/lib/registry/regf.idl | 2 +- source4/lib/registry/tools/regtree.c | 6 ++++-- source4/lib/registry/util.c | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source4/lib/registry/regf.idl b/source4/lib/registry/regf.idl index 064aaf09cee2..ba45442c6377 100644 --- a/source4/lib/registry/regf.idl +++ b/source4/lib/registry/regf.idl @@ -111,7 +111,7 @@ interface regf uint32 next_offset; uint32 ref_cnt; uint32 rec_size; - uint8 sec_desc[rec_size]; + uint8 sec_desc[rec_size-4]; }; [noprint] struct lh_hash { diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 56f38e7d4bac..c4ffe0d9a406 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -93,8 +93,10 @@ static void print_tree(unsigned int level, struct registry_key *p, } mem_ctx = talloc_init("sec_desc"); - if (!W_ERROR_IS_OK(reg_get_sec_desc(mem_ctx, p, &sec_desc))) { - DEBUG(0, ("Error getting security descriptor\n")); + error = reg_get_sec_desc(mem_ctx, p, &sec_desc); + if (!W_ERROR_IS_OK(error)) { + DEBUG(0, ("Error getting security descriptor: - %s\n", + win_errstr(error))); } talloc_free(mem_ctx); } diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index 1197adba7f15..7681f0ae287c 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -41,13 +41,14 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type, (void **)&ret, &converted_size); break; case REG_DWORD: + ret = talloc_asprintf(mem_ctx, "0x%8.8x", + RIVAL(data.data, 0)); + break; case REG_DWORD_BIG_ENDIAN: - SMB_ASSERT(data.length == sizeof(uint32_t)); ret = talloc_asprintf(mem_ctx, "0x%8.8x", IVAL(data.data, 0)); break; case REG_QWORD: - SMB_ASSERT(data.length == sizeof(uint64_t)); ret = talloc_asprintf(mem_ctx, "0x%16.16llx", (long long)BVAL(data.data, 0)); break; -- 2.34.1