From f4848def5e9dc6a810191efaba716dcc5932bf18 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 29 Oct 2019 23:21:28 +0100 Subject: [PATCH 01/19] Parse solution method from OSP. --- src/manage_sql_nvts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index 61f443c1a..f84d31360 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -1183,7 +1183,7 @@ nvti_from_vt (entity_t vt) solution = entity_child (vt, "solution"); if (solution) { - const gchar *type; + const gchar *type, *method; nvti_set_solution (nvti, entity_text (solution)); @@ -1192,6 +1192,10 @@ nvti_from_vt (entity_t vt) g_debug ("%s: SOLUTION missing type", __func__); else nvti_set_solution_type (nvti, type); + + method = entity_attribute (solution, "method"); + if (method) + nvti_set_solution_method (nvti, method); } refs = entity_child (vt, "refs"); From 2e6d06686e31b2b4949f86ba84f00f9fe4fb7533 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 31 Oct 2019 18:45:03 +0100 Subject: [PATCH 02/19] Extend table nvts with solution_method. --- src/manage_pg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/manage_pg.c b/src/manage_pg.c index 27762d8c8..73df80f47 100644 --- a/src/manage_pg.c +++ b/src/manage_pg.c @@ -2919,6 +2919,7 @@ create_tables () " modification_time integer," " solution text," " solution_type text," + " solution_method text," " detection text," " qod integer," " qod_type text);"); From 0287cfd2a0658ba47e6249cf6b964add402f7e29 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 31 Oct 2019 18:47:11 +0100 Subject: [PATCH 03/19] Write also solution_method into nvts table. --- src/manage_sql_nvts.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index f84d31360..155c24134 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -253,7 +253,7 @@ insert_nvt (const nvti_t *nvti) gchar *quoted_name, *quoted_summary, *quoted_insight, *quoted_affected; gchar *quoted_impact, *quoted_detection, *quoted_cve, *quoted_tag; gchar *quoted_cvss_base, *quoted_qod_type, *quoted_family; - gchar *quoted_solution, *quoted_solution_type; + gchar *quoted_solution, *quoted_solution_type, *quoted_solution_method; int qod, i; cve = nvti_refs (nvti, "cve", "", 0); @@ -272,6 +272,8 @@ insert_nvt (const nvti_t *nvti) nvti_solution (nvti) : ""); quoted_solution_type = sql_quote (nvti_solution_type (nvti) ? nvti_solution_type (nvti) : ""); + quoted_solution_method = sql_quote (nvti_solution_method (nvti) ? + nvti_solution_method (nvti) : ""); quoted_detection = sql_quote (nvti_detection (nvti) ? nvti_detection (nvti) : ""); @@ -298,14 +300,14 @@ insert_nvt (const nvti_t *nvti) sql ("INSERT into nvts (oid, name, summary, insight, affected," " impact, cve, tag, category, family, cvss_base," " creation_time, modification_time, uuid, solution_type," - " solution, detection, qod, qod_type)" + " solution_method, solution, detection, qod, qod_type)" " VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s'," - " '%s', %i, '%s', '%s', %i, %i, '%s', '%s', '%s', '%s', %d, '%s');", + " '%s', %i, '%s', '%s', %i, %i, '%s', '%s', '%s', '%s', '%s', %d, '%s');", nvti_oid (nvti), quoted_name, quoted_summary, quoted_insight, quoted_affected, quoted_impact, quoted_cve, quoted_tag, nvti_category (nvti), quoted_family, quoted_cvss_base, nvti_creation_time (nvti), nvti_modification_time (nvti), - nvti_oid (nvti), quoted_solution_type, + nvti_oid (nvti), quoted_solution_type, quoted_solution_method, quoted_solution, quoted_detection, qod, quoted_qod_type); sql ("DELETE FROM vt_refs where vt_oid = '%s';", nvti_oid (nvti)); @@ -338,6 +340,7 @@ insert_nvt (const nvti_t *nvti) g_free (quoted_family); g_free (quoted_solution); g_free (quoted_solution_type); + g_free (quoted_solution_method); g_free (quoted_detection); g_free (quoted_qod_type); } From aac9dffd13f1dada72e61299d470cc346cb15687 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Thu, 31 Oct 2019 19:18:53 +0100 Subject: [PATCH 04/19] Prepare migrator to add solution_method to nvts --- src/manage_migrators.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/manage_migrators.c b/src/manage_migrators.c index 36504e8ec..702eb3a74 100644 --- a/src/manage_migrators.c +++ b/src/manage_migrators.c @@ -1575,7 +1575,6 @@ migrate_221_to_222 () sql_begin_immediate (); /* Ensure that the database is currently version 221. */ - if (manage_db_version () != 221) { sql_rollback (); @@ -1589,7 +1588,6 @@ migrate_221_to_222 () sql ("DELETE FROM permissions_trash WHERE name = 'modify_report';"); /* Set the database version to 222. */ - set_db_version (222); sql_commit (); @@ -1597,6 +1595,35 @@ migrate_221_to_222 () return 0; } +/** + * @brief Migrate the database from version 221 to version 222. + * + * @return 0 success, -1 error. + */ +int +migrate_222_to_223 () +{ + sql_begin_immediate (); + + /* Ensure that the database is currently version 222. */ + if (manage_db_version () != 222) + { + sql_rollback (); + return -1; + } + + /* Update the database. */ + + /* Extend table "nvts" with additional column "solution_method" */ + sql ("ALTER TABLE IF EXISTS nvts ADD COLUMN solution_method text;"); + + set_db_version (223); + + sql_commit (); + + return 0; +} + #undef UPDATE_DASHBOARD_SETTINGS /** @@ -1625,6 +1652,7 @@ static migrator_t database_migrators[] = { {220, migrate_219_to_220}, {221, migrate_220_to_221}, {222, migrate_221_to_222}, + {223, migrate_222_to_223}, /* End marker. */ {-1, NULL}}; From aefee04c0428b920cf21bdbf38f8e5159cd2440b Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Mon, 4 Nov 2019 21:48:14 +0100 Subject: [PATCH 05/19] Add solution element to results nvt. Use the solution text and the solution type. This keeps the same data the tag string for the time being. --- src/gmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gmp.c b/src/gmp.c index 56f4fd8e4..b9f92ffbc 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -10246,6 +10246,18 @@ results_xml_append_nvt (iterator_t *results, GString *buffer, int cert_loaded) cvss_base ?: "", tags->str ?: ""); + if (result_iterator_nvt_solution (results)) + { + buffer_xml_append_printf (buffer, "%s", + result_iterator_nvt_solution (results)); + } + first = 1; result_iterator_nvt_refs_append (buffer, results, &first); results_xml_append_cert (buffer, results, oid, cert_loaded, &first); From 3de6db17772d4f1fe3b9f5fc2aae8cb6b2657841 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Mon, 4 Nov 2019 22:39:54 +0100 Subject: [PATCH 06/19] Add solution method to solution element. This adds the solution method to the solution element in the results nvt object. --- src/gmp.c | 4 ++++ src/manage.h | 3 +++ src/manage_sql.c | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/gmp.c b/src/gmp.c index b9f92ffbc..51adcd751 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -10254,6 +10254,10 @@ results_xml_append_nvt (iterator_t *results, GString *buffer, int cert_loaded) buffer_xml_append_printf (buffer, " type='%s'", result_iterator_nvt_solution_type (results)); + if (result_iterator_nvt_solution_method (results)) + buffer_xml_append_printf (buffer, " method='%s'", + result_iterator_nvt_solution_method (results)); + buffer_xml_append_printf (buffer, ">%s", result_iterator_nvt_solution (results)); } diff --git a/src/manage.h b/src/manage.h index 558ad0d8a..d75be750b 100644 --- a/src/manage.h +++ b/src/manage.h @@ -1429,6 +1429,9 @@ result_iterator_nvt_solution (iterator_t *); const char* result_iterator_nvt_solution_type (iterator_t *); +const char* +result_iterator_nvt_solution_method (iterator_t *); + const char* result_iterator_nvt_detection (iterator_t *); diff --git a/src/manage_sql.c b/src/manage_sql.c index 3c553d76e..54d9a96cf 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -24294,6 +24294,25 @@ result_iterator_nvt_solution_type (iterator_t *iterator) return NULL; } +/** + * @brief Get the NVT solution_method from a result iterator. + * + * @param[in] iterator Iterator. + * + * @return The solution_method of the NVT that produced the result, + * or NULL on error. + */ +const char* +result_iterator_nvt_solution_method (iterator_t *iterator) +{ + nvti_t *nvti; + if (iterator->done) return NULL; + nvti = lookup_nvti (result_iterator_nvt_oid (iterator)); + if (nvti) + return nvti_solution_method (nvti); + return NULL; +} + /** * @brief Get the NVT detection from a result iterator. * From d015130d0aca217c5a66cf780bb0db89bd45590f Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 06:46:30 +0100 Subject: [PATCH 07/19] Create soltion element even without solution. In case only a solution type and/or method is present, still create the solution element. --- src/gmp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index 51adcd751..f178cf0f1 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -10246,20 +10246,25 @@ results_xml_append_nvt (iterator_t *results, GString *buffer, int cert_loaded) cvss_base ?: "", tags->str ?: ""); - if (result_iterator_nvt_solution (results)) + if (result_iterator_nvt_solution (results) || + result_iterator_nvt_solution_type (results) || + result_iterator_nvt_solution_method (results)) { buffer_xml_append_printf (buffer, "%s", - result_iterator_nvt_solution (results)); + if (result_iterator_nvt_solution (results)) + buffer_xml_append_printf (buffer, ">%s", + result_iterator_nvt_solution (results)); + else + buffer_xml_append_printf (buffer, "/>"); } first = 1; From 4444321426a7a209a6fcd662914d74f3df51ab23 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 06:49:06 +0100 Subject: [PATCH 08/19] Add solution method iterator for nvts. --- src/manage.h | 3 +++ src/manage_sql_nvts.c | 10 ++++++++++ src/manage_sql_nvts.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/manage.h b/src/manage.h index d75be750b..5f30c2ec0 100644 --- a/src/manage.h +++ b/src/manage.h @@ -2026,6 +2026,9 @@ nvt_iterator_solution (iterator_t*); const char* nvt_iterator_solution_type (iterator_t*); +const char* +nvt_iterator_solution_method (iterator_t*); + char* nvt_default_timeout (const char *); diff --git a/src/manage_sql_nvts.c b/src/manage_sql_nvts.c index 155c24134..8467eeca9 100644 --- a/src/manage_sql_nvts.c +++ b/src/manage_sql_nvts.c @@ -912,6 +912,16 @@ DEF_ACCESS (nvt_iterator_impact, GET_ITERATOR_COLUMN_COUNT + 18); */ DEF_ACCESS (nvt_iterator_detection, GET_ITERATOR_COLUMN_COUNT + 19); +/** + * @brief Get the solution method from an NVT iterator. + * + * @param[in] iterator Iterator. + * + * @return Solution method, or NULL if iteration is complete. Freed by + * cleanup_iterator. + */ +DEF_ACCESS (nvt_iterator_solution_method, GET_ITERATOR_COLUMN_COUNT + 20); + /** * @brief Get the default timeout of an NVT. * diff --git a/src/manage_sql_nvts.h b/src/manage_sql_nvts.h index 439f6a775..fcb904a62 100644 --- a/src/manage_sql_nvts.h +++ b/src/manage_sql_nvts.h @@ -61,6 +61,7 @@ { "affected", NULL, KEYWORD_TYPE_STRING }, \ { "impact", NULL, KEYWORD_TYPE_STRING }, \ { "detection", NULL, KEYWORD_TYPE_STRING }, \ + { "solution_method", NULL, KEYWORD_TYPE_STRING }, \ { NULL, NULL, KEYWORD_TYPE_UNKNOWN } \ } From eb1678da2d0bd9d19cf4c17991f160182bb645ad Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 06:49:50 +0100 Subject: [PATCH 09/19] Add solution element to nvt object. This adds the solution element. The solution and solution_type are still in the tag and need to be removed later. --- src/manage.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/manage.c b/src/manage.c index 77e8888ea..fdf4f8133 100644 --- a/src/manage.c +++ b/src/manage.c @@ -7908,6 +7908,28 @@ get_nvti_xml (iterator_t *nvts, int details, int pref_count, g_string_free(refs_str, 1); g_string_free(tags_str, 1); + if (nvt_iterator_solution (nvts) || + nvt_iterator_solution_type (nvts) || + nvt_iterator_solution_method (nvts)) + { + g_string_append_printf (buffer, "%s", + nvt_iterator_solution (nvts)); + else + g_string_append_printf (buffer, "/>"); + } + + if (preferences) { iterator_t prefs; From dbf6b662b6653a9eba4c38507cbce786006b50e2 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 17:12:51 +0100 Subject: [PATCH 10/19] Consider new solution element. Also considers the optional solution method and print it on a extra line. --- src/report_formats/TXT/TXT.xsl | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/report_formats/TXT/TXT.xsl b/src/report_formats/TXT/TXT.xsl index 97f967ebe..001c0af32 100644 --- a/src/report_formats/TXT/TXT.xsl +++ b/src/report_formats/TXT/TXT.xsl @@ -456,18 +456,25 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - + Solution: - + Solution type: - + + + + + Solution method: + + + + + + + - - - - From da7a11e01adb2172a0cca036a44951257a5aec83 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 17:14:35 +0100 Subject: [PATCH 11/19] Consider new solution element. Also considers the optional solution method and print it on a extra line. --- src/report_formats/LaTeX/latex.xsl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/report_formats/LaTeX/latex.xsl b/src/report_formats/LaTeX/latex.xsl index 7b3402e53..52887fa7b 100644 --- a/src/report_formats/LaTeX/latex.xsl +++ b/src/report_formats/LaTeX/latex.xsl @@ -1254,19 +1254,26 @@ advice given in each description, in order to rectify the issue. - + \hline \textbf{Solution} - + \textbf{Solution type:} - + - - - + + \textbf{Solution method:} + + + + + + + + From 13a326c36069f780fa360c599302db01b5bed1b4 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 17:16:31 +0100 Subject: [PATCH 12/19] Consider new solution element. Also considers the optional solution method and print it on a extra line. --- src/report_formats/NBE/NBE.xsl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/report_formats/NBE/NBE.xsl b/src/report_formats/NBE/NBE.xsl index 889960fbd..e1d0b4721 100644 --- a/src/report_formats/NBE/NBE.xsl +++ b/src/report_formats/NBE/NBE.xsl @@ -163,16 +163,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. \n\n - + Solution: \n - + Solution type: - + \n - - \n\n + + Solution method: + + \n + + + + \n\n + From 6d4a86b8c5348610a163852ef235a3651e475d95 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 17:18:03 +0100 Subject: [PATCH 13/19] Consider new solution element. Also considers the optional solution method and print it on a extra line. --- .../Verinice_ISM/Verinice_ISM.xsl | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/report_formats/Verinice_ISM/Verinice_ISM.xsl b/src/report_formats/Verinice_ISM/Verinice_ISM.xsl index 79c7135f4..97cbd4acb 100644 --- a/src/report_formats/Verinice_ISM/Verinice_ISM.xsl +++ b/src/report_formats/Verinice_ISM/Verinice_ISM.xsl @@ -67,7 +67,7 @@ Parameters: and string-length (gvm:get-nvt-tag ($nvt/tags, 'insight')) and string-length (gvm:get-nvt-tag ($nvt/tags, 'vuldetect')) and string-length (gvm:get-nvt-tag ($nvt/tags, 'impact')) - and string-length (gvm:get-nvt-tag ($nvt/tags, 'solution'))"> + and $nvt/solution"> @@ -609,17 +609,24 @@ CIS - + Solution: - + Solution type: - + + + + + Solution method: + + + + + + - - - From a88bd66cc531dd974a7103a906863158c97c65e8 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 5 Nov 2019 17:19:13 +0100 Subject: [PATCH 14/19] Consider new solution element. The optional solution method is not considered because it was change the column structure and thus change the CSV API. --- src/report_formats/CSV_Results/CSV_Results.xsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/report_formats/CSV_Results/CSV_Results.xsl b/src/report_formats/CSV_Results/CSV_Results.xsl index def4970ee..137a40141 100644 --- a/src/report_formats/CSV_Results/CSV_Results.xsl +++ b/src/report_formats/CSV_Results/CSV_Results.xsl @@ -186,8 +186,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. , ," - - + + "," @@ -229,8 +229,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. "," - - + + "," From 219e921df5b4c16d62902dd136f740e05ff01556 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Fri, 8 Nov 2019 20:08:49 +0100 Subject: [PATCH 15/19] Add changelog entry. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dab3c41d1..5ff9b8f83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Update SCAP and CERT feed info in sync scripts [#810](https://github.com/greenbone/gvmd/pull/810) +- Extend GMP API for nvt object to carry a explicit solution element [#849](https://github.com/greenbone/gvmd/pull/849) ### Fixed - Add NULL check in nvts_feed_version_epoch [#768](https://github.com/greenbone/gvmd/pull/768) From 2cc8c73453e28b16dfa4bb3ff1ee30fe9762ffe2 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 19 Nov 2019 11:42:16 +0100 Subject: [PATCH 16/19] Add change note for GMP about solution method. This boiled down to just the change note since the nvt element is not detailed anywhere in the GMP documentation. --- src/schema_formats/XML/GMP.xml.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/schema_formats/XML/GMP.xml.in b/src/schema_formats/XML/GMP.xml.in index a67ad25ff..79aa4a79e 100644 --- a/src/schema_formats/XML/GMP.xml.in +++ b/src/schema_formats/XML/GMP.xml.in @@ -27174,6 +27174,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20.04 + + GET_INFO + Add element SOLUTION_METHOD for type "nvt" to element NVT + +

