If you are using an API which takes a filter _expression_, the filter _expression_ must be well formed. This can include escaping any characters which would otherwise be interpreted as part of the _expression_ language.
 
The spec, https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.filtersyntax, is pretty clear on this:
 
"attr must not contain the characters '=', '>', '<', '~', '(' or ')'."
 
"If value must contain one of the characters reverse solidus ('\' \u005C), asterisk ('*' \u002A), parentheses open ('(' \u0028) or parentheses close (')' \u0029), then these characters should be preceded with the reverse solidus ('\' \u005C) character."
--

BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
 
 
----- Original message -----
From: "Leschke, Scott via osgi-dev" <osgi-dev@mail.osgi.org>
Sent by: osgi-dev-boun...@mail.osgi.org
To: "'osgi-dev@mail.osgi.org'" <osgi-dev@mail.osgi.org>
Cc:
Subject: [EXTERNAL] [osgi-dev] escaping registry filter queries
Date: Tue, Dec 10, 2019 13:06
 

I’d like to know which characters need to be escaped in registry queries. Obviously characters ‘(‘ and ‘)’ need to be, and the escape character ‘\’ itself.

So what others, ‘=’, ‘<’ and ‘>’ perhaps?  The negation ‘!’ char?

 

Since filters use LDAP syntax, I had assumed that the escaping would follow LDAP rules as well, ie ‘(‘ -> “\28” and ‘)’ -> “\29” but that doesn’t appear to work at all.

 

As always, thanks in advance.

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev 
 

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to