Imported Upstream version 2.7
[ossec-hids.git] / src / analysisd / dodiff.c
index c17de31..2fba506 100755 (executable)
@@ -1,4 +1,5 @@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/analysisd/dodiff.c, 2012/07/23 dcid Exp $
+ */
 
 /* Copyright (C) 2010 Trend Micro Inc.
  * All rights reserved.
@@ -8,7 +9,7 @@
  * 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
  */
 
@@ -34,7 +35,7 @@ static int _add2last(char *str, int strsize, char *file)
         dirrule = strrchr(file, '/');
         if(!dirrule)
         {
-            merror("%s: ERROR: Invalid file name to diff: %s", 
+            merror("%s: ERROR: Invalid file name to diff: %s",
                    ARGV0, file);
             return(0);
         }
@@ -99,6 +100,7 @@ int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
     currently_rule->last_events[0] = NULL;
 
 
+
     if(lf->hostname[0] == '(')
     {
         htpt = strchr(lf->hostname, ')');
@@ -106,8 +108,8 @@ int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
         {
             *htpt = '\0';
         }
-        snprintf(flastfile, OS_SIZE_2048, "%s/%s/%d/%s", DIFF_DIR, lf->hostname+1, 
-                 currently_rule->sigid, DIFF_LAST_FILE); 
+        snprintf(flastfile, OS_SIZE_2048, "%s/%s/%d/%s", DIFF_DIR, lf->hostname+1,
+                 currently_rule->sigid, DIFF_LAST_FILE);
 
         if(htpt)
         {
@@ -117,7 +119,7 @@ int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
     }
     else
     {
-        snprintf(flastfile, OS_SIZE_2048, "%s/%s/%d/%s", DIFF_DIR, lf->hostname, 
+        snprintf(flastfile, OS_SIZE_2048, "%s/%s/%d/%s", DIFF_DIR, lf->hostname,
                  currently_rule->sigid, DIFF_LAST_FILE);
     }
 
@@ -133,7 +135,6 @@ int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
     date_of_change = File_DateofChange(flastfile);
     if(date_of_change <= 0)
     {
-        merror("last file: %s",flastfile);
         if(!_add2last(lf->log, lf->size, flastfile))
         {
             merror("%s: ERROR: unable to create last file: %s", ARGV0, flastfile);
@@ -181,8 +182,8 @@ int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
         {
             *htpt = '\0';
         }
-        snprintf(fdifffile, OS_SIZE_2048, "%s/%s/%d/state.%d", DIFF_DIR, lf->hostname+1, 
-                 currently_rule->sigid, date_of_change); 
+        snprintf(fdifffile, OS_SIZE_2048, "%s/%s/%d/state.%d", DIFF_DIR, lf->hostname+1,
+                 currently_rule->sigid, date_of_change);
 
         if(htpt)
         {
@@ -192,7 +193,7 @@ int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
     }
     else
     {
-        snprintf(fdifffile, OS_SIZE_2048, "%s/%s/%d/state.%d", DIFF_DIR, lf->hostname, 
+        snprintf(fdifffile, OS_SIZE_2048, "%s/%s/%d/state.%d", DIFF_DIR, lf->hostname,
                  currently_rule->sigid, date_of_change);
     }