HP-UX Directory Server 8.1 administrator guide
Table C-1 LDAP URL components (continued)
DescriptionComponent
The scope of the search, which can be one of these values:
• base retrieves information only about the distinguished name (base_dn) specified
in the URL.
• one retrieves information about entries one level below the distinguished name
(base_dn) specified in the URL. The base entry is not included in this scope.
• sub retrieves information about entries at all levels below the distinguished name
(base_dn) specified in the URL. The base entry is included in this scope.
If no scope is specified, the server performs a base search.
scope
Search filter to apply to entries within the specified scope of the search. If no filter is
specified, the server uses the filter (objectClass=*).
filter
The attributes, scope, and filter components are identified by their positions in the URL. Even if
no attributes are specified, the question marks still must be included to delimit that field.
For example, to specify a subtree search starting from dc=example,dc=com that returns all
attributes for entries matching (sn=Jensen), use the following LDAP URL:
ldap://ldap.example.com/dc=example,dc=com??sub?(sn=Jensen)
The two consecutive question marks, ??, indicate that no attributes have been specified. Because
no specific attributes are identified in the URL, all attributes are returned in the search.
C.2 Escaping unsafe characters
Any unsafe characters in the URL need to be escaped, or substituted with a special sequence of
characters.
For example, a space is an unsafe character that must be represented as %20 within the URL.
Thus, the distinguished name o=example.com corporation must be encoded as
o=example.com%20corporation.
The following table lists the characters that are considered unsafe within URLs and provides the
associated escape characters to use in place of the unsafe character:
Escape CharactersUnsafe CharacterEscape CharactersUnsafe Character
%7c|%20
space
%5c\%3c<
%5e^%3e>
%7e~%22"
%5b[%23#
%5d]%25%
%60`%7b{
%7d}
C.3 Examples of LDAP URLs
NOTE:
The LDAP URL format is described in RFC 4516, which is available at http://www.ietf.org/rfc/
rfc4516.txt.
Example 1 The following LDAP URL specifies a base search for the entry with the distinguished
name dc=example,dc=com.
ldap://ldap.example.com/dc=example,dc=com
570 LDAP URLs