Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.util.PropertyPermission question

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic