Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

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

    r740 r988  
    7474        char *tdbname;
    7575
    76         path = talloc_strdup(ctx, state_path("eventlog"));
     76        path = state_path("eventlog");
    7777        if (!path) {
    7878                return NULL;
     
    8585        }
    8686
    87         tdbname = talloc_asprintf(path, "%s/%s", state_path("eventlog"), file);
     87        tdbname = talloc_asprintf(ctx, "%s/%s", path, file);
    8888        if (!tdbname) {
    8989                talloc_free(path);
     
    9191        }
    9292
     93        talloc_free(path);
    9394        return tdbname;
    9495}
     
    341342        char *eventlogdir;
    342343        TALLOC_CTX *ctx = talloc_tos();
     344        bool ok;
    343345
    344346        /* check for invalid options */
     
    372374        /* make sure that the eventlog dir exists */
    373375
    374         eventlogdir = state_path( "eventlog" );
    375         if ( !directory_exist( eventlogdir ) )
    376                 mkdir( eventlogdir, 0755 );
     376        eventlogdir = state_path("eventlog");
     377        if (eventlogdir == NULL) {
     378                return NULL;
     379        }
     380        ok = directory_create_or_exist(eventlogdir, 0755);
     381        TALLOC_FREE(eventlogdir);
     382        if (!ok) {
     383                return NULL;
     384        }
    377385
    378386        /* get the path on disk */
     
    417425                }
    418426
    419                 if ( !(tdb_node = TALLOC_ZERO_P( NULL, ELOG_TDB)) ) {
     427                if ( !(tdb_node = talloc_zero( NULL, ELOG_TDB)) ) {
    420428                        DEBUG(0,("elog_open_tdb: talloc() failure!\n"));
    421429                        tdb_close( tdb );
     
    579587        } else if ( 0 == strncmp( start, "STR", stop - start ) ) {
    580588                size_t tmp_len;
    581                 int num_of_strings;
     589                size_t num_of_strings;
    582590                /* skip past initial ":" */
    583591                stop++;
     
    782790        /* lock */
    783791        ret = tdb_lock_bystring_with_timeout(tdb, EVT_NEXT_RECORD, 1);
    784         if (ret == -1) {
     792        if (ret != 0) {
    785793                return NT_STATUS_LOCK_NOT_GRANTED;
    786794        }
     
    805813
    806814        ret = tdb_store(tdb, kbuf, ebuf, 0);
    807         if (ret == -1) {
     815        if (ret != 0) {
    808816                tdb_unlock_bystring(tdb, EVT_NEXT_RECORD);
    809817                return NT_STATUS_EVENTLOG_FILE_CORRUPT;
     
    811819
    812820        ret = tdb_store_int32(tdb, EVT_NEXT_RECORD, r->record_number + 1);
    813         if (ret == -1) {
     821        if (ret != 0) {
    814822                tdb_unlock_bystring(tdb, EVT_NEXT_RECORD);
    815823                return NT_STATUS_EVENTLOG_FILE_CORRUPT;
     
    955963                if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
    956964                                           t->sid.data, t->sid.length,
    957                                            (void *)&sid_str, &len, false)) {
     965                                           (void *)&sid_str, &len)) {
    958966                        return NT_STATUS_INVALID_SID;
    959967                }
Note: See TracChangeset for help on using the changeset viewer.