Skip to content

Introduce SystemAccessUtils to all Security Manager permission checks - #1700

Open
taoliult wants to merge 1 commit into
IBM:mainfrom
taoliult:main_SecurityManager
Open

Introduce SystemAccessUtils to all Security Manager permission checks#1700
taoliult wants to merge 1 commit into
IBM:mainfrom
taoliult:main_SecurityManager

Conversation

@taoliult

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+).

Comment thread src/main/java/com/ibm/crypto/plus/provider/OpenJCEPlusProvider.java Outdated
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>
@taoliult
taoliult force-pushed the main_SecurityManager branch from 4a2a561 to 4ced49d Compare August 14, 2026 18:48
@taoliult
taoliult requested a review from jasonkatonica August 14, 2026 18:49

@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

@JinhangZhang JinhangZhang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

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.

5 participants