2 ** Copyright 2009 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
17 #include "courierauth.h"
19 static const char rcsid
[]="$Id: authldapescape.c,v 1.2 2009/12/18 04:33:45 mrsam Exp $";
21 static void escape_specials(const char *str
,
25 static const char specials
[]="*()\\";
32 if (strchr(specials
, *str
))
34 sprintf(buf
, "\\%02x", (int)(unsigned char)*str
);
56 char *courier_auth_ldap_escape(const char *str
)
62 escape_specials(str
, NULL
, &escaped_cnt
);
63 escaped
=malloc(escaped_cnt
);
67 escape_specials(str
, escaped
, NULL
);