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 "allinfo" as get_info type #790

Merged
merged 11 commits into from
Oct 15, 2019
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add NULL check in nvts_feed_version_epoch [#768](https://github.com/greenbone/gvmd/pull/768)

### Removed
- Remove suport for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)

[20.04]: https://github.com/greenbone/gvmd/compare/gvmd-9.0...master

Expand Down
27 changes: 1 addition & 26 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14166,8 +14166,6 @@ handle_get_info (gmp_parser_t *gmp_parser, GError **error)
name = g_strdup ("DFN-CERT");
else if (strcmp (get_info_data->type, "nvt") == 0)
name = g_strdup ("NVT");
else if (strcmp (get_info_data->type, "allinfo") == 0)
name = g_strdup ("All SecInfo");
else
{
if (send_find_error_to_client ("get_info", "type",
Expand Down Expand Up @@ -14273,12 +14271,6 @@ handle_get_info (gmp_parser_t *gmp_parser, GError **error)
info_count = dfn_cert_adv_info_count;
get_info_data->get.subtype = g_strdup ("dfn_cert_adv");
}
else if (g_strcmp0 ("allinfo", get_info_data->type) == 0)
{
init_info_iterator = init_all_info_iterator;
info_count = all_info_count;
get_info_data->get.subtype = g_strdup ("allinfo");
}
else
{
if (send_find_error_to_client ("get_info", "type",
Expand Down Expand Up @@ -14542,18 +14534,6 @@ handle_get_info (gmp_parser_t *gmp_parser, GError **error)
return;
}
}
else if (g_strcmp0 ("allinfo", get_info_data->type) == 0)
{
const char *extra = all_info_iterator_extra (&info);
xml_string_append (result,
"<allinfo>"
"<type>%s</type>"
"<extra>%s</extra>"
"<severity>%s</severity>",
all_info_iterator_type (&info),
extra ? extra : "",
all_info_iterator_severity (&info));
}

/* Append raw data if full details are requested */

Expand Down Expand Up @@ -14587,12 +14567,7 @@ handle_get_info (gmp_parser_t *gmp_parser, GError **error)
? info_name_count (get_info_data->type, get_info_data->name)
: info_count (&get_info_data->get));

if (strcmp (get_info_data->type, "allinfo"))
SEND_GET_END ("info", &get_info_data->get, count, filtered);
else
send_get_end ("info", &get_info_data->get, count, filtered,
total_info_count (&get_info_data->get, 0),
gmp_parser->client_writer, gmp_parser->client_writer_data);
SEND_GET_END ("info", &get_info_data->get, count, filtered);

get_info_data_reset (get_info_data);
set_client_state (CLIENT_AUTHENTIC);
Expand Down
18 changes: 0 additions & 18 deletions src/manage.h
Original file line number Diff line number Diff line change
Expand Up @@ -3827,24 +3827,6 @@ init_nvt_dfn_cert_adv_iterator (iterator_t*, const char*, int, const char*);

/* All SecInfo Data */

int
all_info_count (const get_data_t *);

int
total_info_count (const get_data_t *, int);

int
init_all_info_iterator (iterator_t*, get_data_t*, const char*);

const char*
all_info_iterator_type (iterator_t*);

const char*
all_info_iterator_extra (iterator_t*);

const char*
all_info_iterator_severity (iterator_t*);

void
init_ovaldi_file_iterator (iterator_t*);

Expand Down
Loading