Skip to content

windows: fix calculation of "job_metadata.xml" object size#1695

Merged
BareosBot merged 3 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-windows-issues
Feb 7, 2024
Merged

windows: fix calculation of "job_metadata.xml" object size#1695
BareosBot merged 3 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-windows-issues

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Feb 2, 2024

Thank you for contributing to the Bareos Project!

This PR fixes an issue on windows that causes bareos to miscalculate the size of a restore object. This may cause the fd to crash.

This PR also removes the use of a vla inside our glob compability layer.

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)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Required backport PRs have been created
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
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@sebsura sebsura force-pushed the dev/ssura/master/fix-windows-issues branch from 3427238 to 4b75dd0 Compare February 2, 2024 07:50
@pstorz pstorz self-requested a review February 2, 2024 12:21
@pstorz pstorz changed the title windows: fix miscalculating *all* object size windows: fix miscalculating *all* object sizes Feb 2, 2024
@pstorz pstorz changed the title windows: fix miscalculating *all* object sizes windows: fix miscalculating "*all*" object size Feb 2, 2024
@pstorz pstorz changed the title windows: fix miscalculating "*all*" object size windows: fix miscalculating "job_metadata.xml" object size Feb 2, 2024
@pstorz pstorz self-assigned this Feb 2, 2024
@pstorz pstorz changed the title windows: fix miscalculating "job_metadata.xml" object size windows: fix calculation of "job_metadata.xml" object size Feb 2, 2024
sebsura and others added 3 commits February 7, 2024 14:52
BSTR_2_str converts the wide string into a multibyte string.  As such
wcslen * sizeof(wchar_t) is just wrong.  This leads to a SIGSEV on
windows sometimes.
@BareosBot BareosBot force-pushed the dev/ssura/master/fix-windows-issues branch from 76b80d9 to c26a8a5 Compare February 7, 2024 14:52
@BareosBot BareosBot merged commit 09f3654 into bareos:master Feb 7, 2024
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.

3 participants