svn commit: samba r13766 - branches/SAMBA_3_0/source/rpc_server trunk/source/rpc_server

jerry at samba.org jerry at samba.org
Wed Mar 1 03:10:22 GMT 2006


Author: jerry
Date: 2006-03-01 03:10:21 +0000 (Wed, 01 Mar 2006)
New Revision: 13766

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

Log:
Patch from Arek Glabek <aglabek at centeris.com>:

* Fix parsing error in eventlogadm caused by log entries 
  with no DAT: line.



Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_eventlog_lib.c
   trunk/source/rpc_server/srv_eventlog_lib.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_eventlog_lib.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_eventlog_lib.c	2006-03-01 02:47:50 UTC (rev 13765)
+++ branches/SAMBA_3_0/source/rpc_server/srv_eventlog_lib.c	2006-03-01 03:10:21 UTC (rev 13766)
@@ -707,16 +707,13 @@
 		memset( temp, 0, sizeof( temp ) );
 		strncpy( temp, stop, temp_len );
 		rpcstr_push( ( void * ) ( entry->data_record.strings +
-					  entry->data_record.strings_len ),
+					  ( entry->data_record.strings_len / 2 ) ),
 			     temp,
 			     sizeof( entry->data_record.strings ) -
-			     entry->data_record.strings_len, STR_TERMINATE );
-		entry->data_record.strings_len += temp_len + 1;
+			     ( entry->data_record.strings_len / 2 ), STR_TERMINATE );
+		entry->data_record.strings_len += ( temp_len * 2 ) + 2;
 		entry->record.num_strings++;
 	} else if ( 0 == strncmp( start, "DAT", stop - start ) ) {
-		/* Now that we're done processing the STR data, adjust the length to account for
-		   unicode, then proceed with the DAT data. */
-		entry->data_record.strings_len *= 2;
 		/* skip past initial ":" */
 		stop++;
 		/* now skip any other leading whitespace */

Modified: trunk/source/rpc_server/srv_eventlog_lib.c
===================================================================
--- trunk/source/rpc_server/srv_eventlog_lib.c	2006-03-01 02:47:50 UTC (rev 13765)
+++ trunk/source/rpc_server/srv_eventlog_lib.c	2006-03-01 03:10:21 UTC (rev 13766)
@@ -707,16 +707,13 @@
 		memset( temp, 0, sizeof( temp ) );
 		strncpy( temp, stop, temp_len );
 		rpcstr_push( ( void * ) ( entry->data_record.strings +
-					  entry->data_record.strings_len ),
+					  ( entry->data_record.strings_len / 2 ) ),
 			     temp,
 			     sizeof( entry->data_record.strings ) -
-			     entry->data_record.strings_len, STR_TERMINATE );
-		entry->data_record.strings_len += temp_len + 1;
+			     ( entry->data_record.strings_len / 2 ), STR_TERMINATE );
+		entry->data_record.strings_len += ( temp_len * 2 ) + 2;
 		entry->record.num_strings++;
 	} else if ( 0 == strncmp( start, "DAT", stop - start ) ) {
-		/* Now that we're done processing the STR data, adjust the length to account for
-		   unicode, then proceed with the DAT data. */
-		entry->data_record.strings_len *= 2;
 		/* skip past initial ":" */
 		stop++;
 		/* now skip any other leading whitespace */



More information about the samba-cvs mailing list