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

ldapsearch basics



hi-

i'm having trouble doing a basic ldap search.  the command i'm using is:

ldapsearch -vx "(uid=luna)" - which gives me the following:

20:38:25(root@under)/etc/ldap>ldapsearch -vx "(uid=luna)"
ldap_initialize( <DEFAULT> )
filter: (uid=luna)
requesting: ALL
# extended LDIF
#
# LDAPv3
# base <> with scope sub
# filter: (uid=luna)
# requesting: ALL
#

# search result
search: 2
result: 0 Success

# numResponses: 1

however, if i use this command instead:

ldapsearch -vx "(uid=luna*)" - i get the expected results:

20:38:28(root@under)/etc/ldap>ldapsearch -vx "(uid=luna*)"
ldap_initialize( <DEFAULT> )
filter: (uid=luna*)
requesting: ALL
# extended LDIF
#
# LDAPv3
# base <> with scope sub
# filter: (uid=luna*)
# requesting: ALL
#

# luna, People, groundnoise.net
dn: uid=luna,ou=People,dc=groundnoise,dc=net
uid: luna
cn: luna
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
shadowLastChange: 12729
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1000
homeDirectory: /home/luna
gecos: luna,,,

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

i can do searches on any other attribute aside from uid, and not need 
to add the * at the end of the filter, but for a reason i have yet to 
figure out, the uid attribute filter seems to behave differently.

any ideas?

thanks
-ben