X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fclient-agent%2Freceiver.c;h=1a354844552a1bd6276a0dfa678eff953cb52973;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hp=35b7d7ef885780d60829a5f61047001ac0fa2ff8;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/client-agent/receiver.c b/src/client-agent/receiver.c index 35b7d7e..1a35484 100755 --- a/src/client-agent/receiver.c +++ b/src/client-agent/receiver.c @@ -1,11 +1,12 @@ -/* @(#) $Id: receiver.c,v 1.28 2009/06/24 17:06:24 dcid Exp $ */ +/* @(#) $Id: ./src/client-agent/receiver.c, 2011/09/08 dcid Exp $ + */ /* 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 */ @@ -29,7 +30,7 @@ char file_sum[34] = ""; char file[OS_SIZE_1024 +1] = ""; -/* receive_msg: +/* receive_msg: * Receive events from the server. */ void *receive_msg() @@ -47,7 +48,7 @@ void *receive_msg() - /* Read until no more messages are available */ + /* Read until no more messages are available */ while((recv_b = recv(logr->sock, buffer, OS_SIZE_1024, MSG_DONTWAIT)) > 0) { buffer[recv_b] = '\0'; @@ -83,7 +84,7 @@ void *receive_msg() { if(OS_SendUnix(logr->execdq, tmp_msg, 0) < 0) { - merror("%s: Error communicating with execd", + merror("%s: Error communicating with execd", ARGV0); } } @@ -101,7 +102,7 @@ void *receive_msg() continue; - } + } /* Restart syscheck. */ @@ -128,7 +129,7 @@ void *receive_msg() /* File update message */ - if(strncmp(tmp_msg, FILE_UPDATE_HEADER, + if(strncmp(tmp_msg, FILE_UPDATE_HEADER, strlen(FILE_UPDATE_HEADER)) == 0) { char *validate_file; @@ -164,10 +165,10 @@ void *receive_msg() } if(tmp_msg[0] == '.') - tmp_msg[0] = '-'; + tmp_msg[0] = '-'; - snprintf(file, OS_SIZE_1024, "%s/%s", + snprintf(file, OS_SIZE_1024, "%s/%s", SHAREDCFG_DIR, tmp_msg); @@ -179,7 +180,7 @@ void *receive_msg() } } - else if(strncmp(tmp_msg, FILE_CLOSE_HEADER, + else if(strncmp(tmp_msg, FILE_CLOSE_HEADER, strlen(FILE_CLOSE_HEADER)) == 0) { /* no error */ @@ -208,7 +209,7 @@ void *receive_msg() if(strcmp(currently_md5, file_sum) != 0) { debug1("%s: ERROR: Failed md5 for: %s -- deleting.", - ARGV0, file); + ARGV0, file); unlink(file); } else @@ -252,7 +253,7 @@ void *receive_msg() merror("%s: WARN: Unknown message received. No action defined.", ARGV0); } - } + } return(NULL);