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
/
remoted
/
ar-forward.c
diff --git
a/src/remoted/ar-forward.c
b/src/remoted/ar-forward.c
index
1e6bc1c
..
df76769
100755
(executable)
--- a/
src/remoted/ar-forward.c
+++ b/
src/remoted/ar-forward.c
@@
-1,4
+1,5
@@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/remoted/ar-forward.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
@@
-28,9
+29,9
@@
void *AR_Forward(void *arg)
int arq = 0;
int agent_id = 0;
int ar_location = 0;
int arq = 0;
int agent_id = 0;
int ar_location = 0;
-
+
char msg_to_send[OS_SIZE_1024 +1];
char msg_to_send[OS_SIZE_1024 +1];
-
+
char msg[OS_SIZE_1024 +1];
char *location = NULL;
char *ar_location_str = NULL;
char msg[OS_SIZE_1024 +1];
char *location = NULL;
char *ar_location_str = NULL;
@@
-53,8
+54,8
@@
void *AR_Forward(void *arg)
{
/* Always zeroing the location */
ar_location = 0;
{
/* Always zeroing the location */
ar_location = 0;
-
-
+
+
/* Getting the location */
location = msg;
/* Getting the location */
location = msg;
@@
-104,8
+105,8
@@
void *AR_Forward(void *arg)
{
ar_location|=SPECIFIC_AGENT;
}
{
ar_location|=SPECIFIC_AGENT;
}
-
-
+
+
/*** Extracting the active response location ***/
tmp_str = strchr(ar_location_str, ' ');
if(!tmp_str)
/*** Extracting the active response location ***/
tmp_str = strchr(ar_location_str, ' ');
if(!tmp_str)
@@
-127,28
+128,28
@@
void *AR_Forward(void *arg)
}
*tmp_str = '\0';
tmp_str++;
}
*tmp_str = '\0';
tmp_str++;
-
-
+
+
/*** Creating the new message ***/
if(ar_location & NO_AR_MSG)
{
/*** Creating the new message ***/
if(ar_location & NO_AR_MSG)
{
- snprintf(msg_to_send, OS_SIZE_1024, "%s%s",
+ snprintf(msg_to_send, OS_SIZE_1024, "%s%s",
CONTROL_HEADER,
tmp_str);
}
else
{
CONTROL_HEADER,
tmp_str);
}
else
{
- snprintf(msg_to_send, OS_SIZE_1024, "%s%s%s",
+ snprintf(msg_to_send, OS_SIZE_1024, "%s%s%s",
CONTROL_HEADER,
EXECD_HEADER,
tmp_str);
}
CONTROL_HEADER,
EXECD_HEADER,
tmp_str);
}
-
+
/* Lock use of keys */
key_lock();
/* Lock use of keys */
key_lock();
-
-
+
+
/* Sending to ALL agents */
if(ar_location & ALL_AGENTS)
{
/* Sending to ALL agents */
if(ar_location & ALL_AGENTS)
{
@@
-168,7
+169,7
@@
void *AR_Forward(void *arg)
merror(AR_NOAGENT_ERROR, ARGV0, location);
continue;
}
merror(AR_NOAGENT_ERROR, ARGV0, location);
continue;
}
-
+
send_msg(agent_id, msg_to_send);
}
send_msg(agent_id, msg_to_send);
}
@@
-178,7
+179,7
@@
void *AR_Forward(void *arg)
ar_location++;
agent_id = OS_IsAllowedID(&keys, ar_agent_id);
ar_location++;
agent_id = OS_IsAllowedID(&keys, ar_agent_id);
-
+
if(agent_id < 0)
{
key_unlock();
if(agent_id < 0)
{
key_unlock();
@@
-195,6
+196,6
@@
void *AR_Forward(void *arg)
}
}
}
}
-
+
/* EOF */
/* EOF */