groovy-sandbox icon indicating copy to clipboard operation
groovy-sandbox copied to clipboard

Sandbox ignoring Owners and Delegates of nested Closures.

Open BloodWorkXGaming opened this issue 7 years ago • 0 comments

If I have nested Closures and I try to access something from the outside Closure I will run into a problem as it is only checking the functions from the inner Closure.

Here is an attempted fix for it:

https://github.com/BloodWorkXGaming/GroovySandboxedLauncher/blob/82761afcc3f69b5e17bd47784b76ccca01dc0495/src/main/java/org/kohsuke/groovy/sandbox/impl/ClosureSupport.java#L28-L65

The already existing code is smart enough to check it in the correct order, while the recursion adds the other objects to the back of the list the deeper we go in the hierarchy.

BloodWorkXGaming avatar Oct 17 '17 22:10 BloodWorkXGaming