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

Allow other named NetPermissions to be used

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Allow other named NetPermissions to be used.

      Problem

      The current specification of java.net.NetPermission states: "The following table lists all the possible NetPermission target names ...", which implies that unless the permission target is listed in the table, it cannot be used.

      However, there is no such enforcement in the implementation, and it is useful and somewhat common for applications / libraries to create their own permission target names.

      Solution

      Relax the specification so that non-listed permissions are allowable. The table will remain, but will only document Java SE permissions.

      Specification

      --- a/src/java.base/share/classes/java/net/NetPermission.java
      +++ b/src/java.base/share/classes/java/net/NetPermission.java
      @@ -43,7 +43,7 @@
        * signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
        * match, while "*foo" and "a*b" do not.
        * <P>
      - * The following table lists all the possible NetPermission target names,
      + * The following table lists the standard NetPermission target names,
        * and for each provides a description of what the permission allows
        * and a discussion of the risks of granting code the permission.
        *

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chegar Chris Hegarty
              Reporter:
              chegar Chris Hegarty
              Reviewed By:
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: