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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jun 9 12:45:23 CEST 2010


Author: mattm
Date: 2010-06-09 12:45:21 +0200 (Wed, 09 Jun 2010)
New Revision: 7977

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/omp.c
Log:
	* src/omp.c (create_task_data_t, create_task_data_reset): Replace schedule
	with schedule_id.
	(omp_xml_handle_start_element, omp_xml_handle_end_element)
	(omp_xml_handle_text): Get schedule ID from attribute instead of text, as
	in other elements.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2010-06-09 10:31:32 UTC (rev 7976)
+++ trunk/openvas-manager/ChangeLog	2010-06-09 10:45:21 UTC (rev 7977)
@@ -1,5 +1,13 @@
 2010-06-09  Matthew Mundell <matthew.mundell at greenbone.net>
 
+	* src/omp.c (create_task_data_t, create_task_data_reset): Replace schedule
+	with schedule_id.
+	(omp_xml_handle_start_element, omp_xml_handle_end_element)
+	(omp_xml_handle_text): Get schedule ID from attribute instead of text, as
+	in other elements.
+
+2010-06-09  Matthew Mundell <matthew.mundell at greenbone.net>
+
 	* src/manage_sql.c (init_result_iterator): Collate hosts with collate_ip.
 
 2010-06-08  Matthew Mundell <matthew.mundell at greenbone.net>

Modified: trunk/openvas-manager/src/omp.c
===================================================================
--- trunk/openvas-manager/src/omp.c	2010-06-09 10:31:32 UTC (rev 7976)
+++ trunk/openvas-manager/src/omp.c	2010-06-09 10:45:21 UTC (rev 7977)
@@ -840,7 +840,7 @@
 {
   char *config;
   char *escalator_id;
-  char *schedule;
+  char *schedule_id;
   char *target_id;
   task_t task;
 } create_task_data_t;
@@ -850,7 +850,7 @@
 {
   free (data->config);
   free (data->escalator_id);
-  free (data->schedule);
+  free (data->schedule_id);
   free (data->target_id);
 
   memset (data, 0, sizeof (create_task_data_t));
@@ -2440,7 +2440,6 @@
           {
             create_task_data->task = make_task (NULL, 0, NULL);
             if (create_task_data->task == (task_t) 0) abort (); // FIX
-            openvas_append_string (&create_task_data->schedule, "");
             set_client_state (CLIENT_CREATE_TASK);
           }
         else if (strcasecmp ("DELETE_AGENT", element_name) == 0)
@@ -4363,7 +4362,14 @@
             set_client_state (CLIENT_CREATE_TASK_ESCALATOR);
           }
         else if (strcasecmp ("SCHEDULE", element_name) == 0)
-          set_client_state (CLIENT_CREATE_TASK_SCHEDULE);
+          {
+            const gchar* attribute;
+            if (find_attribute (attribute_names, attribute_values,
+                                "id", &attribute))
+              openvas_append_string (&create_task_data->schedule_id,
+                                     attribute);
+            set_client_state (CLIENT_CREATE_TASK_SCHEDULE);
+          }
         else if (strcasecmp ("TARGET", element_name) == 0)
           {
             const gchar* attribute;
@@ -10106,10 +10112,10 @@
 
           /* Set any schedule. */
 
-          if (strlen (create_task_data->schedule))
+          if (create_task_data->schedule_id)
             {
               schedule_t schedule;
-              if (find_schedule (create_task_data->schedule, &schedule))
+              if (find_schedule (create_task_data->schedule_id, &schedule))
                 {
                   SEND_TO_CLIENT_OR_FAIL (XML_INTERNAL_ERROR ("create_task"));
                   create_task_data_reset (create_task_data);
@@ -12819,9 +12825,6 @@
                                        text_len))
           abort (); // FIX out of mem
         break;
-      case CLIENT_CREATE_TASK_SCHEDULE:
-        openvas_append_text (&create_task_data->schedule, text, text_len);
-        break;
 
       case CLIENT_DELETE_CONFIG_NAME:
         openvas_append_text (&delete_config_data->name, text, text_len);



More information about the Openvas-commits mailing list