[Openvas-commits] r5504 - in trunk/openvas-client: . openvas openvas/prefs_dialog

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 13 00:33:41 CEST 2009


Author: jan
Date: 2009-10-13 00:33:38 +0200 (Tue, 13 Oct 2009)
New Revision: 5504

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/openvas/cli.c
   trunk/openvas-client/openvas/comm.c
   trunk/openvas-client/openvas/filter.c
   trunk/openvas-client/openvas/latex_output.c
   trunk/openvas-client/openvas/openvas_plugin.c
   trunk/openvas-client/openvas/openvas_plugin.h
   trunk/openvas-client/openvas/pdf_output.c
   trunk/openvas-client/openvas/plugin_cache.c
   trunk/openvas-client/openvas/plugin_infos.c
   trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_plugins_prefs.c
   trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_scan_opt.c
   trunk/openvas-client/openvas/prefs_dialog/prefs_plugins_tree.c
   trunk/openvas-client/openvas/prefs_dialog/prefs_report.c
   trunk/openvas-client/openvas/xml_output_ng.c
Log:
Continued to replace struct openvas_plugin by nvti.

* openvas/openvas_plugin.c (openvas_plugin_new):
Now handle name, copyright, cve, bid, xres, scripts_tags,
sign_key_ids, family and version via nvti.
(openvas_plugin_get_by_name): Use new method to access name.
(openvas_plugin_duplicate): Use new methods to access elements.

* openvas/openvas_plugin.h (struct openvas_plugin): Removed
elements name, copyright, cve, bid, xrefs, scripts_tags,
sign_key_ids, family and version.

* openvas/pdf_output.c, openvas/plugin_infos.c,
openvas/prefs_dialog/prefs_dialog_plugins_prefs.c,
openvas/prefs_dialog/prefs_plugins_tree.c,
openvas/prefs_dialog/prefs_report.c,
openvas/prefs_dialog/prefs_dialog_scan_opt.c,
openvas/plugin_cache.c, openvas/filter.c,
openvas/xml_output_ng.c, openvas/cli.c, openvas/comm.c,
openvas/latex_output.c: Apply new method to access elements.



Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/ChangeLog	2009-10-12 22:33:38 UTC (rev 5504)
@@ -1,3 +1,26 @@
+2009-10-13  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+
+	Continued to replace struct openvas_plugin by nvti.
+
+	* openvas/openvas_plugin.c (openvas_plugin_new):
+	Now handle name, copyright, cve, bid, xres, scripts_tags,
+	sign_key_ids, family and version via nvti.
+	(openvas_plugin_get_by_name): Use new method to access name.
+	(openvas_plugin_duplicate): Use new methods to access elements.
+
+	* openvas/openvas_plugin.h (struct openvas_plugin): Removed
+	elements name, copyright, cve, bid, xrefs, scripts_tags,
+	sign_key_ids, family and version.
+
+	* openvas/pdf_output.c, openvas/plugin_infos.c,
+	openvas/prefs_dialog/prefs_dialog_plugins_prefs.c,
+	openvas/prefs_dialog/prefs_plugins_tree.c,
+	openvas/prefs_dialog/prefs_report.c,
+	openvas/prefs_dialog/prefs_dialog_scan_opt.c,
+	openvas/plugin_cache.c, openvas/filter.c,
+	openvas/xml_output_ng.c, openvas/cli.c, openvas/comm.c,
+	openvas/latex_output.c: Apply new method to access elements.
+
 2009-10-12  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
 	* openvas/prefs_dialog/prefs_report.c (fill_tree_model): Put a string

Modified: trunk/openvas-client/openvas/cli.c
===================================================================
--- trunk/openvas-client/openvas/cli.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/cli.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -425,11 +425,11 @@
 
  printf("INSERT INTO plugins VALUES ('%s', ", p->oid);
 
