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

GString map identifiers don't work in sandboxed Groovy code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • script-security-plugin
    • None
    • Script Security 1.33

      The following code will fail in non-CPS-transformed sandboxed Groovy, but will pass in CPS-transformed-and-sandboxed Groovy or vanilla Groovy:

      def m = [fruitA: 'apple', fruitB: 'banana']
      
      def bKey = 'B'
      
      assert m."fruitB" == m."fruit${bKey}"

      That's obviously wrong. Not sure yet where the problem is happening but will dig.

            Unassigned Unassigned
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: