X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Flogcollector%2Fread_command.c;h=f1de982333c68f1a4571298548997b9b4fd1a60d;hp=a6c413f39b41ab8a5f7e9a6d0607dc567b5a02b7;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/logcollector/read_command.c b/src/logcollector/read_command.c index a6c413f..f1de982 100755 --- a/src/logcollector/read_command.c +++ b/src/logcollector/read_command.c @@ -1,4 +1,5 @@ -/* @(#) $Id$ */ +/* @(#) $Id: ./src/logcollector/read_command.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. @@ -43,9 +44,9 @@ void *read_command(int pos, int *rc, int drop_it) } - snprintf(str, 256, "ossec: output: '%s': ", - (NULL != logff[pos].alias) - ? logff[pos].alias + snprintf(str, 256, "ossec: output: '%s': ", + (NULL != logff[pos].alias) + ? logff[pos].alias : logff[pos].command); cmd_size = strlen(str); @@ -53,7 +54,7 @@ void *read_command(int pos, int *rc, int drop_it) while(fgets(str + cmd_size, OS_MAXSTR - OS_LOG_HEADER - 256, cmd_output) != NULL) { /* Getting the last occurence of \n */ - if ((p = strrchr(str, '\n')) != NULL) + if ((p = strrchr(str, '\n')) != NULL) { *p = '\0'; } @@ -69,11 +70,11 @@ void *read_command(int pos, int *rc, int drop_it) { continue; } - - + + debug2("%s: DEBUG: Reading command message: '%s'", ARGV0, str); - + /* Sending message to queue */ if(drop_it == 0) { @@ -94,7 +95,7 @@ void *read_command(int pos, int *rc, int drop_it) pclose(cmd_output); - return(NULL); + return(NULL); } /* EOF */