Skip to content

Commit

Permalink
Merge pull request #790 from janowagner/drop_allsecinfo
Browse files Browse the repository at this point in the history
Drop "allinfo" as get_info type
  • Loading branch information
mattmundell authored Oct 15, 2019
2 parents 5b41558 + 08d3f88 commit 52a3532
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 743 deletions.
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

0 comments on commit 52a3532

Please sign in to comment.