Constants.java generates AccessControl Exception in unsigned applet [LUCENE-4205]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Using Lucene (i.e. writing a Document to a RAMDirectory) in an unsigned applet causes an AccessControlException because Constants.java is attempting to read a System property that is not allowed.
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "sun.arch.data.model" "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.apache.lucene.util.Constants.<clinit>(Constants.java:84)
on line 84: final String x = System.getProperty("sun.arch.data.model");
We have tested setting the String x to the property value for "java.vm.name" and find that works for us...
---
Migrated from [LUCENE-4205](https://issues.apache.org/jira/browse/LUCENE-4205) by Stuart Rose, updated Jul 10 2012
Environment:
```
unsigned applet
```
Contributor guide
Research direction
Inspect org.apache.lucene.util.Constants.java at line 84, where the unsigned applet reads the sun.arch.data.model system property. Reproduce the failure by writing a Document to a RAMDirectory from an unsigned applet, then verify that the access-control exception no longer occurs while the architecture-related value remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100