[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldpsearch filter showing all records.



Surya Santosh Kumar Allena wrote:
> Hi,
>
> You may want to try
>
> ldapsearch -h 127.0.0.1 -b "ou=people,dc=example,dc=com" -x -D
> "cn=Manager,dc=example,dc=com" -W "(&(objectClass=inetOrgPerson)
> (uid=ldap-admin))"
>
> if you want the details of user having uid as ldap-admin and
> ObjectClass as inetOrgPerson
>
> Thanks
> Surya


Hello Surya,

Thanks a lot.... :-)
The search is working as expected.
Wish you a nice time.



>
>
> On Mon, Jun 15, 2009 at 3:36 PM, J. Bakshi <joydeep@infoservices.in
> <mailto:joydeep@infoservices.in>> wrote:
>
>     Hello list,
>
>     My filter on ldapsearch is not working as expected but showing all the
>     records.
>
>     If I simply do an search on object class like below it shows all
>     records
>     belong to that object
>
>     ````````````````````````````````````````````````````````````````````````````
>      ldapsearch -h 127.0.0.1 -b "ou=people,dc=example,dc=com" -x
>     "objectclass=inetOrgPerson"  -D "cn=Manager,dc=example,dc=com" -W
>     Enter LDAP Password:
>
>     # extended LDIF
>     #
>     # LDAPv3
>     # base <ou=people,dc=example,dc=com> with scope subtree
>     # filter: objectclass=inetOrgPerson
>     # requesting: ALL
>     #
>
>     # test1, people, example.com <http://example.com>
>     dn: cn=test1,ou=people,dc=example,dc=com
>     objectClass: inetOrgPerson
>     cn: test1
>     sn: smith
>     uid: rjsmith
>     userPassword:: MTIzNDU2
>     carLicense: HISCAR 123
>     homePhone: 555-111-2222
>     description: swell guy
>     ou: Human Resources
>     mail: r.smith@example.com <mailto:r.smith@example.com>
>
>     # test2, people, example.com <http://example.com>
>     dn: cn=test2,ou=people,dc=example,dc=com
>     objectClass: inetOrgPerson
>     cn: test2
>     sn: Billy
>     uid: rbilly
>     userPassword:: MTIzNDU2
>     carLicense: HISCAR 123
>     homePhone: 555-111-2222
>     mail: billy@example.com <mailto:billy@example.com>
>     description: sales guy
>     ou: Sales
>
>     # search result
>     search: 2
>     result: 0 Success
>
>     # numResponses: 3
>     # numEntries: 2
>     ``````````````````````````````````````````````````````````````````````````````````````
>
>     Now to redifine the filter.  Want to result where gid=rjsmith
>
>     ` ` ` ` ` ` ` `
>     ldapsearch -h 127.0.0.1 -b "ou=people,dc=example,dc=com" -x
>     "objectclass=inetOrgPerson" uid=rjsmith  -D
>     "cn=Manager,dc=example,dc=com" -W
>     Enter LDAP Password:
>
>     # extended LDIF
>     #
>     # LDAPv3
>     # base <ou=people,dc=example,dc=com> with scope subtree
>     # filter: objectclass=inetOrgPerson
>     # requesting: uid=rjsmith
>     #
>
>     # test1, people, example.com <http://example.com>
>     dn: cn=test1,ou=people,dc=example,dc=com
>
>     # test2, people, example.com <http://example.com>
>     dn: cn=test2,ou=people,dc=example,dc=com
>
>     # search result
>     search: 2
>     result: 0 Success
>
>     # numResponses: 3
>     # numEntries: 2
>
>     ` ` ` ` ` `
>
>     Again both the results are showing.   something wrong in my  filter  ?
>     Please enlighten me.
>
>     Thanks
>
>