[
https://issues.apache.org/jira/browse/LUCENE-5650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14017206#comment-14017206
]
Steve Rowe commented on LUCENE-5650:
------------------------------------
Yeah, that does look dumb. And {{pathToFile()}} absolutizes relative
directories against the CWD, so using a relative dir won't help.
I found a solution that allows all the tests to succeed on my box, though I
admit it's totally cargo-culted from o.a.s.cloud.hdfs.StressHdfsTest:
{code:java}
Index: solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java
===================================================================
--- solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java
(revision 1599731)
+++ solr/core/src/test/org/apache/solr/search/TestRecoveryHdfs.java
(working copy)
@@ -78,6 +78,7 @@
@BeforeClass
public static void beforeClass() throws Exception {
dfsCluster = HdfsTestUtil.setupClass(createTempDir().getAbsolutePath());
+ System.setProperty("solr.hdfs.home", dfsCluster.getURI().toString() +
"/solr");
hdfsUri = dfsCluster.getFileSystem().getUri().toString();
try {
{code}
Any objections to committing this? [[email protected]]?
> Enforce read-only access to any path outside the temporary folder via
> security manager
> --------------------------------------------------------------------------------------
>
> 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, LUCENE-5650.patch,
> LUCENE-5650.patch, dih.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: [email protected]
For additional commands, e-mail: [email protected]