Skip to content

dird: avoid crash in job listing when "current" and "count" are both specified at the same time#1026

Merged
pstorz merged 2 commits intomasterfrom
dev/pstorz/master/fix-list-jobs-current-count-crash
Dec 16, 2021
Merged

dird: avoid crash in job listing when "current" and "count" are both specified at the same time#1026
pstorz merged 2 commits intomasterfrom
dev/pstorz/master/fix-list-jobs-current-count-crash

Conversation

@pstorz
Copy link
Member

@pstorz pstorz commented Dec 15, 2021

If both keywords count and current were given in the "list jobs" command, the output filter for the
rows were set while the result only will contain one column. When the
filter accesses the non-existent column it crashes.

Now only the filters for current are set if count is not set.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing

@pstorz pstorz changed the title ua_output.cc: do not set filter for current output if count is also set ua_output.cc: avoid crash in job listing when "current" and "count" are both specified at the same time Dec 15, 2021
@alaaeddineelamri
Copy link
Contributor

if we merge PR #1025 first, we can add a test to the python-bareos list_jobs test

@pstorz pstorz requested a review from frb121 December 16, 2021 12:34
@pstorz pstorz self-assigned this Dec 16, 2021
@pstorz pstorz force-pushed the dev/pstorz/master/fix-list-jobs-current-count-crash branch from a31a6b6 to 3653d91 Compare December 16, 2021 12:55
If both keywords count and current were given, the output filter for the
rows were set while the result only will contain one column. When the
filter accesses the non-existent column it crashes.

Now only the filters for current are set if count is not set.
@pstorz pstorz force-pushed the dev/pstorz/master/fix-list-jobs-current-count-crash branch from 3653d91 to bf5215e Compare December 16, 2021 12:59
@pstorz pstorz changed the title ua_output.cc: avoid crash in job listing when "current" and "count" are both specified at the same time dird: avoid crash in job listing when "current" and "count" are both specified at the same time Dec 16, 2021
Copy link
Contributor

@frb121 frb121 left a comment

Choose a reason for hiding this comment

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

The PR looks good to me.

@pstorz pstorz merged commit 912b3e0 into master Dec 16, 2021
@pstorz pstorz deleted the dev/pstorz/master/fix-list-jobs-current-count-crash branch December 16, 2021 14:08
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.

4 participants