diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/registry/regfio.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.xz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/registry/regfio.c')
-rw-r--r-- | source3/registry/regfio.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index bd5380787c..6d2beccfef 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -22,6 +22,7 @@ #include "regfio.h" #include "../librpc/gen_ndr/ndr_security.h" #include "../libcli/security/security_descriptor.h" +#include "../libcli/security/secdesc.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY @@ -497,7 +498,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) REGF_HBIN *hbin; uint32 record_size, curr_off, block_size, header; - if ( !(hbin = TALLOC_ZERO_P(file->mem_ctx, REGF_HBIN)) ) + if ( !(hbin = talloc_zero(file->mem_ctx, REGF_HBIN)) ) return NULL; hbin->file_off = offset; hbin->free_off = -1; @@ -1072,7 +1073,7 @@ static bool hbin_prs_key( REGF_FILE *file, REGF_HBIN *hbin, REGF_NK_REC *nk ) } } - if ( !(nk->sec_desc = TALLOC_ZERO_P( file->mem_ctx, REGF_SK_REC )) ) + if ( !(nk->sec_desc = talloc_zero( file->mem_ctx, REGF_SK_REC )) ) return False; nk->sec_desc->sk_off = nk->sk_off; if ( !hbin_prs_sk_rec( "sk_rec", sub_hbin, depth, nk->sec_desc )) @@ -1378,7 +1379,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) if ( !file ) return NULL; - if ( !(nk = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) { + if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) { DEBUG(0,("regfio_rootkey: talloc() failed!\n")); return NULL; } @@ -1446,7 +1447,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) return NULL; nk->subkey_index++; - if ( !(subkey = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) + if ( !(subkey = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) return NULL; if ( !hbin_prs_key( file, hbin, subkey ) ) @@ -1464,7 +1465,7 @@ static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32 block_size ) REGF_HBIN *hbin; SMB_STRUCT_STAT sbuf; - if ( !(hbin = TALLOC_ZERO_P( file->mem_ctx, REGF_HBIN )) ) + if ( !(hbin = talloc_zero( file->mem_ctx, REGF_HBIN )) ) return NULL; memcpy( hbin->header, "hbin", sizeof(HBIN_HDR_SIZE) ); @@ -1719,7 +1720,7 @@ static bool create_vk_record(REGF_FILE *file, REGF_VK_REC *vk, if ( vk->data_size > sizeof(uint32) ) { uint32 data_size = ( (vk->data_size+sizeof(uint32)) & 0xfffffff8 ) + 8; - vk->data = (uint8 *)TALLOC_MEMDUP( file->mem_ctx, + vk->data = (uint8 *)talloc_memdup( file->mem_ctx, regval_data_p(value), vk->data_size ); if (vk->data == NULL) { @@ -1750,7 +1751,7 @@ static bool create_vk_record(REGF_FILE *file, REGF_VK_REC *vk, static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) { - return StrCaseCmp( h1->fullname, h2->fullname ); + return strcasecmp_m( h1->fullname, h2->fullname ); } /******************************************************************* @@ -1764,7 +1765,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) REGF_HBIN *vlist_hbin = NULL; uint32 size; - if ( !(nk = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) + if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) return NULL; memcpy( nk->header, "nk", REC_HDR_SIZE ); @@ -1830,7 +1831,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) return NULL; } - if ( !(nk->sec_desc = TALLOC_ZERO_P( file->mem_ctx, REGF_SK_REC )) ) + if ( !(nk->sec_desc = talloc_zero( file->mem_ctx, REGF_SK_REC )) ) return NULL; /* now we have to store the security descriptor in the list and @@ -1897,7 +1898,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->subkeys.num_keys = nk->num_subkeys; if (nk->subkeys.num_keys) { - if ( !(nk->subkeys.hashes = TALLOC_ZERO_ARRAY( file->mem_ctx, REGF_HASH_REC, nk->subkeys.num_keys )) ) + if ( !(nk->subkeys.hashes = talloc_zero_array( file->mem_ctx, REGF_HASH_REC, nk->subkeys.num_keys )) ) return NULL; } else { nk->subkeys.hashes = NULL; @@ -1925,7 +1926,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->values_off = prs_offset( &vlist_hbin->ps ) + vlist_hbin->first_hbin_off - HBIN_HDR_SIZE; if (nk->num_values) { - if ( !(nk->values = TALLOC_ARRAY( file->mem_ctx, REGF_VK_REC, nk->num_values )) ) + if ( !(nk->values = talloc_array( file->mem_ctx, REGF_VK_REC, nk->num_values )) ) return NULL; } else { nk->values = NULL; |