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

Export of Variables over api creates invalid JSON if escaping is required

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: envinject-plugin
    • Labels:
    • Environment:
      Jenkins 1.644 (deb package)
    • Similar Issues:

      Description

      If you have an env variable with e.g. double quotation marks a call to job/<name>/<buildid>//injectedEnvVars/export/api/json will create invalid JSON.

      If for example if the Variable is declared as
      export VAR='test"test"test'
      it would create the following output
      ...

      {"name":"VAR", "value":"test"test"test"}

      ...

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The issue is confirmed

          Show
          oleg_nenashev Oleg Nenashev added a comment - The issue is confirmed
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rechi
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectVarList.java
          http://jenkins-ci.org/commit/envinject-plugin/32c7a4c0d09aec51c47c40e1b6d02b35c6badecf
          Log:
          JENKINS-32428 Escape xml and json outputs in REST API (#120)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rechi Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectVarList.java http://jenkins-ci.org/commit/envinject-plugin/32c7a4c0d09aec51c47c40e1b6d02b35c6badecf Log: JENKINS-32428 Escape xml and json outputs in REST API (#120)
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The fix has been released in 2.1.1

          Show
          oleg_nenashev Oleg Nenashev added a comment - The fix has been released in 2.1.1
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rechi
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectVarList.java
          http://jenkins-ci.org/commit/envinject-plugin/df82446c16a9747ccbf7036d7b46de407a1eaeee
          Log:
          JENKINS-32428 Escape xml and json outputs in REST API - fix 2 (#123)

          JENKINS-32428 Escape xml and json outputs in REST API - fix 2 (#120)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rechi Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectVarList.java http://jenkins-ci.org/commit/envinject-plugin/df82446c16a9747ccbf7036d7b46de407a1eaeee Log: JENKINS-32428 Escape xml and json outputs in REST API - fix 2 (#123) JENKINS-32428 Escape xml and json outputs in REST API - fix 2 (#120)

            People

            • Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              juergen_thomann J├╝rgen Thomann
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: