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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 17 20:26:43 CET 2010


Author: mattm
Date: 2010-02-17 20:26:30 +0100 (Wed, 17 Feb 2010)
New Revision: 6762

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/omp.c
Log:
	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NOTES also send
	the note text.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2010-02-17 15:42:45 UTC (rev 6761)
+++ trunk/openvas-manager/ChangeLog	2010-02-17 19:26:30 UTC (rev 6762)
@@ -1,5 +1,10 @@
 2010-02-17  Matthew Mundell <matthew.mundell at intevation.de>
 
+	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_NOTES also send
+	the note text.
+
+2010-02-17  Matthew Mundell <matthew.mundell at intevation.de>
+
 	* src/omp.c (omp_xml_handle_end_element): In CLIENT_GET_REPORT in the XML
 	case include notes in filter details.
 

Modified: trunk/openvas-manager/src/omp.c
===================================================================
--- trunk/openvas-manager/src/omp.c	2010-02-17 15:42:45 UTC (rev 6761)
+++ trunk/openvas-manager/src/omp.c	2010-02-17 19:26:30 UTC (rev 6762)
@@ -4804,12 +4804,22 @@
                                   get_notes_data->sort_order,
                                   get_notes_data->sort_field);
               while (next (&notes))
-                SENDF_TO_CLIENT_OR_FAIL ("<note id=\"%s\">"
-                                         "<nvt oid=\"%s\"><name>%s</name></nvt>"
-                                         "</note>",
-                                         note_iterator_uuid (&notes),
-                                         note_iterator_nvt_oid (&notes),
-                                         note_iterator_nvt_name (&notes));
+                {
+                  const char *text = note_iterator_text (&notes);
+                  gchar *excerpt = g_strndup (text, 40);
+                  SENDF_TO_CLIENT_OR_FAIL ("<note id=\"%s\">"
+                                           "<nvt oid=\"%s\">"
+                                           "<name>%s</name>"
+                                           "</nvt>"
+                                           "<text excerpt=\"%i\">%s</text>"
+                                           "</note>",
+                                           note_iterator_uuid (&notes),
+                                           note_iterator_nvt_oid (&notes),
+                                           note_iterator_nvt_name (&notes),
+                                           strlen (excerpt) < strlen (text),
+                                           excerpt);
+                  g_free (excerpt);
+                }
               cleanup_iterator (&notes);
 
               SEND_TO_CLIENT_OR_FAIL ("</get_notes_response>");



More information about the Openvas-commits mailing list