Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/registry/regfio.c

    r414 r740  
    1919
    2020#include "includes.h"
     21#include "system/filesys.h"
    2122#include "regfio.h"
     23#include "../librpc/gen_ndr/ndr_security.h"
     24#include "../libcli/security/security_descriptor.h"
    2225
    2326#undef DBGC_CLASS
     
    3033 ******************************************************************/
    3134
     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
     45static 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}
    3273
    3374/*******************************************************************
     
    954995*******************************************************************/
    955996
    956 static REGF_SK_REC* find_sk_record_by_sec_desc( REGF_FILE *file, SEC_DESC *sd )
     997static REGF_SK_REC* find_sk_record_by_sec_desc( REGF_FILE *file, struct security_descriptor *sd )
    957998{
    958999        REGF_SK_REC *p;
     
    14381479
    14391480        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);
    14411482
    14421483        hbin->block_size     = block_size;
     
    15681609*******************************************************************/
    15691610
    1570 static uint32 sk_record_data_size( SEC_DESC * sd )
     1611static uint32 sk_record_data_size( struct security_descriptor * sd )
    15711612{
    15721613        uint32 size, size_mod8;
     
    15761617        /* the record size is sizeof(hdr) + name + static members + data_size_field */
    15771618
    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);
    15791620
    15801621        /* multiple of 8 */
     
    17181759 REGF_NK_REC* regfio_write_key( REGF_FILE *file, const char *name,
    17191760                               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 )
    17211762{
    17221763        REGF_NK_REC *nk;
     
    17681809
    17691810                /* 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);
    17721812
    17731813                if ( !hbin_prs_lf_records( "lf_rec", parent->subkeys.hbin, 0, parent ) )
     
    18071847                       
    18081848                        /* 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)
    18101850                                + sizeof(uint32);
    18111851
     
    18161856                           offsets to ourself. */
    18171857
    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);
    18201860
    18211861                                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.