- m = sql_addslashes(p->name);
+ m = sql_addslashes(nvti_name(p->ni));
  printf("'%s', ", m);
  efree(&m);
 
- m = sql_addslashes(p->family);
+ m = sql_addslashes(nvti_family(p->ni));
  printf("'%s', ", m);
  efree(&m);
 
@@ -437,7 +437,7 @@
  printf("'%s', ", m);
  efree(&m);
 
- m = sql_addslashes(p->copyright);
+ m = sql_addslashes(nvti_copyright(p->ni));
  printf("'%s', ", m);
  efree(&m);
 
@@ -450,29 +450,29 @@
  printf("'%s',", m);
  efree(&m);
 
- m = sql_addslashes(p->version);
+ m = sql_addslashes(nvti_version(p->ni));
  printf("'%s',", m);
  efree(&m);
 
- if( p->cve != NULL )
+ if( nvti_cve(p->ni) != NULL )
  {
-  m = sql_addslashes(p->cve );
+  m = sql_addslashes(nvti_cve(p->ni));
   printf("'%s',", m);
   efree(&m);
  }
  else printf("'',");
 
- if(p->bid != NULL)
+ if(nvti_bid(p->ni) != NULL)
   {
-  m = sql_addslashes(p->bid );
+  m = sql_addslashes(nvti_bid(p->ni));
   printf("'%s',", m);
   efree(&m);
   }
  else printf("'',");
 
- if(p->xrefs != NULL)
+ if(nvti_xref(p->ni) != NULL)
   {
-  m = sql_addslashes(p->xrefs);
+  m = sql_addslashes(nvti_xref(p->ni));
   printf("'%s');\n", m);
   efree(&m);
   }
@@ -490,16 +490,16 @@
   char * n;
 
   printf("%s|", var);
-  var = addslashes(p->family);
+  var = addslashes(nvti_family(p->ni));
   printf("%s|", var);
   efree(&var);
-  var = addslashes(p->name);
+  var = addslashes(nvti_name(p->ni));
   printf("%s|", var);
   efree(&var);
   var = addslashes(p->category);
   printf("%s|", var);
   efree(&var);
-  var = addslashes(p->copyright);
+  var = addslashes(nvti_copyright(p->ni));
   printf("%s|", var);
   efree(&var);
 
@@ -507,19 +507,19 @@
   printf("%s|", var);
   efree(&var);
 
-  var = addslashes(p->version);
+  var = addslashes(nvti_version(p->ni));
   printf("%s|", var);
   efree(&var);
 
-  var = addslashes(p->cve);
+  var = addslashes(nvti_cve(p->ni));
   printf("%s|", var);
   efree(&var);
 
-  var = addslashes(p->bid);
+  var = addslashes(nvti_bid(p->ni));
   printf("%s|", var);
   efree(&var);
 
-  var = addslashes(p->xrefs);
+  var = addslashes(nvti_xref(p->ni));
   printf("%s|", var);
   efree(&var);
 

Modified: trunk/openvas-client/openvas/comm.c
===================================================================
--- trunk/openvas-client/openvas/comm.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/comm.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -1210,12 +1210,12 @@
           v = strdup(value);
           if (v && (t = strchr(v, ';')))
             t[0] = 0;
-          network_printf(context->socket, "%s[%s]:%s <|> %s\n", plugs->name, type, name, v);
+          network_printf(context->socket, "%s[%s]:%s <|> %s\n", nvti_name(plugs->ni), type, name, v);
           free(v);
         }
         else
         {
-          network_printf(context->socket, "%s[%s]:%s <|> %s\n", plugs->name, type, name, value);
+          network_printf(context->socket, "%s[%s]:%s <|> %s\n", nvti_name(plugs->ni), type, name, value);
         }
 
 	if(!strcmp(type, PREF_FILE))

Modified: trunk/openvas-client/openvas/filter.c
===================================================================
--- trunk/openvas-client/openvas/filter.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/filter.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -259,15 +259,15 @@
   int retval = 0;
 
 #ifdef USE_GTK
