Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop autofp #1300

Merged
merged 23 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3a4c7a
Remove autofp from result_iterator_opts_table().
janowagner Sep 10, 2020
9eb6890
Remove autofp from results_extra_where().
janowagner Sep 10, 2020
4fa2d39
Remove autofp from manage_report_filter_control()
janowagner Sep 10, 2020
63bd3a4
Remove autofp handling from report_severity_data()
janowagner Sep 12, 2020
b2f64c3
Remove autofp from report_counts()
janowagner Sep 13, 2020
9e39b9c
Remove filter_term_autofp()
janowagner Sep 13, 2020
3bf8c8f
Remove handling of "autofp" in filter string.
janowagner Sep 13, 2020
811a5ba
Remove autofp for columns.
janowagner Sep 13, 2020
72b3041
Remove unneeded proto.
janowagner Sep 13, 2020
99a6608
Drop param autofp from report_results_get_data()
janowagner Sep 13, 2020
46d6630
Drop autofp from report_results_filter_term()
janowagner Sep 13, 2020
6a29f12
For type do not consider autofp anymore.
janowagner Sep 13, 2020
2b112aa
Remove autfp from results interator.
janowagner Sep 13, 2020
5116bd9
Remove SQL view for autofp.
janowagner Sep 13, 2020
45921c5
Remove auto_type_sql from where_levels_auto()
janowagner Sep 14, 2020
f3f0e85
Drop auto_type from REPORT_ITERATOR_FILTER_COLUMNS
janowagner Sep 16, 2020
46f95ab
Drop the elements from GMP XML spec.
janowagner Sep 16, 2020
8325a47
Add Changelog.
janowagner Sep 29, 2020
fcda896
Drop auto_type_sql use.
janowagner Oct 5, 2020
804a82b
Formatting fix.
janowagner Oct 5, 2020
c152989
Formatting issue.
janowagner Oct 5, 2020
bb5a4d2
Remove redudante SQL brackets.
janowagner Oct 5, 2020
57ffc48
Adjust to itertor change.
janowagner Oct 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/gmp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2019 Greenbone Networks GmbH
/* Copyright (C) 2009-2020 Greenbone Networks GmbH
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
Expand Down Expand Up @@ -8273,7 +8273,6 @@ buffer_notes_xml (GString *buffer, iterator_t *notes, int include_notes_details,
get_data_t *result_get;
result_get = report_results_get_data (1, 1,
1, /* apply_overrides */
0, /* autofp*/
0 /* min_qod */);
result_get->id = g_strdup (uuid_result);
init_result_get_iterator (&results, result_get,
Expand Down Expand Up @@ -8556,7 +8555,6 @@ buffer_overrides_xml (GString *buffer, iterator_t *overrides,
get_data_t *result_get;
result_get = report_results_get_data (1, 1,
1, /* apply_overrides */
0, /* autofp */
0 /* min_qod */);
result_get->id = g_strdup (uuid_result);
init_result_get_iterator (&results, result_get,
Expand Down Expand Up @@ -15275,7 +15273,6 @@ handle_get_results (gmp_parser_t *gmp_parser, GError **error)
NULL, /* delta_states */
NULL, /* search_phrase */
NULL, /* search_phrase_exact */
NULL, /* autofp */
&notes,
&overrides,
NULL, /* apply_overrides */
Expand Down Expand Up @@ -17141,8 +17138,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error)
if (report_counts (first_report_id,
&debugs, &holes_2, &infos_2, &logs,
&warnings_2, &false_positives,
&severity_2, apply_overrides,
0, min_qod))
&severity_2, apply_overrides, min_qod))
g_error ("%s: GET_TASKS: error getting counts for"
" first report, aborting",
__func__);
Expand All @@ -17159,8 +17155,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error)
&debugs, &holes_2, &infos_2,
&logs, &warnings_2,
&false_positives, &severity_2,
apply_overrides,
0, min_qod))
apply_overrides, min_qod))
g_error ("%s: GET_TASKS: error getting counts for"
" second report, aborting",
__func__);
Expand Down Expand Up @@ -17213,8 +17208,7 @@ handle_get_tasks (gmp_parser_t *gmp_parser, GError **error)
(last_report_id,
&debugs, &holes, &infos, &logs,
&warnings, &false_positives, &severity,
apply_overrides,
0, min_qod))
apply_overrides, min_qod))
g_error ("%s: GET_TASKS: error getting counts for"
" last report, aborting",
__func__);
Expand Down
13 changes: 5 additions & 8 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,19 +976,17 @@ delete_reports (task_t task)
* @param[in] first First row.
* @param[in] rows Number of rows.
* @param[in] apply_overrides Whether to apply overrides.
* @param[in] autofp Auto-FP value.
* @param[in] min_qod Minimum QOD.
*
* @return Filter term.
*/
static gchar *
report_results_filter_term (int first, int rows,
int apply_overrides, int autofp, int min_qod)
int apply_overrides, int min_qod)
{
return g_strdup_printf ("first=%d rows=%d"
" apply_overrides=%d autofp=%d min_qod=%d",
first, rows,
apply_overrides, autofp, min_qod);
" apply_overrides=%d min_qod=%d",
first, rows, apply_overrides, min_qod);
}


