ADDITIONAL SYSTEM INFORMATION :
Microsoft Windows [Version 10.0.19042.985]
openjdk version "11.0.11" 2021-04-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode)
working as expected with:
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
A DESCRIPTION OF THE PROBLEM :
We need to run an application with SecurityManager enabled.
Now we run into problems with JFileChooser - for example clicking on computer-icon.
The security-policy, which worked (long) before, does not so anymore.
I could reduce the problem to test with SecurityManager.checkRead(String) - see sourcecode.
Digging deeper it looks like these special Windows-filenames (like "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") were jus ignored before, but produce now errors.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the test code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no exception
ACTUAL -
access denied exception
---------- BEGIN SOURCE ----------
SecMan.policy:
grant {
/* --- Computer-Symbol links --- */
permission java.io.FilePermission "ShellFolder: 0x11", "read";
permission java.io.FilePermission "ShellFolder: 0x11${/}-", "read";
/* --- Netzwerk-Symbol links --- */
permission java.io.FilePermission "ShellFolder: 0x12", "read";
permission java.io.FilePermission "ShellFolder: 0x12${/}-", "read";
/* --- Computer dropdown --- */
permission java.io.FilePermission "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "read";
permission java.io.FilePermission "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}${/}-", "read";
/* --- Netzwerk dropdown --- */
permission java.io.FilePermission "::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}", "read";
permission java.io.FilePermission "::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}${/}-", "read";
/* --- Bibliotheken dropdown --- */
permission java.io.FilePermission "::{031E4825-7B94-4DC3-B131-E946B44C8DD5}", "read";
permission java.io.FilePermission "::{031E4825-7B94-4DC3-B131-E946B44C8DD5}${/}-", "read";
/* permission java.io.FilePermission "<<ALL FILES>>", "read"; */
};
SecMan.java:
public class SecMan {
public static void main(final String[] args) {
System.setProperty("java.security.policy", "SecMan.policy");
final String wfn = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
System.out.printf("%s -> %s%n", wfn, new File(wfn).getPath());
new SecurityManager().checkRead(wfn);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
none - except not enabling security
FREQUENCY : always