Skip to content

core: fix some overlooked issues in msvc merge#1912

Merged
BareosBot merged 34 commits intomasterfrom
dev/ssura/master/fix-bad-msvc-rebase-issues
Aug 22, 2024
Merged

core: fix some overlooked issues in msvc merge#1912
BareosBot merged 34 commits intomasterfrom
dev/ssura/master/fix-bad-msvc-rebase-issues

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Aug 2, 2024

Thank you for contributing to the Bareos Project!

Some issues in the msvc native build pr were overlooked, e.g. the removal of -Wshadow. This pr fixes those issues.
This pr also addresses:

It also takes care of some of the warnings reported by the windows native build.
This pr also detects some new bad configurations; in some cases we require the ndmp password to be stored in clear text while we want it as md5 in others. This can lead to wrong configuration parses if both passes do not agree on which password to use.
This pr adds detection for that.

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
    Required backport PRs have been created
  • Correct milestone is set
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 added this to the 24.0.0 milestone Aug 2, 2024
@sebsura sebsura self-assigned this Aug 2, 2024
@sebsura sebsura changed the title Dev/ssura/master/fix bad msvc rebase issues core: fix some overlooked issues in msvc merge Aug 2, 2024
@sebsura sebsura requested a review from pstorz August 2, 2024 11:04
@sebsura sebsura added the removal this PR removes functionality label Aug 14, 2024
@sebsura sebsura linked an issue Aug 14, 2024 that may be closed by this pull request
Comment on lines +768 to +770
#if HAVE_WIN32
add_str(lf, '\r');
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we add an \r here or not ? Im not sure what the best approach is.

Copy link
Member

Choose a reason for hiding this comment

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

Good question. The configuration files are using unix file endings also on windows. What would be the advantage of adding \r here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I figured that there might be windows specific things that may need windows line endings to work. But i guess in that case we probably wouldve gotten bug reports by now as that is currently also not possible.

@sebsura sebsura force-pushed the dev/ssura/master/fix-bad-msvc-rebase-issues branch 2 times, most recently from 8ef6de3 to 72d9093 Compare August 14, 2024 07:12
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. Maybe we want to talk about the comments.


if (add_suffix) {
if (len) dest[len++] = ',';
if (len > 0 && (len + 1) < str_size) dest[len++] = ',';
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch. How did you find this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was previously part of the bsnprintf pr. I think i saw this when i was looking at the bsnprintf call above.

Comment on lines +768 to +770
#if HAVE_WIN32
add_str(lf, '\r');
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Good question. The configuration files are using unix file endings also on windows. What would be the advantage of adding \r here?

@sebsura sebsura force-pushed the dev/ssura/master/fix-bad-msvc-rebase-issues branch 2 times, most recently from 8551555 to ee13d6c Compare August 22, 2024 07:34
arogge and others added 15 commits August 22, 2024 08:46
item->code for autopasswords discriminates between cleartext & md5
in-memory-storage.  item->flags may have CFG_ITEM_REQUIRED set.
We accessed a nullptr if the program quits during the parsing stage as
me is not yet initialized.
Both pass1 and pass2 should agree on what kind of password is getting
parsed.  If Protocol is defined last and set to
something requiring clear text passwords, then this would fail as
bareos loads an md5 password instead.
@BareosBot BareosBot force-pushed the dev/ssura/master/fix-bad-msvc-rebase-issues branch from 8074541 to 92baf93 Compare August 22, 2024 08:46
@BareosBot BareosBot merged commit 3ae7a6e into master Aug 22, 2024
@BareosBot BareosBot deleted the dev/ssura/master/fix-bad-msvc-rebase-issues branch August 22, 2024 08:46
@sebsura sebsura mentioned this pull request Nov 13, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

removal this PR removes functionality

Projects

None yet

4 participants