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

missing doPrivileged and permission in jdk.zipfs

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b06
    • Verification:
      Verified

      Description

      Running javac under security manager, I encountered the following failure:

      Exception in thread "main" java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.dir" "read")
      at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
      at java.base/java.security.AccessController.checkPermission(AccessController.java:895)
      at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322)
      at java.base/java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1066)
      at java.base/sun.nio.fs.UnixPath.toAbsolutePath(UnixPath.java:842)
      at java.base/sun.nio.fs.UnixPath.toRealPath(UnixPath.java:852)
      at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.removeFileSystem(ZipFileSystemProvider.java:321)
      at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.close(ZipFileSystem.java:302)
      at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFile(Locations.java:382)
      at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:342)
      at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:330)
      at jdk.compiler/com.sun.tools.javac.file.Locations$SearchPath.addFiles(Locations.java:336)
      at jdk.compiler/com.sun.tools.javac.file.Locations$SimpleLocationHandler.handleOption(Locations.java:705)
      at jdk.compiler/com.sun.tools.javac.file.Locations.handleOption(Locations.java:2114)
      at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:269)
      at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOptions(BaseFileManager.java:282)
      at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:258)
      at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
      at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
      at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)

      It is the case that jdk.zipfs does not have a PropertyPermission for user.dir, and it is also the case that granting the privilege to all code bases fixed the problem.

        Attachments

          Activity

            People

            • Assignee:
              lancea Lance Andersen
              Reporter:
              jjg Jonathan Gibbons
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: