Skip to content

use correct type for drive-parameter in stored/dir_cmd.cc#850

Merged
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/improve-testing
Jun 15, 2021
Merged

use correct type for drive-parameter in stored/dir_cmd.cc#850
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/improve-testing

Conversation

@arogge
Copy link
Member

@arogge arogge commented Jun 14, 2021

This PR fixes an issue with the drive-parameter in SD's director command parsing. This issue is only visible on big endian machines.

Please check

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

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
Tests
  • The problem this PR fixes broke a test on big endian machines.

arogge added 2 commits June 14, 2021 22:00
dir_cmd.cc uses scanf() to fill integers. As %hd is used, pointers to
(short int)* was expected, but int* was passed. While this works on
little endian, it breaks on big endian.
This patch now uses short int where applicable.
previously the SYSTEMTEST_TIMEOUT was not passed correctly leading to
systemtests with a timeout of 0 seconds.
@arogge arogge requested a review from pstorz June 14, 2021 20:11
@pstorz pstorz changed the title fix mishandling of drive-parameter in stored/dir_cmd.cc use correct type for drive-parameter in stored/dir_cmd.cc Jun 15, 2021
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

Looks good. I think we need backports to 20 and 19.2.

@arogge arogge merged commit 3934b8b into bareos:master Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants