Skip to content

Commit

Permalink
revert changes to MBeanServerFileAccessController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweij committed Mar 5, 2024
1 parent 2b55b17 commit 80810b5
Showing 1 changed file with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package com.sun.jmx.remote.security;

import jdk.internal.access.SharedSecrets;

import java.io.FileInputStream;
import java.io.IOException;
import java.security.AccessControlContext;
Expand Down Expand Up @@ -302,19 +300,16 @@ private static Properties propertiesFromFile(String fname)
}
}

@SuppressWarnings("removal")
private synchronized void checkAccess(AccessType requiredAccess, String arg) {
final Subject s;
if (!SharedSecrets.getJavaLangAccess().allowSecurityManager()) {
s = Subject.current();
} else {
AccessControlContext acc = AccessController.getContext();
s = AccessController.doPrivileged(new PrivilegedAction<>() {
public Subject run() {
return Subject.getSubject(acc);
}
});
}
@SuppressWarnings("removal")
final AccessControlContext acc = AccessController.getContext();
@SuppressWarnings("removal")
final Subject s =
AccessController.doPrivileged(new PrivilegedAction<>() {
public Subject run() {
return Subject.getSubject(acc);
}
});
if (s == null) return; /* security has not been enabled */
final Set<Principal> principals = s.getPrincipals();
String newPropertyValue = null;
Expand Down

0 comments on commit 80810b5

Please sign in to comment.