Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5650

Enforce read-only access to any path outside the temporary folder via security manager

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.0, 6.0
    • general/test
    • None
    • New

    Description

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

      Attachments

        1. dih.patch
          3 kB
          Ryan Ernst
        2. LUCENE-5650.patch
          23 kB
          Ryan Ernst
        3. LUCENE-5650.patch
          17 kB
          Ryan Ernst
        4. LUCENE-5650.patch
          17 kB
          Dawid Weiss
        5. LUCENE-5650.patch
          3 kB
          Ryan Ernst

        Issue Links

          Activity

            People

              dweiss Dawid Weiss
              rjernst Ryan Ernst
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: