diff options
author | Gerald Carter <jerry@samba.org> | 2005-08-22 19:47:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:01:11 -0500 |
commit | 030bba20f1270eabb52eba5f95d85cc25f82e224 (patch) | |
tree | 35d2ded96274427082f42722b6aeb1179bfa7f71 /source3 | |
parent | f98f86394a654722fa13ef1dc3c4dea82d452442 (diff) | |
download | samba-030bba20f1270eabb52eba5f95d85cc25f82e224.tar.gz samba-030bba20f1270eabb52eba5f95d85cc25f82e224.tar.bz2 samba-030bba20f1270eabb52eba5f95d85cc25f82e224.zip |
r9486: ensure that the registry hash records are sorted by original subkey name and not the 4 character hash key
(This used to be commit 8d347561919ded19b1e7096aceb119c66f461c61)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/regfio.h | 1 | ||||
-rw-r--r-- | source3/registry/regfio.c | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source3/include/regfio.h b/source3/include/regfio.h index e088a4a344..3f0c10e895 100644 --- a/source3/include/regfio.h +++ b/source3/include/regfio.h @@ -80,6 +80,7 @@ typedef struct regf_hbin { typedef struct { uint32 nk_off; uint8 keycheck[sizeof(uint32)]; + char *fullname; } REGF_HASH_REC; typedef struct { diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index 4868396986..aebb1ebaed 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -1670,7 +1670,7 @@ static BOOL create_vk_record( REGF_FILE *file, REGF_VK_REC *vk, REGISTRY_VALUE * static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) { - return StrnCaseCmp( h1->keycheck, h2->keycheck, sizeof(uint32) ); + return strcmp( h1->fullname, h2->fullname ); } /******************************************************************* @@ -1722,6 +1722,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) hash->nk_off = prs_offset( &nk->hbin->ps ) + nk->hbin->first_hbin_off - HBIN_HDR_SIZE; memcpy( hash->keycheck, name, sizeof(uint32) ); + hash->fullname = talloc_strdup( file->mem_ctx, name ); parent->subkey_index++; /* sort the list by keyname */ @@ -1852,8 +1853,8 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->max_bytes_valuename = namelen * 2; datalen = regval_size( r ); - if ( datalen*2 > nk->max_bytes_value ) - nk->max_bytes_value = datalen * 2; + if ( datalen > nk->max_bytes_value ) + nk->max_bytes_value = datalen; } } |