Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35416

xunit plugin should add a help message that a path must not begin with "./" or ".."

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Do
    • Component/s: xunit-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      Similar to JENKINS-13608 I just burned some time figuring out, why I keep getting the following error message even though the file does exist:

      [xUnit] [INFO] - Starting to record.
      [xUnit] [INFO] - Processing JUnit
      [xUnit] [INFO] - [JUnit] - No test report file(s) were found with the pattern './Product/testresults.xml' relative to 'C:\Jenkins\workspace\RnD\FA\Opto\Platform\Platform_Unittest_Job_Vorlage' for the testing framework 'JUnit'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'JUnit'?
      [xUnit] [ERROR] - No test reports found for the metric 'JUnit' with the resolved pattern './Product/testresults.xml'. Configuration error?.
      

      I know understand that "./" and "../" is not considered as relative path to the working space, although I did not change the directory and therefore thought my path is absolutely correct.

      I suggest improving the error message and adding a help text to the configuration box of the path noting, that any path starting with "./" or "../" is not considered as compliant relative path.

        Attachments

          Issue Links

            Activity

            Hide
            nfalco Nikolas Falco added a comment - - edited

            For security issue (OWSP path traversal) you could not go outside workspace directory.

            Jenkins use Ant DirectoryScanner that supports Ant glob pattern. The help section wherever you can setup pattern, links to the Ant fileset help page, that say "These files can be found in a directory tree starting in a base directory". I would not make documentation different than one in similar places.

            A more clear documentation could be found in dirtask that cites:

            "In general, patterns are considered relative paths, relative to a task dependent base directory (the dir attribute in the case of <fileset>). Only files found below that base directory are considered. So while a pattern like ../foo.java is possible, it will not match anything when applied since the base directory's parent is never scanned for files."

            Show
            nfalco Nikolas Falco added a comment - - edited For security issue (OWSP path traversal) you could not go outside workspace directory. Jenkins use Ant DirectoryScanner that supports Ant glob pattern. The help section wherever you can setup pattern, links to the Ant fileset help page, that say "These files can be found in a directory tree starting in a base directory". I would not make documentation different than one in similar places. A more clear documentation could be found in dirtask that cites: "In general, patterns are considered relative paths, relative to a task dependent base directory (the dir attribute in the case of <fileset> ). Only files found below that base directory are considered. So while a pattern like ../foo.java is possible, it will not match anything when applied since the base directory's parent is never scanned for files."

              People

              • Assignee:
                nfalco Nikolas Falco
                Reporter:
                rstahn Roland Stahn
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: