[Openvas-commits] r12139 - in trunk/openvas-plugins: . scripts
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Nov 21 09:49:46 CET 2011
Author: hdoreau
Date: 2011-11-21 09:49:42 +0100 (Mon, 21 Nov 2011)
New Revision: 12139
Modified:
trunk/openvas-plugins/ChangeLog
trunk/openvas-plugins/scripts/host_details.inc
Log:
* scripts/host_details.inc (register_host_details): Made the description
parameter optional when registering host details. Added product
registration function.
Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog 2011-11-21 08:30:28 UTC (rev 12138)
+++ trunk/openvas-plugins/ChangeLog 2011-11-21 08:49:42 UTC (rev 12139)
@@ -1,3 +1,9 @@
+2011-11-21 Henri Doreau <henri.doreau at greenbone.net>
+
+ * scripts/host_details.inc (register_host_details): Made the description
+ parameter optional when registering host details. Added product
+ registration function.
+
2011-11-18 Henri Doreau <henri.doreau at greenbone.net>
* scripts/punBB_profile_xss.nasl,
Modified: trunk/openvas-plugins/scripts/host_details.inc
===================================================================
--- trunk/openvas-plugins/scripts/host_details.inc 2011-11-21 08:30:28 UTC (rev 12138)
+++ trunk/openvas-plugins/scripts/host_details.inc 2011-11-21 08:49:42 UTC (rev 12139)
@@ -89,10 +89,15 @@
function register_host_detail(name, value, nvt, desc) {
set_kb_item(name:"HostDetails", value:name);
set_kb_item(name:"HostDetails/NVT", value:nvt);
- replace_kb_item(name:"HostDetails/NVT/" + nvt, value:desc);
+ if (!isnull(desc))
+ replace_kb_item(name:"HostDetails/NVT/" + nvt, value:desc);
set_kb_item(name:"HostDetails/NVT/" + nvt + "/" + name, value:value);
}
+function register_product(cpe, location, nvt) {
+ register_host_detail(name:"App", value:cpe, nvt:nvt);
+}
+
# provided for conveniency: host_details_list("OS")
function host_details_list(key) {
return get_kb_list("HostDetails/NVT/*/" + key);
@@ -127,7 +132,8 @@
report += xml_open_tag(tag:'source');
report += xml_tagline(tag:'type', value:"nvt");
report += xml_tagline(tag:'name', value:nvt);
- report += xml_tagline(tag:'description', value:desc);
+ if (!isnull(desc))
+ report += xml_tagline(tag:'description', value:desc);
report += xml_close_tag(tag:'source');
report += xml_close_tag(tag:'detail');
}
@@ -217,7 +223,8 @@
report += xml_tagline(tag:'name', value:oid);
desc = get_kb_item("HostDetails/NVT/" + oid);
- report += xml_tagline(tag:'description', value:desc);
+ if (!isnull(desc))
+ report += xml_tagline(tag:'description', value:desc);
report += xml_close_tag(tag:'source');
report += xml_close_tag(tag:'detail');
@@ -255,7 +262,8 @@
report += xml_tagline(tag:'name', value:oid);
desc = get_kb_item("HostDetails/NVT/" + oid);
- report += xml_tagline(tag:'description', value:desc);
+ if (!isnull(desc))
+ report += xml_tagline(tag:'description', value:desc);
report += xml_close_tag(tag:'source');
report += xml_close_tag(tag:'detail');
More information about the Openvas-commits
mailing list