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 / Security / March 2006

Tip: Looking for answers? Try searching our database.

extending SecurityManager

Thread view: 
arbysauce@gmail.com - 23 Mar 2006 01:10 GMT
I'm writing a security manager that I want to grant all permission to
classes loaded by my loader or JRE classes, otherwise no permissions.

My problem is that in checkPermission() , the calls to get class
loaders (of thread / class context) cause checkPermission() calls
themselves and I get an infinite loop.

I see the secmanager methods currentClassLoader() &
currentLoadedClass()  that are related to what I'm trying to do, but
they are deprecated and it is recommended to use checkPermission to
somehow acclomplish the same type of check.

I must be missing something here -- any ideas on how to override
checkPermission() and use methods in there that trigger calls to
checkPermission themselves?   And/or a better strategy to  accomplish
my main goal?  

TIA John
Thomas Hawtin - 23 Mar 2006 02:39 GMT
> I'm writing a security manager that I want to grant all permission to
> classes loaded by my loader or JRE classes, otherwise no permissions.
>
> My problem is that in checkPermission() , the calls to get class
> loaders (of thread / class context) cause checkPermission() calls
> themselves and I get an infinite loop.

Not really my area, but: I think you want to be looking at
java.security.SecureClassLoader. Particularly getPermissions. Also
java.net.URLClassLoader. Add permissions to classes (indirectly) and let
AccessController do its stuff.

Extending SecurityManager is usually about restricting permissions (see
sun.applet.AppletSecurity).

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/



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.