Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

java.policy programmatically modification & SocketPermission

Thread view: 
oziris - 06 Dec 2005 14:16 GMT
Hi !

For my application I allow users to modify several settings and one of
them is the list of IP which are authorized to connect to a server
socket.

I know that consists in using SocketPermission class.

The stuff is that configuration should be intuitive so I want users do
not have to modify directly the java.policy file but just a simple
properties file.

Does it possible to modify programmatically java.policy? Or have I to
develop a routine that perform this check (IP related), so without
using AccessController and SecurityManager?

Thanks a lot for your advices.

-o--
Shin - 06 Dec 2005 17:05 GMT
I may not understand your situation correctly, but here is a few
options I can think of:

1. the user can have a customized policy file, say, test.policy, and
this can be passed to the application when lauching java

2. you can consider using AccessController.doPriviledged(..) in your
class where you first check whether the IP is allowed, then wrap the
connection code inside a priviledged action.
The list of allowed IPs can be build at the start of the program by
reading some regular file user can modifiy.

-Shin


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.