Skip to content

Commit

Permalink
Merge pull request #1022 from jjnicola/qod
Browse files Browse the repository at this point in the history
Use nvti_qod instead of the old nvti_get_tag()
  • Loading branch information
mattmundell authored Mar 23, 2020
2 parents fac7001 + 95ec506 commit d1a7fe0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Put 'lean' back to 0 for GET_RESULTS [#1001](https://github.com/greenbone/gvmd/pull/1001)
- Improve handling of removed NVT prefs [#1003](https://github.com/greenbone/gvmd/pull/1003)
- Ensure parent exists when moving report format dir [#1019](https://github.com/greenbone/gvmd/pull/1019)
- Use nvti_qod instead of the old nvti_get_tag() [#1022](https://github.com/greenbone/gvmd/pull/1022)

### Removed
- Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)
Expand Down
13 changes: 9 additions & 4 deletions src/manage_sql_nvts.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,14 @@ insert_nvt (const nvti_t *nvti)

quoted_cvss_base = sql_quote (nvti_cvss_base (nvti) ? nvti_cvss_base (nvti) : "");

qod_str = nvti_get_tag (nvti, "qod");
qod_str = nvti_qod (nvti);
qod_type = nvti_qod_type (nvti);

if (qod_str == NULL || sscanf (qod_str, "%d", &qod) != 1)
qod = qod_from_type (qod_type);

quoted_qod_type = sql_quote (qod_type ? qod_type : "");

g_free (qod_str);

quoted_family = sql_quote (nvti_family (nvti) ? nvti_family (nvti) : "");

if (sql_int ("SELECT EXISTS (SELECT * FROM nvts WHERE oid = '%s');",
Expand Down Expand Up @@ -1238,8 +1236,15 @@ nvti_from_vt (entity_t vt)
detection = entity_child (vt, "detection");
if (detection)
{
const gchar *qod;

nvti_set_detection (nvti, entity_text (detection));
nvti_set_qod_type (nvti, entity_attribute (detection, "qod_type"));

qod = entity_attribute (detection, "qod");
if (qod == NULL)
nvti_set_qod_type (nvti, entity_attribute (detection, "qod_type"));
else
nvti_set_qod (nvti, qod);
}

solution = entity_child (vt, "solution");
Expand Down

0 comments on commit d1a7fe0

Please sign in to comment.