core: fix some overlooked issues in msvc merge#1912
Conversation
core/src/lib/lex.cc
Outdated
| #if HAVE_WIN32 | ||
| add_str(lf, '\r'); | ||
| #endif |
There was a problem hiding this comment.
Should we add an \r here or not ? Im not sure what the best approach is.
There was a problem hiding this comment.
Good question. The configuration files are using unix file endings also on windows. What would be the advantage of adding \r here?
There was a problem hiding this comment.
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.
8ef6de3 to
72d9093
Compare
pstorz
left a comment
There was a problem hiding this comment.
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++] = ','; |
There was a problem hiding this comment.
Nice catch. How did you find this?
There was a problem hiding this comment.
This was previously part of the bsnprintf pr. I think i saw this when i was looking at the bsnprintf call above.
core/src/lib/lex.cc
Outdated
| #if HAVE_WIN32 | ||
| add_str(lf, '\r'); | ||
| #endif |
There was a problem hiding this comment.
Good question. The configuration files are using unix file endings also on windows. What would be the advantage of adding \r here?
8551555 to
ee13d6c
Compare
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.
This info is helpful to debug problems without access to debug info.
As this option is actually not used anywhere, we will deprecated it for now.
This is necessary for the auth_fails test as the server might close the connection (because the auth was unsuccessful) while the client still tries to read from it, causing a SIGPIPE and a failed test.
8074541 to
92baf93
Compare
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
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-toolto have some simple automated checks run and a proper changelog record added.General
Required backport PRs have been createdSource code quality
Tests