Is it possible to use SecurityManager to control which classes can write to stdout/stderr?

倖福魔咒の 提交于 2020-07-03 03:42:08

问题


I'm curious if it's possible to restrict who can write to System.out/System.err using a SecurityManager. Looking at System.java this doesn't appear to be possible out of the box, but perhaps there's another layer I haven't looked at?

If it's not possible out of the box, is there a reasonable pattern for implementing a custom security check using System.setOut()/System.setErr()?

来源:https://stackoverflow.com/questions/62584518/is-it-possible-to-use-securitymanager-to-control-which-classes-can-write-to-stdo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!