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

missing doPrivileged and permission in jdk.zipfs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 13
    • 12
    • core-libs
    • b06
    • Verified

      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.

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

              Created:
              Updated:
              Resolved: