[ https://issues.apache.org/jira/browse/LUCENE-5650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13993996#comment-13993996 ]
Dawid Weiss commented on LUCENE-5650: ------------------------------------- I think this patch is great. Ran Solr tests and it clearly shows that there are things the tests shouldn't be doing. {code} 2> 175732 T527 oasc.CoreContainer.recordAndThrow ERROR Unable to create core: collection1 org.apache.solr.common.SolrException: access denied ("java.io.FilePermission" "C:\Work\lucene\trunk\solr\example\solr\collection1\data\index" "write") 2> at org.apache.solr.core.SolrCore.<init>(SolrCore.java:869) 2> at org.apache.solr.core.SolrCore.<init>(SolrCore.java:644) 2> at org.apache.solr.core.CoreContainer.create(CoreContainer.java:556) 2> at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:261) 2> at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:253) 2> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 2> at java.util.concurrent.FutureTask.run(FutureTask.java:166) 2> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 2> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 2> at java.util.concurrent.FutureTask.run(FutureTask.java:166) 2> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 2> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 2> at java.lang.Thread.run(Thread.java:722) 2> Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Work\lucene\trunk\solr\example\solr\collection1\data\index" "write") 2> at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366) 2> at java.security.AccessController.checkPermission(AccessController.java:555) 2> at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) 2> at java.lang.SecurityManager.checkWrite(SecurityManager.java:979) 2> at java.io.File.mkdir(File.java:1237) 2> at java.io.File.mkdirs(File.java:1266) 2> at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:136) 2> at org.apache.lucene.store.MockLockFactoryWrapper$MockLock.obtain(MockLockFactoryWrapper.java:72) 2> at org.apache.lucene.store.Lock.obtain(Lock.java:77) 2> at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:714) 2> at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:77) 2> at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:64) 2> at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:521) 2> at org.apache.solr.core.SolrCore.<init>(SolrCore.java:775) 2> ... 12 more {code} > createTempDir and associated functions no longer create java.io.tmpdir > ---------------------------------------------------------------------- > > Key: LUCENE-5650 > URL: https://issues.apache.org/jira/browse/LUCENE-5650 > Project: Lucene - Core > Issue Type: Improvement > Components: general/test > Reporter: Ryan Ernst > Assignee: Dawid Weiss > Priority: Minor > Fix For: 4.9, 5.0 > > Attachments: LUCENE-5650.patch, LUCENE-5650.patch > > > The recent refactoring to all the create temp file/dir functions (which is > great!) has a minor regression from what existed before. With the old > {{LuceneTestCase.TEMP_DIR}}, the directory was created if it did not exist. > So, if you set {{java.io.tmpdir}} to {{"./temp"}}, then it would create that > dir within the per jvm working dir. However, {{getBaseTempDirForClass()}} > now does asserts that check the dir exists, is a dir, and is writeable. > Lucene uses {{"."}} as {{java.io.tmpdir}}. Then in the test security > manager, the per jvm cwd has read/write/execute permissions. However, this > allows tests to write to their cwd, which I'm trying to protect against (by > setting cwd to read/execute in my test security manager). -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org