final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
private void loadProvider(final Bundle bundle) { if (bundle.getState() == Bundle.UNINSTALLED) { return; } try { checkPermission(new AdminPermission(bundle, AdminPermission.RESOURCE)); checkPermission(new AdaptPermission(BundleWiring.class.getName(), bundle, AdaptPermission.ADAPT)); final BundleContext bundleContext = bundle.getBundleContext(); if (bundleContext == null) { LOGGER.debug("Bundle {} has no context (state={}), skipping loading provider", bundle.getSymbolicName(), toStateString(bundle.getState())); } else { loadProvider(bundleContext, bundle.adapt(BundleWiring.class)); } } catch (final SecurityException e) { LOGGER.debug("Cannot access bundle [{}] contents. Ignoring.", bundle.getSymbolicName(), e); } catch (final Exception e) { LOGGER.warn("Problem checking bundle {} for Log4j 2 provider.", bundle.getSymbolicName(), e); } }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
@Override <A> void checkAdaptPerm(BundleImpl b, Class<A> type) { final SecurityManager sm = System.getSecurityManager(); if (null != sm) { sm.checkPermission(new AdaptPermission(type.getName(), b, AdaptPermission.ADAPT)); } }
/** * Check for permission to get a service. */ private <A> void checkAdaptPermission(Class<A> adapterType) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return; } sm.checkPermission(new AdaptPermission(adapterType.getName(), this, AdaptPermission.ADAPT)); }
<A> void checkAdapt(Class<A> type) { Object sm = System.getSecurityManager(); if ((sm != null) && (getFramework().getSecurityProvider() != null)) { Class[] classes = m_smEx.getClassContext(); if (classes.length < 3 || ((Felix.m_secureAction.getClassLoader(classes[3]) != m_classloader) || !classes[3].getName().startsWith("org.apache.felix.framework."))) { ((SecurityManager) sm).checkPermission( new AdaptPermission(type.getName(), this, AdaptPermission.ADAPT)); } } }
private void loadProvider(final Bundle bundle) { if (bundle.getState() == Bundle.UNINSTALLED) { return; } try { checkPermission(new AdminPermission(bundle, AdminPermission.RESOURCE)); checkPermission(new AdaptPermission(BundleWiring.class.getName(), bundle, AdaptPermission.ADAPT)); loadProvider(bundle.getBundleContext(), bundle.adapt(BundleWiring.class)); } catch (final SecurityException e) { LOGGER.debug("Cannot access bundle [{}] contents. Ignoring.", bundle.getSymbolicName(), e); } catch (final Exception e) { LOGGER.warn("Problem checking bundle {} for Log4j 2 provider.", bundle.getSymbolicName(), e); } }
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));
final int newMask = ap.action_mask; if (oldMask != newMask) { pc.put(name, new AdaptPermission(existing.filter, oldMask | newMask));