X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fanalysisd%2Fdecoders%2Fdecoders_list.c;h=652f78574adaa7edb8b9bee5151bc455ac9d88d5;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hp=7fe23b646956df3974acbd4588bb5b52b3fa9f44;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/analysisd/decoders/decoders_list.c b/src/analysisd/decoders/decoders_list.c index 7fe23b6..652f785 100755 --- a/src/analysisd/decoders/decoders_list.c +++ b/src/analysisd/decoders/decoders_list.c @@ -1,14 +1,15 @@ -/* @(#) $Id: decoders_list.c,v 1.7 2009/06/24 17:06:23 dcid Exp $ */ +/* @(#) $Id: ./src/analysisd/decoders/decoders_list.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 3) as published by the FSF - Free Software + * 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 {