Hi all, can anybody tell me if the following is a bug or is a normal behavior? $ ldapsearch -x -H ldap://ldap.ex.com -b ou=People,dc=ex,dc=com |grep zhiling $ ldapsearch -x -H ldap://ldap.ex.com -b ou=People,dc=ex,dc=com "(uid=zhiling)"
# extended LDIF # # LDAPv3 # base <ou=People,dc=ex,dc=com> with scope subtree # filter: (uid=zhiling) # requesting: ALL #
# zhiling, People, ex.com dn: uid=zhiling,ou=People,dc=ex,dc=com uid: zhiling cn: Uela Zhiling objectClass: account objectClass: posixAccount objectClass: top loginShell: /usr/local/bin/bash uidNumber: 20893 gidNumber: 30484 homeDirectory: /users/zhiling gecos: Uela Zhiling, DCS
# search result search: 2 result: 0 Success
# numResponses: 2 # numEntries: 1
why I don't get any match with the grep command? ldap server version: 2.3.34 Thanks in advance, AMos
On Thursday 29 March 2007, Amos Castelli wrote:
Hi all, can anybody tell me if the following is a bug or is a normal behavior? $ ldapsearch -x -H ldap://ldap.ex.com -b ou=People,dc=ex,dc=com |grep zhiling $ ldapsearch -x -H ldap://ldap.ex.com -b ou=People,dc=ex,dc=com "(uid=zhiling)"
# extended LDIF # # LDAPv3 # base <ou=People,dc=ex,dc=com> with scope subtree # filter: (uid=zhiling) # requesting: ALL #
# zhiling, People, ex.com dn: uid=zhiling,ou=People,dc=ex,dc=com uid: zhiling cn: Uela Zhiling objectClass: account objectClass: posixAccount objectClass: top loginShell: /usr/local/bin/bash uidNumber: 20893 gidNumber: 30484 homeDirectory: /users/zhiling gecos: Uela Zhiling, DCS
# search result search: 2 result: 0 Success
# numResponses: 2 # numEntries: 1
why I don't get any match with the grep command?
The most likely answer is that your first search exceeded it's size or time limit before finding the entry. Unfortunately, you don't provide the result code from the first search (which would have told you the answer anyway).
Regards, Buchan
Amos Castelli wrote:
Hi all, can anybody tell me if the following is a bug or is a normal behavior? $ ldapsearch -x -H ldap://ldap.ex.com -b ou=People,dc=ex,dc=com |grep zhiling $ ldapsearch -x -H ldap://ldap.ex.com -b ou=People,dc=ex,dc=com "(uid=zhiling)"
# extended LDIF # # LDAPv3 # base <ou=People,dc=ex,dc=com> with scope subtree # filter: (uid=zhiling) # requesting: ALL #
# zhiling, People, ex.com dn: uid=zhiling,ou=People,dc=ex,dc=com uid: zhiling cn: Uela Zhiling objectClass: account objectClass: posixAccount objectClass: top loginShell: /usr/local/bin/bash uidNumber: 20893 gidNumber: 30484 homeDirectory: /users/zhiling gecos: Uela Zhiling, DCS
# search result search: 2 result: 0 Success
# numResponses: 2 # numEntries: 1
why I don't get any match with the grep command? ldap server version: 2.3.34
Hitting a size limit?
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.n.c. 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 ------------------------------------------
Hello,
I was just wondering how i could launch ONE basic ldap search on several custom attributes all prefixed by "companyName..."
I even don't know if processing that way is possible or if i should make several ldap searches
Thanks for your help
LM
<quote who="Marot Laurent">
Hello,
I was just wondering how i could launch ONE basic ldap search on several custom attributes all prefixed by "companyName..."
I even don't know if processing that way is possible or if i should make several ldap searches
Thanks for your help
LM
Something like:
ldapsearch -x -H ldap://myhost (&(objectClass=CustomClass)(|(companyNameEtc)(blah))) dn
See:
http://www.rfc-editor.org/rfc/rfc4515.txt
Hello,
Instead of using (|(companyNameAttr1)(companyNameAttr2))).... I'd like to know if i could use some "joker" on attribut name like (companyNameAttr*)
Laurent Marot _______________________________
ALLIACOM 98 Avenue du Général Leclerc 92 100 Boulogne Billancourt - France Phone +33 (0)1 55 38 98 98 Mobile 06 21 09 52 29 www.alliacom.com
-----Message d'origine----- De : Gavin Henry [mailto:ghenry@suretecsystems.com] Envoyé : mardi 10 avril 2007 16:07 À : Marot Laurent Cc : openldap-software@openldap.org Objet : Re: Ldapsearch on multiple attributes
<quote who="Marot Laurent">
Hello,
I was just wondering how i could launch ONE basic ldap search on several custom attributes all prefixed by "companyName..."
I even don't know if processing that way is possible or if i should make several ldap searches
Thanks for your help
LM
Something like:
ldapsearch -x -H ldap://myhost (&(objectClass=CustomClass)(|(companyNameEtc)(blah))) dn
See:
http://www.rfc-editor.org/rfc/rfc4515.txt
-- Kind Regards,
Gavin Henry. Managing Director.
T +44 (0) 1224 279484 M +44 (0) 7930 323266 F +44 (0) 1224 824887 E ghenry@suretecsystems.com
Open Source. Open Solutions(tm).
<quote who="Marot Laurent">
Hello,
Instead of using (|(companyNameAttr1)(companyNameAttr2))).... I'd like to know if i could use some "joker" on attribut name like (companyNameAttr*)
Sure. Why don't you just try it? ;-)
Laurent Marot _______________________________
ALLIACOM 98 Avenue du Général Leclerc 92 100 Boulogne Billancourt - France Phone +33 (0)1 55 38 98 98 Mobile 06 21 09 52 29 www.alliacom.com
-----Message d'origine----- De : Gavin Henry [mailto:ghenry@suretecsystems.com] Envoyé : mardi 10 avril 2007 16:07 À : Marot Laurent Cc : openldap-software@openldap.org Objet : Re: Ldapsearch on multiple attributes
<quote who="Marot Laurent"> > Hello, > > I was just wondering how i could launch ONE basic ldap search on > several custom attributes all prefixed by "companyName..." > > I even don't know if processing that way is possible or if i should > make several ldap searches > > Thanks for your help > > LM > >
Something like:
ldapsearch -x -H ldap://myhost (&(objectClass=CustomClass)(|(companyNameEtc)(blah))) dn
See:
http://www.rfc-editor.org/rfc/rfc4515.txt
-- Kind Regards,
Gavin Henry. Managing Director.
T +44 (0) 1224 279484 M +44 (0) 7930 323266 F +44 (0) 1224 824887 E ghenry@suretecsystems.com
Open Source. Open Solutions(tm).
Marot Laurent wrote:
Hello,
Instead of using (|(companyNameAttr1)(companyNameAttr2))).... I'd like to know if i could use some "joker" on attribut name like (companyNameAttr*)
That's forbidden by LDAP specs. Questions like this, which are not related OpenLDAP but quite generic, and clearly originating from a limited knowledge of LDAP basics, should rather be directed to generic LDAP lists, or addressed by reading the specs or a good book.
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">
Marot Laurent wrote:
Hello,
Instead of using (|(companyNameAttr1)(companyNameAttr2))).... I'd like to know if i could use some "joker" on attribut name like (companyNameAttr*)
That's forbidden by LDAP specs. Questions like this, which are not related OpenLDAP but quite generic, and clearly originating from a limited knowledge of LDAP basics, should rather be directed to generic LDAP lists, or addressed by reading the specs or a good book.
Sorry, I read the question wrong. That'll teach me to reply to quickly.
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
Marot Laurent writes:
Instead of using (|(companyNameAttr1)(companyNameAttr2))).... I'd like to know if i could use some "joker" on attribut name like (companyNameAttr*)
No.
However if it's your own schema and you are still developing it, you can define them as subtypes of a common attribute and then search for that common attribute. Such a search will find subtypes too.
The subtypes inherit the syntax and matching rules of the supertype unless overridden. And I don't know how indexing works if you override the syntax or matching rules, e.g. caseIgnoreMatch -> caseExactMatch. (If you index the common attribute, the index will include the subtypes so that the search will work properly.)
The common attribute (likely also defined in your schema) should normally not itself be used in directory entries and thus not in the MUST/MAY clauses of object classes, since you'll have no standard way to search for that attribute _without_ getting subtype matches as well.
See e.g. the definitions of attributes 'name', 'c' and 'o' in RFC 4519.
openldap-software@openldap.org