Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check hosts in MODIFY_OVERRIDE, as in CREATE_OVERRIDE #1162

Merged
merged 3 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix gvm-manage-certs. [#1140](https://github.com/greenbone/gvmd/pull/1140)
- Fix CVE scanner and results handling [#1141](https://github.com/greenbone/gvmd/pull/1141)
- Handle INTERRUPTED scans [#1146](https://github.com/greenbone/gvmd/pull/1146)
- Check hosts in MODIFY_OVERRIDE, as in CREATE_OVERRIDE [#1162](https://github.com/greenbone/gvmd/pull/1162)

### Removed
- Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)
Expand Down
14 changes: 14 additions & 0 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23675,6 +23675,8 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,

case CLIENT_MODIFY_OVERRIDE:
{
int max;

if (acl_user_may ("modify_override") == 0)
{
SEND_TO_CLIENT_OR_FAIL
Expand All @@ -23693,6 +23695,18 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context,
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("modify_override",
"A TEXT entity is required"));
else if (modify_override_data->hosts
&& ((max = manage_count_hosts (modify_override_data->hosts,
NULL))
== -1))
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("modify_override",
"Error in host specification"));
else if (modify_override_data->hosts && (max > manage_max_hosts ()))
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("modify_override",
"Host specification exceeds maximum number"
" of hosts"));
else switch (modify_override (modify_override_data->override_id,
modify_override_data->active,
modify_override_data->nvt_oid,
Expand Down