1 .TH LDAP_GET_DN 3 "22 July 2001" "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( LDAP *ld, LDAPMessage *entry )
16 char **ldap_explode_dn( const char *dn, int notypes )
19 char **ldap_explode_rdn( const char *rdn, int notypes )
22 char *ldap_dn2ufn( const char * dn )
24 These routines allow LDAP entry names (Distinguished Names, or DNs)
25 to be obtained, parsed, converted to a user-friendly form, and tested.
26 A DN has the form described in
27 RFC 2253 "Lightweight Directory Access Protocol (v3):
28 UTF-8 String Representation of Distinguished Names".
32 routine takes an \fIentry\fP as returned by
33 .BR ldap_first_entry (3)
35 .BR ldap_next_entry (3)
37 the entry's DN. Space for the DN will be obtained dynamically
38 and should be freed by the caller using
43 routine takes a DN as returned by
45 and breaks it up into its component parts. Each part is known as a
46 Relative Distinguished Name, or RDN.
49 NULL-terminated array, each component of which contains an RDN from the
50 DN. The \fInotypes\fP parameter is used to request that only the RDN
51 values be returned, not their types. For example, the DN "cn=Bob,
52 c=US" would return as either { "cn=Bob", "c=US", NULL } or { "Bob",
53 "US", NULL }, depending on whether notypes was 0 or 1, respectively.
54 The result can be freed by calling
55 .BR ldap_value_free (3).
59 routine takes an RDN as returned by
60 .B ldap_explode_dn(dn,0)
61 and breaks it up into its "type=value" component parts (or just "value",
62 if the \fInotypes\fP parameter is set). Note the value is not
63 unescaped. The result can be freed by calling
64 .BR ldap_value_free (3).
67 is used to turn a DN as returned by
69 into a more user-friendly form, stripping off all type names. See
70 "Using the Directory to Achieve User Friendly Naming" (RFC 1781)
71 for more details on the UFN format. Due to the ambigious nature
72 of the format, it is generally only used for display purposes.
73 The space for the UFN returned is obtained dynamically and the user
74 is responsible for freeing it via a call to
79 NULL is returned and the
81 field in the \fIld\fP parameter is set to indicate the error. See
83 for a description of possible error codes.
84 .BR ldap_explode_dn() ,
85 .BR ldap_explode_rdn() ,
90 set appropriately in case of trouble.
92 These routines dyanamically allocate memory that the caller must free.
96 .BR ldap_first_entry(3),
98 .BR ldap_value_free(3)
101 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
103 is derived from University of Michigan LDAP 3.3 Release.