Skip to content

Commit e2ae039

Browse files
committed
Bug 38139257 - [38041090->25.03.3] Failed to restart services: java.lang.SecurityException due to Subject is not inherited from the parent thread
Undo //dev/coherence-ce/release/coherence-ce-v25.03/prj/... changelist 117247 [git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v25.03/": change = 117350]
1 parent 91be3ac commit e2ae039

File tree

12 files changed

+34
-391
lines changed

12 files changed

+34
-391
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: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.tangosol.coherence.config.Config;
1313

1414
import com.tangosol.net.security.SecurityHelper;
15-
import com.tangosol.net.security.SecurityManagerWrapperImpl;
1615

1716
import java.security.CodeSource;
1817

@@ -63,7 +62,7 @@ public static Unsafe getUnsafe()
6362
{
6463
String sClassName = aStack[i].getClassName();
6564
// skip frames pertinent to use of Unsafe within a security block
66-
if (!sClassName.startsWith("java.security") && !sClassName.startsWith("javax.security"))
65+
if (!sClassName.startsWith("java.security"))
6766
{
6867
sCallingClass = sClassName;
6968
break;
@@ -97,12 +96,10 @@ public static Unsafe getUnsafe()
9796

9897
}
9998

100-
CodeSource srcUnsafe = Unsafe.class.getProtectionDomain().getCodeSource();
101-
CodeSource srcCaller = clzCaller.getProtectionDomain().getCodeSource();
102-
CodeSource srcSecurity = SecurityHelper.class.getProtectionDomain().getCodeSource();
103-
CodeSource srcSecurity2 = SecurityManagerWrapperImpl.class.getProtectionDomain().getCodeSource();
104-
if (Base.equals(srcCaller, srcUnsafe) || Base.equals(srcCaller, srcSecurity)
105-
|| Base.equals(srcCaller, srcSecurity2))
99+
CodeSource srcUnsafe = Unsafe.class.getProtectionDomain().getCodeSource();
100+
CodeSource srcCaller = clzCaller.getProtectionDomain().getCodeSource();
101+
CodeSource srcSecurity = SecurityHelper.getCodeSource();
102+
if (Base.equals(srcCaller, srcUnsafe) || Base.equals(srcCaller, srcSecurity))
106103
{
107104
return INSTANCE;
108105
}

0 commit comments

Comments
 (0)