Author: mattm
Date: 2016-09-22 20:16:52 +0200 (Thu, 22 Sep 2016)
New Revision: 26265

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/manage_sql.c
Log:
        * src/manage_sql.c (escalate_1): Get the filter from setting Results
        Filter, if it is set.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog     2016-09-22 15:18:56 UTC (rev 26264)
+++ trunk/openvas-manager/ChangeLog     2016-09-22 18:16:52 UTC (rev 26265)
@@ -1,5 +1,10 @@
 2016-09-22  Matthew Mundell <matthew.mund...@greenbone.net>
 
+       * src/manage_sql.c (escalate_1): Get the filter from setting Results
+       Filter, if it is set.
+
+2016-09-22  Matthew Mundell <matthew.mund...@greenbone.net>
+
        * CMakeLists.txt: Allow OPENVAS_RUN_DIR to be passed in.
 
 2016-09-22  Michael Wiegand <michael.wieg...@greenbone.net>

Modified: trunk/openvas-manager/src/manage_sql.c
===================================================================
--- trunk/openvas-manager/src/manage_sql.c      2016-09-22 15:18:56 UTC (rev 
26264)
+++ trunk/openvas-manager/src/manage_sql.c      2016-09-22 18:16:52 UTC (rev 
26265)
@@ -11752,14 +11752,29 @@
 {
   int ret;
   get_data_t get;
+  char *results_filter;
+
   memset (&get, 0, sizeof (get_data_t));
   get.details = 1;
-  get.filter = g_strdup_printf ("notes=1 overrides=1 sort-reverse=severity"
-                                " rows=%d",
-                                method == ALERT_METHOD_EMAIL ? 1000 : -1);
 
+  results_filter = setting_filter ("Results");
+  if (results_filter && strlen (results_filter))
+    {
+      get.filt_id = results_filter;
+      get.filter = filter_term (results_filter);
+    }
+  else
+    {
+      get.filt_id = g_strdup ("0");
+      get.filter = g_strdup_printf ("notes=1 overrides=1 sort-reverse=severity"
+                                    " rows=%d",
+                                    method == ALERT_METHOD_EMAIL ? 1000 : -1);
+    }
+
   ret = escalate_2 (alert, task, report, event, event_data, method, condition,
                     &get, 1, 1);
+  free (results_filter);
+  g_free (get.filter);
   return ret;
 }
 

_______________________________________________
Openvas-commits mailing list
Openvas-commits@wald.intevation.org
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-commits

Reply via email to