1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

* added network permission in ExpressionFormat sandbox

This commit is contained in:
Reinhard Pointner 2009-09-23 13:43:21 +00:00
parent b04f89b7fd
commit 0b30c631ed
2 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import groovy.lang.MissingPropertyException;
import java.io.FilePermission; import java.io.FilePermission;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.SocketPermission;
import java.security.AccessControlContext; import java.security.AccessControlContext;
import java.security.AccessControlException; import java.security.AccessControlException;
import java.security.AccessController; import java.security.AccessController;
@ -220,6 +221,7 @@ public class ExpressionFormat extends Format {
permissions.add(new RuntimePermission("createClassLoader")); permissions.add(new RuntimePermission("createClassLoader"));
permissions.add(new FilePermission("<<ALL FILES>>", "read")); permissions.add(new FilePermission("<<ALL FILES>>", "read"));
permissions.add(new SocketPermission("*", "connect"));
permissions.add(new PropertyPermission("*", "read")); permissions.add(new PropertyPermission("*", "read"));
permissions.add(new RuntimePermission("getenv.*")); permissions.add(new RuntimePermission("getenv.*"));

View File

@ -9,6 +9,13 @@ String.metaClass.lower = { toLowerCase() }
String.metaClass.upper = { toUpperCase() } String.metaClass.upper = { toUpperCase() }
/**
* Allow comparison of Strings and Numbers (overloading of comparison operators is not supported yet though)
*/
String.metaClass.compareTo = { Number other -> delegate.compareTo(other.toString()) }
Number.metaClass.compareTo = { String other -> delegate.toString().compareTo(other) }
/** /**
* Pad strings or numbers with given characters ('0' by default). * Pad strings or numbers with given characters ('0' by default).
* *