Changeset 740 for vendor/current/source3/registry/regfio.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/registry/regfio.c
r414 r740 19 19 20 20 #include "includes.h" 21 #include "system/filesys.h" 21 22 #include "regfio.h" 23 #include "../librpc/gen_ndr/ndr_security.h" 24 #include "../libcli/security/security_descriptor.h" 22 25 23 26 #undef DBGC_CLASS … … 30 33 ******************************************************************/ 31 34 35 #if defined(PARANOID_MALLOC_CHECKER) 36 #define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem_((ps),sizeof(type),(count)) 37 #else 38 #define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem((ps),sizeof(type),(count)) 39 #endif 40 41 /******************************************************************* 42 Reads or writes an NTTIME structure. 43 ********************************************************************/ 44 45 static bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth) 46 { 47 uint32 low, high; 48 if (nttime == NULL) 49 return False; 50 51 prs_debug(ps, depth, desc, "smb_io_time"); 52 depth++; 53 54 if(!prs_align(ps)) 55 return False; 56 57 if (MARSHALLING(ps)) { 58 low = *nttime & 0xFFFFFFFF; 59 high = *nttime >> 32; 60 } 61 62 if(!prs_uint32("low ", ps, depth, &low)) /* low part */ 63 return False; 64 if(!prs_uint32("high", ps, depth, &high)) /* high part */ 65 return False; 66 67 if (UNMARSHALLING(ps)) { 68 *nttime = (((uint64_t)high << 32) + low); 69 } 70 71 return True; 72 } 32 73 33 74 /******************************************************************* … … 954 995 *******************************************************************/ 955 996 956 static REGF_SK_REC* find_sk_record_by_sec_desc( REGF_FILE *file, SEC_DESC*sd )997 static REGF_SK_REC* find_sk_record_by_sec_desc( REGF_FILE *file, struct security_descriptor *sd ) 957 998 { 958 999 REGF_SK_REC *p; … … 1438 1479 1439 1480 hbin->free_off = HBIN_HEADER_REC_SIZE; 1440 hbin->free_size = block_size - hbin->free_off + sizeof(uint32); ;1481 hbin->free_size = block_size - hbin->free_off + sizeof(uint32); 1441 1482 1442 1483 hbin->block_size = block_size; … … 1568 1609 *******************************************************************/ 1569 1610 1570 static uint32 sk_record_data_size( SEC_DESC* sd )1611 static uint32 sk_record_data_size( struct security_descriptor * sd ) 1571 1612 { 1572 1613 uint32 size, size_mod8; … … 1576 1617 /* the record size is sizeof(hdr) + name + static members + data_size_field */ 1577 1618 1578 size = sizeof(uint32)*5 + ndr_size_security_descriptor(sd, NULL,0) + sizeof(uint32);1619 size = sizeof(uint32)*5 + ndr_size_security_descriptor(sd, 0) + sizeof(uint32); 1579 1620 1580 1621 /* multiple of 8 */ … … 1718 1759 REGF_NK_REC* regfio_write_key( REGF_FILE *file, const char *name, 1719 1760 struct regval_ctr *values, struct regsubkey_ctr *subkeys, 1720 SEC_DESC*sec_desc, REGF_NK_REC *parent )1761 struct security_descriptor *sec_desc, REGF_NK_REC *parent ) 1721 1762 { 1722 1763 REGF_NK_REC *nk; … … 1768 1809 1769 1810 /* sort the list by keyname */ 1770 1771 qsort( parent->subkeys.hashes, parent->subkey_index, sizeof(REGF_HASH_REC), QSORT_CAST hashrec_cmp ); 1811 TYPESAFE_QSORT(parent->subkeys.hashes, parent->subkey_index, hashrec_cmp); 1772 1812 1773 1813 if ( !hbin_prs_lf_records( "lf_rec", parent->subkeys.hbin, 0, parent ) ) … … 1807 1847 1808 1848 /* size value must be self-inclusive */ 1809 nk->sec_desc->size = ndr_size_security_descriptor(sec_desc, NULL,0)1849 nk->sec_desc->size = ndr_size_security_descriptor(sec_desc, 0) 1810 1850 + sizeof(uint32); 1811 1851 … … 1816 1856 offsets to ourself. */ 1817 1857 1818 if ( nk->sec_desc->prev) {1819 REGF_SK_REC *prev = nk->sec_desc->prev;1858 if ( DLIST_PREV(nk->sec_desc) ) { 1859 REGF_SK_REC *prev = DLIST_PREV(nk->sec_desc); 1820 1860 1821 1861 nk->sec_desc->prev_sk_off = prev->hbin_off + prev->hbin->first_hbin_off - HBIN_HDR_SIZE;
Note:
See TracChangeset
for help on using the changeset viewer.