scuffed-code/icu4j/main/shared/data/security.policy
Yoshito Umaoka 34beeaddfc ICU-6951 Fixed secureCheck issues
X-SVN-Rev: 26131
2009-06-18 22:29:33 +00:00

48 lines
2.4 KiB
Plaintext

//#
//#*******************************************************************************
//#* Copyright (C) 1997-2009, International Business Machines Corporation and *
//#* others. All Rights Reserved. *
//#*******************************************************************************
//#* This is the ant build file for ICU4J. See readme.html for more information.
//#*
// policies needed to run tests
grant
{
// temporary for debugging
// permission java.lang.RuntimePermission "getProtectionDomain";
permission java.lang.RuntimePermission "accessDeclaredMembers";
// needed for Locale.setDefault, only used in tests and demos
permission java.util.PropertyPermission "user.language", "write";
// for charsets
permission java.lang.RuntimePermission "charsetProvider", "read";
// IBM 1.6 on Windows does not allow to use reflection to access
// getDSTSavings in TimeZone implementation class in sun.util.clanedar.
permission java.lang.RuntimePermission "accessClassInPackage.sun.util.calendar";
};
// there must be a way for code in one jar file to call code in another jar
// file and give the called code permission to read the calling code's
// jar. they're in different protection domains despite being on the
// same classpath and being loaded by the same class loader, so the class
// loader doesn't disambiguate which protection domain we're using. it's
// not easy to figure out the security docs, sigh.
//
// this is so ICUData (in icu4j.jar), called from test code (in core/charset tests jar)
// can read test resource files (in core/charset tests jar)
//
grant codebase "file:${user.dir}/main/classes/core/out/lib/icu4j.jar"
{
permission java.io.FilePermission "${/}${user.dir}${/}main${/}tests${/}core${/}out${/}lib${/}icu4j-core-tests.jar", "read";
permission java.io.FilePermission "${/}${user.dir}${/}main${/}tests${/}charset${/}out${/}lib${/}icu4j-charset-tests.jar", "read";
permission java.io.FilePermission "${/}${user.dir}${/}main${/}classes${/}charset${/}out${/}lib${/}icu4j-charsets.jar", "read";
};
grant codebase "file:${user.dir}/main/tests/framework/out/lib/icu4j-test-framework.jar"
{
permission java.io.FilePermission "${/}${user.dir}${/}main${/}tests${/}core${/}out${/}lib${/}icu4j-core-tests.jar", "read";
permission java.io.FilePermission "${/}${user.dir}${/}main${/}tests${/}charset${/}out${/}lib${/}icu4j-charset-tests.jar", "read";
};