A security manager is an object that defines a security policy for an application. This policy specifies actions that are unsafe or sensitive. Any actions not allowed by the security policy cause a SecurityException to be thrown. An application can also query its security manager to discover which actions are allowed.
Questions tagged [securitymanager]
218 questions
1
vote
0 answers
Can't get runtime to allow class in java.util
I recently wanted to create my own copy of GregorianCalendar to add some System.out.println to help me understand how it works. I copied the source and renamed the class, but it wouldn't compile because the source references package-private names…

ajb
- 31,309
- 3
- 58
- 84
1
vote
0 answers
Changing System Property in Java
I'm trying to study JINI library, and found example of simple programm. Programm is here:
package book.basic;
import net.jini.core.discovery.LookupLocator;
import net.jini.core.lookup.ServiceRegistrar;
import java.rmi.RMISecurityManager;
import…

Aleksandr
- 4,906
- 4
- 32
- 47
1
vote
2 answers
Can I guarantee that my Java application will be executed with a Security Manager with a restrictive policy?
I will be distributing a stand alone Java application that will be installed on a public/shared computer. I want to secure the application as best I can from possible malicious/curious users. This means that I want the application to run in the…

axiopisty
- 4,972
- 8
- 44
- 73
1
vote
2 answers
Preventing Thread creation/start in Java
my question, similar to
why java security manager doesn't forbid neither creating new Thread() nor starting it?
I'm writing a didactic application, where students are allowed to submit java code that perform certain tasks, and interact with each…

Marco Servetto
- 684
- 1
- 5
- 14
1
vote
1 answer
Security Manager in Clojure
I try to install a security manager from a Clojure program and am stuck short after a good start.
This one works for me in Clojures simple REPL, in the Lein REPL, and in the Cider REPL in Emacs. It prevents the use of (System/exit n).
(def SM (proxy…

Falko
- 1,028
- 1
- 12
- 24
1
vote
2 answers
Access denied ("java.net.SocketPermission" Error Occurred when i run my CLient Project in NetBeans
java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:1099" "connect,resolve")
My server side is working perfectly, no errors on the server.. while when I run my client code, I get this access denied…

user3125051
- 9
- 1
- 1
- 2
1
vote
3 answers
Is it acceptable to globally and finally store the check for a SecurityManager
Is it acceptable to globally and finally store the check for a security manager?
Given the following line of code:
public static final boolean SEC_ON = (System.getSecurityManager() != null);
Would it be acceptable to place this in a library and…

Ray
- 1,324
- 10
- 18
1
vote
2 answers
AccessController doPrivileged can create thread when modifyThreadGroup not granted?
I am trying to prohibit thread creation in an AccessController.doPriviliged() method. The method below creates and runs the thread. I run this with -Djava.security.manager. According to this link, if modifyThreadGroup is not granted, then Thread…

markt
- 73
- 1
- 7
1
vote
1 answer
AccessControlException when connecting to HTTP server from Tomcat servlet
I'm trying to make my tomcat servlet download a number of files, but I have apache and tomcat running on the same server, so I assume that is why it doesn't work. I've tested on servers not running apache, and all is well.
Here's the exception I'm…

Stefan Kendall
- 66,414
- 68
- 253
- 406
1
vote
1 answer
Security manager rarely used on server?
A recent question on SO lead me to an older answer about the Java Security Manager. My question about this line in that answer:
The security manager impacts performances though, and it is rarely used on the server side.
Can someone please back…

Miserable Variable
- 28,432
- 15
- 72
- 133
1
vote
1 answer
Java AccessControlException despite granting appropriate file permission
I'm getting a bizarre error trying to run a Java RMI application with a SecurityManager. When the server starts up, I want it to read in text from a file supplied as a command-line argument. I'm using Eclipse, and this file is in the same directory…

Edward
- 5,942
- 4
- 38
- 55
1
vote
1 answer
Security: Restrict internal access by third-party software
I have a Java application in which third-party "plugins" can be loaded by users to enhance the user experience. An API exists for use by these plugins, but the third-party software should be restricted from access to internal application classes…

FThompson
- 28,352
- 13
- 60
- 93
1
vote
2 answers
java.security.AccessControlException : Access denied (java.lang.RuntimePermission modifyThread)
I have my Batch Application Program, in which I am using ThreadPoolExecutor in my Batch Application Program. So as soon as it hits the-
executorService.shutdown();
line in my Batch Application program, I always get this below error in my Batch…

arsenal
- 23,366
- 85
- 225
- 331
1
vote
2 answers
How can I "capture" System.exit(-1) from different thread?
I have the following
System.setSecurityManager(new SecurityManager() {
@Override
public void checkExit(int status) {
super.checkExit(status);
//custom exception extends SecurityException
throw new…

numeric
- 475
- 3
- 15
0
votes
1 answer
Access non-public classes in sun.awt package [specifically: FetcherInfo]
Question:
I have some performance problem in my app - and the bottleneck is sun.awt.image.ImageFetcher.run, and I canno't get any (more) meaningfull info from profiler. So I figured that it would be nice to look at jobs that ImageFetcher is doing.…

jb.
- 23,300
- 18
- 98
- 136