]> git.samba.org - ira/wip.git/commitdiff
s3-eventlog: remove read_package_entry.
authorGünther Deschner <gd@samba.org>
Wed, 4 Feb 2009 20:34:35 +0000 (21:34 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 4 Feb 2009 21:51:07 +0000 (22:51 +0100)
Guenther

source3/rpc_server/srv_eventlog_nt.c

index b378556f43590da06378a5d63cb47d739d114760..4a2ea2f2c08f019e0f8ca241c5a9aebb6c1eadfa 100644 (file)
@@ -350,98 +350,6 @@ done:
        return ret;
 }
 
-/********************************************************************
- ********************************************************************/
-
-static Eventlog_entry *read_package_entry( TALLOC_CTX *mem_ctx,
-                                          Eventlog_entry * entry )
-{
-       uint8 *offset;
-       Eventlog_entry *ee_new = NULL;
-
-       ee_new = TALLOC_ZERO_ARRAY(mem_ctx, Eventlog_entry, 1 );
-       if ( ee_new == NULL ) {
-               return NULL;
-       }
-
-       entry->data_record.sid_padding =
-               ( ( 4 -
-                   ( ( entry->data_record.source_name_len +
-                       entry->data_record.computer_name_len ) % 4 ) ) % 4 );
-       entry->data_record.data_padding =
-               ( 4 -
-                 ( ( entry->data_record.strings_len +
-                     entry->data_record.user_data_len ) % 4 ) ) % 4;
-       entry->record.length = sizeof( Eventlog_record );
-       entry->record.length += entry->data_record.source_name_len;
-       entry->record.length += entry->data_record.computer_name_len;
-       if ( entry->record.user_sid_length == 0 ) {
-               /* Should not pad to a DWORD boundary for writing out the sid if there is
-                  no SID, so just propagate the padding to pad the data */
-               entry->data_record.data_padding +=
-                       entry->data_record.sid_padding;
-               entry->data_record.sid_padding = 0;
-       }
-       DEBUG( 10,
-              ( "sid_padding is [%d].\n", entry->data_record.sid_padding ) );
-       DEBUG( 10,
-              ( "data_padding is [%d].\n",
-                entry->data_record.data_padding ) );
-
-       entry->record.length += entry->data_record.sid_padding;
-       entry->record.length += entry->record.user_sid_length;
-       entry->record.length += entry->data_record.strings_len;
-       entry->record.length += entry->data_record.user_data_len;
-       entry->record.length += entry->data_record.data_padding;
-       /* need another copy of length at the end of the data */
-       entry->record.length += sizeof( entry->record.length );
-       DEBUG( 10,
-              ( "entry->record.length is [%d].\n", entry->record.length ) );
-       entry->data =
-               TALLOC_ZERO_ARRAY(mem_ctx, uint8_t,
-                                 entry->record.length -
-                                 sizeof( Eventlog_record ) -
-                                 sizeof( entry->record.length ));
-       if ( entry->data == NULL ) {
-               return NULL;
-       }
-       offset = entry->data;
-       memcpy( offset, entry->data_record.source_name,
-               entry->data_record.source_name_len );
-       offset += entry->data_record.source_name_len;
-       memcpy( offset, entry->data_record.computer_name,
-               entry->data_record.computer_name_len );
-       offset += entry->data_record.computer_name_len;
-       /* SID needs to be DWORD-aligned */
-       offset += entry->data_record.sid_padding;
-       entry->record.user_sid_offset =
-               sizeof( Eventlog_record ) + ( offset - entry->data );
-       memcpy( offset, entry->data_record.sid,
-               entry->record.user_sid_length );
-       offset += entry->record.user_sid_length;
-       /* Now do the strings */
-       entry->record.string_offset =
-               sizeof( Eventlog_record ) + ( offset - entry->data );
-       memcpy( offset, entry->data_record.strings,
-               entry->data_record.strings_len );
-       offset += entry->data_record.strings_len;
-       /* Now do the data */
-       entry->record.data_length = entry->data_record.user_data_len;
-       entry->record.data_offset =
-               sizeof( Eventlog_record ) + ( offset - entry->data );
-       memcpy( offset, entry->data_record.user_data,
-               entry->data_record.user_data_len );
-       offset += entry->data_record.user_data_len;
-
-       memcpy( &( ee_new->record ), &entry->record,
-               sizeof( Eventlog_record ) );
-       memcpy( &( ee_new->data_record ), &entry->data_record,
-               sizeof( Eventlog_data_record ) );
-       ee_new->data = entry->data;
-
-       return ee_new;
-}
-
 /********************************************************************
  ********************************************************************/