2 ** Copyright 2009 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
17 #include "courierauth.h"
20 static void escape_specials(const char *str
,
24 static const char specials
[]="*()\\";
31 if (strchr(specials
, *str
))
33 sprintf(buf
, "\\%02x", (int)(unsigned char)*str
);
55 char *courier_auth_ldap_escape(const char *str
)
60 escape_specials(str
, NULL
, &escaped_cnt
);
61 escaped
=malloc(escaped_cnt
);
65 escape_specials(str
, escaped
, NULL
);