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

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source3/lib/eventlog
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/eventlog/eventlog.c

    r414 r740  
    2222
    2323#include "includes.h"
     24#include "system/filesys.h"
     25#include "lib/eventlog/eventlog.h"
     26#include "../libcli/security/security.h"
     27#include "util_tdb.h"
    2428
    2529/* maintain a list of open eventlog tdbs with reference counts */
     
    6670char *elog_tdbname(TALLOC_CTX *ctx, const char *name )
    6771{
    68         char *path = talloc_asprintf(ctx, "%s/%s.tdb",
    69                         state_path("eventlog"),
    70                         name);
     72        char *path;
     73        char *file;
     74        char *tdbname;
     75
     76        path = talloc_strdup(ctx, state_path("eventlog"));
    7177        if (!path) {
    7278                return NULL;
    7379        }
    74         strlower_m(path);
    75         return path;
     80
     81        file = talloc_asprintf_strlower_m(path, "%s.tdb", name);
     82        if (!file) {
     83                talloc_free(path);
     84                return NULL;
     85        }
     86
     87        tdbname = talloc_asprintf(path, "%s/%s", state_path("eventlog"), file);
     88        if (!tdbname) {
     89                talloc_free(path);
     90                return NULL;
     91        }
     92
     93        return tdbname;
    7694}
    7795
     
    677695        blob = data_blob_const(data.dptr, data.dsize);
    678696
    679         ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, r,
     697        ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, r,
    680698                           (ndr_pull_flags_fn_t)ndr_pull_eventlog_Record_tdb);
    681699
     
    727745        }
    728746
    729         r->Length = r->Length2 = ndr_size_EVENTLOGRECORD(r, NULL, 0);
     747        r->Length = r->Length2 = ndr_size_EVENTLOGRECORD(r, 0);
    730748
    731749        return r;
     
    771789        r->record_number = tdb_fetch_int32(tdb, EVT_NEXT_RECORD);
    772790
    773         ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, r,
     791        ndr_err = ndr_push_struct_blob(&blob, mem_ctx, r,
    774792                      (ndr_push_flags_fn_t)ndr_push_eventlog_Record_tdb);
    775793        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     
    941959                }
    942960                if (len > 0) {
    943                         e->UserSid = *string_sid_talloc(mem_ctx, sid_str);
     961                        string_to_sid(&e->UserSid, sid_str);
    944962                }
    945963        }
     
    9931011                }
    9941012
    995                 endoffset += ndr_size_EVENTLOGRECORD(&e, NULL, 0);
     1013                endoffset += ndr_size_EVENTLOGRECORD(&e, 0);
    9961014
    9971015                ADD_TO_ARRAY(mem_ctx, struct EVENTLOGRECORD, e, &evt.records, &num_records);
     
    10201038        }
    10211039
    1022         ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, &evt,
     1040        ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &evt,
    10231041                   (ndr_push_flags_fn_t)ndr_push_EVENTLOG_EVT_FILE);
    10241042        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
Note: See TracChangeset for help on using the changeset viewer.