Author: bricks
Date: 2016-10-12 11:56:01 +0200 (Wed, 12 Oct 2016)
New Revision: 26376

Modified:
   trunk/gsa/ChangeLog
   trunk/gsa/src/gsad_omp.c
Log:
* src/gsad_omp.c (create_target_omp): Fix checking hosts_filter parameter.
The hosts_filter parameter is only required and used if target_source is set
to asset_hosts.

Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog 2016-10-12 09:11:21 UTC (rev 26375)
+++ trunk/gsa/ChangeLog 2016-10-12 09:56:01 UTC (rev 26376)
@@ -1,3 +1,9 @@
+2016-10-12 Bj�rn Ricks <bjoern.ri...@greenbone.net>
+
+       * src/gsad_omp.c (create_target_omp): Fix checking hosts_filter 
parameter.
+       The hosts_filter parameter is only required and used if target_source 
is set
+       to asset_hosts.
+
 2016-10-12  Timo Pollmeier <timo.pollme...@greenbone.net>
 
        * src/html/classic/omp.xsl (report-hosts-link): Get number of results

Modified: trunk/gsa/src/gsad_omp.c
===================================================================
--- trunk/gsa/src/gsad_omp.c    2016-10-12 09:11:21 UTC (rev 26375)
+++ trunk/gsa/src/gsad_omp.c    2016-10-12 09:56:01 UTC (rev 26376)
@@ -9696,11 +9696,11 @@
                             "Given target_source was invalid",
                             G_STRINGIFY (MHD_HTTP_BAD_REQUEST),
                             "Create Target", "new_target");
-  CHECK_PARAM_INVALID (hosts_filter, "Create Target", "new_target");
-  if (hosts_filter == NULL && strcmp (target_source, "asset_hosts") == 0)
-    return new_target (credentials, params,
-                       GSAD_MESSAGE_INVALID_PARAM ("Create Target"),
-                       response_data);
+
+  /* require hosts_filter if target_source is "asset_hosts" */
+  if (strcmp (target_source, "asset_hosts") == 0)
+    CHECK_PARAM_INVALID (hosts_filter, "Create Target", "new_target");
+
   CHECK_PARAM_INVALID (comment, "Create Target", "new_target");
   CHECK_PARAM_INVALID (port_list_id, "Create Target", "new_target");
   CHECK_PARAM_INVALID (target_ssh_credential, "Create Target", "new_target");

_______________________________________________
Openvas-commits mailing list
Openvas-commits@wald.intevation.org
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-commits

Reply via email to