开发者

Java application permissions

Does the java application permissions extends for created processes? i.e. if application hasn't permissions to create file and I'm running someprogram.exe from this application, t开发者_开发知识库hen is it restricted too?

If no then how can I restrict created processes? Another thing I want to do is to restrict the memory used by subprocess. Please help


It's not absolute clear to me, what kind of permissions you're talking about.

The Java security settings are per application restrictions. They affect java code that runs inside one java virtual machine. If you call an executable, than that executable will not inherit those permissions.

Other permissions are per user permission. So if you don't have the permission to create a file in a certain folder, then the Java application that you started won't have the permission and any executable started from the java vm won't have permission too.


You can restrict the memory of the sub process just like any normal java app, for ex:

java -Xmx16m -XX:MaxPermSize=128m

On the other hand I believe the permissions are the same as the user that started the application, just like any *nix behaviour. When you spawn the new process you can probably change the user in witch that process is started but depends on implementation.

I don't have ref to this so I might be wrong but I don's see why this behaviour would be any different in any desktop app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