Piotr Wadas wrote:
Hello, using openldap 2.3.35.
When I do a search for some attribute like "cn=foobar", and in set of attributes which are to be returned per-entry is "cn" attribute, all its values are returned.
however, when I search with "cn=foo*", and entry has multiple "cn" values, like
"cn=foo", "cn=joe", "cn=foobar", "cn=foobarX", "cn=bob", "cn=nofoobar"
- is it possible to have "cn" returned, but only these values,
which actually matched the filter ?
Yes. Use RFC 3876 control. E.g.
$ ldapsearch -E mv="(cn=foo*)"
Or, is it possible to find out how many values of "cn" in particular entry, matched?
Dunno. But you can count the values returned by the above search
While doing such search in some specified case, I'm interested only with values "cn=foo", "cn=foobar" and "cn=foobarX", I do not care what are other "cn" values, nor even there are other values of "cn" which didn't match, or not. Such feature seems complicated, because filter actually may be build with many attributes,
- and only if some of them are specified in return attributes, the
matching values should be returned .
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------