X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fremoted%2Fremoted.c;h=0800f1cc72695878ae87509ffb032c8d8eb8f28d;hp=4930aba3bf51ea21bbcce423ccadbc0e3b2e6486;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/remoted/remoted.c b/src/remoted/remoted.c index 4930aba..0800f1c 100755 --- 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. @@ -8,14 +9,14 @@ * 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. - * Listen to remote packets and forward them to the analysis + * Listen to remote packets and forward them to the analysis * system */ @@ -54,13 +55,13 @@ void HandleRemote(int position, int uid) } } } - - /* Bind TCP */ + + /* Bind TCP */ 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]); } @@ -68,22 +69,22 @@ void HandleRemote(int position, int uid) 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]); } } - - + + /* Revoking the privileges */ if(Privsep_SetUser(uid) < 0) { ErrorExit(SETUID_ERROR,ARGV0, REMUSER); } - - + + /* 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()); - + /* If Secure connection, deal with it */ if(logr.conn[position] == SECURE_CONN) { HandleSecure(); } - + else if(logr.proto[position] == TCP_PROTO) { HandleSyslogTCP(); } - + /* If not, deal with syslog */ else { HandleSyslog(); } - + return; }