+ The new element SOLUTION_METHOD optionally accompanies the SOLUTION_TYPE for type "nvt" in the NVT element. +

+
+ 20.04 +
CREATE_CONFIG From d9cb56b37e29a7b0764d3612a97fceaea91a2858 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Tue, 19 Nov 2019 13:54:00 +0100 Subject: [PATCH 17/19] Activate database migration to 223. The column is mandatory for correct function. So we need to enfore the migration. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30fe905b8..fe116ba42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,7 @@ include (CPack) ## Variables -set (GVMD_DATABASE_VERSION 221) +set (GVMD_DATABASE_VERSION 223) set (GVMD_SCAP_DATABASE_VERSION 15) From 07a51d1fb455a8400dbd55dafb4709c578f98e5c Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Fri, 29 Nov 2019 16:51:43 +0100 Subject: [PATCH 18/19] Fixed formatting issues. --- src/gmp.c | 6 +++--- src/manage.c | 2 +- src/manage_migrators.c | 7 ++++++- src/report_formats/Verinice_ISM/Verinice_ISM.xsl | 14 +++++++------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index f178cf0f1..a053b9773 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -10246,9 +10246,9 @@ results_xml_append_nvt (iterator_t *results, GString *buffer, int cert_loaded) cvss_base ?: "", tags->str ?: ""); - if (result_iterator_nvt_solution (results) || - result_iterator_nvt_solution_type (results) || - result_iterator_nvt_solution_method (results)) + if (result_iterator_nvt_solution (results) + || result_iterator_nvt_solution_type (results) + || result_iterator_nvt_solution_method (results)) { buffer_xml_append_printf (buffer, "%s", - nvt_iterator_solution (nvts)); + nvt_iterator_solution (nvts)); else g_string_append_printf (buffer, "/>"); } diff --git a/src/manage_migrators.c b/src/manage_migrators.c index 702eb3a74..57531353f 100644 --- a/src/manage_migrators.c +++ b/src/manage_migrators.c @@ -1575,6 +1575,7 @@ migrate_221_to_222 () sql_begin_immediate (); /* Ensure that the database is currently version 221. */ + if (manage_db_version () != 221) { sql_rollback (); @@ -1588,6 +1589,7 @@ migrate_221_to_222 () sql ("DELETE FROM permissions_trash WHERE name = 'modify_report';"); /* Set the database version to 222. */ + set_db_version (222); sql_commit (); @@ -1596,7 +1598,7 @@ migrate_221_to_222 () } /** - * @brief Migrate the database from version 221 to version 222. + * @brief Migrate the database from version 222 to version 223. * * @return 0 success, -1 error. */ @@ -1606,6 +1608,7 @@ migrate_222_to_223 () sql_begin_immediate (); /* Ensure that the database is currently version 222. */ + if (manage_db_version () != 222) { sql_rollback (); @@ -1617,6 +1620,8 @@ migrate_222_to_223 () /* Extend table "nvts" with additional column "solution_method" */ sql ("ALTER TABLE IF EXISTS nvts ADD COLUMN solution_method text;"); + /* Set the database version to 223. */ + set_db_version (223); sql_commit (); diff --git a/src/report_formats/Verinice_ISM/Verinice_ISM.xsl b/src/report_formats/Verinice_ISM/Verinice_ISM.xsl index 97cbd4acb..46e8c5d14 100644 --- a/src/report_formats/Verinice_ISM/Verinice_ISM.xsl +++ b/src/report_formats/Verinice_ISM/Verinice_ISM.xsl @@ -67,7 +67,7 @@ Parameters: and string-length (gvm:get-nvt-tag ($nvt/tags, 'insight')) and string-length (gvm:get-nvt-tag ($nvt/tags, 'vuldetect')) and string-length (gvm:get-nvt-tag ($nvt/tags, 'impact')) - and $nvt/solution"> + and $nvt/solution"> @@ -609,21 +609,21 @@ CIS
- + Solution: - + Solution type: - + - + Solution method: - + - + From fd3bedd1218d3a0b7f99e9175571122b1f5c3d58 Mon Sep 17 00:00:00 2001 From: Jan-Oliver Wagner Date: Sat, 30 Nov 2019 18:42:47 +0100 Subject: [PATCH 19/19] Remove the change entry again. This section is meant to document changes, no additions. So, reverting it. --- src/schema_formats/XML/GMP.xml.in | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/schema_formats/XML/GMP.xml.in b/src/schema_formats/XML/GMP.xml.in index 79aa4a79e..a67ad25ff 100644 --- a/src/schema_formats/XML/GMP.xml.in +++ b/src/schema_formats/XML/GMP.xml.in @@ -27174,16 +27174,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20.04 - - GET_INFO - Add element SOLUTION_METHOD for type "nvt" to element NVT - -

- The new element SOLUTION_METHOD optionally accompanies the SOLUTION_TYPE for type "nvt" in the NVT element. -

-
- 20.04 -
CREATE_CONFIG