izmjene za lintian
[ossec-hids.git] / src / client-agent / receiver.c
index b9ab116..45c96c6 100755 (executable)
@@ -1,4 +1,5 @@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/client-agent/receiver.c, 2011/09/08 dcid Exp $
+ */
 
 /* Copyright (C) 2009 Trend Micro Inc.
  * All right reserved.
@@ -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,15 +48,15 @@ void *receive_msg()
 
 
 
-    /* Read until no more messages are available */ 
-    while((recv_b = recv(logr->sock, buffer, OS_SIZE_1024, MSG_DONTWAIT)) > 0)
+    /* Read until no more messages are available */
+    while((recv_b = recv(agt->sock, buffer, OS_SIZE_1024, MSG_DONTWAIT)) > 0)
     {
         buffer[recv_b] = '\0';
 
         tmp_msg = ReadSecMSG(&keys, buffer, cleartext, 0, recv_b -1);
         if(tmp_msg == NULL)
         {
-            merror(MSG_ERROR,ARGV0,logr->rip[logr->rip_id]);
+            merror(MSG_ERROR,ARGV0,agt->rip[agt->rip_id]);
             continue;
         }
 
@@ -68,7 +69,7 @@ void *receive_msg()
 
             #ifdef WIN32
             /* Run timeout commands. */
-            if(logr->execdq >= 0)
+            if(agt->execdq >= 0)
                 WinTimeoutRun(available_server);
             #endif
 
@@ -79,11 +80,11 @@ void *receive_msg()
                 tmp_msg+=strlen(EXECD_HEADER);
 
                 #ifndef WIN32
-                if(logr->execdq >= 0)
+                if(agt->execdq >= 0)
                 {
-                    if(OS_SendUnix(logr->execdq, tmp_msg, 0) < 0)
+                    if(OS_SendUnix(agt->execdq, tmp_msg, 0) < 0)
                     {
-                        merror("%s: Error communicating with execd", 
+                        merror("%s: Error communicating with execd",
                                 ARGV0);
                     }
                 }
@@ -92,7 +93,7 @@ void *receive_msg()
 
 
                 /* Run on windows. */
-                if(logr->execdq >= 0)
+                if(agt->execdq >= 0)
                 {
                     WinExecdRun(tmp_msg);
                 }
@@ -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);