Neither ~/foo/ nor java.util.regex.Pattern.compile("foo") are whitelisted

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Outside the sandbox, the following will correctly echo java.util.regex.Pattern

      def f = ~/foo/
      echo f.class.toString()
      

      But when sandboxed, it barfs with RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.ScriptBytecodeAdapter bitwiseNegate java.lang.Object.

      This is distinct to CPS-transformed code - if that's in a @NonCPS method or any other non-CPS sandboxed code, it works fine. Somehow we're misidentifying the ~/foo/ in sandboxed CPS code.

      EDIT: Amending to include the fact that staticMethod java.util.regex.Pattern compile java.lang.String is not whitelisted. That should be fixed too.

            Assignee:
            Andrew Bayer
            Reporter:
            Andrew Bayer
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: