Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Limit object's access with SecurityManager?
I'm trying to solve how to code a system where an Java application loads
external classes with class loader. The problem is that those externally
loaded classes can be malicious so i must somehow limit their actions.

Is it valid solution to create a new SecurityManager that "denies
everything" only in the case that there is a class loaded with a certain
classloader in the stack?

Example source from
http://forum.java.sun.com/thread.js...4&thread=457210

public class MySecurityManager {

public MySecurityManager() {}

public void checkRead(String file) {
Class[] c = getClassContext(); // current execution stack

for (int i = 0; i < c.length; i++) {
ClassLoader cl = c[ i ].getClassLoader();
if (cl != null) {
if (cl.getClass().equals(MyClassLoader.class))
throw new SecurityException();
}
}
}
}


Michael Maier

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Maier
09-22-04 08:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Security archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:15 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.