Add more LDAP escaping rules from RFC 2253
authoraland <aland>
Sun, 8 Apr 2007 07:14:45 +0000 (07:14 +0000)
committeraland <aland>
Sun, 8 Apr 2007 07:14:45 +0000 (07:14 +0000)
src/modules/rlm_ldap/rlm_ldap.c

index aa709cd..53c966c 100644 (file)
@@ -848,7 +848,9 @@ static int ldap_escape_func(char *out, int outlen, const char *in)
                /*
                 *      Encode unsafe characters.
                 */
-               if (strchr("*=\\,()", *in)) {
+               if (((len == 0) &&
+                   ((in[0] == ' ') || (in[0] == '#'))) ||
+                   (strchr(",+\"\\<>;*=()", *in))) {
                        static const char hex[] = "0123456789abcdef";
 
                        /*