Uploaded image for project: 'Apache NiFi MiNiFi - MOVED TO NIFI PROJECT'
  1. Apache NiFi MiNiFi - MOVED TO NIFI PROJECT
  2. MINIFI-497

С2 Server: wrong regex pattern in "getConfiguration" (NiFiRestConfigurationProvider.java)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.5.0
    • 1.14.0
    • Command and Control

    Description

      C2 Server can't get from NiFi templates with versions v10+, only v1-v9.

      The reason is an error in the "getConfiguration" function, where "filenamePattern" is determined.

      Wrong code (maybe a typo?):

      String filenamePattern = Arrays.stream(filename.split(Pattern.quote("${version}"), -1)).map(Pattern::quote).collect(Collectors.joining("([0-9+])"));
      

      It should be:

      String filenamePattern = Arrays.stream(filename.split(Pattern.quote("${version}"), -1)).map(Pattern::quote).collect(Collectors.joining("([0-9]+)"));
      
      [0-9+] -> [0-9]+

      Link to source code:

      https://github.com/apache/nifi-minifi/blob/master/minifi-c2/minifi-c2-provider/minifi-c2-provider-nifi-rest/src/main/java/org/apache/nifi/minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java#L105

      Attachments

        Issue Links

          Activity

            People

              VladimirMikhailov Vladimir Mikhailov
              VladimirMikhailov Vladimir Mikhailov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h