From f610774546d33bdd59713bd4216b127904c531af Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Mon, 23 Feb 2015 22:30:05 -0700 Subject: [PATCH] Revert "Add String to the default whitelisted receivers" This reverts commit f493b982597b4e2724f12414f5b1536fd67ac472. --- .../script/groovy/GroovySandboxExpressionChecker.java | 1 - .../java/org/elasticsearch/script/GroovySandboxScriptTests.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/script/groovy/GroovySandboxExpressionChecker.java b/src/main/java/org/elasticsearch/script/groovy/GroovySandboxExpressionChecker.java index 4970b4ebfbb..aa7ca8db65c 100644 --- a/src/main/java/org/elasticsearch/script/groovy/GroovySandboxExpressionChecker.java +++ b/src/main/java/org/elasticsearch/script/groovy/GroovySandboxExpressionChecker.java @@ -92,7 +92,6 @@ public class GroovySandboxExpressionChecker implements SecureASTCustomizer.Expre private final static String[] defaultReceiverWhitelist = new String [] { groovy.util.GroovyCollections.class.getName(), java.lang.Math.class.getName(), - java.lang.String.class.getName(), java.lang.Integer.class.getName(), "[I", "[[I", "[[[I", java.lang.Float.class.getName(), "[F", "[[F", "[[[F", java.lang.Double.class.getName(), "[D", "[[D", "[[[D", diff --git a/src/test/java/org/elasticsearch/script/GroovySandboxScriptTests.java b/src/test/java/org/elasticsearch/script/GroovySandboxScriptTests.java index c0723e2d5bf..8e521a6f392 100644 --- a/src/test/java/org/elasticsearch/script/GroovySandboxScriptTests.java +++ b/src/test/java/org/elasticsearch/script/GroovySandboxScriptTests.java @@ -60,8 +60,6 @@ public class GroovySandboxScriptTests extends ElasticsearchIntegrationTest { testSuccess("def t = Instant.now().getMillis()"); // GroovyCollections testSuccess("def n = [1,2,3]; GroovyCollections.max(n)"); - // String - testSuccess("def s = String.format(\\\"%d\\\", 4)"); // Fail cases testFailure("pr = Runtime.getRuntime().exec(\\\"touch /tmp/gotcha\\\"); pr.waitFor()",