Skip to content

bareos-config-libs: double quote dbconfig values#2111

Merged
BareosBot merged 2 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/fix-internal#224-double-quote-values-returned-by-dbconfig
Jan 23, 2025
Merged

bareos-config-libs: double quote dbconfig values#2111
BareosBot merged 2 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/fix-internal#224-double-quote-values-returned-by-dbconfig

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Jan 8, 2025

Returned dbconfig values are unquoted. This commit add double quotes
around each values (except dbaddress)

Unquoted value might create situation where the dbpassword might be
truncated by the parser if it contain for example special meaning
character like start a comment (; or #)

Fix bareos/internal#224

Signed-off-by: Bruno Friedmann bruno.friedmann@bareos.com

Thank you for contributing to the Bareos Project!

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

Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

This only breaks if you manually add quotes in the dbconfig prompt. Should we ceck for it ? " may be used in passwords

(This use case was already broken before so this does not change much)

As this is already a great change, ill approve it. Let me know what you think!

bruno-at-bareos and others added 2 commits January 23, 2025 14:03
Returned dbconfig values are unquoted. This commit add double quotes
around each values (except dbaddress)

Unquoted value might create situation where the dbpassword might be
truncated by the parser if it contain for example special meaning
character like start a comment (`;` or `#`)

Fix internal#224

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
@BareosBot BareosBot force-pushed the dev/bruno/master/fix-internal#224-double-quote-values-returned-by-dbconfig branch from e2bba48 to 03df632 Compare January 23, 2025 14:04
@BareosBot BareosBot merged commit a16f1a5 into bareos:master Jan 23, 2025
@bruno-at-bareos bruno-at-bareos deleted the dev/bruno/master/fix-internal#224-double-quote-values-returned-by-dbconfig branch January 27, 2025 10:19
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