projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.7
[ossec-hids.git]
/
src
/
logcollector
/
read_command.c
diff --git
a/src/logcollector/read_command.c
b/src/logcollector/read_command.c
index
a6c413f
..
f1de982
100755
(executable)
--- 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.
/* 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);
: 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 */
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';
}
{
*p = '\0';
}
@@
-69,11
+70,11
@@
void *read_command(int pos, int *rc, int drop_it)
{
continue;
}
{
continue;
}
-
-
+
+
debug2("%s: DEBUG: Reading command message: '%s'", ARGV0, str);
debug2("%s: DEBUG: Reading command message: '%s'", ARGV0, str);
-
+
/* Sending message to queue */
if(drop_it == 0)
{
/* 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);
pclose(cmd_output);
- return(NULL);
+ return(NULL);
}
/* EOF */
}
/* EOF */