diff options
author | Graham Leggett <minfrin@apache.org> | 2014-04-21 17:45:58 +0000 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2014-04-21 17:45:58 +0000 |
commit | 882e7b8852fd4af3decd4c93fd895155a5c25c95 (patch) | |
tree | 636100248ba3547f2661b93ef9487d4aca12e476 /include/apr_escape.h | |
parent | d81ecb2730b3545f544016f1d9411cc4568b7bef (diff) | |
download | apr-882e7b8852fd4af3decd4c93fd895155a5c25c95.tar.gz |
Split the ability to filter LDAP escape sequences into DN escaping or filter
escaping, allowing the option to escape both at the same time.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1588937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_escape.h')
-rw-r--r-- | include/apr_escape.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/apr_escape.h b/include/apr_escape.h index f1968be0c..6d4e08be0 100644 --- a/include/apr_escape.h +++ b/include/apr_escape.h @@ -40,7 +40,22 @@ extern "C" { * passed to indicate a string-valued key, and have the length computed * automatically. */ -#define APR_ESCAPE_STRING (-1) +#define APR_ESCAPE_STRING (-1) + +/** + * Apply LDAP distinguished name escaping as per RFC4514. + */ +#define APR_ESCAPE_LDAP_DN (0x01) + +/** + * Apply LDAP filter escaping as per RFC4515. + */ +#define APR_ESCAPE_LDAP_FILTER (0x02) + +/** + * Apply both RFC4514 and RFC4515 LDAP escaping. + */ +#define APR_ESCAPE_LDAP_ALL (0x03) /** * Perform shell escaping on the provided string. @@ -372,11 +387,13 @@ APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, * @param dest The destination buffer, can be NULL * @param src The original buffer * @param srclen The length of the original buffer + * @param flags APR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for + * RFC4515, APR_ESCAPE_LDAP_ALL for both * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_ldap(char *dest, const void *src, - apr_ssize_t srclen, apr_size_t *len); + apr_ssize_t srclen, int flags, apr_size_t *len); /** * Apply LDAP escaping to binary data, and return the results from a @@ -385,11 +402,13 @@ APR_DECLARE(apr_status_t) apr_escape_ldap(char *dest, const void *src, * @param p Pool to allocate from * @param src The original buffer * @param slen The length of the original buffer + * @param flags APR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for + * RFC4515, APR_ESCAPE_LDAP_ALL for both * @return A zero padded buffer allocated from the pool on success, or * NULL if src was NULL. */ APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src, - apr_ssize_t slen) __attribute__((nonnull(1))); + apr_ssize_t slen, int flags) __attribute__((nonnull(1))); /** @} */ #ifdef __cplusplus |