Skip to content

Commit b072395

Browse files
ozgengreenbonebot
authored andcommitted
Add: Support update_to_latest in gsad agent update flow
1 parent 11f29af commit b072395

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/gsad_gmp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19329,7 +19329,7 @@ modify_agent_gmp (gvm_connection_t *connection, credentials_t *credentials,
1932919329
gchar *xml, *response, *format;
1933019330
const char *authorized, *attempts, *delay_in_seconds, *bulk_size;
1933119331
const char *max_jitter_in_seconds, *bulk_throttle_time_in_ms,
19332-
*indexer_dir_depth;
19332+
*indexer_dir_depth, *update_to_latest;
1933319333
const char *interval_in_seconds, *miss_until_inactive, *comment;
1933419334
params_t *scheduler_cron_times;
1933519335
int ret;
@@ -19339,6 +19339,7 @@ modify_agent_gmp (gvm_connection_t *connection, credentials_t *credentials,
1933919339

1934019340
agent_ids = params_values (params, "agent_ids:");
1934119341
authorized = params_value (params, "authorized");
19342+
update_to_latest = params_value (params, "update_to_latest");
1934219343
attempts = params_value (params, "attempts");
1934319344
delay_in_seconds = params_value (params, "delay_in_seconds");
1934419345
bulk_size = params_value (params, "bulk_size");
@@ -19365,6 +19366,7 @@ modify_agent_gmp (gvm_connection_t *connection, credentials_t *credentials,
1936519366
if (has_config)
1936619367
{
1936719368
CHECK_VARIABLE_INVALID (authorized, "Save Agent List");
19369+
CHECK_VARIABLE_INVALID (update_to_latest, "Save Agent List");
1936819370
CHECK_VARIABLE_INVALID (attempts, "Save Agent List");
1936919371
CHECK_VARIABLE_INVALID (delay_in_seconds, "Save Agent List");
1937019372
CHECK_VARIABLE_INVALID (bulk_size, "Save Agent List");
@@ -19423,6 +19425,7 @@ modify_agent_gmp (gvm_connection_t *connection, credentials_t *credentials,
1942319425
"<modify_agent>"
1942419426
"%s" /* agents */
1942519427
"<authorized>%d</authorized>"
19428+
"<update_to_latest>%d</update_to_latest>"
1942619429
"<config>"
1942719430
"<agent_control>"
1942819431
"<retry>"
@@ -19447,7 +19450,7 @@ modify_agent_gmp (gvm_connection_t *connection, credentials_t *credentials,
1944719450
"<comment>%%s</comment>"
1944819451
"</modify_agent>",
1944919452
agents_element->str, authorized ? strcmp (authorized, "0") : 0,
19450-
items_xml->str);
19453+
update_to_latest ? strcmp (update_to_latest, "0") : 0, items_xml->str);
1945119454

1945219455
response = NULL;
1945319456
entity = NULL;

src/gsad_validator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ init_validator ()
556556

557557
gvm_validator_alias (validator, "add_tag", "boolean");
558558
gvm_validator_alias (validator, "authorized", "boolean");
559+
gvm_validator_alias (validator, "update_to_latest", "boolean");
559560
gvm_validator_alias (validator, "accept_invalid_certs", "boolean");
560561
gvm_validator_alias (validator, "registry_allow_insecure", "boolean");
561562
gvm_validator_alias (validator, "agent_ids:name", "number");

0 commit comments

Comments
 (0)