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
/
remoted.c
diff --git
a/src/remoted/remoted.c
b/src/remoted/remoted.c
index
4930aba
..
0800f1c
100755
(executable)
--- a/
src/remoted/remoted.c
+++ b/
src/remoted/remoted.c
@@
-1,4
+1,5
@@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/remoted/remoted.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
@@
-8,14
+9,14
@@
* License (version 2) as published by the FSF - Free Software
* Foundation.
*
* 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
*/
/* remote daemon.
* online at: http://www.ossec.net/en/licensing.html
*/
/* remote daemon.
- * Listen to remote packets and forward them to the analysis
+ * Listen to remote packets and forward them to the analysis
* system
*/
* system
*/
@@
-54,13
+55,13
@@
void HandleRemote(int position, int uid)
}
}
}
}
}
}
-
- /* Bind TCP */
+
+ /* Bind TCP */
if(logr.proto[position] == TCP_PROTO)
{
if(logr.proto[position] == TCP_PROTO)
{
- if((logr.sock =
- OS_Bindporttcp(logr.port[position],logr.lip[position])) < 0)
+ if((logr.sock =
+ OS_Bindporttcp(logr.port[position],logr.lip[position], logr.ipv6[position])) < 0)
{
ErrorExit(BIND_ERROR, ARGV0, logr.port[position]);
}
{
ErrorExit(BIND_ERROR, ARGV0, logr.port[position]);
}
@@
-68,22
+69,22
@@
void HandleRemote(int position, int uid)
else
{
/* Using UDP. Fast, unreliable.. perfect */
else
{
/* Using UDP. Fast, unreliable.. perfect */
- if((logr.sock =
- OS_Bindportudp(logr.port[position], logr.lip[position])) < 0)
+ if((logr.sock =
+ OS_Bindportudp(logr.port[position], logr.lip[position], logr.ipv6[position])) < 0)
{
ErrorExit(BIND_ERROR, ARGV0, logr.port[position]);
}
}
{
ErrorExit(BIND_ERROR, ARGV0, logr.port[position]);
}
}
-
-
+
+
/* Revoking the privileges */
if(Privsep_SetUser(uid) < 0)
{
ErrorExit(SETUID_ERROR,ARGV0, REMUSER);
}
/* Revoking the privileges */
if(Privsep_SetUser(uid) < 0)
{
ErrorExit(SETUID_ERROR,ARGV0, REMUSER);
}
-
-
+
+
/* Creating PID */
if(CreatePID(ARGV0, getpid()) < 0)
{
/* Creating PID */
if(CreatePID(ARGV0, getpid()) < 0)
{
@@
-93,25
+94,25
@@
void HandleRemote(int position, int uid)
/* Start up message */
verbose(STARTUP_MSG, ARGV0, (int)getpid());
/* Start up message */
verbose(STARTUP_MSG, ARGV0, (int)getpid());
-
+
/* If Secure connection, deal with it */
if(logr.conn[position] == SECURE_CONN)
{
HandleSecure();
}
/* If Secure connection, deal with it */
if(logr.conn[position] == SECURE_CONN)
{
HandleSecure();
}
-
+
else if(logr.proto[position] == TCP_PROTO)
{
HandleSyslogTCP();
}
else if(logr.proto[position] == TCP_PROTO)
{
HandleSyslogTCP();
}
-
+
/* If not, deal with syslog */
else
{
HandleSyslog();
}
/* If not, deal with syslog */
else
{
HandleSyslog();
}
-
+
return;
}
return;
}