import java.io.*;
class TinyHttpdSecurityManager extends SecurityManager {
public void checkAccess(Thread g) { };
public void checkListen(int port) { };
public void checkLink(String lib) { };
public void checkPropertyAccess(String key) { };
public void checkAccept(String host, int port) { };
public void checkWrite(FileDescriptor fd) { };
public void checkRead(FileDescriptor fd ) { };
public void checkRead( String s ) {
if ( new File(s).isAbsolute() || (s.indexOf("..") != -1) )
throw new SecurityException( "Access to file : "+ s + " denied." );
}
}
|