Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-131

CLI address parsing is overly restrictive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.Beta1
    • None
    • None
    • None

    Description

      This should work:

      host=pingguo.local:read-resource
      The node name is not a valid identifier 'pingguo.local' or the format is wrong for prefix 'null'

      The validation in Util.isValidIdentifier() is limiting things to Character.isJavaIdentifierPart(c[i]) || c[i] == '-'

      The org.jboss.as.controller.PathElement class is what validates address elements as we create them from dmr nodes. It uses the following patterns to validate:

      /**

      • A valid key contains alphanumerics and underscores, cannot start with a number, and cannot start or end with
      • {@code -}

        .
        */
        private static final Pattern VALID_KEY_PATTERN = Pattern.compile("[_a-zA-Z](?:[-_a-zA-Z0-9]*[_a-zA-Z0-9])?");

      private static final Pattern VALID_VALUE_PATTERN = Pattern.compile("\\*|[^*
      p

      {Space}


      p

      {Cntrl}

      ]+");

      Since '=', ':', ',' and '(' have special significance in the CLI there will need to be a mechanism to quote or escape those if used in path element values.

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: