1 .TH LDAP_GET_DN 3 "21 July 2000" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_get_dn, ldap_explode_dn, ldap_explode_rdn, ldap_dn2ufn \- LDAP DN handling routines
13 char *ldap_get_dn(ld, entry)
19 char **ldap_explode_dn(dn, notypes)
25 char **ldap_explode_rdn(rdn, notypes)
35 These routines allow LDAP entry names (Distinguished Names, or DNs)
36 to be obtained, parsed, converted to a user-friendly form, and tested.
37 A DN has the form described in
38 RFC 2253 "Lightweight Directory Access Protocol (v3):
39 UTF-8 String Representation of Distinguished Names".
43 routine takes an \fIentry\fP as returned by
44 .BR ldap_first_entry (3)
46 .BR ldap_next_entry (3)
48 the entry's DN. Space for the DN will be obtained dynamically
49 and should be freed by the caller using
54 routine takes a DN as returned by
56 and breaks it up into its component parts. Each part is known as a
57 Relative Distinguished Name, or RDN.
60 NULL-terminated array, each component of which contains an RDN from the
61 DN. The \fInotypes\fP parameter is used to request that only the RDN
62 values be returned, not their types. For example, the DN "cn=Bob,
63 c=US" would return as either { "cn=Bob", "c=US", NULL } or { "Bob",
64 "US", NULL }, depending on whether notypes was 0 or 1, respectively.
65 The result can be freed by calling
66 .BR ldap_value_free (3).
70 routine takes an RDN as returned by
71 .B ldap_explode_dn(dn,0)
72 and breaks it up into its "type=value" component parts (or just "value",
73 if the \fInotypes\fP parameter is set). The result can be freed by
75 .BR ldap_value_free (3).
78 is used to turn a DN as returned by
80 into a more user-friendly form, stripping off type names. See
81 RFC 1781 "Using the Directory to Achieve User Friendly Naming"
82 for more details on the UFN format. The space for the UFN returned
83 is obtained dynamically and the user is responsible for freeing it
89 NULL is returned and the
91 field in the \fIld\fP parameter is set to indicate the error. See
93 for a description of possible error codes.
94 .BR ldap_explode_dn() ,
95 .BR ldap_explode_rdn() ,
100 set appropriately in case of trouble.
102 These routines dyanamically allocate memory that the caller must free.
106 .BR ldap_first_entry(3),
108 .BR ldap_value_free(3)
111 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
113 is derived from University of Michigan LDAP 3.3 Release.