HP UX Red Hat Direry Server Software manual Ldap Search Filters

Models: UX Red Hat Direry Server Software

1 638
Download 638 pages 23.73 Kb
Page 579
Image 579

LDAP Search Filters

the search line. For example, the following ldapsearch command performs both searches but returns only the DN and the givenname and sn attributes of each entry:

ldapsearch -h mozilla -f searchdb sn givenname

2.4.8. Specifying DNs That Contain Commas in Search Filters

When a DN within a search filter contains a comma as part of its value, the comma must be escaped with a backslash (\). For example, to find everyone in the example.com Bolivia, S.A. subtree, use the following command:

ldapsearch -h mozilla -s base -b "l=Bolivia\,S.A.,dc=example,dc=com"

"objectclass=*"

2.4.9. Using Client Authentication When Searching

This example shows user bjensen searching the directory using client authentication:

ldapsearch -h mozilla -p 636 -b "dc=example,dc=com" -N "bjensenscertname"

-Z -W certdbpassword -P /home/bjensen/certdb/cert8.db

"givenname=Richard"

3. LDAP Search Filters

Search filters select the entries to be returned for a search operation. They are most commonly used with the ldapsearch command-line utility. When using ldapsearch, there can be multiple search filters in a file, with each filter on a separate line in the file, or a search filter can be specified directly on the command-line.

For example, the following filter specifies a search for the common name Babs Jensen:

cn=babs jensen

This search filter returns all entries that contain the common name Babs Jensen. Searches for common name values are not case sensitive.

When the common name attribute has values associated with a language tag, all of the values are returned. Thus, the following two attribute values both match this filter:

cn: babs jensen

cn;lang-fr: babs jensen

For a list of all the supported language tags, see Table D.1, “Supported Locales”.

559

Page 579
Image 579
HP UX Red Hat Direry Server Software manual Ldap Search Filters, Specifying DNs That Contain Commas in Search Filters