Author: jerry
Date: 2005-08-17 13:48:13 +0000 (Wed, 17 Aug 2005)
New Revision: 9364

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9364

Log:
eventlog subkey fix from Marcin
Modified:
   trunk/source/registry/reg_eventlog.c


Changeset:
Modified: trunk/source/registry/reg_eventlog.c
===================================================================
--- trunk/source/registry/reg_eventlog.c        2005-08-17 13:41:27 UTC (rev 
9363)
+++ trunk/source/registry/reg_eventlog.c        2005-08-17 13:48:13 UTC (rev 
9364)
@@ -114,7 +114,7 @@
                uiDisplayNameId = 0x07;
                regval_ctr_addvalue( val, "CategoryCount",    REG_DWORD, 
(char*)&uiDisplayNameId,       sizeof(uint32) ); 
        
-               init_unistr2( &data, "%SystemRoot%\\system32\\sambamsg.dll", 
UNI_STR_TERMINATE);
+               init_unistr2( &data, "%SystemRoot%\\system32\\eventlog.dll", 
UNI_STR_TERMINATE);
                regval_ctr_addvalue( val, "CategoryMessageFile", REG_EXPAND_SZ, 
(char*)data.buffer, data.uni_str_len*sizeof(uint16) );
        
                num_values = regval_ctr_numvals( val ); 
@@ -190,20 +190,34 @@
                        regsubkey_ctr_addkey( subkey_ctr, *evtlog_list);
 
                return regsubkey_ctr_numkeys( subkey_ctr );
-       }
+       } else {
+               /* if we get <logname>/<logname> then we don't add anymore */
 
-       /* look for a match */
+               if (strchr(path,'\\')) {
+                       DEBUG(10,("eventlog_subkey_info: Not adding subkey to 
%s\n",path));     
+                       return 0;
+               }
 
-       if ( !evtlog_list )
-               return -1;
+               /* add in a subkey with the same name as the eventlog... */
 
-       for ( /* nothing */; *evtlog_list; evtlog_list++ ) { 
-               
-               /* if we find a match, then return 0 subkeys */
+               DEBUG(10,("eventlog_subkey_info: Looking to add eventlog subkey 
to %s\n",path));        
 
-               if ( strequal(path,*evtlog_list) ) 
-                       return 0;
+               /* look for a match */
+
+               evtlog_list = lp_eventlog_list(); 
+
+               if ( !evtlog_list )
+                       return -1; 
+
+               for ( /* nothing */; *evtlog_list; evtlog_list++ ) { 
+                       if ( strequal(path,*evtlog_list) ) {
+                               regsubkey_ctr_addkey( subkey_ctr, path);
+                               return regsubkey_ctr_numkeys( subkey_ctr );
+                       }
+               }
        }
+
+
        
        SAFE_FREE( path );
 

Reply via email to