Skip to content

Commit

Permalink
Merge pull request #1224 from mattmundell/get-vulns-min-qod
Browse files Browse the repository at this point in the history
Add missing min_qod to FILTERS in GET_VULNS response
  • Loading branch information
bjoernricks authored Aug 11, 2020
2 parents 738cb18 + 91c94e5 commit a797e5e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Allow group access to lockfile and fix growing or empty timestamp [#1213](https://github.com/greenbone/gvmd/pull/1213)
- Ignore whitespace when checking for changed delta results [#1219](https://github.com/greenbone/gvmd/pull/1219)
- Check permissions when applying tag in filter [#1222](https://github.com/greenbone/gvmd/pull/1222)
- Add qod as name in results columns, for sorting [#1243](https://github.com/greenbone/gvmd/pull/1243)
- Add missing min_qod to FILTERS in GET_VULNS response [#1224](https://github.com/greenbone/gvmd/pull/1224)
- Improve EXE installer NSIS script generation [#1226](https://github.com/greenbone/gvmd/pull/1226)
- Add qod as name in results columns, for sorting [#1243](https://github.com/greenbone/gvmd/pull/1243)

### Removed
- Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)
Expand Down
27 changes: 18 additions & 9 deletions src/gmp_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ send_get_end_internal (const char *type, get_data_t *get, int get_counts,
g_free (filter);
if ((strcmp (type, "task") == 0)
|| (strcmp (type, "report") == 0)
|| (strcmp (type, "result") == 0))
|| (strcmp (type, "result") == 0)
|| (strcmp (type, "vuln") == 0))
{
gchar *value;

Expand All @@ -614,16 +615,21 @@ send_get_end_internal (const char *type, get_data_t *get, int get_counts,
}
g_free (value);

value = filter_term_value (new_filter, "apply_overrides");
if (value == NULL)
if ((strcmp (type, "task") == 0)
|| (strcmp (type, "report") == 0)
|| (strcmp (type, "result") == 0))
{
filter = new_filter;
new_filter = g_strdup_printf ("apply_overrides=%i %s",
APPLY_OVERRIDES_DEFAULT,
filter);
g_free (filter);
value = filter_term_value (new_filter, "apply_overrides");
if (value == NULL)
{
filter = new_filter;
new_filter = g_strdup_printf ("apply_overrides=%i %s",
APPLY_OVERRIDES_DEFAULT,
filter);
g_free (filter);
}
g_free (value);
}
g_free (value);
}
filter = new_filter;
}
Expand All @@ -636,6 +642,9 @@ send_get_end_internal (const char *type, get_data_t *get, int get_counts,
G_STRINGIFY (APPLY_OVERRIDES_DEFAULT)
" min_qod="
G_STRINGIFY (MIN_QOD_DEFAULT));
else if (strcmp (type, "vuln") == 0)
filter = manage_clean_filter(" min_qod="
G_STRINGIFY (MIN_QOD_DEFAULT));
else
filter = manage_clean_filter ("");
}
Expand Down
15 changes: 10 additions & 5 deletions src/schema_formats/XML/GMP.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -16345,11 +16345,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<type>levels</type>
<summary>Severity levels to select</summary>
</option>
<option>
<name>min_qod</name>
<type>integer</type>
<summary>Minimum QoD of the results</summary>
</option>
<option>
<name>notes</name>
<type>boolean</type>
Expand Down Expand Up @@ -16390,6 +16385,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<type>name</type>
<summary>Name of the owner</summary>
</column>
<column>
<name>min_qod</name>
<type>integer</type>
<summary>Minimum QoD of the results</summary>
</column>
<column>
<name>host</name>
<type>text</type>
Expand Down Expand Up @@ -22547,6 +22547,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<type>iso_time</type>
<summary>Modification time</summary>
</column>
<column>
<name>min_qod</name>
<type>integer</type>
<summary>Minimum QoD of the vulnerability</summary>
</column>
<column>
<name>results</name>
<type>integer</type>
Expand Down

0 comments on commit a797e5e

Please sign in to comment.