Skip to content

Commit f50d7ef

Browse files
committed
ROLLBACK: Bug 38139258 - [38041090->25.09] Failed to restart services: java.lang.SecurityException due to Subject is not inherited from the parent thread (Undo @117244+)
[git-p4: depot-paths = "//dev/coherence-ce/main/": change = 117439]
1 parent 71e2929 commit f50d7ef

File tree

12 files changed

+27
-381
lines changed

12 files changed

+27
-381
lines changed

prj/coherence-core-21/src/main/java/com/tangosol/net/security/DoAsAction.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

prj/coherence-core-21/src/main/java/com/tangosol/net/security/SecurityManagerWrapperImpl.java

Lines changed: 0 additions & 168 deletions
This file was deleted.

prj/coherence-core/src/main/java/com/tangosol/net/security/SecurityManagerWrapperImpl.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @author Jonathan Knight 25/01/2025
3030
*/
3131
@SuppressWarnings("removal")
32-
public class SecurityManagerWrapperImpl
32+
class SecurityManagerWrapperImpl
3333
implements SecurityManagerWrapper
3434
{
3535
SecurityManagerWrapperImpl()
@@ -71,7 +71,7 @@ public <T> T doIfSecure(PrivilegedExceptionAction<T> action) throws Exception
7171
{
7272
if (hasSecurityManager())
7373
{
74-
return AccessController.doPrivileged(action);
74+
AccessController.doPrivileged(action);
7575
}
7676
return action.run();
7777
}
@@ -83,10 +83,7 @@ public void doIfSecure(PrivilegedAction<?> action, Runnable fallback)
8383
{
8484
AccessController.doPrivileged(action);
8585
}
86-
else
87-
{
88-
fallback.run();
89-
}
86+
fallback.run();
9087
}
9188

9289
@Override

prj/coherence-core/src/main/java/com/tangosol/util/Unsafe.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import com.oracle.coherence.common.base.Logger;
1212
import com.tangosol.coherence.config.Config;
1313

14-
import com.tangosol.net.security.SecurityManagerWrapperImpl;
14+
import com.tangosol.net.security.SecurityHelper;
1515

1616
import java.security.CodeSource;
1717

@@ -62,7 +62,7 @@ public static Unsafe getUnsafe()
6262
{
6363
String sClassName = aStack[i].getClassName();
6464
// skip frames pertinent to use of Unsafe within a security block
65-
if (!sClassName.startsWith("java.security") && !sClassName.startsWith("javax.security"))
65+
if (!sClassName.startsWith("java.security"))
6666
{
6767
sCallingClass = sClassName;
6868
break;
@@ -98,7 +98,7 @@ public static Unsafe getUnsafe()
9898

9999
CodeSource srcUnsafe = Unsafe.class.getProtectionDomain().getCodeSource();
100100
CodeSource srcCaller = clzCaller.getProtectionDomain().getCodeSource();
101-
CodeSource srcSecurity = SecurityManagerWrapperImpl.class.getProtectionDomain().getCodeSource();
101+
CodeSource srcSecurity = SecurityHelper.getCodeSource();
102102
if (Base.equals(srcCaller, srcUnsafe) || Base.equals(srcCaller, srcSecurity))
103103
{
104104
return INSTANCE;

0 commit comments

Comments
 (0)