-/* @(#) $Id: read_command.c,v 1.3 2009/11/05 19:55:34 dcid Exp $ */
+/* @(#) $Id$ */
/* Copyright (C) 2009 Trend Micro Inc.
* All right 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
*/
}
- snprintf(str, 256, "ossec: output: '%s': ", logff[pos].command);
+ snprintf(str, 256, "ossec: output: '%s': ",
+ (NULL != logff[pos].alias)
+ ? logff[pos].alias
+ : logff[pos].command);
cmd_size = strlen(str);
{
*p = '\0';
}
+
+ /* Removing empty lines. */
+ #ifdef WIN32
+ if(str[0] == '\r' && str[1] == '\0')
+ {
+ continue;
+ }
+ #endif
+ if(str[0] == '\0')
+ {
+ continue;
+ }
+
debug2("%s: DEBUG: Reading command message: '%s'", ARGV0, str);
/* Sending message to queue */
if(drop_it == 0)
{
- if(SendMSG(logr_queue,str,logff[pos].command,
+ if(SendMSG(logr_queue,str,
+ (NULL != logff[pos].alias) ? logff[pos].alias : logff[pos].command,
LOCALFILE_MQ) < 0)
{
merror(QUEUE_SEND, ARGV0);