int elog_close_tdb( ELOG_TDB *etdb, bool force_close );
int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee );
void fixup_eventlog_entry( Eventlog_entry * ee );
-bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor );
+bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bool * eor );
/* The following definitions come from rpc_server/srv_eventlog_nt.c */
going in.
********************************************************************/
-bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor )
+bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bool * eor )
{
- TALLOC_CTX *ctx = talloc_tos();
char *start = NULL, *stop = NULL;
start = line;
while ( isspace( stop[0] ) ) {
stop++;
}
- entry->data_record.source_name_len = rpcstr_push_talloc(ctx,
+ entry->data_record.source_name_len = rpcstr_push_talloc(mem_ctx,
&entry->data_record.source_name,
stop);
if (entry->data_record.source_name_len == (uint32_t)-1 ||
while ( isspace( stop[0] ) ) {
stop++;
}
- entry->data_record.computer_name_len = rpcstr_push_talloc(ctx,
+ entry->data_record.computer_name_len = rpcstr_push_talloc(mem_ctx,
&entry->data_record.computer_name,
stop);
if (entry->data_record.computer_name_len == (uint32_t)-1 ||
while ( isspace( stop[0] ) ) {
stop++;
}
- entry->record.user_sid_length = rpcstr_push_talloc(ctx,
+ entry->record.user_sid_length = rpcstr_push_talloc(mem_ctx,
&entry->data_record.sid,
stop);
if (entry->record.user_sid_length == (uint32_t)-1 ||
while ( isspace(stop[0])) {
stop++;
}
- tmp_len = rpcstr_push_talloc(ctx,
+ tmp_len = rpcstr_push_talloc(mem_ctx,
&temp,
stop);
if (tmp_len == (size_t)-1 || !temp) {
return false;
}
old_len = entry->data_record.strings_len;
- entry->data_record.strings = (smb_ucs2_t *)TALLOC_REALLOC_ARRAY(ctx,
+ entry->data_record.strings = (smb_ucs2_t *)TALLOC_REALLOC_ARRAY(mem_ctx,
entry->data_record.strings,
char,
old_len + tmp_len);
stop++;
}
entry->data_record.user_data_len = strlen(stop);
- entry->data_record.user_data = talloc_strdup(ctx,
+ entry->data_record.user_data = talloc_strdup(mem_ctx,
stop);
if (!entry->data_record.user_data) {
return false;