Skip to content

Commit

Permalink
WFLY-6484 make cached context proxy use the same protection domain of…
Browse files Browse the repository at this point in the history
… the context
  • Loading branch information
istudens committed Apr 20, 2016
1 parent f87d951 commit 014d11b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public ClassLoader run() {
config.setClassLoader(loader);
config.setSuperClass(initialContextClass);
config.setProxyName(initialContextClassName + "$$$$Proxy" + PROXY_ID.incrementAndGet());
config.setProtectionDomain(context.getClass().getProtectionDomain());
ProxyFactory<?> factory = new ProxyFactory<Object>(config);
return (Context) factory.newInstance(new CachedContext(context));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import static org.jboss.as.naming.subsystem.NamingSubsystemModel.ENVIRONMENT;
import static org.jboss.as.naming.subsystem.NamingSubsystemModel.EXTERNAL_CONTEXT;
import static org.jboss.as.naming.subsystem.NamingSubsystemModel.MODULE;
import static org.jboss.as.test.shared.integration.ejb.security.PermissionUtils.createPermissionsXmlAsset;

import javax.naming.Context;
import javax.naming.InitialContext;
Expand Down Expand Up @@ -78,6 +79,7 @@

import com.sun.jndi.ldap.LdapCtx;
import com.sun.jndi.ldap.LdapCtxFactory;
import org.wildfly.naming.java.permission.JndiPermission;

/**
* Test for external context binding. There are tests which use a usual InitialContext and treat it
Expand Down Expand Up @@ -312,7 +314,8 @@ public void tearDown(ManagementClient managementClient, String containerId) thro
@Deployment
public static JavaArchive deploy() {
return ShrinkWrap.create(JavaArchive.class, "externalContextBindingTest.jar")
.addClasses(ExternalContextBindingTestCase.class, LookupEjb.class);
.addClasses(ExternalContextBindingTestCase.class, LookupEjb.class)
.addAsManifestResource(createPermissionsXmlAsset(new JndiPermission("*", "lookup")), "jboss-permissions.xml");
}

@Test
Expand Down

0 comments on commit 014d11b

Please sign in to comment.