Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Security Manager and RMI

843811Sep 12 2001 — edited Sep 21 2001
I am developping an application that uses RMI.
So in the code i must declare the RMISecurityManager as the security manager. But if the user specify the standard security manager on the command line it dont works.
I understand why, because my question is :
How the user can ensure that my application is safe if he cannot specify the basic security manager on the comnd line ( -Djava.security.manager ) ?

tom

Comments

843811
First of all, you don't have to use RMISecurityManager as the security manager at all. It's a legacy class from Java 1.1. times that the RMI tutorials continue to refer to, see this thread:

http://forum.java.sun.com/thread.jsp?forum=58&thread=161874

Secondly, it is tricky but Java 2 allows a security manager to be set more than once -- it all depends on whether the currently installed manager allows to be replaced [RuntimePermission("setSecurityManager") permission].

Finally, if you expect that the user will define a security policy through command line, all you have to do is code something like this:
if (System.getSecurityManager() == null)
   System.setSecurityManager(your_security_manager);
to set yours only when nothing was set on the command line.

Vlad.
843811
Was my answer helpful?
843811
I don�t know if it was helpful for tom, but for me yes.
Pablo
843811
Yes, Thank you vladimp

tom
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 19 2001
Added on Sep 12 2001
4 comments
86 views