Changeset 988 for vendor/current/source3/lib/eventlog
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/eventlog/eventlog.c
r740 r988 74 74 char *tdbname; 75 75 76 path = talloc_strdup(ctx, state_path("eventlog"));76 path = state_path("eventlog"); 77 77 if (!path) { 78 78 return NULL; … … 85 85 } 86 86 87 tdbname = talloc_asprintf( path, "%s/%s", state_path("eventlog"), file);87 tdbname = talloc_asprintf(ctx, "%s/%s", path, file); 88 88 if (!tdbname) { 89 89 talloc_free(path); … … 91 91 } 92 92 93 talloc_free(path); 93 94 return tdbname; 94 95 } … … 341 342 char *eventlogdir; 342 343 TALLOC_CTX *ctx = talloc_tos(); 344 bool ok; 343 345 344 346 /* check for invalid options */ … … 372 374 /* make sure that the eventlog dir exists */ 373 375 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 } 377 385 378 386 /* get the path on disk */ … … 417 425 } 418 426 419 if ( !(tdb_node = TALLOC_ZERO_P( NULL, ELOG_TDB)) ) {427 if ( !(tdb_node = talloc_zero( NULL, ELOG_TDB)) ) { 420 428 DEBUG(0,("elog_open_tdb: talloc() failure!\n")); 421 429 tdb_close( tdb ); … … 579 587 } else if ( 0 == strncmp( start, "STR", stop - start ) ) { 580 588 size_t tmp_len; 581 int num_of_strings;589 size_t num_of_strings; 582 590 /* skip past initial ":" */ 583 591 stop++; … … 782 790 /* lock */ 783 791 ret = tdb_lock_bystring_with_timeout(tdb, EVT_NEXT_RECORD, 1); 784 if (ret == -1) {792 if (ret != 0) { 785 793 return NT_STATUS_LOCK_NOT_GRANTED; 786 794 } … … 805 813 806 814 ret = tdb_store(tdb, kbuf, ebuf, 0); 807 if (ret == -1) {815 if (ret != 0) { 808 816 tdb_unlock_bystring(tdb, EVT_NEXT_RECORD); 809 817 return NT_STATUS_EVENTLOG_FILE_CORRUPT; … … 811 819 812 820 ret = tdb_store_int32(tdb, EVT_NEXT_RECORD, r->record_number + 1); 813 if (ret == -1) {821 if (ret != 0) { 814 822 tdb_unlock_bystring(tdb, EVT_NEXT_RECORD); 815 823 return NT_STATUS_EVENTLOG_FILE_CORRUPT; … … 955 963 if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, 956 964 t->sid.data, t->sid.length, 957 (void *)&sid_str, &len , false)) {965 (void *)&sid_str, &len)) { 958 966 return NT_STATUS_INVALID_SID; 959 967 }
Note:
See TracChangeset
for help on using the changeset viewer.