Skip to content

Commit

Permalink
Remove source_iface from gsad
Browse files Browse the repository at this point in the history
  • Loading branch information
saberlynx committed May 6, 2021
1 parent 340ad6f commit 3d7a4e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion gsad/src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ init_validator ()
"^(-1(\\.0)?|[0-9](\\.[0-9])?|10(\\.0)?)$");
gvm_validator_add (validator, "severity_optional",
"^(-1(\\.0)?|[0-9](\\.[0-9])?|10(\\.0)?)?$");
gvm_validator_add (validator, "source_iface", "^(.*){1,16}$");
gvm_validator_add (validator, "uuid", "^[0-9abcdefABCDEF\\-]{1,40}$");
gvm_validator_add (validator, "usage_type", "^(audit|policy|scan|)$");
/* This must be "login" with space and comma. */
Expand Down
24 changes: 4 additions & 20 deletions gsad/src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ create_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
const char *name, *comment, *config_id, *target_id, *scanner_type;
const char *scanner_id, *schedule_id, *schedule_periods;
const char *max_checks, *max_hosts;
const char *in_assets, *hosts_ordering, *alterable, *source_iface;
const char *in_assets, *hosts_ordering, *alterable;
const char *add_tag, *tag_id, *auto_delete, *auto_delete_data;
const char *apply_overrides, *min_qod, *usage_type;
gchar *name_escaped, *comment_escaped;
Expand All @@ -2116,7 +2116,6 @@ create_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
scanner_type = params_value (params, "scanner_type");
schedule_id = params_value (params, "schedule_id");
schedule_periods = params_value (params, "schedule_periods");
source_iface = params_value (params, "source_iface");
tag_id = params_value (params, "tag_id");
target_id = params_value (params, "target_id");
usage_type = params_value (params, "usage_type");
Expand All @@ -2126,15 +2125,13 @@ create_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
{
hosts_ordering = "";
max_checks = "";
source_iface = "";
max_hosts = "";
}
else if (!strcmp (scanner_type, "3"))
{
config_id = "";
hosts_ordering = "";
max_checks = "";
source_iface = "";
max_hosts = "";
}

Expand Down Expand Up @@ -2180,7 +2177,6 @@ create_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
}

CHECK_VARIABLE_INVALID (max_checks, "Create Task");
CHECK_VARIABLE_INVALID (source_iface, "Create Task");
CHECK_VARIABLE_INVALID (auto_delete, "Create Task");
CHECK_VARIABLE_INVALID (auto_delete_data, "Create Task");
CHECK_VARIABLE_INVALID (max_hosts, "Create Task");
Expand Down Expand Up @@ -2252,10 +2248,6 @@ create_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
"<value>%s</value>"
"</preference>"
"<preference>"
"<scanner_name>source_iface</scanner_name>"
"<value>%s</value>"
"</preference>"
"<preference>"
"<scanner_name>auto_delete</scanner_name>"
"<value>%s</value>"
"</preference>"
Expand All @@ -2270,7 +2262,7 @@ create_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
config_id, schedule_periods, schedule_element, alert_element->str,
target_id, scanner_id, hosts_ordering, name_escaped, comment_escaped,
max_checks, max_hosts, strcmp (in_assets, "0") ? "yes" : "no",
strcmp (apply_overrides, "0") ? "yes" : "no", min_qod, source_iface,
strcmp (apply_overrides, "0") ? "yes" : "no", min_qod,
auto_delete, auto_delete_data, alterable ? strcmp (alterable, "0") : 0,
usage_type);

Expand Down Expand Up @@ -2439,7 +2431,7 @@ save_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
gchar *html, *response, *format;
const char *comment, *name, *schedule_id, *in_assets;
const char *scanner_id, *task_id, *max_checks, *max_hosts;
const char *config_id, *target_id, *hosts_ordering, *alterable, *source_iface;
const char *config_id, *target_id, *hosts_ordering, *alterable;
const char *scanner_type, *schedule_periods, *auto_delete, *auto_delete_data;
const char *apply_overrides, *min_qod;
int ret;
Expand All @@ -2463,7 +2455,6 @@ save_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
scanner_type = params_value (params, "scanner_type");
schedule_id = params_value (params, "schedule_id");
schedule_periods = params_value (params, "schedule_periods");
source_iface = params_value (params, "source_iface");
target_id = params_value (params, "target_id");
task_id = params_value (params, "task_id");

Expand All @@ -2474,15 +2465,13 @@ save_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
{
hosts_ordering = "";
max_checks = "";
source_iface = "";
max_hosts = "";
}
else if (!strcmp (scanner_type, "3"))
{
config_id = "0";
hosts_ordering = "";
max_checks = "";
source_iface = "";
max_hosts = "";
}
}
Expand All @@ -2502,7 +2491,6 @@ save_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
CHECK_VARIABLE_INVALID (scanner_id, "Save Task");
CHECK_VARIABLE_INVALID (task_id, "Save Task");
CHECK_VARIABLE_INVALID (max_checks, "Save Task");
CHECK_VARIABLE_INVALID (source_iface, "Save Task");
CHECK_VARIABLE_INVALID (auto_delete, "Save Task");
CHECK_VARIABLE_INVALID (auto_delete_data, "Save Task");
CHECK_VARIABLE_INVALID (max_hosts, "Save Task");
Expand Down Expand Up @@ -2582,10 +2570,6 @@ save_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
"<value>%%s</value>"
"</preference>"
"<preference>"
"<scanner_name>source_iface</scanner_name>"
"<value>%%s</value>"
"</preference>"
"<preference>"
"<scanner_name>auto_delete</scanner_name>"
"<value>%%s</value>"
"</preference>"
Expand All @@ -2605,7 +2589,7 @@ save_task_gmp (gvm_connection_t *connection, credentials_t *credentials,
schedule_periods, scanner_id, max_checks, max_hosts,
strcmp (in_assets, "0") ? "yes" : "no",
strcmp (apply_overrides, "0") ? "yes" : "no", min_qod,
source_iface, auto_delete, auto_delete_data);
auto_delete, auto_delete_data);
g_free (format);

g_string_free (alert_element, TRUE);
Expand Down

0 comments on commit 3d7a4e7

Please sign in to comment.