[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ossec-cvs] ossec-hids: maild.c (HEAD) maild.h (HEAD) os_maild_client.c (HEAD) [dcid]



Module name:	ossec-hids
Changes by:	dcid	07/07/19 21:19:26

Modified files:
	maild.c maild.h os_maild_client.c

Log message:
Description: Adding better error messages, symantec ws rule, fixing a issue on the e-mail subjects (when do_not_group option is used) and changing parts of the code to gplv3 (more comming).
Reviewed by: dcid
Bug:

Index: maild.c
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/os_maild/maild.c,v
diff -u -r1.26 -r1.27
--- maild.c	13 Jun 2007 22:24:49 -0000	1.26
+++ maild.c	20 Jul 2007 00:19:26 -0000	1.27
@@ -1,12 +1,15 @@
 /* @(#) $Id$ */
 
-/* Copyright (C) 2004-2006 Daniel B. Cid <dcid@xxxxxxxxx>
+/* Copyright (C) 2003-2007 Daniel B. Cid <dcid@xxxxxxxxx>
  * All rights 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 2) as published by the FSF - Free Software
- * Foundation
+ * License (version 3) as published by the FSF - Free Software
+ * Foundation.
+ *
+ * License details at the LICENSE file included with OSSEC or 
+ * online at: http://www.ossec.net/en/licensing.html
  */
 
 
@@ -384,7 +387,7 @@
             /* Change timeout to see if any new message is coming shortly */
             if(mail->groupping)
             {
-                /* If priority is setm send email now */
+                /* If priority is set, send email now */
                 if(mail->priority)
                 {
                     mail_timeout = DEFAULT_TIMEOUT;

Index: maild.h
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/os_maild/maild.h,v
diff -u -r1.19 -r1.20
--- maild.h	7 Jul 2007 03:11:48 -0000	1.19
+++ maild.h	20 Jul 2007 00:19:26 -0000	1.20
@@ -1,12 +1,15 @@
 /* @(#) $Id$ */
 
-/* Copyright (C) 2004-2006 Daniel B. Cid <dcid@xxxxxxxxx>
+/* Copyright (C) 2003-2007 Daniel B. Cid <dcid@xxxxxxxxx>
  * All rights 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 2) as published by the FSF - Free Software
- * Foundation
+ * License (version 3) as published by the FSF - Free Software
+ * Foundation.
+ *
+ * License details at the LICENSE file included with OSSEC or 
+ * online at: http://www.ossec.net/en/licensing.html
  */
 
 

Index: os_maild_client.c
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/os_maild/os_maild_client.c,v
diff -u -r1.18 -r1.19
--- os_maild_client.c	7 Jul 2007 03:11:48 -0000	1.18
+++ os_maild_client.c	20 Jul 2007 00:19:26 -0000	1.19
@@ -22,7 +22,7 @@
 MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, 
                       MailConfig *Mail, MailMsg **msg_sms)
 {
-    int i = 0, body_size = OS_MAXSTR -3, log_size, sms_set = 0;
+    int i = 0, body_size = OS_MAXSTR -3, log_size, sms_set = 0,donotgroup = 0;
     char logs[OS_MAXSTR + 1];
     char *subject_host;
     
@@ -97,23 +97,6 @@
     }
 
     
-    /* Getting highest level for alert */
-    if(_g_subject)
-    {
-        if(_g_subject_level < al_data->level)
-        {
-            strncpy(_g_subject, mail->subject, SUBJECT_SIZE);
-            _g_subject_level = al_data->level;
-        }
-    }
-    else
-    {
-        strncpy(_g_subject, mail->subject, SUBJECT_SIZE);
-        _g_subject_level = al_data->level;
-    }
-
-
-
     /* fixing subject back */
     if(subject_host)
     {
@@ -237,6 +220,7 @@
                     {
                         Mail->priority = DONOTGROUP;
                         Mail->gran_set[i] = DONOTGROUP;
+                        donotgroup = 1;
                     }
                     else
                     {
@@ -245,6 +229,26 @@
                 }
             }
             i++;
+        }
+    }
+
+
+    /* If DONOTGROUP is set, we can't assign the new subject */
+    if(!donotgroup)
+    {
+        /* Getting highest level for alert */
+        if(_g_subject[0] != '\0')
+        {
+            if(_g_subject_level < al_data->level)
+            {
+                strncpy(_g_subject, mail->subject, SUBJECT_SIZE);
+                _g_subject_level = al_data->level;
+            }
+        }
+        else
+        {
+            strncpy(_g_subject, mail->subject, SUBJECT_SIZE);
+            _g_subject_level = al_data->level;
         }
     }
     


OSSEC home | Main Index | Thread Index


OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.