db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "AnalyzingSecurityManagerIssues" by MyrnavanLunteren
Date Fri, 08 Nov 2013 05:10:19 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The "AnalyzingSecurityManagerIssues" page has been changed by MyrnavanLunteren:
https://wiki.apache.org/db-derby/AnalyzingSecurityManagerIssues?action=diff&rev1=3&rev2=4

  
   . A section of code which, when running under !SecurityManager, requires a  certain permission,
has to be wrapped in a 'Privileged Block'. For  instance, code that needs to check on a system
property, or read or  write to a file, would need this.
  
-  . For examples of Privileged Block code, see: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/PrivilegedFileOpsForTests.java?revision=1537394&view=markup
or http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TimeZoneTestSetup.java?revision=1524579&view=markup.
However, this is in test code, but typically, you want to put Priviledged code in private
methods, for example: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?view=markup
+  . For examples of Privileged Block code in derby source, see: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/PrivilegedFileOpsForTests.java?revision=1537394&view=markup
or http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TimeZoneTestSetup.java?revision=1524579&view=markup.
However, this is in test code, but typically, you want to put Priviledged code in private
methods, for example: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?view=markup.
And for more examples with explanation see this guide: http://docs.oracle.com/javase/7/docs/technotes/guides/security/doprivileged.html.
  
   * Running without !SecurityManager
  

Mime
View raw message