HP-UX Directory Server Administrator Guide HP-UX Directory Server Version 8.1 (5900-3098, May 2013)

Table 84 LDAP URL components (continued)
DescriptionComponent
If no scope is specified, the server performs a base search.
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|%20space
%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
Because no port number is specified, the standard LDAP port number (389) is used.
Because no attributes are specified, the search returns all attributes.
C.2 Escaping unsafe characters 571