-  char * name        = plugin->name;
+  char * name        = nvti_name(plugin->ni);
   char * description = nvti_description(plugin->ni);
   char * summary     = nvti_summary(plugin->ni);
-  char * author      = plugin->copyright;
+  char * author      = nvti_copyright(plugin->ni);
   char * oid         = plugin->oid;
   char * category    = plugin->category;
-  char * cve         = plugin->cve;
-  char * bid         = plugin->bid;
-  char * xref        = plugin->xrefs;
+  char * cve         = nvti_cve(plugin->ni);
+  char * bid         = nvti_bid(plugin->ni);
+  char * xref        = nvti_xref(plugin->ni);
 
   if (!filter->pattern || !strlen(filter->pattern))
     goto ret;

Modified: trunk/openvas-client/openvas/latex_output.c
===================================================================
--- trunk/openvas-client/openvas/latex_output.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/latex_output.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -494,7 +494,7 @@
    if( plugins->enabled != 0 )
    {
     fprintf(f, "\\item \\verb+%s+\n", 
-    			plugins->name);
+    			nvti_name(plugins->ni));
    }
    plugins = plugins->next; 
  }

Modified: trunk/openvas-client/openvas/openvas_plugin.c
===================================================================
--- trunk/openvas-client/openvas/openvas_plugin.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/openvas_plugin.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -69,24 +69,24 @@
       np->ni = nvti_new();
 
       nvti_set_oid(np->ni, oid);
+      nvti_set_version(np->ni, version);
+      nvti_set_name(np->ni, name);
+      nvti_set_summary(np->ni, summary);
       nvti_set_description(np->ni, description);
-      nvti_set_summary(np->ni, summary);
+      nvti_set_copyright(np->ni, copyright);
+      nvti_set_cve(np->ni, cve);
+      nvti_set_bid(np->ni, bid);
+      nvti_set_xref(np->ni, xrefs);
+      nvti_set_tag(np->ni, script_tags);
+      nvti_set_sign_key_ids(np->ni, sign_key_ids);
+      nvti_set_family(np->ni, family);
 
       nvtis_add(ni_store, np->ni);
     }
 
  np->oid          = cache_inc (oid);
  np->md5sum       = NULL;
- np->name         = cache_inc (name); 
  np->category     = cache_inc (category);
- np->copyright    = cache_inc (copyright);
- np->family       = cache_inc (family);
- np->version      = cache_inc (version);
- np->cve          = cache_inc (cve);
- np->bid          = cache_inc (bid);
- np->xrefs        = cache_inc (xrefs);
- np->script_tags  = cache_inc (script_tags);
- np->sign_key_ids = cache_inc (sign_key_ids);
  np->next    = NULL;
 
  return np;
@@ -125,7 +125,7 @@
 
   while (plugins != NULL)
     {
-      if (plugins->name && strcmp (plugins->name, name) == 0)
+      if (nvti_name(plugins->ni) && strcmp (nvti_name(plugins->ni), name) == 0)
         return plugins;
       plugins = plugins->next;
     }
@@ -167,10 +167,10 @@
 openvas_plugin_duplicate (struct openvas_plugin *plugin)
 {
   struct openvas_plugin * copy = openvas_plugin_new(plugin->oid,
-      plugin->name, plugin->category, plugin->copyright,
-      nvti_description(plugin->ni), nvti_summary(plugin->ni), plugin->family,
-      plugin->version, plugin->cve, plugin->bid, plugin->xrefs, 
-      plugin->sign_key_ids, plugin->script_tags);
+      nvti_name(plugin->ni), plugin->category, nvti_copyright(plugin->ni),
+      nvti_description(plugin->ni), nvti_summary(plugin->ni), nvti_family(plugin->ni),
+      nvti_version(plugin->ni), nvti_cve(plugin->ni), nvti_bid(plugin->ni), nvti_xref(plugin->ni), 
+      nvti_sign_key_ids(plugin->ni), nvti_tag(plugin->ni));
   copy->enabled = plugin->enabled;
   openvas_plugin_set_md5sum(copy, plugin->md5sum);
   if (plugin->plugin_prefs != NULL)

