[Openvas-commits] r10621 - in trunk/openvas-plugins: . scripts

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 22 14:44:44 CET 2011


Author: mwiegand
Date: 2011-03-22 14:44:38 +0100 (Tue, 22 Mar 2011)
New Revision: 10621

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/kb_2_sc.nasl
Log:
* scripts/kb_2_sc.nasl: List correct OVAL schema version in generator
  element. Get product, vendor and version from plugin_feed_info.inc.
  List only used schemaLocations. Removed filler text.


Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2011-03-22 13:24:29 UTC (rev 10620)
+++ trunk/openvas-plugins/ChangeLog	2011-03-22 13:44:38 UTC (rev 10621)
@@ -1,3 +1,9 @@
+2011-03-22  Michael Wiegand <michael.wiegand at greenbone.net>
+
+	* scripts/kb_2_sc.nasl: List correct OVAL schema version in generator
+	element. Get product, vendor and version from plugin_feed_info.inc.
+	List only used schemaLocations. Removed filler text.
+
 2011-03-22  Michael Meyer <michael.meyer at greenbone.net>
 
 	* scripts/gb_wondercms_44916.nasl,

Modified: trunk/openvas-plugins/scripts/kb_2_sc.nasl
===================================================================
--- trunk/openvas-plugins/scripts/kb_2_sc.nasl	2011-03-22 13:24:29 UTC (rev 10620)
+++ trunk/openvas-plugins/scripts/kb_2_sc.nasl	2011-03-22 13:44:38 UTC (rev 10621)
@@ -43,6 +43,8 @@
  exit (0);
 }
 
+include ("plugin_feed_info.inc");
+
 create_sc = script_get_preference("Create OVAL System Characteristics");
 if (create_sc == "no") {
   exit (0);
@@ -56,7 +58,10 @@
 }
 
 xml = '';
-xml = string (xml, '<oval_system_characteristics xmlns=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5\" xmlns:linux-sc=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#linux\" xmlns:oval=\"http://oval.mitre.org/XMLSchema/oval-common-5\" xmlns:oval-sc=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5\" xmlns:unix-sc=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#unix\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5 oval-system-characteristics-schema.xsd http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#unix unix-system-characteristics-schema.xsd http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#linux linux-system-characteristics-schema.xsd http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#windows windows-system-characteristics-schema.xsd http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#independent independent-system-characteristics-schema.xsd\">\n\n');
+# Please note: If this NVT is extended to produce System Characteristics defined
+# in other schemas than the ones listed below it the schemas should be added to
+# the xsi:schemaLocation attribute.
+xml = string (xml, '<oval_system_characteristics xmlns=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5\" xmlns:linux-sc=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#linux\" xmlns:oval=\"http://oval.mitre.org/XMLSchema/oval-common-5\" xmlns:oval-sc=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://oval.mitre.org/XMLSchema/oval-system-characteristics-5 oval-system-characteristics-schema.xsd http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#linux linux-system-characteristics-schema.xsd\">\n\n');
 
 t = localtime();
 
@@ -67,9 +72,9 @@
 sec    = fancy_date ( t["sec"]  );
 
 report += string ('<oval:timestamp>', t["year"], '-', month, '-', day, 'T', hour, ':', minute, ':', sec, '</oval:timestamp>');
-xml = string (xml, '\t<generator>\n\t\t<oval:product_name>OpenVAS</oval:product_name>\n\t\t<oval:product_version>4</oval:product_version>\n\t\t<oval:schema_version>5.7</oval:schema_version>\n\t\t<oval:timestamp>', t["year"], '-', month, '-', day, 'T', hour, ':', minute, ':', sec, '</oval:timestamp>\n\t\t<vendor>The OpenVAS Project</vendor>\n\t</generator>\n\n');
+xml = string (xml, '\t<generator>\n\t\t<oval:product_name>', PLUGIN_FEED, '</oval:product_name>\n\t\t<oval:product_version>', PLUGIN_SET, '</oval:product_version>\n\t\t<oval:schema_version>5.9</oval:schema_version>\n\t\t<oval:timestamp>', t["year"], '-', month, '-', day, 'T', hour, ':', minute, ':', sec, '</oval:timestamp>\n\t\t<vendor>', FEED_VENDOR, '</vendor>\n\t</generator>\n\n');
 
-xml = string (xml, '\t<system_info>\n\t\t<os_name>FIXME</os_name>\n\t\t<os_version>FIXME</os_version>\n\t\t<architecture>FIXME</architecture>\n\t\t<primary_host_name>FIXME</primary_host_name>\n\t\t<interfaces>\n\t\t\t<interface>\n\t\t\t\t<interface_name>FIXME</interface_name>\n\t\t\t\t<ip_address>FIXME</ip_address>\n\t\t\t\t<mac_address>FIXME</mac_address>\n\t\t\t</interface>\n\t\t</interfaces>\n\t</system_info>\n\n');
+xml = string (xml, '\t<system_info>\n\t\t<os_name></os_name>\n\t\t<os_version></os_version>\n\t\t<architecture></architecture>\n\t\t<primary_host_name></primary_host_name>\n\t\t<interfaces>\n\t\t\t<interface>\n\t\t\t\t<interface_name></interface_name>\n\t\t\t\t<ip_address></ip_address>\n\t\t\t\t<mac_address></mac_address>\n\t\t\t</interface>\n\t\t</interfaces>\n\t</system_info>\n\n');
 xml = string (xml, '\t<system_data>\n');
 
 release = get_kb_item ("ssh/login/release");



More information about the Openvas-commits mailing list