You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Daniel John Debrunner (JIRA)" <de...@db.apache.org> on 2006/01/13 21:10:20 UTC

[jira] Created: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Creating trace files in derbytclient fails when running with a SecurityManager
------------------------------------------------------------------------------

         Key: DERBY-811
         URL: http://issues.apache.org/jira/browse/DERBY-811
     Project: Derby
        Type: Bug
  Components: Network Client, Security  
    Versions: 10.1.2.1, 10.2.0.0    
    Reporter: Daniel John Debrunner
    Priority: Minor


Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.

Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".


java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
        at java.security.AccessController.checkPermission(AccessController.java:476)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
        at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
        at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
        at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
        at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
        at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
        at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-811:
----------------------------------

    Derby Info:   (was: [Patch Available])

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt, DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-811:
----------------------------------

    Derby Info: [Patch Available]

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt, DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-811:
---------------------------------


Is this issue fixed now?

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt, DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-811:
----------------------------------

    Attachment: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt

Very simple change as part of review package DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt to remove hard coded "/" and user File.separator instead.

If no objections to the changes, then I will commit it over next couple days.

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt, DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471470 ] 

Mamta A. Satoor commented on DERBY-811:
---------------------------------------

I am looking into the derby dev list to see how to run an old harness test with java security but what I found so far does not seem to work for me. Following is what I am trying
java -Djava.security.manager -Djava.security.policy=file:/c:/p4clients/maintest3/classes/derby_tests.policy -DderbyTesting.codeclasses=file:/c:/p4clients/maintest3/classes/. -DderbyTesting.codedir=file:/c:/p4clients/maintest3/classes/ -DderbyTesting.codejar=file://unused/ org.apache.derbyTesting.functionTests.harness.RunTest jdbcapi/checkDriver.java

I get following error
Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission C:\p4clients\maintest3\classes write)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
        at java.security.AccessController.checkPermission(AccessController.java:401)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
        at java.lang.SecurityManager.checkWrite(SecurityManager.java:954)
        at java.io.File.mkdir(File.java:1097)
        at org.apache.derbyTesting.functionTests.harness.RunTest.setDirectories(RunTest.java:636)
        at org.apache.derbyTesting.functionTests.harness.RunTest.main(RunTest.java:266)

Can someone give me a pointer as to how a non-junit test is run with security manager?

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>            Priority: Minor
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471720 ] 

Daniel John Debrunner commented on DERBY-811:
---------------------------------------------

Actually the code changes for DERBY-1275 really fixed this issue. Before, the opening of the file was not in a privileged block (see the initial stack trace for this issue). Thus just adding the policies would not have fixed this. Just wanted to track this down to see what issue had fixed it.

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471472 ] 

Mamta A. Satoor commented on DERBY-811:
---------------------------------------

I added -Dderby.system.home to my command above and that moved me beuond the write FilePermission. Instead, now I get FilePermission <<ALL FILES>> execute) exception.

Exact command is as follows
$ java -Djava.security.manager= -Djava.security.policy=file:/c:/p4clients/maintest3/classes/derby_tests.policy -Dframework=DerbyNetClient -DderbyTesting.codeclasses=file:/c:/p4clients/maintest3/classes/. -DderbyTesting.codedir=file:/c:/p4clients/maintest3/classes/ -Dderby.system.home=file:/c:/p4clients/maintest3/classes/ -DderbyTesting.codejar=file://unused/ org.apache.derbyTesting.functionTests.harness.RunTest jdbcapi/checkDriver.java

And the error message returned is as follows
-- listing properties --
derby.user.testuser=testpass
derby.authentication.provider=BUILTIN
derby.infolog.append=true
derby.debug.true=AuthenticationTrace
derby.database.users.testpropdb=testuser,APP
derby.user.APP=xxxx
Process exception: java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
*** Start: checkDriver jdk1.4.2_07 DerbyNetClient 2007-02-08 12:10:59 ***
Initialize for framework: DerbyNetClient
java -Duser.language=en -Duser.country=US -Dderby.system.home=C:\p4clients\maintest3\classes\DerbyNetClient\checkDriver -Djava.security.manager -Djava.security.policy=C:\p4clients\maintest3\classes\derby_tests.policy -DderbyTesting.codedir=C:\p4clients\maintest3\classes -DderbyTesting.serverhost=localhost -DderbyTesting.clienthost=localhost org.apache.derby.drda.NetworkServerControl start
Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
        at java.security.AccessController.checkPermission(AccessController.java:401)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
        at java.lang.SecurityManager.checkExec(SecurityManager.java:774)
        at java.lang.Runtime.exec(Runtime.java:563)
        at java.lang.Runtime.exec(Runtime.java:491)
        at java.lang.Runtime.exec(Runtime.java:457)
        at org.apache.derbyTesting.functionTests.harness.NetServer.start(NetServer.java:192)
        at org.apache.derbyTesting.functionTests.harness.RunTest.main(RunTest.java:351)
