From 90be4e60a80902906030acb1a8474412d7f11b88 Mon Sep 17 00:00:00 2001 From: jbcheng Date: Thu, 8 Nov 2012 17:44:40 -0800 Subject: [PATCH] [2.7-rc1-maild] add md5/sha1 checksum back to syscheck email alerts Change version to v2.7 --- src/LOCATION | 2 +- src/VERSION | 2 +- src/headers/defs.h | 2 +- src/init/ossec-client.sh | 2 +- src/init/ossec-local.sh | 2 +- src/init/ossec-server.sh | 2 +- src/os_maild/os_maild_client.c | 46 ++++++++++++++++++++++++++++++++++ src/win32/ossec-installer.nsi | 2 +- src/win32/ui.nsi | 2 +- 9 files changed, 54 insertions(+), 8 deletions(-) diff --git a/src/LOCATION b/src/LOCATION index aa3477ae0..8a53a0345 100755 --- a/src/LOCATION +++ b/src/LOCATION @@ -1,4 +1,4 @@ -DIR="/var/ossec27rc1f" +DIR="/var/ossec" CC=gcc GCC=gcc CLANG=clang diff --git a/src/VERSION b/src/VERSION index 90d743e23..6354a5050 100755 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -v2.7-rc1 +v2.7 diff --git a/src/headers/defs.h b/src/headers/defs.h index 1bbff584e..8fa06a692 100755 --- a/src/headers/defs.h +++ b/src/headers/defs.h @@ -52,7 +52,7 @@ /* Some Global names */ #define __name "OSSEC HIDS" -#define __version "v2.7-rc1" +#define __version "v2.7" #define __author "Trend Micro Inc." #define __contact "contact@ossec.net" #define __site "http://www.ossec.net" diff --git a/src/init/ossec-client.sh b/src/init/ossec-client.sh index c76e7ae71..3a27bab98 100755 --- a/src/init/ossec-client.sh +++ b/src/init/ossec-client.sh @@ -11,7 +11,7 @@ DIR=`dirname $PWD`; ### Do not modify bellow here ### NAME="OSSEC HIDS" -VERSION="v2.7-rc1" +VERSION="v2.7" AUTHOR="Trend Micro Inc." DAEMONS="ossec-logcollector ossec-syscheckd ossec-agentd ossec-execd" diff --git a/src/init/ossec-local.sh b/src/init/ossec-local.sh index ee8c26e13..1fd9cb0ac 100755 --- a/src/init/ossec-local.sh +++ b/src/init/ossec-local.sh @@ -22,7 +22,7 @@ fi NAME="OSSEC HIDS" -VERSION="v2.7-rc1" +VERSION="v2.7" AUTHOR="Trend Micro Inc." DAEMONS="ossec-monitord ossec-logcollector ossec-syscheckd ossec-analysisd ossec-maild ossec-execd ${DB_DAEMON} ${CSYSLOG_DAEMON} ${AGENTLESS_DAEMON}" diff --git a/src/init/ossec-server.sh b/src/init/ossec-server.sh index 231175688..d07993b3d 100755 --- a/src/init/ossec-server.sh +++ b/src/init/ossec-server.sh @@ -22,7 +22,7 @@ fi NAME="OSSEC HIDS" -VERSION="v2.7-rc1" +VERSION="v2.7" AUTHOR="Trend Micro Inc." DAEMONS="ossec-monitord ossec-logcollector ossec-remoted ossec-syscheckd ossec-analysisd ossec-maild ossec-execd ${DB_DAEMON} ${CSYSLOG_DAEMON} ${AGENTLESS_DAEMON}" diff --git a/src/os_maild/os_maild_client.c b/src/os_maild/os_maild_client.c index 31d1faac5..641b0cdda 100755 --- a/src/os_maild/os_maild_client.c +++ b/src/os_maild/os_maild_client.c @@ -73,6 +73,51 @@ MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, i++; } + if (al_data->old_md5) + { + log_size = strlen(al_data->old_md5) + 16 + 4; + if(body_size > log_size) + { + strncat(logs, "Old md5sum was: ", 16); + strncat(logs, al_data->old_md5, body_size); + strncat(logs, "\r\n", 4); + body_size -= log_size; + } + } + if (al_data->new_md5) + { + log_size = strlen(al_data->new_md5) + 16 + 4; + if(body_size > log_size) + { + strncat(logs, "New md5sum is : ", 16); + strncat(logs, al_data->new_md5, body_size); + strncat(logs, "\r\n", 4); + body_size -= log_size; + } + } + if (al_data->old_sha1) + { + log_size = strlen(al_data->old_sha1) + 17 + 4; + if(body_size > log_size) + { + strncat(logs, "Old sha1sum was: ", 17); + strncat(logs, al_data->old_sha1, body_size); + strncat(logs, "\r\n", 4); + body_size -= log_size; + } + } + if (al_data->new_sha1) + { + log_size = strlen(al_data->new_sha1) + 17 + 4; + if(body_size > log_size) + { + strncat(logs, "New sha1sum is : ", 17); + strncat(logs, al_data->new_sha1, body_size); + strncat(logs, "\r\n", 4); + body_size -= log_size; + } + } + /* Subject */ subject_host = strchr(al_data->location, '>'); @@ -152,6 +197,7 @@ MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, al_data->comment, logs); #endif + debug2("OS_RecvMailQ: mail->body[%s]", mail->body); /* Checking for granular email configs */ if(Mail->gran_to) diff --git a/src/win32/ossec-installer.nsi b/src/win32/ossec-installer.nsi index 72b88777f..97822003f 100755 --- a/src/win32/ossec-installer.nsi +++ b/src/win32/ossec-installer.nsi @@ -8,7 +8,7 @@ !define MUI_ICON favicon.ico !define MUI_UNICON ossec-uninstall.ico -!define VERSION "2.7-rc1" +!define VERSION "2.7" !define NAME "OSSEC HIDS" !define /date CDATE "%b %d %Y at %H:%M:%S" diff --git a/src/win32/ui.nsi b/src/win32/ui.nsi index 7070365ea..87e4c6d96 100644 --- a/src/win32/ui.nsi +++ b/src/win32/ui.nsi @@ -2,7 +2,7 @@ ; my template correctly. !include "MUI.nsh" -!define VERSION "2.7-rc1" +!define VERSION "2.7" !define NAME "OSSEC HIDS" !define /date CDATE "%b %d %Y at %H:%M:%S"