Modified: trunk/openvas-client/openvas/openvas_plugin.h
===================================================================
--- trunk/openvas-client/openvas/openvas_plugin.h	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/openvas_plugin.h	2009-10-12 22:33:38 UTC (rev 5504)
@@ -29,21 +29,10 @@
 struct openvas_plugin {
   nvti_t * ni;
 	char * oid;
-	char * name;
 	char * md5sum;
 	
 	char * category;
-	char * copyright;
 
-	char * family;
-	char * version;
-
-	char * cve;
-	char * bid;
-	char * xrefs;
-        char * script_tags;
-        char * sign_key_ids;
-
 	struct arglist * plugin_prefs;
 
 	struct openvas_plugin * next;

Modified: trunk/openvas-client/openvas/pdf_output.c
===================================================================
--- trunk/openvas-client/openvas/pdf_output.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/pdf_output.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -762,9 +762,9 @@
   int idx = 0;
   gchar** fprs;
 
-  if( nvt->sign_key_ids == NULL
-      || strcmp(nvt->sign_key_ids, "") == 0
-      || strcmp(nvt->sign_key_ids, "NOSIGNKEYS") == 0)
+  if( nvti_sign_key_ids(nvt->ni) == NULL
+      || strcmp(nvti_sign_key_ids(nvt->ni), "") == 0
+      || strcmp(nvti_sign_key_ids(nvt->ni), "NOSIGNKEYS") == 0)
     {
     print_plugin_table_row(file, _("Signed by"), _("not signed"));
     }
@@ -777,7 +777,7 @@
     {
     /* fprs contains (comma separated) fingerprint(s) that are keys in 
        the contexts hashtable. extract and look up */
-    fprs = g_strsplit_set(nvt->sign_key_ids, ",", -1);
+    fprs = g_strsplit_set(nvti_sign_key_ids(nvt->ni), ",", -1);
     // Start table row
     fprintf(file, "\t<tr><td align=\"right\" valign=\"top\"><b>%s</b></td>"
                   "<td align=\"left\">", _("Signed by"));
@@ -832,19 +832,19 @@
   }
 
   fprintf(file, "<H3><a name=\"nvt%s\">NVT %s: %s</a></H3>\n\n",
-      plugin_oid, plugin_oid, plugin->name);
+      plugin_oid, plugin_oid, nvti_name(plugin->ni));
 
   fprintf(file, "<table>\n");
   print_plugin_table_row(file, _("Summary"), nvti_summary(plugin->ni));
   print_plugin_table_row(file, _("Category"), plugin->category);
-  print_plugin_table_row(file, _("Family"), plugin->family);
-  print_plugin_table_row(file, _("Version"), plugin->version);
-  if(plugin->cve != NULL && strcmp(plugin->cve, "NOCVE") != 0)
-    print_plugin_table_row(file, _("CVE"), plugin->cve);
-  if(plugin->bid != NULL &&  strcmp(plugin->bid, "NOBID") != 0)
-    print_plugin_table_row(file, _("BID"), plugin->bid);
-  if(plugin->xrefs != NULL &&  strcmp(plugin->xrefs, "NOXREF") != 0)
-    print_plugin_table_row(file, _("XRefs"), plugin->xrefs);
+  print_plugin_table_row(file, _("Family"), nvti_family(plugin->ni));
+  print_plugin_table_row(file, _("Version"), nvti_version(plugin->ni));
+  if(nvti_cve(plugin->ni) != NULL && strcmp(nvti_cve(plugin->ni), "NOCVE") != 0)
+    print_plugin_table_row(file, _("CVE"), nvti_cve(plugin->ni));
+  if(nvti_bid(plugin->ni) != NULL &&  strcmp(nvti_bid(plugin->ni), "NOBID") != 0)
+    print_plugin_table_row(file, _("BID"), nvti_bid(plugin->ni));
+  if(nvti_xref(plugin->ni) != NULL &&  strcmp(nvti_xref(plugin->ni), "NOXREF") != 0)
+    print_plugin_table_row(file, _("XRefs"), nvti_xref(plugin->ni));
   print_plugin_information_signatures(file, plugin, context);
   fprintf(file, "</table>");
 