$

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>            Priority: Minor
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor reassigned DERBY-811:
-------------------------------------

    Assignee: Mamta A. Satoor

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471715 ] 

Mamta A. Satoor commented on DERBY-811:
---------------------------------------

Committed DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt with following comment (revision number 505317)
DERBY-811 Enabling SecurityManager for checkDriver test. This test was running into problems when run with Derby jar files in DerbyNetClient framework with SecurityManager. This is because required permissions were not granted to the jar in the policy file. Fix for DERBY-1275 took care of those permissions and hence checkDriver test can now start running with SecurityManager.


> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-811:
----------------------------------

    Attachment: DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt

Thanks, Andrew. I was able to run the test with SecurityManager after removing the noSecurityManager=true from checkDriver_app.properties. 

I ran checkDriver test with the Derby jar files under DerbyNetClient framework after the fix for DERBY-1275 was committed and there was no security related exceptions. I have attached the patch DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt which removes noSecurityManager=true from checkDriver_app.properties. If there are no objections to this change, then I will commit it sometime tomorrow.

As for the ClientBaseDataSource.computePrintWriter using hard coded "/" rather than File.separator, I will make that change next and post another patch after running some basic tests.


> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472147 ] 

Mamta A. Satoor commented on DERBY-811:
---------------------------------------

Committed DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt with revision 506160

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt, DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Andrew McIntyre (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471474 ] 

Andrew McIntyre commented on DERBY-811:
---------------------------------------

The old test harness runs with security manager enabled by default, unless the test specifies not to run with the security manager in its _app.properties.

checkDriver currently has this in its _app.properties:

#exclude with SecurityManager DERBY-811
noSecurityManager=true

remove these lines and rebuild to run the test with the security manager in the old harness. 

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>            Priority: Minor
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471737 ] 

Mamta A. Satoor commented on DERBY-811:
---------------------------------------

Agreed. Just the policy file changes wouldn't have been enough to fix checkDriver test failure.

I guess what I meant to say is without the accompanying changes to policy file for jars, checkDriver would have still failed when run with jars (even with the code changes for DERBY-1275). Just like what happened with the JUnit test added as part of DERBY-1275 failed when run with jar files (DERBY-2302)

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-811) Creating trace files in derbytclient fails when running with a SecurityManager

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor resolved DERBY-811.
-----------------------------------

    Resolution: Fixed

> Creating trace files in derbytclient fails when running with a SecurityManager
> ------------------------------------------------------------------------------
>
>                 Key: DERBY-811
>                 URL: https://issues.apache.org/jira/browse/DERBY-811
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Security
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Mamta A. Satoor
>            Priority: Minor
>         Attachments: DERBY811_RemoveHardcodedSlashForFileSeparator_diff_v01.txt, DERBY811_RunCheckDriverWithSecurityManager_diff_v01.txt
>
>
> Can be seen by running the test jdbcapi/checkDriver.java in the DerbyNetClient framework.
> Another bug in the code is in ClientBaseDataSource.computePrintWriter  where the file separator is hard coded as "/".
> java.security.AccessControlException: access denied (java.io.FilePermission C:\_work\svn_clean2\trunk\systest\out2\DerbyNetClient\checkDriver\trace.out write)
>         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:292)
>         at java.security.AccessController.checkPermission(AccessController.java:476)
>         at java.lang.SecurityManager.checkPermission(SecurityManager.java:538)
>         at java.lang.SecurityManager.checkWrite(SecurityManager.java:968)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:191)
>         at java.io.FileOutputStream.<init>(FileOutputStream.java:124)
>         at org.apache.derby.client.am.LogWriter.getPrintWriter(LogWriter.java:1190)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computePrintWriter(ClientBaseDataSource.java:587)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriter(ClientBaseDataSource.java:528)
>         at org.apache.derby.jdbc.ClientBaseDataSource.computeDncLogWriterForNewConnection(ClientBaseDataSource.java:512)
>         at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:116)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testConnect(checkDriver.java:397)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.testClientAttributes(checkDriver.java:177)
>         at org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDriver.main(checkDriver.java:133)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.