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

FilePermission makes symlinks useless

    XMLWordPrintable

Details

    • generic, x86
    • generic, windows_xp

    Backports

      Description

        I have a directory /classes. Underneath it I populate it with class
        hierarchies from various places via symlinks, e.g.,
            /classes/net/jini -> /files1/classes/net/jini
            /classes/com/sun -> /files2/classes/com/sun

        If set my classpath to /classes, I am unable to load any classes (other
        than the first one), because of the canonical pathname stuff that's
        done in FilePermission. I can't even work around this with AllPermission.
        To my mind, this is quite unacceptable. It essentially defeats the whole
        purpose of symlinks.

        I don't believe that FilePermission should be following symlinks and substituting to obtain a "real" path; it should only be doing syntactic regularization. (And certainly computing the canonical path just once, when the filesystem can change arbitrarily over time while a Java program is running, is just plain wrong.)


        edward.jucevic@eng 1998-05-28
        This problem also affects SAP

        edward.jucevic@eng 1998-06-15
        This no-longer affects SAP.
        This issue causes the following JCK test failures:

        api/java_nio/file/Files/Files.html#CreateTests[createSymbolicLink_MinPerms]
        api/java_nio/file/Files/Files.html#CpMvDelTests[copy_SymLinkMinPermsNoFollow]
        api/java_nio/file/Files/Files.html#CpMvDelTests[move_MinPermsMov]
        api/java_nio/file/Files/Files.html#CpMvDelTests[move_MinPermsRen]

        These testcases fail when the test is run with
        -Dsun.io.useCanonCaches=false
        and passes when the test is run with
        -Dsun.io.useCanonCaches=true.

        The issue was reported by IBM. All the mentioned tests have been excluded. Please see CR 7057265 for more details.

        Attachments

          Issue Links

            Activity

              People

                xuelei Xuelei Fan
                bscheiflsunw Bob Scheifler (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: