Skip to content

Introduce SystemAccessUtils to all Security Manager permission checks - #1705

Merged
jasonkatonica merged 1 commit into
IBM:java27from
taoliult:java27_SecurityManager
Aug 20, 2026
Merged

Introduce SystemAccessUtils to all Security Manager permission checks#1705
jasonkatonica merged 1 commit into
IBM:java27from
taoliult:java27_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>

@jasonkatonica jasonkatonica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KostasTsiounis KostasTsiounis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasonkatonica
jasonkatonica merged commit 95529bb into IBM:java27 Aug 20, 2026
3 checks passed
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.

4 participants