jjs with support for Security Manager?
ecki at zusammenkunft.net
Tue Feb 4 18:08:16 PST 2014
I tried to use jjs to do some tests with the Java security manager,
however it does not completely work:
a) when starting jjs with -Djava.security.manager no SM is installed:
C:\Program Files\Java\jdk1.8.0\bin>jjs -Djava.security.manager
This is normally the job of the launcher, so I guess this is a problem in the jjs binary.
b) when installing the SM by hand it seems to have a deny-all policy:
jjs> var Manager = Java.type("java.lang.SecurityManager")
jjs> java.lang.System.setSecurityManager(new Manager)
java.lang.SecurityManager at 51b279c
java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.version" "read")
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "exitVM.0")
However I cannot use java.security.debug=all to see where the problem is. No idea why this is. Maybe it is related to the way system properties are set with jjs? Any ideas?
More information about the nashorn-dev