Issue Details (XML | Word | Printable)

Key: JDBC-254
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

AccessControlException in LoggerFactory can cause driver load to fail in restricted environment

Created: 20/May/12 03:25 PM   Updated: 22/Oct/12 11:47 AM
Component/s: JDBC driver
Affects Version/s: None
Fix Version/s: Jaybird 3.0

Time Tracking:
Not Specified


 Description  « Hide
See http://stackoverflow.com/q/10673119/466862

The loading of FBDriver can fail in a restricted environment as the LoggerFactory tries to retrieve the system property FBLog4j; if this fails (as described in above stackoverflow post in an unsigned applet, but other restricted scenarios are possible as well) with an AccessControlException, then the driver load will fail with a java.lang.NoClassDefFoundError: Could not initialize class org.firebirdsql.jdbc.FBDriver
and:
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission FBLog4j read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at org.firebirdsql.logging.LoggerFactory.getLogger(LoggerFactory.java:36)
    at org.firebirdsql.logging.LoggerFactory.getLogger(LoggerFactory.java:72)
    at org.firebirdsql.jdbc.FBDriver.<clinit>(FBDriver.java:63)
    ... 12 more

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 20/May/12 03:29 PM
I will need to Investigate if this can occur in other situations with a restricted policy.

Mark Rotteveel added a comment - 10/Oct/12 05:49 PM
Made all access to system properties a privileged action (which by itself won't solve this issue). Will delve into it deeper at a later time.