harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1751) Classlib test org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage() fails
Date Tue, 05 Dec 2006 14:26:47 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-1751?page=comments#action_12455647 ] 
            
Ilya Okomin commented on HARMONY-1751:
--------------------------------------

Hello Stepan!
Sorry for delay in my reply.

I've checked your fix:
1. Suggested scenario works (however ../JavaSoft / Prefs key refreshed for me only when I
had allowed Enumerate Subkeys and Query Value permissions to this key). This scenario worked
only for the first time, when java/lang key subtree was created. If you are implementing the
scenario when java/lang was already created - SecurityException is thrown on Harmony.
2. With only allowed 'Create Subkey' permission testSystemNodeForPackage passed for me( only
for the first run, next runs failed with SecurityException ) on Harmony, but it failed on
RI with exception:

Could not open windows registry node Software\JavaSoft\Prefs\java\lang at root 0x80000002:
Access denied
java.lang.SecurityException: Could not open windows registry node Software\JavaSoft\Prefs\java\lang
at root 0x80000002: Access denied at java.util.prefs.WindowsPreferences.openKey(WindowsPreferences.java:496)
at java.util.prefs.WindowsPreferences.openKey(WindowsPreferences.java:463) at java.util.prefs.WindowsPreferences.openKey(WindowsPreferences.java:449)
at     java.util.prefs.WindowsPreferences.childrenNamesSpi(WindowsPreferences.java:717) at
java.util.prefs.AbstractPreferences.childrenNames(AbstractPreferences.java:699) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:74)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)

3. With combination of permissions, that I had on the machine for testing (I suppose Elena
had the same permissions set): Allow permissions set:
- Query Value
- Enumerate Subkeys
- Notify
- Read Control

with your fix testSystemNodeForPackage passed for me on RI, but it failed on Harmony with
exception:

java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116)
at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:646) at
java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:626) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:597)
at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)

I want to add, despite test passed on RI there was a set of warnings printed to the log:

    [junit] WARNING: Could not create windows registry node Software\JavaSoft\Prefs\java at
root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
    [junit] 05.12.2006 16:10:22 java.util.prefs.WindowsPreferences WindowsRegOpenKey1
    [junit] WARNING: Trying to recreate Windows registry node Software\JavaSoft\Prefs\java
at root 0x80000002.
    [junit] 05.12.2006 16:10:22 java.util.prefs.WindowsPreferences openKey
    [junit] WARNING: Could not open windows registry node Software\JavaSoft\Prefs\java at
root 0x80000002. Windows RegOpenKey(...) returned error code 2.
    [junit] Preferences p = System Preference Node: /java/lang
    ...etc...

Summary:
Test passes for users with allowed permissions. Spec keeps silence how to handle cases with
certain users permissions and it clearly says that implementations are encouraged to throw
SecurityException if the caller lacks sufficient privileges. Fix for this issue doesn't seem
so easy to me. I would suggest to leave this as non-bug difference again or we can discuss
it with the wider audience on dev list, probably someone else could help us with the resolution.
Stepan?

> Classlib test org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage()
fails
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1751
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1751
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Stepan Mishura
>         Attachments: fixFor_getNode.patch, H-1751_PreferencesTest_updated.patch, Harmony-1751.patch,
PreferencesTest.patch, TestPref.java
>
>
> The test fails for me on Windows on both j9 and drlvm with the following assertion:
> ant -Dbuild.module=prefs -Dtest.case=PreferencesTest test
> testSystemNodeForPackage Error N/A
> (J9)
> java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116)
at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:645) at
java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:626) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:597)
at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) 
> (drlvm)
> java.lang.SecurityException at java.util.prefs.RegistryPreferencesImpl.childSpi(RegistryPreferencesImpl.java:116)
at java.util.prefs.AbstractPreferences.getNodeFromBackend(AbstractPreferences.java:644) at
java.util.prefs.AbstractPreferences.nodeImpl(AbstractPreferences.java:625) at java.util.prefs.AbstractPreferences.node(AbstractPreferences.java:595)
at java.util.prefs.Preferences.systemNodeForPackage(Preferences.java:767) at org.apache.harmony.prefs.tests.java.util.prefs.PreferencesTest.testSystemNodeForPackage(PreferencesTest.java:62)
at java.lang.reflect.VMReflection.invokeMethod(Native Method)

-- 
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

        

Mime
View raw message