Skip to content

fix for "configure add" handling of quotes in strings#764

Merged
joergsteffens merged 3 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/configure-add-storage-description
Apr 1, 2021
Merged

fix for "configure add" handling of quotes in strings#764
joergsteffens merged 3 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/configure-add-storage-description

Conversation

@alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Mar 12, 2021

Thank you for contributing to the Bareos Project!

Description

When adding resources using the configure add command, quoted strings and escaped quotes in script commands were not registered correctly, leading to configuration files containing wrong or incomplete data in certain situations. This PR aims to fix those issues.

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)

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
  • check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing
Tests
  • Decision taken that a system- or unittest is required (if not, then remove this paragraph)
  • The decision towards a systemtest is reasonable compared to a unittest
  • Testname matches exactly what is being tested
  • Output of the test leads quickly to the origin of the fault

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from 42e8cfb to 382251d Compare March 12, 2021 15:49
@joergsteffens joergsteffens self-requested a review March 15, 2021 11:06
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from 382251d to 8acd18b Compare March 15, 2021 12:25
@joergsteffens joergsteffens self-assigned this Mar 16, 2021
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch 5 times, most recently from a78fdf6 to d4d0567 Compare March 18, 2021 14:09
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from a49052d to 602dcf3 Compare March 23, 2021 18:49
@alaaeddineelamri alaaeddineelamri changed the title fix for configure add storage description missing quotes fix for "configure add" handling of quotes in strings Mar 24, 2021
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from f2e9aed to 51f366f Compare March 24, 2021 13:24
@alaaeddineelamri alaaeddineelamri marked this pull request as ready for review March 24, 2021 13:24
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from 51f366f to 2e795c0 Compare March 24, 2021 14:07
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from 2e795c0 to c11a77e Compare March 24, 2021 15:27
Copy link
Member

@joergsteffens joergsteffens 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. Automatic and manual testing succeeded.

Copy link
Member

@joergsteffens joergsteffens left a comment

Choose a reason for hiding this comment

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

Unfortenatly I see now, that compilation fails on some platforms, namely:

  • Debian_9.0.i586
  • Debian_9.0.x86_64
  • Univention_4.4.x86_64 (might also be based on Debian 9)
  • FreeBSD_12.2.amd64

The error always looks similar to this:

[2021-03-24T15:33:33.312Z] ../../../../core/src/dird/ua_configure.cc: In function ‘bool directordaemon::config_add_directive(directordaemon::UaContext*, ResourceTable*, const char*, const char*, PoolMem&, int)’:

[2021-03-24T15:33:33.312Z] ../../../../core/src/dird/ua_configure.cc:142:9: error: invalid use of template-name ‘std::array’ without an argument list

[2021-03-24T15:33:33.312Z]    const std::array quotable_types{

[2021-03-24T15:33:33.312Z]          ^~~

[2021-03-24T15:33:33.312Z] In file included from /usr/include/c++/6/tuple:39:0,

[2021-03-24T15:33:33.312Z]                  from /usr/include/c++/6/bits/stl_map.h:63,

[2021-03-24T15:33:33.312Z]                  from /usr/include/c++/6/map:61,

[2021-03-24T15:33:33.312Z]                  from ../../../../core/src/include/bareos.h:184,

[2021-03-24T15:33:33.312Z]                  from ../../../../core/src/dird/ua_configure.cc:29:

[2021-03-24T15:33:33.312Z] /usr/include/c++/6/array:90:12: note: ‘template<class _Tp, unsigned int _Nm> struct std::array’ declared here

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch 3 times, most recently from 5fe8197 to 2372343 Compare March 29, 2021 14:30
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/configure-add-storage-description branch from 2372343 to e538b86 Compare March 30, 2021 16:47
@joergsteffens joergsteffens merged commit 31226a9 into bareos:master Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants