summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/slapi-plugin.h
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-08-27 11:55:29 -0600
committerRich Megginson <rmeggins@redhat.com>2010-08-31 13:35:55 -0600
commit8a943175138bbfec0b398ea4ffd24f3047df3951 (patch)
tree0de237774ea8b33921ebf7fc31177dc1986f0e4b /ldap/servers/slapd/slapi-plugin.h
parent219b8af89283faae5fb408beb74f082ff7265d34 (diff)
downloadds-8a943175138bbfec0b398ea4ffd24f3047df3951.tar.gz
ds-8a943175138bbfec0b398ea4ffd24f3047df3951.tar.xz
ds-8a943175138bbfec0b398ea4ffd24f3047df3951.zip
implement slapi_ldap_explode_dn and slapi_ldap_explode_rdn
The DS has some problems with the openldap versions of these functions: 1) They are deprecated - should use the str2[r]dn and [r]dn2str and the bv versions of those functions instead 2) They escape utf-8 and other values in the strings - the mozldap functions do not do this 3) They handle double quoted strings, but they remove the quotes - our code expects the quotes to be left in place Until we fix our DN handling, and get rid of the double quoted DNs, we just use the mozldap versions of these functions.
Diffstat (limited to 'ldap/servers/slapd/slapi-plugin.h')
-rw-r--r--ldap/servers/slapd/slapi-plugin.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 948fe1c1..0aab49ca 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -5170,6 +5170,40 @@ int slapi_ldif_parse_line(
int *freeval /* values will usually be returned in place as pointers into line - if the value is a url, the value will be malloced and must be freed by the caller */
);
+/**
+ * Parse an LDAP DN string. Return an array of RDN strings, terminated by a NULL. This
+ * function differs from the standard openldap ldap_explode_dn, which will escape utf-8
+ * characters. In the directory server, we do not want to escape them. The caller
+ * should use slapi_ldap_value_free to free the returned memory when finished.
+ *
+ * \param dn The LDAP DN
+ * \param notypes set to true (1) to return only the attribute values with no attribute types
+ * \return \c An array of RDN strings - use slapi_ch_array_free to free
+ *
+ * \see slapi_ldap_value_free()
+ */
+char **slapi_ldap_explode_dn(
+ const char *dn, /* dn to explode */
+ int notypes /* set to true to return only the values with no types */
+);
+
+/**
+ * Parse an LDAP RDN string. Return an array of AVA strings, terminated by a NULL. This
+ * function differs from the standard openldap ldap_explode_rdn, which will escape utf-8
+ * characters. In the directory server, we do not want to escape them. The caller
+ * should use slapi_ldap_value_free to free the returned memory when finished.
+ *
+ * \param dn The LDAP RDN
+ * \param notypes set to true (1) to return only the attribute values with no attribute types
+ * \return \c An array of AVA strings - use slapi_ch_array_free to free
+ *
+ * \see slapi_ldap_value_free()
+ */
+char **slapi_ldap_explode_rdn(
+ const char *rdn, /* rdn to explode */
+ int notypes /* set to true to return only the values with no types */
+);
+
/*
* computed attributes
*/