Skip to content

Commit 71e2929

Browse files
committed
Bug 38139258 - [38041090->25.09] Failed to restart services: java.lang.SecurityException due to Subject is not inherited from the parent thread, tantitive fix...
[git-p4: depot-paths = "//dev/coherence-ce/main/": change = 117390]
1 parent a83f1d0 commit 71e2929

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public <T> T doIfSecure(PrivilegedExceptionAction<T> action) throws Exception
7777
}
7878

7979
Subject subject = getCurrentSubject();
80-
return AccessController.doPrivileged((PrivilegedAction<T>) () ->
80+
return AccessController.doPrivileged((PrivilegedExceptionAction<T>) () ->
8181
Subject.callAs(subject, action::run));
8282
}
8383
return action.run();

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

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

14-
import com.tangosol.net.security.SecurityHelper;
1514
import com.tangosol.net.security.SecurityManagerWrapperImpl;
1615

1716
import java.security.CodeSource;
@@ -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 = SecurityManagerWrapperImpl.class.getProtectionDomain().getCodeSource();
102+
if (Base.equals(srcCaller, srcUnsafe) || Base.equals(srcCaller, srcSecurity))
106103
{
107104
return INSTANCE;
108105
}

0 commit comments

Comments
 (0)