Skip to content

Added missing code to save several values from the agent task dialog. - #448

Open
jhelmold wants to merge 2 commits into
mainfrom
GEA-2022_Min_QoD_not_configurable_for_Agent_tasks
Open

Added missing code to save several values from the agent task dialog.#448
jhelmold wants to merge 2 commits into
mainfrom
GEA-2022_Min_QoD_not_configurable_for_Agent_tasks

Conversation

@jhelmold

@jhelmold jhelmold commented Aug 28, 2026

Copy link
Copy Markdown
Member

What

Added missing code to save the values "in assets", "apply overrides" and "min qod" from the agent task dialog in gvmd.

Why

This was a bug.

References

GEA-2022

Checklist

Tested manually on my local development system.

@jhelmold
jhelmold marked this pull request as ready for review August 28, 2026 11:36
@jhelmold
jhelmold requested review from a team as code owners August 28, 2026 11:36
@greenbonebot
greenbonebot enabled auto-merge (rebase) August 28, 2026 11:36
Comment thread src/gsad_gmp.c
CHECK_VARIABLE_INVALID (agent_group_id, "Save Agent Group Task");
CHECK_VARIABLE_INVALID (in_assets, "Save Task");

if (!strcmp (in_assets, "1"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love if we can use str_equal from gsad_utils here. strcmp is very confusing to read if C is not your daily business.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't understand the desired logic here. if in_assets is set apply_overrides and min_qod are validated? what's the connection here? I thought all three values are independent of each other.

IMHO also it is best to not add to specific business logic into gsad. Business logic belongs to gvmd. gsad should only forward things it gets from GSA with validation and cleanup as little as possible.

Comment thread src/gsad_gmp.c
schedule_periods = params_value (params, "schedule_periods");
min_qod = params_value (params, "min_qod");
if (!params_given (params, "min_qod") || !params_valid (params, "min_qod"))
min_qod = "";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct. In this case CHECK_VARIABLE_INVALID (min_qod, "Save Agent Group Task"); below will not work.

Comment thread src/gsad_gmp.c
ret = gmpf (connection, credentials, NULL, &entity, response_data, format,
task_id, name, comment, agent_group_id, schedule_id,
schedule_periods);
schedule_periods, strcmp (in_assets, "0") ? "yes" : "no",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i wrote strcmp is very confusing to read.

Suggested change
schedule_periods, strcmp (in_assets, "0") ? "yes" : "no",
schedule_periods, str_equal(in_assets, "1") ? "yes" : "no",

Comment thread src/gsad_gmp.c
task_id, name, comment, agent_group_id, schedule_id,
schedule_periods);
schedule_periods, strcmp (in_assets, "0") ? "yes" : "no",
strcmp (apply_overrides, "0") ? "yes" : "no", min_qod);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
strcmp (apply_overrides, "0") ? "yes" : "no", min_qod);
str_equal (apply_overrides, "1") ? "yes" : "no", min_qod);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants