aspose file tools*
The moose likes Java in General and the fly likes java.util.PropertyPermission question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.util.PropertyPermission question" Watch "java.util.PropertyPermission question" New topic
Author

java.util.PropertyPermission question

Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
i saw this in java.policy file (under jre/lib/security)
which i guess is the default policy file that is used when we run a java application on our machine.
permission java.util.PropertyPermission "os.name", "read";
i was able to set the System property "os.name" to something else in my code. There was no runtime error either.
probably setting the default security manager again is redundant? anyways this worked.
When am allowed only a "read" action on the property why am i allowed to overwrite it?
Can somebody explain this behaviour?
thanks.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi karthik,
Well, if you have control of your own machine, doesn't it seem reasonable to let you grant what permissions you want? Those permissions in the system policy file are for "external" entites like an applet that came from some hacker's site.
Hope this clears it up,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.util.PropertyPermission question
 
Similar Threads
Testing my past assignment game
Pointbase : How can I create a stored procedures with Pointbase database?
Corba Exception while communicating to WLS from Jboss
Problem in RMI based chat server...
JAAS and Policy files problems