Expand All @@ -998,20 +996,19 @@ report_results_filter_term (int first, int rows,
* @param[in] first First row.
* @param[in] rows Number of rows.
* @param[in] apply_overrides Whether to apply overrides.
* @param[in] autofp Auto-FP value.
* @param[in] min_qod Minimum QOD.
*
* @return GET data struct.
*/
get_data_t*
report_results_get_data (int first, int rows,
int apply_overrides, int autofp, int min_qod)
int apply_overrides, int min_qod)
{
get_data_t* get = g_malloc (sizeof (get_data_t));
memset (get, 0, sizeof (get_data_t));
get->type = g_strdup ("result");
get->filter = report_results_filter_term (first, rows,
apply_overrides, autofp, min_qod);
apply_overrides, min_qod);

return get;
}
Expand Down
11 changes: 4 additions & 7 deletions src/manage.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2019 Greenbone Networks GmbH
/* Copyright (C) 2009-2020 Greenbone Networks GmbH
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
Expand Down Expand Up @@ -1247,7 +1247,7 @@ report_scan_result_count (report_t, const char*, const char*, int, const char*,

int
report_counts (const char*, int*, int*, int*, int*, int*, int*, double*,
int, int, int);
int, int);

int
report_counts_id (report_t, int*, int*, int*, int*, int*, int*, double*,
Expand All @@ -1258,7 +1258,7 @@ report_counts_id_no_filt (report_t, int*, int*, int*, int*, int*, int*,
double*, const get_data_t*, const char*);

get_data_t*
report_results_get_data (int, int, int, int, int);
report_results_get_data (int, int, int, int);

int
scan_start_time_epoch (report_t);
Expand Down Expand Up @@ -1536,7 +1536,7 @@ manage_filter_controls (const gchar *, int *, int *, gchar **, int *);
void
manage_report_filter_controls (const gchar *, int *, int *, gchar **, int *,
int *, gchar **, gchar **, gchar **, gchar **,
int *, int *, int *, int *, int *, gchar **);
int *, int *, int *, int *, gchar **);

gchar *
manage_clean_filter (const gchar *);
Expand Down Expand Up @@ -2966,9 +2966,6 @@ filter_term_value (const char *, const char *);
int
filter_term_apply_overrides (const char *);

int
filter_term_autofp (const char *);

int
filter_term_min_qod (const char *);

Expand Down
62 changes: 0 additions & 62 deletions src/manage_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2739,68 +2739,6 @@ create_tables ()
" (SELECT 0 AS override UNION SELECT 1 AS override) AS override_opts,"
" (SELECT 0 AS dynamic UNION SELECT 1 AS dynamic) AS dynamic_opts;");

sql ("CREATE OR REPLACE VIEW results_autofp AS"
" SELECT results.id as result, autofp_selection,"
" (CASE autofp_selection"
" WHEN 1 THEN"
" (CASE WHEN"
" (((SELECT family FROM nvts WHERE oid = results.nvt)"
" IN (" LSC_FAMILY_LIST "))"
" OR EXISTS"
" (SELECT id FROM nvts"
" WHERE oid = results.nvt"
" AND"
" (cve = ''"
" OR cve NOT IN (SELECT cve FROM nvts"
" WHERE oid"
" IN (SELECT source_name"
" FROM report_host_details"
" WHERE report_host"
" = (SELECT id"
" FROM report_hosts"
" WHERE report = %llu"
" AND host"
" = results.host)"
" AND name = 'EXIT_CODE'"
" AND value = 'EXIT_NOTVULN')"
" AND family IN (" LSC_FAMILY_LIST ")))))"
" THEN NULL"
" WHEN severity = " G_STRINGIFY (SEVERITY_ERROR) " THEN NULL"
" ELSE 1 END)"
" WHEN 2 THEN"
" (CASE WHEN"
" (((SELECT family FROM nvts WHERE oid = results.nvt)"
" IN (" LSC_FAMILY_LIST "))"
" OR EXISTS"
" (SELECT id FROM nvts AS outer_nvts"
" WHERE oid = results.nvt"
" AND"
" (cve = ''"
" OR NOT EXISTS"
" (SELECT cve FROM nvts"
" WHERE oid IN (SELECT source_name"
" FROM report_host_details"
" WHERE report_host"
" = (SELECT id"
" FROM report_hosts"
" WHERE report = results.report"
" AND host = results.host)"
" AND name = 'EXIT_CODE'"
" AND value = 'EXIT_NOTVULN')"
" AND family IN (" LSC_FAMILY_LIST ")"
/* The CVE of the result NVT is outer_nvts.cve. The CVE of the
* NVT that has registered the "closed" host detail is nvts.cve.
* Either can be a list of CVEs. */
" AND common_cve (nvts.cve, outer_nvts.cve)))))"
" THEN NULL"
" WHEN severity = " G_STRINGIFY (SEVERITY_ERROR) " THEN NULL"
" ELSE 1 END)"
" ELSE 0 END) AS autofp"
" FROM results,"
" (SELECT 0 AS autofp_selection"
" UNION SELECT 1 AS autofp_selection"
" UNION SELECT 2 AS autofp_selection) AS autofp_opts;");

sql ("CREATE OR REPLACE VIEW tls_certificate_source_origins AS"
" SELECT sources.id AS source_id, tls_certificate,"
" origin_id, origin_type, origin_data"
Expand Down
Loading