[Openvas-commits] r11589 - in trunk/openvas-manager: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 8 09:22:38 CEST 2011


Author: mattm
Date: 2011-09-08 09:22:37 +0200 (Thu, 08 Sep 2011)
New Revision: 11589

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/manage_sql.c
Log:
	* src/manage_sql.c (print_report_xml): Add detail for threat of highest
	CVSS.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2011-09-07 21:56:50 UTC (rev 11588)
+++ trunk/openvas-manager/ChangeLog	2011-09-08 07:22:37 UTC (rev 11589)
@@ -1,3 +1,8 @@
+2011-09-08  Matthew Mundell <matthew.mundell at greenbone.net>
+
+	* src/manage_sql.c (print_report_xml): Add detail for threat of highest
+	CVSS.
+
 2011-09-07  Matthew Mundell <matthew.mundell at greenbone.net>
 
 	* src/manage_sql.c (scap_loaded): New variable.

Modified: trunk/openvas-manager/src/manage_sql.c
===================================================================
--- trunk/openvas-manager/src/manage_sql.c	2011-09-07 21:56:50 UTC (rev 11588)
+++ trunk/openvas-manager/src/manage_sql.c	2011-09-08 07:22:37 UTC (rev 11589)
@@ -14987,6 +14987,7 @@
                    (&details, report_host);
                   while (next (&details))
                     {
+                      int highest_cvss;
                       const char *value;
                       value = report_host_details_iterator_value (&details);
 
@@ -15006,6 +15007,7 @@
                              report_host_details_iterator_source_name (&details),
                              report_host_details_iterator_source_desc (&details));
 
+                      highest_cvss = -1;
                       if (scap_loaded
                           && (strcmp (report_host_details_iterator_name
                                        (&details),
@@ -15025,6 +15027,8 @@
                                 {
                                   cvss = prognosis_iterator_cvss_int
                                           (&prognosis);
+                                  if (cvss > highest_cvss)
+                                    highest_cvss = cvss;
                                   first = 0;
                                 }
 
@@ -15053,6 +15057,13 @@
                                    cvss_threat (cvss));
                           cleanup_iterator (&prognosis);
                         }
+                      if (highest_cvss >= 0)
+                        PRINT (out,
+                               "<detail>"
+                               "<name>prognosis</name>"
+                               "<value>%s</value>"
+                               "</detail>",
+                               cvss_threat (highest_cvss));
                     }
 
                   cleanup_iterator (&details);



More information about the Openvas-commits mailing list