Modified: trunk/openvas-client/openvas/plugin_cache.c
===================================================================
--- trunk/openvas-client/openvas/plugin_cache.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/plugin_cache.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -237,10 +237,10 @@
   if (md5sum == NULL)
     md5sum = "";
   return write_record(file, "kssssssssssssss", NVT_KEYWORD,
-      plugin->oid, md5sum, plugin->name, plugin->category, plugin->copyright,
-      nvti_description(plugin->ni), nvti_summary(plugin->ni), plugin->family,
-      plugin->version, plugin->cve, plugin->bid, plugin->xrefs, 
-      plugin->sign_key_ids, plugin->script_tags);
+      plugin->oid, md5sum, nvti_name(plugin->ni), plugin->category, nvti_copyright(plugin->ni),
+      nvti_description(plugin->ni), nvti_summary(plugin->ni), nvti_family(plugin->ni),
+      nvti_version(plugin->ni), nvti_cve(plugin->ni), nvti_bid(plugin->ni), nvti_xref(plugin->ni), 
+      nvti_sign_key_ids(plugin->ni), nvti_tag(plugin->ni));
 }
 
 

Modified: trunk/openvas-client/openvas/plugin_infos.c
===================================================================
--- trunk/openvas-client/openvas/plugin_infos.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/plugin_infos.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -100,7 +100,7 @@
       {
         // Like: "Identify unknown Services (Sevice Detection), currently disabled."
         label = g_strdup_printf ("%s (%s), %s %s.", deps->name,
-                                                    p->family,
+                                                    nvti_family(p->ni),
                                                     _("currently"),
                                                     (p->enabled != 0) ? _("enabled") : _("disabled"));
         w = gtk_label_new (label);
@@ -362,7 +362,7 @@
   gtk_widget_show(label);
 
   /* The copyright notice */
-  label = gtk_label_new(plugin->copyright);
+  label = gtk_label_new(nvti_copyright(plugin->ni));
   gtk_box_pack_start(GTK_BOX(vbox), label, FALSE,FALSE,0);
   gtk_misc_set_alignment((GtkMisc *)label, 0, 1);
   gtk_label_set_selectable (GTK_LABEL(label), TRUE);
@@ -374,7 +374,7 @@
   gtk_widget_show(separator);
 
   /* The Family */
-  snprintf(buf, sizeof(buf), _("Family: %s"), plugin->family);
+  snprintf(buf, sizeof(buf), _("Family: %s"), nvti_family(plugin->ni));
   label = gtk_label_new(buf);
   gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE,0);
   gtk_misc_set_alignment((GtkMisc *)label, 0, 1);
@@ -398,7 +398,7 @@
   gtk_widget_show(label);
 
   /* The CVE ID (in case the plugin provides one) */
-  txt = plugin->cve;
+  txt = nvti_cve(plugin->ni);
   if( txt != NULL && txt[0] != '\0' && strcmp(txt, "NOCVE") != 0 )
   {
     snprintf(buf, sizeof(buf), _("CVE: %s"), txt);
@@ -410,7 +410,7 @@
   }
 
   /* The Bugtraq ID (in case the plugin provides one) */
