Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1703

Checking isSymbolicLink should be in doPrivileged block

XMLWordPrintable

      The PathResourceManager.getSymlinkBase() method tires to check parent directories in the loop:

              for (int i = nameCount - 1; i>=0; i--) {
                  if (Files.isSymbolicLink(f)) {
                      return new SymlinkResult(i+1 > rootCount, f);
                  }
                  f = f.getParent();
              }
      

      So, when security manager is enabled, there is no way to grant suitable FilePermissions to this, and it will fail the security check if not <<ALL FILES>> is granted.

      Propose to move the part:

      Files.isSymbolicLink(f)
      

      in a doPrivileged block once security manager is enabled.

            rhn-engineering-lgao Lin Gao
            rhn-engineering-lgao Lin Gao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: