my dog learned polymorphism
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.util.PropertyPermission question" Watch "java.util.PropertyPermission question" New topic

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 "", "read";
i was able to set the System property "" 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?
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:
subject: java.util.PropertyPermission question
It's not a secret anymore!