*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
/* Find all of the eventlogs, add keys for each of them */
const char **elogs = lp_eventlog_list( );
pstring evtlogpath;
+ pstring evtfilepath;
REGSUBKEY_CTR *subkeys;
REGVAL_CTR *values;
- uint32 uiDisplayNameId;
uint32 uiMaxSize;
uint32 uiRetention;
uint32 uiCategoryCount;
}
regdb_fetch_keys( KEY_EVENTLOG, subkeys );
regsubkey_ctr_addkey( subkeys, *elogs );
- if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) )
+ if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) ) {
+ TALLOC_FREE(subkeys);
return False;
+ }
TALLOC_FREE( subkeys );
/* add in the key of form KEY_EVENTLOG/Application */
regdb_fetch_keys( evtlogpath, subkeys );
regsubkey_ctr_addkey( subkeys, *elogs );
- if ( !regdb_store_keys( evtlogpath, subkeys ) )
+ if ( !regdb_store_keys( evtlogpath, subkeys ) ) {
+ TALLOC_FREE(subkeys);
return False;
+ }
TALLOC_FREE( subkeys );
/* now add the values to the KEY_EVENTLOG/Application form key */
/* hard code some initial values */
- uiDisplayNameId = 0x00000100;
+ /* uiDisplayNameId = 0x00000100; */
uiMaxSize = 0x00080000;
uiRetention = 0x93A80;
regval_ctr_addvalue( values, "MaxSize", REG_DWORD,
( char * ) &uiMaxSize,
sizeof( uint32 ) );
+
regval_ctr_addvalue( values, "Retention", REG_DWORD,
( char * ) &uiRetention,
sizeof( uint32 ) );
init_unistr2( &data, *elogs, UNI_STR_TERMINATE );
+
regval_ctr_addvalue( values, "PrimaryModule", REG_SZ,
( char * ) data.buffer,
data.uni_str_len *
( char * ) data.buffer,
data.uni_str_len *
sizeof( uint16 ) );
+
+ pstr_sprintf( evtfilepath, "%%SystemRoot%%\\system32\\config\\%s.tdb", *elogs );
+ init_unistr2( &data, evtfilepath, UNI_STR_TERMINATE );
+ regval_ctr_addvalue( values, "File", REG_EXPAND_SZ, ( char * ) data.buffer,
+ data.uni_str_len * sizeof( uint16 ) );
regdb_store_values( evtlogpath, values );
}
int i;
int numsources;
+ if (!elogs) {
+ return False;
+ }
+
for ( i = 0; elogs[i]; i++ ) {
if ( strequal( elogs[i], eventlog ) )
break;
*( wp + numsources ) = ( char * ) sourcename;
*( wp + numsources + 1 ) = NULL;
mbytes = regval_build_multi_sz( wp, &msz_wp );
- dump_data( 1, ( char * ) msz_wp, mbytes );
+ dump_data( 1, ( uint8 * ) msz_wp, mbytes );
regval_ctr_addvalue( values, "Sources", REG_MULTI_SZ,
( char * ) msz_wp, mbytes );
regdb_store_values( evtlogpath, values );
sourcename ) );
}
TALLOC_FREE( values );
- if ( wrklist )
- TALLOC_FREE( wrklist ); /* */
+ TALLOC_FREE( wrklist ); /* */
if ( !( subkeys = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR ) ) ) {
DEBUG( 0, ( "talloc() failure!\n" ) );
}
TALLOC_FREE( subkeys );
- /* at this point KEY_EVENTLOG/<eventlog>/<sourcename> key is in there. Now need to add EventLogMessageFile */
+ /* at this point KEY_EVENTLOG/<eventlog>/<sourcename> key is in there. Now need to add EventMessageFile */
/* now allocate room for the source's subkeys */
return False;
}
DEBUG( 5,
- ( "Storing EventLogMessageFile [%s] to eventlog path of [%s]\n",
+ ( "Storing EventMessageFile [%s] to eventlog path of [%s]\n",
messagefile, evtlogpath ) );
regdb_fetch_values( evtlogpath, values );
init_unistr2( &data, messagefile, UNI_STR_TERMINATE );
- regval_ctr_addvalue( values, "EventLogMessageFile", REG_EXPAND_SZ,
+ regval_ctr_addvalue( values, "EventMessageFile", REG_SZ,
( char * ) data.buffer,
data.uni_str_len * sizeof( uint16 ) );
regdb_store_values( evtlogpath, values );