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 ? Or, is it possible to find out how many values of "cn" in particular entry, matched? 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 .
Regards, Piotr
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 ---------------------------------------
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*)"
Very cool.
On Sun, 24 Jun 2007, Pierangelo Masarati wrote:
Piotr Wadas wrote:
Hello, using openldap 2.3.35.
- is it possible to have "cn" returned, but only these values,
which actually matched the filter ?
$ ldapsearch -E mv="(cn=foo*)"
That's ok, but how do I use the extension with ldap_search_ext from C LDAP SDK ? :) Regards, Piotr
Piotr Wadas wrote:
On Sun, 24 Jun 2007, Pierangelo Masarati wrote:
Piotr Wadas wrote:
Hello, using openldap 2.3.35.
- is it possible to have "cn" returned, but only these values,
which actually matched the filter ?
$ ldapsearch -E mv="(cn=foo*)"
That's ok, but how do I use the extension with ldap_search_ext from C LDAP SDK ? :)
The save way ldapsearch.c does?
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 ---------------------------------------
On Sun, 2007-06-24 at 15:54 +0200, Pierangelo Masarati wrote:
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*)"
Cool, only this is not mentioned in ldapsearch man page. My story is like Piotr Wadas but I do have too many values for an attribute in different language versions, is it possible to only return values in the language version I specified? cn=Wong Penghui cn;lang-zh=Wang Penghui cn;lang-de=...
Now search for cn=*Penghui and wish to only return result in certain language, is it possible?
Zhang Weiwu wrote:
On Sun, 2007-06-24 at 15:54 +0200, Pierangelo Masarati wrote:
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*)"
Cool, only this is not mentioned in ldapsearch man page.
Please file an ITS for this. Complaining in the last of a series of emails on a partially related subject is really the best way for not seeing it fixed ever.
My story is like Piotr Wadas but I do have too many values for an attribute in different language versions, is it possible to only return values in the language version I specified? cn=Wong Penghui cn;lang-zh=Wang Penghui cn;lang-de=...
Now search for cn=*Penghui and wish to only return result in certain language, is it possible?
I don't know, but I guess so. Why don't you just try using a filter like -E mv="(cn;lang-zh=Wang Penghui)" ?
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 ---------------------------------------
<quote who="Pierangelo Masarati">
Zhang Weiwu wrote:
On Sun, 2007-06-24 at 15:54 +0200, Pierangelo Masarati wrote:
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*)"
Cool, only this is not mentioned in ldapsearch man page.
Please file an ITS for this. Complaining in the last of a series of emails on a partially related subject is really the best way for not seeing it fixed ever.
Please do, then I will action the addition.
Gavin.
On Sat, 2007-06-30 at 15:35 +0200, Pierangelo Masarati wrote:
Zhang Weiwu wrote:
On Sun, 2007-06-24 at 15:54 +0200, Pierangelo Masarati wrote:
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*)"
Cool, only this is not mentioned in ldapsearch man page.
Please file an ITS for this. Complaining in the last of a series of emails on a partially related subject is really the best way for not seeing it fixed ever.
I just filed it http://www.openldap.org/its/index.cgi?findid=5034 It may be duplicated reported, I seem to recall when I was doing a google search on how to use '-E' I came across a page someone reported this issue (he used '-e' rather then '-E'), but I can never find that webpage again today.
My story is like Piotr Wadas but I do have too many values for an attribute in different language versions, is it possible to only return values in the language version I specified? cn=Wong Penghui cn;lang-zh=Wang Penghui cn;lang-de=...
Now search for cn=*Penghui and wish to only return result in certain language, is it possible?
I don't know, but I guess so. Why don't you just try using a filter like -E mv="(cn;lang-zh=Wang Penghui)" ?
Yes but in most cases I am troubled with, eerm, getting only the default language version, that is getting only "cn=Wong Penghui" but not "cn;lang-zh=Wang Penghui"
-E mv="cn=*Penghui" wouldn't work because by RFC 2596, server should think cn;lang-zh=Wang Penghui matches cn=*Penghui
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 ? Or, is it possible
Yes, see RFC3876. A copy of it is in the doc directory of the source tree.
ossible to have "cn" returned, but only these values, which actually matched the filter ? Or, is it possible to find out how many values of "cn" in particular entry, matched? 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,
I don't think so; a search qualifies an object as a match to the filter, so you get the attributes from the matching object(s) that you requested.
- and only if some of them are specified in return attributes, the
matching values should be returned .
I don't understand what this means.
openldap-software@openldap.org