July99 GlenM
July99 GlenM
July99 GlenM
T E C H
T I P S
TIPS, TECHNIQUES, AND SAMPLE CODE
java.awt.*;
java.awt.event.*;
javax.swing.*;
javax.swing.event.*;
javax.swing.undo.*;
jre/lib/security/java.security
If you add a line to java.policy just after "grant {", like this:
grant {
permission local.MyPermission "perm1";
then you've enabled this permission locally.
But it's more complicated than simply editing this file. You might
not have the right to edit a central policy file on your local
system. So the security properties file allows an administrator to
specify which policy files are checked, with the default being:
policy.url.1=file:${java.home}/lib/security/java.policy
policy.url.2=file:${user.home}/.java.policy
In other words, the central file is checked, along with a file you
have control over in your home directory. If you want to run
the above example without editing jre/lib/security/java.policy,
you can instead create a file, ".java.policy", in your home
directory. Here is the content of the local .java.policy file:
grant {
permission local.MyPermission "perm1";
};
This feature does not advance the enforcement of centralized
policies. So an administrator may disable the line in the
java.security file that allows for checking of local policy files.
Another aspect of specifying policy files is the default feature
that allows specification of a policy file on the command line:
java -Djava.security.policy=pathname
The line in the java.security file that reads:
policy.allowSystemProperty=true
can be toggled to "false" to disallow this type of override.
. . . . . . . . . . . . . . . . . . . . . . . .
- NOTE
The names on the JDC mailing list are used for internal Sun
Microsystems(tm) purposes only. To remove your name from the list,
see Subscribe/Unsubscribe below.
- FEEDBACK
Comments? Send your feedback on the JDC Tech Tips to:
[email protected]
- SUBSCRIBE/UNSUBSCRIBE
The JDC Tech Tips are sent to you because you elected to subscribe
when you registered as a JDC member. To unsubscribe from JDC Email,
go to the following address and enter the email address you wish to
remove from the mailing list:
http://developer.java.sun.com/unsubscribe.html
To become a JDC member and subscribe to this newsletter go to:
http://java.sun.com/jdc/
- ARCHIVES
You'll find the JDC Tech Tips archives at:
http://developer.java.sun.com/developer/TechTips/index.html
- COPYRIGHT
Copyright 1999 Sun Microsystems, Inc. All rights reserved.
901 San Antonio Road, Palo Alto, California 94303 USA.
This document is protected by copyright. For more information, see:
http://developer.java.sun.com/developer/copyright.html
The JDC Tech Tips are written by Glen McCluskey.
JDC Tech Tips
July 13, 1999