projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- fortify/harden the compile
[ossec-hids.git]
/
src
/
analysisd
/
dodiff.c
diff --git
a/src/analysisd/dodiff.c
b/src/analysisd/dodiff.c
index
c17de31
..
2fba506
100755
(executable)
--- a/
src/analysisd/dodiff.c
+++ b/
src/analysisd/dodiff.c
@@
-1,4
+1,5
@@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/analysisd/dodiff.c, 2012/07/23 dcid Exp $
+ */
/* Copyright (C) 2010 Trend Micro Inc.
* All rights reserved.
/* 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 (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
*/
* 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)
{
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);
}
ARGV0, file);
return(0);
}
@@
-99,6
+100,7
@@
int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
currently_rule->last_events[0] = NULL;
currently_rule->last_events[0] = NULL;
+
if(lf->hostname[0] == '(')
{
htpt = strchr(lf->hostname, ')');
if(lf->hostname[0] == '(')
{
htpt = strchr(lf->hostname, ')');
@@
-106,8
+108,8
@@
int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
{
*htpt = '\0';
}
{
*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)
{
if(htpt)
{
@@
-117,7
+119,7
@@
int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
}
else
{
}
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);
}
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)
{
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);
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';
}
{
*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)
{
if(htpt)
{
@@
-192,7
+193,7
@@
int doDiff(RuleInfo *currently_rule, Eventinfo *lf)
}
else
{
}
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);
}
currently_rule->sigid, date_of_change);
}