Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8303878

(zipfs) Introduce new system property to turn off JDK-8251329 restrictions

    XMLWordPrintable

Details

    • behavioral
    • minimal
    • Since we are adding back the old functionality of allowing opening of an existing zip file that contains entries with "." or ".." in its name elements , the compatibility risk will be minimal.
    • System or security property
    • Implementation

    Description

      Summary

      Introduce a new system property for JDK 17 and 11 Updates (only) to revert newly added restrictions in the Zip FS provider which by default now rejects ZIP files that contain entries with "." or ".." in name elements.

      Problem

      As part of fix for JDK-8251329 , restrictions were added to ZipFS provider to throw an exception if opening a ZIP file that contained entries with "." or ".." in its name elements.This behavioural change may be problematic in older envionments where modification of such ZIP files may be difficult.

      Solution

      Introduce a new system property which can be used to revert the behavioural change introduced via JDK-8251329.The restrictions remain on by default.

      Specification

      The name of an entry within a ZIP file may contain an optional relative path( a sequence of name elements separated by a forward slash) and therefore may contain name elements of "." or ".." . Note that Zip FS the restriction is due to Zip FS treating a Zip File as a file system.

      Introduce a new system property: jdk.nio.zipfs.allowDotZipEntry which can be used to remove the restriction. Running with -Djdk.nio.zipfs.allowDotZipEntry or -Djdk.nio.zipfs.allowDotZipEntry=true reverts to long standing behaviour.

      Attachments

        Issue Links

          Activity

            People

              rreddy Ravi Reddy
              coffeys Sean Coffey
              Lance Andersen, Sean Coffey
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: