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

text parameter with newlines causing the default goal run

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins 1.583, Windows, Java 7U72
    • Similar Issues:

      Description

      I have a required build-parameter "build_reason" of type text. Our users can insert some free-text for the build reason.

      If the parameter contains, for example, following input in the text-box:

      "first line
      second line"

      then jenkins calling maven in the following way:

      [testwebapp_svn_commit] $ D:\applications\prg\ApacheMaven\current-maven\bin\mvn.bat -Dbuild_reason_org=first line
      scond line -Dpart_svn_url=trunk/devopts/testprojects validate

      This causes maven to simple run the default goal and ignore all other parameters.
      It seems that the text parameter is not escaped correct.

      This problem does not apply only to maven .. it applies to all builds where such parameter is injected.

      • Waffel

        Attachments

          Issue Links

            Activity

            Hide
            olivergondza Oliver Gondža added a comment -

            After a great deal of googling around I am starting to think it is not possible to pass newline in an argument of cmd.exe. I would love to be proven wrong.

            Show
            olivergondza Oliver Gondža added a comment - After a great deal of googling around I am starting to think it is not possible to pass newline in an argument of cmd.exe . I would love to be proven wrong.
            Hide
            teilo James Nord added a comment - - edited

            why are we even parsing these as system properties to the tool. They should be environment variables which "should then just work (tm)".

            in maven ${env.foobar} rather than ${foobar}

            I'm pretty sure (but not willing to bet my house) that windows supports multiline environment variables.

            Show
            teilo James Nord added a comment - - edited why are we even parsing these as system properties to the tool. They should be environment variables which "should then just work (tm)". in maven ${env.foobar } rather than ${foobar } I'm pretty sure (but not willing to bet my house) that windows supports multiline environment variables.
            Hide
            danielbeck Daniel Beck added a comment -

            I think the caret is the end of line escape char there.

            Seriously though would this be a breaking change we could do for 2.0? I've never understood the reason behind having parameters passed like this. Sure it's nice sometimes, but overall more trouble that it's worth.

            Show
            danielbeck Daniel Beck added a comment - I think the caret is the end of line escape char there. Seriously though would this be a breaking change we could do for 2.0? I've never understood the reason behind having parameters passed like this. Sure it's nice sometimes, but overall more trouble that it's worth.
            Hide
            olivergondza Oliver Gondža added a comment -
            Show
            olivergondza Oliver Gondža added a comment - Fix proposed https://github.com/jenkinsci/jenkins/pull/1976 .
            Hide
            danielbeck Daniel Beck added a comment -

            Fix released in 2.12

            Show
            danielbeck Daniel Beck added a comment - Fix released in 2.12

              People

              • Assignee:
                Unassigned
                Reporter:
                waffel Thomas Wabner
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: