Skip to content

Commit

Permalink
Merge pull request #1428 from greenbone/mergify/bp/master/pr-1426
Browse files Browse the repository at this point in the history
Add standard info elem fields for NVTs in get_info (bp #1426)
  • Loading branch information
timopollmeier authored Feb 25, 2021
2 parents 09fe24c + 7094537 commit a36dd25
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 @@ -62,6 +62,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 @@ -12983,54 +12983,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 a36dd25

Please sign in to comment.