-  txt = plugin->bid;
+  txt = nvti_bid(plugin->ni);
   if( txt != NULL  && txt[0] != '\0' && strcmp(txt, "NOBID") != 0 )
   {
     snprintf(buf, sizeof(buf), _("Bugtraq ID: %s"), txt);
@@ -422,7 +422,7 @@
   }
 
   /* The other cross references (in case the plugin provides one) */
-  txt = plugin->xrefs;
+  txt = nvti_xref(plugin->ni);
   if( txt != NULL && txt[0] != '\0' && strcmp(txt, "NOXREF") != 0 )
   {
     snprintf(buf, sizeof(buf), _("Other references: %s"), txt);
@@ -434,7 +434,7 @@
   }
 
   /* The Version */
-  txt = plugin->version;
+  txt = nvti_version(plugin->ni);
   if( txt != NULL  && txt[0] != '\0' )
   {
     snprintf(buf, sizeof(buf), _("Plugin Version: %s"), txt);
@@ -446,7 +446,7 @@
   }
   
   /* Script Tags */
-  txt = plugin->script_tags;
+  txt = nvti_tag(plugin->ni);
   if(txt != NULL && txt[0] != '\0' && strcmp(txt, "NOTAG") != 0)
   {
     snprintf(buf, sizeof(buf), _("Script tags: %s"), txt);
@@ -496,7 +496,7 @@
   gtk_widget_show(hbox);
   
   /* Server trust level information */
-  txt = plugin->sign_key_ids;
+  txt = nvti_sign_key_ids(plugin->ni);
   if(txt && strcmp(txt, "NOSIGNKEYS") == 0)
     txt = NULL;
 
@@ -588,7 +588,7 @@
   /* The button for displaying the dependencies */
   button = gtk_button_new_with_label(_("Show dependencies"));
   g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(show_deps),
-                   plugin->name);
+                   nvti_name(plugin->ni));
   gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5);
   gtk_widget_show(button);
   if(!arg_get_value(Context->dependencies, pluginname))

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_plugins_prefs.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_plugins_prefs.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_plugins_prefs.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -152,13 +152,13 @@
 
     if((prefs = plugs->plugin_prefs) != NULL )
     {
-      if (strcmp(plugs->family, "Credentials"))
+      if (strcmp(nvti_family(plugs->ni), "Credentials"))
       {
-	notebook_vbox = pprefs_add_notebook_page(ctrls, plugs->name, 0);
+	notebook_vbox = pprefs_add_notebook_page(ctrls, nvti_name(plugs->ni), 0);
       }
       else
       {
-        notebook_vbox = pprefs_add_notebook_page(ctrls, plugs->name, 1);
+        notebook_vbox = pprefs_add_notebook_page(ctrls, nvti_name(plugs->ni), 1);
       }
       // For each preference of this plugin, add the widget.
       /** @todo prefs->next ? */
@@ -184,7 +184,7 @@
             nvt_pref_sshlogin_add(notebook_vbox, prefs);
           else
             show_warning(_("%s asked for unknown preference type %s."), 
-                         plugs->name, type);
+                         nvti_name(plugs->ni), type);
 	}
 	prefs = prefs->next;
       }

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_scan_opt.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_scan_opt.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_dialog_scan_opt.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -285,7 +285,7 @@
   {
     gtk_list_store_append(store, &iter);  /* Acquire an iterator */
     gtk_list_store_set(store, &iter,
-      COL_NAME, scans->name,
+      COL_NAME, nvti_name(scans->ni),
       COL_PLUGIN, scans,
       -1);
     scans = scans->next;

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_plugins_tree.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_plugins_tree.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_plugins_tree.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -299,7 +299,7 @@
     gtk_tree_model_get_iter(model, &iter, path);
     gtk_tree_model_get(model, &iter, COL_PLUGIN, &plugin, -1);
 
-    plugin_info_window_setup(plugin, plugin->name);
+    plugin_info_window_setup(plugin, nvti_name(plugin->ni));
   }
 }
 
