Skip to content

Commit 98968c3

Browse files
authored
Merge pull request #2432 from greenbone/fix-port-host-details
Fix: port host details
2 parents 0170e58 + 72ddc09 commit 98968c3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/manage_sql.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57153,7 +57153,8 @@ convert_openvasd_type_to_osp_type (const char *openvasd_type)
5715357153
return g_strdup ("Alarm");
5715457154
else if (g_strcmp0 (openvasd_type, "error") == 0)
5715557155
return g_strdup ("Error Message");
57156-
else if (g_strcmp0 (openvasd_type, "log") == 0)
57156+
else if (g_strcmp0 (openvasd_type, "log") == 0
57157+
|| g_strcmp0 (openvasd_type, "host_detail") == 0)
5715757158
return g_strdup ("Log Message");
5715857159

5715957160
return g_strdup (openvasd_type);
@@ -57185,18 +57186,11 @@ add_openvasd_result_to_report (openvasd_result_t res, gpointer *results_aux)
5718557186
test_id = res->oid;
5718657187
host = res->ip_address;
5718757188
hostname = res->hostname;
57188-
57189-
if (res && res->port == 0 && !strcmp (type, "host_detail") &&
57190-
res->detail_value && *res->detail_value)
57191-
port = g_strdup ("general/Host_Details");
57192-
else if (res->port > 0)
57193-
port = g_strdup_printf ("%d/%s", res->port, res->protocol);
57194-
else
57195-
port = g_strdup_printf ("general/%s", res->protocol);
57189+
port = g_strdup (res->port);
5719657190

5719757191
/* Add report host if it doesn't exist. */
5719857192
manage_report_host_add (rep_aux->report, host, 0, 0);
57199-
if (!strcmp (type, "host_detail"))
57193+
if (!strcmp (port, "general/Host_Details"))
5720057194
{
5720157195
gchar *hash_value = NULL;
5720257196
if (!check_host_detail_exists (rep_aux->report, host,

0 commit comments

Comments
 (0)