Skip to content

Commit

Permalink
Merge pull request #1026
Browse files Browse the repository at this point in the history
dird: avoid crash in job listing when "current" and "count" are both specified at the same time
  • Loading branch information
pstorz committed Dec 16, 2021
2 parents 0fa6bdc + bf5215e commit 912b3e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- [Issue #847]: fix for CVE-2017-14610 PID files that could be exploited on certain systems [PR #928]
- webui: fix a layout corner case where top navbar is hiding navtabs [PR #1022]
- webui: client details now can be displayed for client names containing dots [PR #1023]
- dird: avoid crash in job listing when "current" and "count" are both specified at the same time [PR #1026]

### Added
- systemtests: make database credentials configurable [PR #950]
Expand Down Expand Up @@ -357,7 +358,10 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #999]: https://github.com/bareos/bareos/pull/999
[PR #1007]: https://github.com/bareos/bareos/pull/1007
[PR #1008]: https://github.com/bareos/bareos/pull/1008
[PR #1017]: https://github.com/bareos/bareos/pull/1017
[PR #1018]: https://github.com/bareos/bareos/pull/1018
[PR #1020]: https://github.com/bareos/bareos/pull/1020
[PR #1022]: https://github.com/bareos/bareos/pull/1022
[PR #1023]: https://github.com/bareos/bareos/pull/1023
[PR #1026]: https://github.com/bareos/bareos/pull/1026
[unreleased]: https://github.com/bareos/bareos/tree/master
24 changes: 12 additions & 12 deletions core/src/dird/ua_output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -591,29 +591,29 @@ static bool DoListCmd(UaContext* ua, const char* cmd, e_list_type llist)

switch (llist) {
case VERT_LIST:
if (!count) {
if (!count) { // count result is one column, no filtering
SetAclFilter(ua, 2, Job_ACL); /* JobName */
SetAclFilter(ua, 7, Client_ACL); /* ClientName */
SetAclFilter(ua, 21, Pool_ACL); /* PoolName */
SetAclFilter(ua, 24, FileSet_ACL); /* FilesetName */
}
if (current) {
SetResFilter(ua, 2, R_JOB); /* JobName */
SetResFilter(ua, 7, R_CLIENT); /* ClientName */
SetResFilter(ua, 21, R_POOL); /* PoolName */
SetResFilter(ua, 24, R_FILESET); /* FilesetName */
if (current) {
SetResFilter(ua, 2, R_JOB); /* JobName */
SetResFilter(ua, 7, R_CLIENT); /* ClientName */
SetResFilter(ua, 21, R_POOL); /* PoolName */
SetResFilter(ua, 24, R_FILESET); /* FilesetName */
}
}
if (enabled) { SetEnabledFilter(ua, 2, R_JOB); /* JobName */ }
if (disabled) { SetDisabledFilter(ua, 2, R_JOB); /* JobName */ }
break;
default:
if (!count) {
if (!count) { // count result is one column, no filtering
SetAclFilter(ua, 1, Job_ACL); /* JobName */
SetAclFilter(ua, 2, Client_ACL); /* ClientName */
}
if (current) {
SetResFilter(ua, 1, R_JOB); /* JobName */
SetResFilter(ua, 2, R_CLIENT); /* ClientName */
if (current) {
SetResFilter(ua, 1, R_JOB); /* JobName */
SetResFilter(ua, 2, R_CLIENT); /* ClientName */
}
}
if (enabled) { SetEnabledFilter(ua, 1, R_JOB); /* JobName */ }
if (disabled) { SetDisabledFilter(ua, 1, R_JOB); /* JobName */ }
Expand Down

0 comments on commit 912b3e0

Please sign in to comment.