@@ -499,7 +499,7 @@
 
     /* Determine the iter of the family node for the current plugin.  If
      * the node doesn't exist yet, create it. */
-    plug_family = plugs->family;
+    plug_family = nvti_family(plugs->ni);
     family_path = g_hash_table_lookup(family_hash, plug_family);
 
     if (family_path == NULL )
@@ -519,7 +519,7 @@
      * current plugin belongs to.  Append the plugin to that family. */
     gtk_tree_store_append(GTK_TREE_STORE(store), &insert_iter, &family_iter);
     gtk_tree_store_set (GTK_TREE_STORE(store), &insert_iter,
-                        COL_NAME, plugs->name, COL_PLUGIN, plugs, -1);
+                        COL_NAME, nvti_name(plugs->ni), COL_PLUGIN, plugs, -1);
 
     plugs = plugs->next;
   }

Modified: trunk/openvas-client/openvas/prefs_dialog/prefs_report.c
===================================================================
--- trunk/openvas-client/openvas/prefs_dialog/prefs_report.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/prefs_dialog/prefs_report.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -508,7 +508,7 @@
            && plugin != NULL)
         {
           gtk_text_buffer_get_end_iter (buffer, &iter);
-          gchar* text = g_strdup_printf (_("Reported by NVT \"%s\" (%s):\n\n"), plugin->name, plugin->oid);
+          gchar* text = g_strdup_printf (_("Reported by NVT \"%s\" (%s):\n\n"), nvti_name(plugin->ni), plugin->oid);
           gtk_text_buffer_insert (buffer, &iter, text, -1);
           g_free (text);
         }
@@ -543,7 +543,7 @@
         }
       issue->severity_to = g_strdup ("");
       issue->reason  = g_strdup ("");
-      issue->name    = g_strdup (plugin->name);
+      issue->name    = g_strdup (nvti_name(plugin->ni));
       issue->OID     = g_strdup (plugin_oid);
 
       issues = g_slist_prepend (issues, issue);

Modified: trunk/openvas-client/openvas/xml_output_ng.c
===================================================================
--- trunk/openvas-client/openvas/xml_output_ng.c	2009-10-12 20:12:33 UTC (rev 5503)
+++ trunk/openvas-client/openvas/xml_output_ng.c	2009-10-12 22:33:38 UTC (rev 5504)
@@ -405,15 +405,15 @@
     char * s = nvti_description(u->ni);
 
      xml_fprintf (fd, indent, "<nvt oid=\"%s\">\n", u->oid);
-     xml_fprintf_element (fd, indent+1, "name",  u->name);
-     xml_fprintf_element (fd, indent+1, "version", u->version);
-     xml_fprintf_element (fd, indent+1, "family",  u->family);
-     xml_fprintf_element (fd, indent+1, "cve_id",  u->cve);
-     xml_fprintf_element (fd, indent+1, "bugtraq_id", u->bid);
+     xml_fprintf_element (fd, indent+1, "name",  nvti_name(u->ni));
+     xml_fprintf_element (fd, indent+1, "version", nvti_version(u->ni));
+     xml_fprintf_element (fd, indent+1, "family", nvti_family(u->ni));
+     xml_fprintf_element (fd, indent+1, "cve_id", nvti_cve(u->ni));
+     xml_fprintf_element (fd, indent+1, "bugtraq_id", nvti_bid(u->ni));
      xml_fprintf_element (fd, indent+1, "category", u->category);
      xml_fprintf_element (fd, indent+1, "risk",  getrisk(s));
      xml_fprintf_element (fd, indent+1, "summary", nvti_summary(u->ni));
-     xml_fprintf_element (fd, indent+1, "copyright", u->copyright);
+     xml_fprintf_element (fd, indent+1, "copyright", nvti_summary(u->ni));
      xml_fprintf (fd, indent, "</nvt>\n");
 } /* xml_plugins_plugin */
 



More information about the Openvas-commits mailing list