Added missing code to save several values from the agent task dialog. - #448
Added missing code to save several values from the agent task dialog.#448jhelmold wants to merge 2 commits into
Conversation
| CHECK_VARIABLE_INVALID (agent_group_id, "Save Agent Group Task"); | ||
| CHECK_VARIABLE_INVALID (in_assets, "Save Task"); | ||
|
|
||
| if (!strcmp (in_assets, "1")) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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 = ""; |
There was a problem hiding this comment.
I don't think this is correct. In this case CHECK_VARIABLE_INVALID (min_qod, "Save Agent Group Task"); below will not work.
| 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", |
There was a problem hiding this comment.
As i wrote strcmp is very confusing to read.
| schedule_periods, strcmp (in_assets, "0") ? "yes" : "no", | |
| schedule_periods, str_equal(in_assets, "1") ? "yes" : "no", |
| 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); |
There was a problem hiding this comment.
| strcmp (apply_overrides, "0") ? "yes" : "no", min_qod); | |
| str_equal (apply_overrides, "1") ? "yes" : "no", min_qod); |
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.