fix(#729): escape names embedded in OSGi service filters (#738)
Six lookups in camel-core-osgi built a service filter by concatenating a
name straight into it: OsgiBeanRepository (name= and service.pid=),
OsgiComponentResolver (component=), OsgiLanguageResolver (language= and
resolver=) and OsgiDataFormatResolver (dataformat=).
Filter metacharacters in the name were therefore read as filter syntax
rather than matched as text. A name of "*" becomes a presence assertion
matching every registered service, and since each site takes refs[0] the
lookup returned an arbitrary service instead of not resolving. A name
containing ")(" made the framework reject the filter, faulting the
exchange with a syntax error instead of a clean not-found.
Route this through OsgiFilterHelper.createFilter, which escapes the value
first. Escaping only: the FQCN and service.pid interpretations in
lookupByName are the documented purpose of the class and are left alone,
since narrowing them would change behaviour for existing deployments.
getServiceReference(name) at OsgiBeanRepository:80 takes an exact
interface name rather than a filter, so it needs nothing.
Note the escaping is the OSGi filter grammar's backslash-before-character
form, not the RFC 4515 "\2a" hex form - an OSGi Filter reads the latter as
the two literal characters 2a. The tests caught this: they assert against
a real FrameworkUtil.createFilter, so they check the filter actually stops
matching rather than just that a string was rewritten.Apache Camel is a powerful open source integration framework based on known Enterprise Integration Patterns with powerful bean integration.
This project provides Apache Karaf support for Apache Camel.
To build camel-karaf, simple do:
mvn clean install
If you want to skip the tests, you can do:
mvn clean install -DskipTests
If you want to upgrade camel-karaf to a new camel version, here's the process:
git clone https://github.com/apache/camel
cd camel git checkout camel-x.y.z
tooling/camel-upgrade folder. Go in this folder:cd tooling/camel-upgrade
java -jar target/camel-upgrade-*.jar
git diff for instance) and create a Pull Request.Here's the process to do a camel-karaf release:
mvn release:prepare
mvn release:perform
Close the Maven staging repository on repository.apache.org
The source distribution is available the target folder: camel-karaf-x.y.z-source.release.zip.*. You have to stage the source distribution files to svn://dist.apache.org/repos/dist/dev/camel.
When both Maven Staging Repository (closed) and dist.apache.org are up to date with the release files, you can start the release vote.