Skip to content

Introduce SystemAccessUtils to all Security Manager permission checks - #1707

Open
taoliult wants to merge 1 commit into
IBM:java17from
taoliult:java17_SecurityManager
Open

Introduce SystemAccessUtils to all Security Manager permission checks#1707
taoliult wants to merge 1 commit into
IBM:java17from
taoliult:java17_SecurityManager

Conversation

@taoliult

@taoliult taoliult commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Centralize all security manager permission checks in SystemAccessUtils wrapper methods instead of AccessController.doPrivileged() calls throughout the codebase.

SystemAccessUtils now wraps all permission-requiring operations:

  • System property access (getSystemProperty)
  • File system access (fileExists, newFileReader, getFileCanonicalPath)
  • Library loading (loadLibrary)
  • Class loading (forName)

This centralizes permission checks in one utility class, making the codebase cleaner and easier to maintain across JDK versions (SecurityManager in JDK 21 and earlier, removed AccessController.doPrivileged() in JDK 25+).

This is a back port PR from PR: #1700

Centralize all security manager permission checks in SystemAccessUtils
wrapper methods instead of AccessController.doPrivileged() calls
throughout the codebase.

SystemAccessUtils now wraps all permission-requiring operations:
- System property access (getSystemProperty)
- File system access (fileExists, newFileReader, getFileCanonicalPath)
- Library loading (loadLibrary)
- Class loading (forName)

This centralizes permission checks in one utility class, making the
codebase cleaner and easier to maintain across JDK versions
(SecurityManager in JDK 21 and earlier, removed
AccessController.doPrivileged() in JDK 25+).

Signed-off-by: Tao Liu <tao.liu@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant