X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fanalysisd%2Fdecoders%2Fdecoders_list.c;h=652f78574adaa7edb8b9bee5151bc455ac9d88d5;hp=5cbe9a861c1b201571afabedb6e842e2b62c0d76;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/analysisd/decoders/decoders_list.c b/src/analysisd/decoders/decoders_list.c index 5cbe9a8..652f785 100755 --- a/src/analysisd/decoders/decoders_list.c +++ b/src/analysisd/decoders/decoders_list.c @@ -1,4 +1,5 @@ -/* @(#) $Id$ */ +/* @(#) $Id: ./src/analysisd/decoders/decoders_list.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. @@ -8,7 +9,7 @@ * License (version 2) as published by the FSF - Free Software * Foundation. * - * License details at the LICENSE file included with OSSEC or + * License details at the LICENSE file included with OSSEC or * online at: http://www.ossec.net/en/licensing.html */ @@ -50,7 +51,7 @@ OSDecoderNode *OS_GetFirstOSDecoder(char *p_name) { return(osdecodernode_forpname); } - + return(osdecodernode_nopname); } @@ -60,11 +61,11 @@ OSDecoderNode *_OS_AddOSDecoder(OSDecoderNode *s_node, OSDecoderInfo *pi) { OSDecoderNode *tmp_node = s_node; int rm_f = 0; - + if(tmp_node) { OSDecoderNode *new_node; - + new_node = (OSDecoderNode *)calloc(1,sizeof(OSDecoderNode)); if(new_node == NULL) { @@ -82,9 +83,9 @@ OSDecoderNode *_OS_AddOSDecoder(OSDecoderNode *s_node, OSDecoderInfo *pi) if((tmp_node->osdecoder->prematch || tmp_node->osdecoder->regex) && pi->regex_offset) { - rm_f = 1; + rm_f = 1; } - + /* Multi-regexes patterns cannot have prematch */ if(pi->prematch) { @@ -109,24 +110,24 @@ OSDecoderNode *_OS_AddOSDecoder(OSDecoderNode *s_node, OSDecoderInfo *pi) return(NULL); } } - + }while(tmp_node->next && (tmp_node = tmp_node->next)); - - + + /* Must have a prematch set */ if(!rm_f && (pi->regex_offset & AFTER_PREVREGEX)) { merror(INV_OFFSET, ARGV0, pi->name); return(NULL); } - + tmp_node->next = new_node; - + new_node->next = NULL; - new_node->osdecoder = pi; + new_node->osdecoder = pi; new_node->child = NULL; } - + else { /* Must not have a previous regex set */ @@ -163,7 +164,7 @@ int OS_AddOSDecoder(OSDecoderInfo *pi) /* We can actually have two lists. One with program * name and the other without. */ - if(pi->program_name) + if(pi->program_name) { osdecodernode = osdecodernode_forpname; } @@ -172,7 +173,7 @@ int OS_AddOSDecoder(OSDecoderInfo *pi) osdecodernode = osdecodernode_nopname; } - + /* Search for parent on both lists */ if(pi->parent) { @@ -193,7 +194,7 @@ int OS_AddOSDecoder(OSDecoderInfo *pi) } tmp_node = tmp_node->next; } - + /* List without p name */ tmp_node = osdecodernode_nopname; @@ -218,9 +219,9 @@ int OS_AddOSDecoder(OSDecoderInfo *pi) { return(1); } - + merror(PPLUGIN_INV, ARGV0, pi->parent); - return(0); + return(0); } else {