Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-2859

Strings with newlines break configuration serialization

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 2.3.16, 2.4.6
    • 2.3.17, 2.4.7, 2.5.0
    • Core
    • None

    Description

      The REST API does not validate the input string in a way that would prevent it from breaking the configuration serialization. Strings with an embedded newlines must be rejected.


      Original description:

      The following regex

      (?x) start #comment
      end
      

      is a valid regex with comments enabled.
      It should match "startend"
      The Maxscale REST API allows creating of such regexes and they function as expected, but the resulting .cnf file ine "/var/lib/maxscale/maxscale/cnf.d/" is invalid, as it contains a new line.

      [replication_filter]
      type=filter
      module=binlogfilter
      match=(?#test1)(?x) start #comment
      end
      exclude=something
      rewrite_src=something
      rewrite_dest=something
      

      The REST API returns the following JSON for this filter

                  "parameters": {
                      "match": "(?x) start #comment\nend",
                      "exclude": "something",
                      "rewrite_src": "something",
                      "rewrite_dest": "something"
                  }
      

      The discrepancy between the json and .cnf representations means that after a maxscale restart the .cnf will be loaded and maxscale will crash as this is not a valid .cnf file

      Attachments

        Activity

          People

            markus makela markus makela
            petko.vasilev Petko Vasilev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.