[Openvas-commits] r6021 - in trunk/openvas-administrator: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 1 08:21:34 CET 2009


Author: mwiegand
Date: 2009-12-01 08:21:32 +0100 (Tue, 01 Dec 2009)
New Revision: 6021

Modified:
   trunk/openvas-administrator/CMakeLists.txt
   trunk/openvas-administrator/ChangeLog
   trunk/openvas-administrator/src/CMakeLists.txt
   trunk/openvas-administrator/src/admin.c
   trunk/openvas-administrator/src/oap.c
   trunk/openvas-administrator/src/openvasad.c
Log:
Improving feed synchronization support.

* CMakeLists.txt: Set OPENVAS_SYNC_SCRIPT_DIR.

* src/CMakeLists.txt: Expose OPENVAS_SYNC_SCRIPT_DIR.

* src/openvasad.c (main): Use openvas-nvt-sync as default
synchronization script if no script is specified on the command line.

* src/oap.c (oap_xml_handle_end_element): Reworked describe_feed
response, now includes the feed name.

* src/admin.c: Removed superfluous newlines.


Modified: trunk/openvas-administrator/CMakeLists.txt
===================================================================
--- trunk/openvas-administrator/CMakeLists.txt	2009-11-30 15:34:08 UTC (rev 6020)
+++ trunk/openvas-administrator/CMakeLists.txt	2009-12-01 07:21:32 UTC (rev 6021)
@@ -136,6 +136,7 @@
 
 set (OPENVAS_LIB_INSTALL_DIR    "${LIBDIR}")
 set (OPENVAS_HEADER_INSTALL_DIR "${INCLUDEDIR}")
+set (OPENVAS_SYNC_SCRIPT_DIR    "${SBINDIR}")
 set (OPENVAS_SERVER_CERTIFICATE "${OPENVAS_STATE_DIR}/CA/servercert.pem")
 set (OPENVAS_SERVER_KEY         "${OPENVAS_STATE_DIR}/private/CA/serverkey.pem")
 set (OPENVAS_CA_CERTIFICATE     "${OPENVAS_STATE_DIR}/CA/cacert.pem")

Modified: trunk/openvas-administrator/ChangeLog
===================================================================
--- trunk/openvas-administrator/ChangeLog	2009-11-30 15:34:08 UTC (rev 6020)
+++ trunk/openvas-administrator/ChangeLog	2009-12-01 07:21:32 UTC (rev 6021)
@@ -1,3 +1,19 @@
+2009-12-01  Michael Wiegand <michael.wiegand at intevation.de>
+
+	Improving feed synchronization support.
+
+	* CMakeLists.txt: Set OPENVAS_SYNC_SCRIPT_DIR.
+
+	* src/CMakeLists.txt: Expose OPENVAS_SYNC_SCRIPT_DIR.
+
+	* src/openvasad.c (main): Use openvas-nvt-sync as default
+	synchronization script if no script is specified on the command line.
+
+	* src/oap.c (oap_xml_handle_end_element): Reworked describe_feed
+	response, now includes the feed name.
+
+	* src/admin.c: Removed superfluous newlines.
+
 2009-11-30  Michael Wiegand <michael.wiegand at intevation.de>
 
 	Adding initial support for synchronization with an NVT feed.

Modified: trunk/openvas-administrator/src/CMakeLists.txt
===================================================================
--- trunk/openvas-administrator/src/CMakeLists.txt	2009-11-30 15:34:08 UTC (rev 6020)
+++ trunk/openvas-administrator/src/CMakeLists.txt	2009-12-01 07:21:32 UTC (rev 6021)
@@ -94,6 +94,10 @@
   add_definitions (-DOPENVAS_SYSCONF_DIR=\\\"${OPENVAS_SYSCONF_DIR}\\\")
 endif (OPENVAS_SYSCONF_DIR)
 
+if (OPENVAS_SYNC_SCRIPT_DIR)
+  add_definitions (-DOPENVAS_SYNC_SCRIPT_DIR=\\\"${OPENVAS_SYNC_SCRIPT_DIR}\\\")
+endif (OPENVAS_SYNC_SCRIPT_DIR)
+
 add_definitions (-DOPENVAS_OS_NAME=\\\"${CMAKE_SYSTEM}\\\")
 add_definitions (-DPREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\")
 

Modified: trunk/openvas-administrator/src/admin.c
===================================================================
--- trunk/openvas-administrator/src/admin.c	2009-11-30 15:34:08 UTC (rev 6020)
+++ trunk/openvas-administrator/src/admin.c	2009-12-01 07:21:32 UTC (rev 6021)
@@ -735,7 +735,6 @@
   return TRUE;
 }
 
-
 /**
  * @brief Retrieves the identification string of an NVT synchronization
  * script, with basic validation.
@@ -825,7 +824,6 @@
   return TRUE;
 }
 
-
 /**
  * @brief Retrieves the description of an NVT synchronization
  * script, with basic validation.
@@ -893,7 +891,6 @@
   return TRUE;
 }
 
-
 /**
  * @brief Calls a NVT synchronization script to synchronize the local NVT
  * collection.

Modified: trunk/openvas-administrator/src/oap.c
===================================================================
--- trunk/openvas-administrator/src/oap.c	2009-11-30 15:34:08 UTC (rev 6020)
+++ trunk/openvas-administrator/src/oap.c	2009-12-01 07:21:32 UTC (rev 6021)
@@ -1004,16 +1004,24 @@
       case CLIENT_DESCRIBE_FEED:
           {
             gchar *feed_description = NULL;
+            gchar *feed_identification = NULL;
             if (openvas_get_sync_script_description (sync_script,
-                                                     &feed_description))
+                                                     &feed_description) &&
+                openvas_get_sync_script_identification (sync_script,
+                                                        &feed_identification))
               {
+                gchar **ident = g_strsplit (feed_identification, "|", 6);
                 SEND_TO_CLIENT_OR_FAIL ("<describe_feed_response"
                                         " status=\"" STATUS_OK "\""
                                         " status_text=\"" STATUS_OK_TEXT "\">");
-                SEND_TO_CLIENT_OR_FAIL (feed_description);
+                SEND_TO_CLIENT_OR_FAIL ("<feed>");
+                SENDF_TO_CLIENT_OR_FAIL ("<name>%s</name>", ident[3]);
+                SENDF_TO_CLIENT_OR_FAIL ("<description>%s</description>", feed_description);
+                SEND_TO_CLIENT_OR_FAIL ("</feed>");
                 SEND_TO_CLIENT_OR_FAIL ("</describe_feed_response>");
-                set_client_state (CLIENT_AUTHENTIC);
+                g_strfreev (ident);
                 g_free (feed_description);
+                g_free (feed_identification);
               }
             else
               {

Modified: trunk/openvas-administrator/src/openvasad.c
===================================================================
--- trunk/openvas-administrator/src/openvasad.c	2009-11-30 15:34:08 UTC (rev 6020)
+++ trunk/openvas-administrator/src/openvasad.c	2009-12-01 07:21:32 UTC (rev 6021)
@@ -785,10 +785,8 @@
 
   if (sync_script == NULL)
     {
-      g_critical ("%s: no synchronization script supplied!\n",
-                  __FUNCTION__);
-      free_log_configuration (log_config);
-      exit (EXIT_FAILURE);
+      tracef ("   sync_script not set, setting to default\n");
+      sync_script = OPENVAS_SYNC_SCRIPT_DIR "/openvas-nvt-sync";
     }
 
   tracef ("   Using %s as the synchronization script\n", sync_script);



More information about the Openvas-commits mailing list