28 |
|
#include <sys/types.h> |
29 |
|
#include <string.h> |
30 |
|
|
31 |
+ |
#include "config.h" |
32 |
+ |
#ifdef HAVE_LIBPCRE |
33 |
+ |
#include <pcre.h> |
34 |
+ |
#endif |
35 |
|
#include "stdinc.h" |
36 |
|
#include "ircd.h" |
37 |
|
#include "tools.h" |
40 |
|
#include "event.h" |
41 |
|
#include "s_log.h" |
42 |
|
#include "client.h" /* for UMODE_ALL only */ |
39 |
– |
#include "pcre.h" |
43 |
|
#include "irc_string.h" |
44 |
|
#include "irc_getaddrinfo.h" |
45 |
|
#include "sprintf_irc.h" |
2920 |
|
{ |
2921 |
|
if (regex_ban) |
2922 |
|
{ |
2923 |
< |
pcre *exp_user = NULL; |
2924 |
< |
pcre *exp_host = NULL; |
2923 |
> |
#ifdef HAVE_LIBPCRE |
2924 |
> |
void *exp_user = NULL; |
2925 |
> |
void *exp_host = NULL; |
2926 |
|
const char *errptr = NULL; |
2927 |
|
|
2928 |
|
if (!(exp_user = ircd_pcre_compile(userbuf, &errptr)) || |
2944 |
|
DupString(yy_aconf->reason, reasonbuf); |
2945 |
|
else |
2946 |
|
DupString(yy_aconf->reason, "No reason"); |
2947 |
+ |
#else |
2948 |
+ |
ilog(L_ERROR, "Failed to add regular expression based K-Line: no PCRE support"); |
2949 |
+ |
break; |
2950 |
+ |
#endif |
2951 |
|
} |
2952 |
|
else |
2953 |
|
{ |
3089 |
|
{ |
3090 |
|
if (regex_ban) |
3091 |
|
{ |
3092 |
< |
pcre *exp_p = NULL; |
3092 |
> |
#ifdef HAVE_LIBPCRE |
3093 |
> |
void *exp_p = NULL; |
3094 |
|
const char *errptr = NULL; |
3095 |
|
|
3096 |
|
if (!(exp_p = ircd_pcre_compile(gecos_name, &errptr))) |
3102 |
|
|
3103 |
|
yy_conf = make_conf_item(RXLINE_TYPE); |
3104 |
|
yy_conf->regexpname = exp_p; |
3105 |
+ |
#else |
3106 |
+ |
ilog(L_ERROR, "Failed to add regular expression based X-Line: no PCRE support"); |
3107 |
+ |
break; |
3108 |
+ |
#endif |
3109 |
|
} |
3110 |
|
else |
3111 |
|
yy_conf = make_conf_item(XLINE_TYPE); |