Skip to content

Commit

Permalink
Merge pull request #1426 from timopollmeier/get_info-nvts
Browse files Browse the repository at this point in the history
Add standard info elem fields for NVTs in get_info
  • Loading branch information
bjoernricks authored Feb 25, 2021
2 parents df9da22 + 2b7b43f commit 66e3d4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 43 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [20.8.2] (unreleased)

### Added
- Add standard info elem fields for NVTs in get_info [#1426](https://github.com/greenbone/gvmd/pull/1426)

### Changed

Expand Down
44 changes: 1 addition & 43 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13032,54 +13032,12 @@ handle_get_info (gmp_parser_t *gmp_parser, GError **error)
info_count = cve_info_count;
get_info_data->get.subtype = g_strdup ("cve");
}
else if ((g_strcmp0 ("nvt", get_info_data->type) == 0)
&& (get_info_data->name == NULL)
&& (get_info_data->get.id == NULL))
else if (g_strcmp0 ("nvt", get_info_data->type) == 0)
{
init_info_iterator = init_nvt_info_iterator;
info_count = nvt_info_count;
get_info_data->get.subtype = g_strdup ("nvt");
}
else if (g_strcmp0 ("nvt", get_info_data->type) == 0)
{
gchar *result;

get_info_data->get.subtype = g_strdup ("nvt");

manage_read_info (get_info_data->type, get_info_data->get.id,
get_info_data->name, &result);
if (result)
{
SEND_GET_START ("info");
SEND_TO_CLIENT_OR_FAIL ("<info>");
SEND_TO_CLIENT_OR_FAIL (result);
SEND_TO_CLIENT_OR_FAIL ("</info>");
SEND_TO_CLIENT_OR_FAIL ("<details>1</details>");
SEND_GET_END ("info", &get_info_data->get, 1, 1);
g_free (result);
get_info_data_reset (get_info_data);
set_client_state (CLIENT_AUTHENTIC);
return;
}
else
{
if (send_find_error_to_client ("get_info",
get_info_data->name
? "name"
: "ID",
get_info_data->name
? get_info_data->name
: get_info_data->get.id,
gmp_parser))
{
error_send_to_client (error);
return;
}
get_info_data_reset (get_info_data);
set_client_state (CLIENT_AUTHENTIC);
return;
}
}
else if (g_strcmp0 ("ovaldef", get_info_data->type) == 0)
{
init_info_iterator = init_ovaldef_info_iterator;
Expand Down

0 comments on commit 66e3d4e

Please sign in to comment.