apache / apache/lucene

Constants.java generates AccessControl Exception in unsigned applet [LUCENE-4205]

Open
#5,277 3 comments 0 reactions 0 assignees View on GitHub
affects-version:3.5 affects-version:3.6 affects-version:4.0-ALPHA legacy-jira-label:applet legacy-jira-label:unsigned legacy-jira-priority:Minor module:core/index type:bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.