{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3272","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3272/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3272/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3272/events","html_url":"https://github.com/jruby/jruby/issues/3272","id":102166183,"number":3272,"title":"JRuby Security Manager Issues (accessPackageInClass.sun.misc)","user":{"login":"andrewvc","id":131427,"avatar_url":"https://avatars.githubusercontent.com/u/131427?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewvc","html_url":"https://github.com/andrewvc","followers_url":"https://api.github.com/users/andrewvc/followers","following_url":"https://api.github.com/users/andrewvc/following{/other_user}","gists_url":"https://api.github.com/users/andrewvc/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewvc/subscriptions","organizations_url":"https://api.github.com/users/andrewvc/orgs","repos_url":"https://api.github.com/users/andrewvc/repos","events_url":"https://api.github.com/users/andrewvc/events{/privacy}","received_events_url":"https://api.github.com/users/andrewvc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-20T15:29:45Z","updated_at":"2015-09-04T00:14:15Z","closed_at":null,"body":"Moved from the [mailing list](http://lists.ruby-lang.org/pipermail/jruby/2015-August/000070.html). As @headius put it\r\n\r\n<blockquote>\r\nIn general, we'd like JRuby to work out of\r\nthe box when a security manager is enabled, possibly disabling\r\nfeatures, possibly with warnings to indicate what features have been\r\ndisabled. I do not believe there's a way to disable this particular\r\nlogic, since we depend on the JavaPOSIX fallback when in a secured\r\nenvironment. We may need to find a different way to access it (other\r\nthan reflection).\r\n</blockquote>\r\n\r\nThe usage of classes in `sun.misc` presents issues with the security manager. In a locked down context I'm trying to run JRuby in I get the following stack trace\r\n\r\n```\r\n\r\nCaused by: java.security.AccessControlException: access denied\r\n(\"java.lang.RuntimePermission\" \"accessClassInPackage.sun.misc\") at\r\njava.security.AccessControlContext.checkPermission(AccessControlContext.java:457)\r\nat\r\njava.security.AccessController.checkPermission(AccessController.java:884)\r\nat java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at\r\njava.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1564) at\r\njava.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:811) at\r\njava.lang.ClassLoader.loadClass(ClassLoader.java:357) at\r\njnr.posix.POSIXFactory.getJavaPOSIX(POSIXFactory.java:51) at\r\njnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:109) at\r\njnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:36) at\r\njnr.posix.LazyPOSIX.posix(LazyPOSIX.java:32) at\r\njnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:370) at\r\norg.jruby.RubyGlobal.prepareStdioChannel(RubyGlobal.java:279) at\r\norg.jruby.RubyGlobal.createGlobals(RubyGlobal.java:194) at\r\norg.jruby.Ruby.init(Ruby.java:1240) at\r\norg.jruby.Ruby.newInstance(Ruby.java:331) at\r\norg.jruby.embed.internal.AbstractLocalContextProvider.getGlobalRuntime(AbstractLocalContextProvider.java:82)\r\nat\r\norg.jruby.embed.internal.SingletonLocalContextProvider.getRuntime(SingletonLocalContextProvider.java:99)\r\nat\r\norg.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.runParser(EmbedRubyRuntimeAdapterImpl.java:167)\r\nat\r\norg.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:94)\r\nat org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1238)\r\nat\r\norg.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1298)\r\n```"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/137606235","html_url":"https://github.com/jruby/jruby/issues/3272#issuecomment-137606235","issue_url":"https://api.github.com/repos/jruby/jruby/issues/3272","id":137606235,"user":{"login":"headius","id":10135,"avatar_url":"https://avatars.githubusercontent.com/u/10135?v=3","gravatar_id":"","url":"https://api.github.com/users/headius","html_url":"https://github.com/headius","followers_url":"https://api.github.com/users/headius/followers","following_url":"https://api.github.com/users/headius/following{/other_user}","gists_url":"https://api.github.com/users/headius/gists{/gist_id}","starred_url":"https://api.github.com/users/headius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headius/subscriptions","organizations_url":"https://api.github.com/users/headius/orgs","repos_url":"https://api.github.com/users/headius/repos","events_url":"https://api.github.com/users/headius/events{/privacy}","received_events_url":"https://api.github.com/users/headius/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T00:14:14Z","updated_at":"2015-09-04T00:14:14Z","body":"Hmm...after quick inspection I don't see where jnr-posix is using `sun.misc.Unsafe`."}}