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

Improve handling of http parameters and arguments for gmp #1355

Merged
merged 16 commits into from
Jun 6, 2019
Merged

Improve handling of http parameters and arguments for gmp #1355

merged 16 commits into from
Jun 6, 2019

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented May 3, 2019

Checklist:

@bjoernricks bjoernricks marked this pull request as ready for review May 3, 2019 11:42
@bjoernricks bjoernricks requested review from a team and swaterkamp May 3, 2019 11:42
gsad/src/gsad.c Outdated Show resolved Hide resolved
gsad/src/gsad_gmp.c Outdated Show resolved Hide resolved
gsad/src/gsad.c Show resolved Hide resolved
gsad/src/gsad_gmp.c Show resolved Hide resolved
gsad/src/gsad_gmp.c Show resolved Hide resolved
@timopollmeier
Copy link
Member

Aside from the things I've noted above I've also noticed that the "Rows Per Page" setting is now ignored.
GSAd took care of this before but it may be a good idea to simplify it in that regard and move some of this to GVMd and the JS part of GSA.

@bjoernricks
Copy link
Contributor Author

Aside from the things I've noted above I've also noticed that the "Rows Per Page" setting is now ignored.
GSAd took care of this before but it may be a good idea to simplify it in that regard and move some of this to GVMd and the JS part of GSA.

Yes the web server should be only a proxy between GSA and gvmd and therefore all request preparation and params should be done in the js code now.

Abstract adding arguments into a c structure and functions.
Add gsad_gmp_arguments.c and gsad_gmp_request.c as depdendencies for
gsad.
* Extract a get_entities function from get_many and handle only default
  arguments in get_many additionally.
* Update get_tasks use get_many and get_reports_gmp to use get_entities
  directly.
* Use gmp_arguments_t to avoid char hacking for filters
* Drop extra get_reports function
* Drop special handlings from get_many
* Update get_assets to use gmp_arguments
* Require asset_type param
Don't request tasks and filters in get_alerts.
Don't remove filter params before its values are copied. The char data
is feed when params_remove is called. Therefore the freed memory has
been accessed here.
Don't add the special handling of the plural type to get_many. Instead
pass the correct command types to the function.
This function isn't used in GSA.
By removing the support for the extra_xml param at get_many and
get_entities the extra functions for each get commands have become
obsolete too.
Don't request report formats, tasks and filters in get_alert. This has
to be and is done in GSA directly
}

void
gmp_arguments_free (gmp_arguments_t *arguments)
Copy link
Member

Choose a reason for hiding this comment

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

The _free in the function name makes it sound like it will immediately free the memory of the data structure, so maybe _unref would be better.
I don't want to hold this back any longer, so I'd be fine if you changed this in another PR or we discussed this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I thinks this is a leftover. I couldn't agree on using referencing or freeing with myself ;-) I'll change it in a future PR. Thanks a lot!

@bjoernricks bjoernricks merged commit b5ebe8f into greenbone:master Jun 6, 2019
@bjoernricks bjoernricks deleted the gmp-arguments branch June 6, 2019 10:16
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