diff --git a/.gitignore b/.gitignore index 12c12e7a0..72a3656ca 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ extras/pcre2* extras/c-ares* extras/regexp* config.status -extras/tre* extras/ircdcron/ircd.cron extras/ircdcron/ircdchk src/modules/snomasks/Makefile diff --git a/Makefile.in b/Makefile.in index 7fb975464..af2e0e013 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,11 +34,11 @@ FROMDOS=/home/cmunk/bin/4dos # #XCFLAGS=-O -g -export-dynamic -IRCDLIBS=@IRCDLIBS@ @TRE_LIBS@ @PCRE2_LIBS@ @ARGON2_LIBS@ @CARES_LIBS@ @PTHREAD_LIBS@ +IRCDLIBS=@IRCDLIBS@ @PCRE2_LIBS@ @ARGON2_LIBS@ @CARES_LIBS@ @PTHREAD_LIBS@ CRYPTOLIB=@CRYPTOLIB@ OPENSSLINCLUDES= -XCFLAGS=@PTHREAD_CFLAGS@ @TRE_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@ +XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@ # # use the following on MIPS: #CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR) diff --git a/configure b/configure index e71db9aa5..27c770f3f 100755 --- a/configure +++ b/configure @@ -643,13 +643,11 @@ CARES_LIBS CARES_CFLAGS ARGON2_LIBS ARGON2_CFLAGS -PCRE2_LIBS -PCRE2_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG -TRE_LIBS -TRE_CFLAGS +PCRE2_LIBS +PCRE2_CFLAGS FD_SETSIZE LDFLAGS_PRIVATELIBS PIDFILE @@ -756,8 +754,6 @@ with_no_operoverride with_disableusermod with_operoverride_verify with_disable_extendedban_stacking -with_tre -with_system_tre with_system_pcre2 with_system_argon2 with_system_cares @@ -779,8 +775,6 @@ CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR -TRE_CFLAGS -TRE_LIBS PCRE2_CFLAGS PCRE2_LIBS ARGON2_CFLAGS @@ -1462,9 +1456,6 @@ Optional Packages: Require opers to invite themselves to +s/+p channels --with-disable-extendedban-stacking Disable extended ban stacking - --without-tre Do not use the old deprecated TRE regex library - --with-system-tre Use the system tre package instead of bundled, - discovered using pkg-config --with-system-pcre2 Use the system pcre2 package instead of bundled, discovered using pkg-config --without-system-argon2 Use bundled version instead of system argon2 @@ -1486,8 +1477,6 @@ Some influential environment variables: directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path - TRE_CFLAGS C compiler flags for TRE, overriding pkg-config - TRE_LIBS linker flags for TRE, overriding pkg-config PCRE2_CFLAGS C compiler flags for PCRE2, overriding pkg-config PCRE2_LIBS linker flags for PCRE2, overriding pkg-config @@ -8467,22 +8456,6 @@ fi fi -# Check whether --with-tre was given. -if test "${with_tre+set}" = set; then : - withval=$with_tre; with_tre=no -else - with_tre=yes -fi - - -# Check whether --with-system-tre was given. -if test "${with_system_tre+set}" = set; then : - withval=$with_system_tre; -else - with_system_tre=no -fi - - # Check whether --with-system-pcre2 was given. if test "${with_system_pcre2+set}" = set; then : withval=$with_system_pcre2; @@ -8866,65 +8839,6 @@ done export PATH_SEPARATOR -if test "x$with_tre" = "xyes"; then : - - -$as_echo "#define USE_TRE /**/" >>confdefs.h - - -fi - -if test "x$with_system_tre" = "xno"; then : - - if test "x$with_tre" = "xyes"; then : - - compile_tre="yes" - -fi - -fi - -if test "x$compile_tre" = "xyes"; then : - -tre_version="0.8.0-git" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting TRE regex library" >&5 -$as_echo "extracting TRE regex library" >&6; } -cur_dir=`pwd` -cd extras -rm -rf tre-$tre_version regexp -if test "x$ac_cv_path_GUNZIP" = "x" ; then - tar xfz tre.tar.gz -else - cp tre.tar.gz tre.tar.gz.bak - gunzip -f tre.tar.gz - cp tre.tar.gz.bak tre.tar.gz - tar xf tre.tar -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring TRE regex library" >&5 -$as_echo "configuring TRE regex library" >&6; } -cd tre-$tre_version -./configure --disable-agrep --enable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$cur_dir/extras/regexp --libdir=$PRIVATELIBDIR || exit 1 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling TRE regex library" >&5 -$as_echo "compiling TRE regex library" >&6; } -$ac_cv_prog_MAKER || exit 1 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: installing TRE regex library" >&5 -$as_echo "installing TRE regex library" >&6; } -$ac_cv_prog_MAKER install || exit 1 -TRE_CFLAGS="-I$cur_dir/extras/regexp/include" - - -TRE_LIBS= -if test -n "$ac_cv_path_PKGCONFIG"; then : - TRE_LIBS="`$ac_cv_path_PKGCONFIG --libs tre.pc`" -fi -if test -z "$TRE_LIBS"; then : - TRE_LIBS="$PRIVATELIBDIR/libtre.so" -fi - -cd $cur_dir - -fi - @@ -9045,102 +8959,6 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi fi -if test "x$with_system_tre" = "xyes"; then : - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRE" >&5 -$as_echo_n "checking for TRE... " >&6; } - -if test -n "$TRE_CFLAGS"; then - pkg_cv_TRE_CFLAGS="$TRE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tre >= 0.7.5\""; } >&5 - ($PKG_CONFIG --exists --print-errors "tre >= 0.7.5") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_TRE_CFLAGS=`$PKG_CONFIG --cflags "tre >= 0.7.5" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$TRE_LIBS"; then - pkg_cv_TRE_LIBS="$TRE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"tre >= 0.7.5\""; } >&5 - ($PKG_CONFIG --exists --print-errors "tre >= 0.7.5") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_TRE_LIBS=`$PKG_CONFIG --libs "tre >= 0.7.5" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - TRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "tre >= 0.7.5" 2>&1` - else - TRE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "tre >= 0.7.5" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$TRE_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (tre >= 0.7.5) were not met: - -$TRE_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables TRE_CFLAGS -and TRE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables TRE_CFLAGS -and TRE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - TRE_CFLAGS=$pkg_cv_TRE_CFLAGS - TRE_LIBS=$pkg_cv_TRE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - -fi - if test "x$with_system_pcre2" = "xno"; then : pcre2_version="10.32" diff --git a/configure.ac b/configure.ac index 95565c7b5..6d0db616f 100644 --- a/configure.ac +++ b/configure.ac @@ -692,8 +692,6 @@ AC_ARG_WITH(operoverride-verify, [AS_HELP_STRING([--with-operoverride-verify], [ AC_ARG_WITH(disable-extendedban-stacking, [AS_HELP_STRING([--with-disable-extendedban-stacking], [Disable extended ban stacking])], [AS_IF([test $withval = "yes"], [AC_DEFINE([DISABLE_STACKED_EXTBANS], [], [Define to disable extended ban stacking (~q:~c:\#chan, etc)])])]) -AC_ARG_WITH(tre, [AS_HELP_STRING([--without-tre], [Do not use the old deprecated TRE regex library])], [with_tre=no], [with_tre=yes]) -AC_ARG_WITH(system-tre, [AS_HELP_STRING([--with-system-tre], [Use the system tre package instead of bundled, discovered using pkg-config])], [], [with_system_tre=no]) AC_ARG_WITH(system-pcre2, [AS_HELP_STRING([--with-system-pcre2], [Use the system pcre2 package instead of bundled, discovered using pkg-config])], [], [with_system_pcre2=no]) AC_ARG_WITH(system-argon2, [AS_HELP_STRING([--without-system-argon2], [Use bundled version instead of system argon2 library. Normally autodetected via pkg-config])], [], [with_system_argon2=yes]) AC_ARG_WITH(system-cares, [AS_HELP_STRING([--without-system-cares], [Use bundled version instead of system c-ares. Normally autodetected via pkg-config.])], [], [with_system_cares=yes]) @@ -759,59 +757,6 @@ dnl fail on certain solaris boxes. We might as dnl well set it here. export PATH_SEPARATOR -AS_IF([test "x$with_tre" = "xyes"],[ - AC_DEFINE([USE_TRE], [], [Use the old deprecated TRE regex library]) -]) - -AS_IF([test "x$with_system_tre" = "xno"],[ - AS_IF([test "x$with_tre" = "xyes"],[ - compile_tre="yes" - ]) -]) - -AS_IF([test "x$compile_tre" = "xyes"],[ -dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE! -tre_version="0.8.0-git" -AC_MSG_RESULT(extracting TRE regex library) -cur_dir=`pwd` -cd extras -dnl remove old tre directory to force a recompile... -dnl and remove its installation prefix just to clean things up. -rm -rf tre-$tre_version rege[]xp -if test "x$ac_cv_path_GUNZIP" = "x" ; then - tar xfz tre.tar.gz -else - cp tre.tar.gz tre.tar.gz.bak - gunzip -f tre.tar.gz - cp tre.tar.gz.bak tre.tar.gz - tar xf tre.tar -fi -AC_MSG_RESULT(configuring TRE regex library) -cd tre-$tre_version -./configure --disable-agrep --enable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$cur_dir/extras/regexp --libdir=$PRIVATELIBDIR || exit 1 -AC_MSG_RESULT(compiling TRE regex library) -$ac_cv_prog_MAKER || exit 1 -AC_MSG_RESULT(installing TRE regex library) -$ac_cv_prog_MAKER install || exit 1 -TRE_CFLAGS="-I$cur_dir/extras/regexp/include" -AC_SUBST(TRE_CFLAGS) - -TRE_LIBS= -AS_IF([test -n "$ac_cv_path_PKGCONFIG"], - [TRE_LIBS="`$ac_cv_path_PKGCONFIG --libs tre.pc`"]) -dnl For when pkg-config isn't available -- or for when pkg-config -dnl doesn't see the tre.pc file somehow... (#3982) -AS_IF([test -z "$TRE_LIBS"], - [TRE_LIBS="$PRIVATELIBDIR/libtre.so"]) -AC_SUBST(TRE_LIBS) -cd $cur_dir -]) - -AS_IF([test "x$with_system_tre" = "xyes"],[ -dnl use pkgconfig for tre: -PKG_CHECK_MODULES([TRE], tre >= 0.7.5) -]) - AS_IF([test "x$with_system_pcre2" = "xno"],[ dnl REMEMBER TO CHANGE WITH A NEW PCRE2 RELEASE! pcre2_version="10.32" diff --git a/extras/build-tests/nix/build b/extras/build-tests/nix/build index b01016b24..525c2730a 100755 --- a/extras/build-tests/nix/build +++ b/extras/build-tests/nix/build @@ -20,7 +20,7 @@ if [ "$SSLDIR" != "" ]; then # In case we build local openssl/libressl export LD_LIBRARY_PATH="$SSLDIR/lib" fi -./Config -quick || (tail -n 5000 config.log; echo '*** now tre:'; tail -n 5000 extras/tre-0.8.0-git/config.log; echo '** end of tre config.log **'; exit 1) +./Config -quick || (tail -n 5000 config.log; exit 1) $MAKE yes ''|make pem make install diff --git a/extras/build-tests/windows/compilecmd/vs2017.bat b/extras/build-tests/windows/compilecmd/vs2017.bat index 6de382450..ada4dcf72 100644 --- a/extras/build-tests/windows/compilecmd/vs2017.bat +++ b/extras/build-tests/windows/compilecmd/vs2017.bat @@ -10,9 +10,6 @@ LIBCURL_LIB_DIR="c:\projects\unrealircd-deps\curl-ssl\builds\libcurl-vc-x86-rele CARES_LIB_DIR="c:\projects\unrealircd-deps\c-ares\msvc\cares\dll-release" ^ CARES_INC_DIR="c:\projects\unrealircd-deps\c-ares" ^ CARESLIB="cares.lib" ^ -TRE_LIB_DIR="c:\projects\unrealircd-deps\tre\win32\release" ^ -TRE_INC_DIR="c:\projects\unrealircd-deps\tre" ^ -TRELIB="tre.lib" ^ PCRE2_INC_DIR="c:\projects\unrealircd-deps\pcre2\include" ^ PCRE2_LIB_DIR="c:\projects\unrealircd-deps\pcre2\lib" ^ PCRE2LIB="pcre2-8.lib" ^ diff --git a/extras/tre.tar.gz b/extras/tre.tar.gz deleted file mode 100644 index 81b43c14a..000000000 Binary files a/extras/tre.tar.gz and /dev/null differ diff --git a/include/setup.h.in b/include/setup.h.in index 68c8aefda..dc21042a2 100644 --- a/include/setup.h.in +++ b/include/setup.h.in @@ -392,9 +392,6 @@ support */ #undef USE_LIBCURL -/* Use the old deprecated TRE regex library */ -#undef USE_TRE - /* Define if you are compiling unrealircd on Sun's (or Oracle's?) Solaris */ #undef _SOLARIS diff --git a/include/struct.h b/include/struct.h index b32835492..f193bf399 100644 --- a/include/struct.h +++ b/include/struct.h @@ -59,9 +59,6 @@ # endif #endif #include "auth.h" -#ifdef USE_TRE -#include "tre/regex.h" -#endif #define PCRE2_CODE_UNIT_WIDTH 8 #include "pcre2.h" @@ -602,7 +599,6 @@ struct aloopStruct { typedef enum { MATCH_SIMPLE=1, /**< Simple pattern with * and ? */ MATCH_PCRE_REGEX=2, /**< PCRE2 Perl-like regex (new) */ - MATCH_TRE_REGEX=3, /**< TRE POSIX regex (old, unreal3.2.x) */ } MatchType; /** Match struct, which allows various matching styles, see MATCH_* */ @@ -610,10 +606,7 @@ typedef struct _match { char *str; /**< Text of the glob/regex/whatever. Always set. */ MatchType type; union { - pcre2_code *pcre2_expr; /**< PCRE2 Perl-like Regex (New) */ -#ifdef USE_TRE - regex_t *tre_expr; /**< TRE POSIX Regex (Old) */ -#endif + pcre2_code *pcre2_expr; /**< PCRE2 Perl-like Regex */ } ext; } aMatch; diff --git a/makefile.win32 b/makefile.win32 index e86cccd0c..2351dcba3 100644 --- a/makefile.win32 +++ b/makefile.win32 @@ -14,11 +14,6 @@ MT=mt # Both ways will work, but if you use a batch file it's easier with # upgrading UnrealIRCd as you won't have to edit this makefile again. -### TRE ### -#TRE_LIB_DIR="C:\dev\tre\win32\release" -#TRE_INC_DIR="C:\dev\tre" -#TRELIB="tre.lib" - ### PCRE2 ### #PCRE2_LIB_DIR="C:\dev\pcre2\build\release" #PCRE2_INC_DIR="C:\dev\pcre2" @@ -85,13 +80,6 @@ CARES_INC=/I "$(CARES_INC_DIR)" CARES_LIB=/LIBPATH:"$(CARES_LIB_DIR)" !ENDIF -!IFDEF TRE_INC_DIR -TRE_INC=/I "$(TRE_INC_DIR)" -!ENDIF -!IFDEF TRE_LIB_DIR -TRE_LIB=/LIBPATH:"$(TRE_LIB_DIR)" -!ENDIF - !IFDEF PCRE2_INC_DIR PCRE2_INC=/I "$(PCRE2_INC_DIR)" !ENDIF @@ -138,18 +126,18 @@ MODDBGCFLAG=/LDd /MD /Zi !ENDIF FD_SETSIZE=/D FD_SETSIZE=16384 -CFLAGS=$(DBGCFLAG) $(TRE_INC) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /J /I ./INCLUDE /I ./INCLUDE/WIN32/ARES /Fosrc/ /nologo \ +CFLAGS=$(DBGCFLAG) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /J /I ./INCLUDE /I ./INCLUDE/WIN32/ARES /Fosrc/ /nologo \ $(CURLCFLAGS) $(FD_SETSIZE) $(SSLCFLAGS) /D NOSPOOF=1 /c /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _USE_32BIT_TIME_T -CFLAGSST=$(DBGCFLAGST) $(TRE_INC) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /J /I ./INCLUDE /I ./INCLUDE/WIN32/ARES /Fosrc/ /nologo \ +CFLAGSST=$(DBGCFLAGST) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /J /I ./INCLUDE /I ./INCLUDE/WIN32/ARES /Fosrc/ /nologo \ $(CURLCFLAGS) $(FD_SETSIZE) $(SSLCFLAGS) /D NOSPOOF=1 /c /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _USE_32BIT_TIME_T LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib ws2_32.lib advapi32.lib \ - dbghelp.lib oldnames.lib comctl32.lib comdlg32.lib $(CARES_LIB) $(CARESLIB) $(TRE_LIB) $(TRELIB) \ + dbghelp.lib oldnames.lib comctl32.lib comdlg32.lib $(CARES_LIB) $(CARESLIB) \ $(PCRE2_LIB) $(PCRE2LIB) $(ARGON2_LIB) $(ARGON2LIB) $(LIBRESSL_LIB) $(SSLLIB) $(LIBCURL_LIB) $(CURLLIB) /def:UnrealIRCd.def /implib:UnrealIRCd.lib \ /nologo $(DBGLFLAG) /out:UnrealIRCd.exe MODCFLAGS=$(MODDBGCFLAG) $(SSLCFLAGS) $(CURLCFLAGS) /J /Fesrc/modules/ \ - /Fosrc/modules/ /nologo $(TRE_INC) $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /I ./INCLUDE /D \ + /Fosrc/modules/ /nologo $(PCRE2_INC) $(ARGON2_INC) $(CARES_INC) $(LIBCURL_INC) $(LIBRESSL_INC) /I ./INCLUDE /D \ DYNAMIC_LINKING /D NOSPOOF /D MODULE_COMPILE /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _USE_32BIT_TIME_T -MODLFLAGS=/link /def:src/modules/module.def UnrealIRCd.lib ws2_32.lib $(TRE_LIB) $(TRELIB) \ +MODLFLAGS=/link /def:src/modules/module.def UnrealIRCd.lib ws2_32.lib \ $(PCRE2_LIB) $(PCRE2LIB) $(ARGON2_LIB) $(ARGON2LIB) $(CARES_LIB) $(LIBRESSL_LIB) $(SSLLIB) \ $(LIBCURL_LIB) $(CURLLIB) diff --git a/src/ircd.c b/src/ircd.c index 9f27a2ec6..8d9570035 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -1305,9 +1305,6 @@ int InitUnrealIRCd(int argc, char *argv[]) fprintf(stderr, "%s", unreallogo); fprintf(stderr, " v%s\n\n", VERSIONONLY); fprintf(stderr, " using %s\n", pcre2_version()); -#ifdef USE_TRE - fprintf(stderr, " using %s\n", tre_version()); -#endif fprintf(stderr, " using %s\n", SSLeay_version(SSLEAY_VERSION)); #ifdef USE_LIBCURL fprintf(stderr, " using %s\n", curl_version()); diff --git a/src/match.c b/src/match.c index ed2e1f873..8719bbe0e 100644 --- a/src/match.c +++ b/src/match.c @@ -433,16 +433,6 @@ int match(const char *mask, const char *name) { void unreal_delete_match(aMatch *m) { safefree(m->str); -#ifdef USE_TRE - if (m->type == MATCH_TRE_REGEX) - { - if (m->ext.tre_expr) - { - regfree(m->ext.tre_expr); - MyFree(m->ext.tre_expr); - } - } -#endif if (m->type == MATCH_PCRE_REGEX) { if (m->ext.pcre2_expr) @@ -492,27 +482,6 @@ aMatch *unreal_create_match(MatchType type, char *str, char **error) pcre2_jit_compile(m->ext.pcre2_expr, PCRE2_JIT_COMPLETE); return m; } -#ifdef USE_TRE - else if (m->type == MATCH_TRE_REGEX) - { - int errorcode; - - m->ext.tre_expr = MyMallocEx(sizeof(regex_t)); - errorcode = regcomp(m->ext.tre_expr, str, REG_ICASE|REG_EXTENDED|REG_NOSUB); - if (errorcode > 0) - { - int errorbufsize = 512; - char *errtmp = MyMallocEx(errorbufsize); - regerror(errorcode, m->ext.tre_expr, errtmp, errorbufsize); - strlcpy(errorbuf, errtmp, sizeof(errorbuf)); - MyFree(errtmp); - if (error) - *error = errorbuf; - unreal_delete_match(m); - return NULL; - } - } -#endif else { /* Unknown type, how did that happen ? */ unreal_delete_match(m); @@ -547,15 +516,6 @@ int unreal_match(aMatch *m, char *str) return 0; /* NO MATCH */ } -#ifdef USE_TRE - if (m->type == MATCH_TRE_REGEX) - { - if (regexec(m->ext.tre_expr, str, 0, NULL, 0) == 0) - return 1; - return 0; - } -#endif - return 0; } @@ -563,8 +523,6 @@ int unreal_match_method_strtoval(char *str) { if (!strcmp(str, "regex") || !strcmp(str, "pcre")) return MATCH_PCRE_REGEX; - if (!strcmp(str, "posix") || !strcmp(str, "tre")) - return MATCH_TRE_REGEX; if (!strcmp(str, "simple") || !strcmp(str, "glob")) return MATCH_SIMPLE; return 0; @@ -574,8 +532,6 @@ char *unreal_match_method_valtostr(int val) { if (val == MATCH_PCRE_REGEX) return "regex"; - if (val == MATCH_TRE_REGEX) - return "posix"; if (val == MATCH_SIMPLE) return "simple"; diff --git a/src/modules/m_tkl.c b/src/modules/m_tkl.c index f88aab953..4e4a80295 100644 --- a/src/modules/m_tkl.c +++ b/src/modules/m_tkl.c @@ -828,19 +828,19 @@ char *err = NULL; return spamfilter_usage(sptr); } - match_type = unreal_match_method_strtoval(parv[2]+1); - if (!match_type) - { - return spamfilter_new_usage(cptr,sptr,parv); - } - - if ((whattodo == 0) && (match_type == MATCH_TRE_REGEX)) + if ((whattodo == 0) && !strcasecmp(parv[2]+1, "posix")) { sendnotice(sptr, "ERROR: Spamfilter type 'posix' is DEPRECATED. You must use type 'regex' instead."); sendnotice(sptr, "See https://www.unrealircd.org/docs/FAQ#spamfilter-posix-deprecated"); return 0; } + match_type = unreal_match_method_strtoval(parv[2]+1); + if (!match_type) + { + return spamfilter_new_usage(cptr,sptr,parv); + } + targets = spamfilter_gettargets(parv[3], sptr); if (!targets) return spamfilter_usage(sptr); @@ -1070,8 +1070,8 @@ aTKline *_tkl_add_line(int type, char *usermask, char *hostmask, char *reason, c aMatch *m = NULL; /* Pre-allocate etc check for spamfilters that fail to compile. - * This could happen if for example TRE supports a feature on server X, but not - * on server Y! + * This could happen if for example the regex engine supports + * a feature on server X, but not * on server Y. */ if (type & TKL_SPAMF) { @@ -2108,7 +2108,7 @@ CMD_FUNC(_m_tkl) int found = 0; char gmt[256], gmt2[256]; TS expiry_1, setat_1, spamf_tklduration = 0; - MatchType spamf_match_method = MATCH_TRE_REGEX; /* (if unspecified, default to this) */ + MatchType spamf_match_method = MATCH_PCRE_REGEX; /* default */ char *reason = NULL, *timeret; int softban = 0; aTKline *head; @@ -2186,6 +2186,13 @@ CMD_FUNC(_m_tkl) if (parc >= 12) { reason = parv[11]; + if (!strcasecmp(parv[10], "posix")) + { + sendto_realops("Ignoring spamfilter from %s. Spamfilter is of type 'posix' (TRE) which " + "is not supported in UnrealIRCd 5. Suggestion: upgrade the other server.", + sptr->name); + return 0; + } spamf_match_method = unreal_match_method_strtoval(parv[10]); if (spamf_match_method == 0) { @@ -2194,15 +2201,12 @@ CMD_FUNC(_m_tkl) return 0; } } else { + /* Actually this only happens for 3.2.x or lower */ reason = parv[10]; -#ifdef USE_TRE - spamf_match_method = MATCH_TRE_REGEX; -#else - sendto_realops("Ignoring spamfilter from %s. Spamfilter is of type 'posix' (TRE) and this " - "build was compiled without TRE support. Suggestion: upgrade the other server", + sendto_realops("Ignoring spamfilter from %s. Spamfilter is of type 'posix' (TRE) which " + "is not supported in UnrealIRCd 5. Suggestion: upgrade the other server.", sptr->name); return 0; -#endif } spamf_tklduration = config_checkval(parv[8], CFG_TIME); /* was: atol(parv[8]); */ } @@ -2410,27 +2414,12 @@ CMD_FUNC(_m_tkl) parv[1], parv[2], parv[3], parv[4], parv[5], parv[6], parv[7], parv[8], parv[9], parv[10], parv[11]); - /* Also send to old TKLEXT and even older non-TKLEXT.. - * ..but only if spam filter is of type 'posix', not cause any trouble.. - */ - if (tk->ptr.spamf->expr->type == MATCH_TRE_REGEX) + /* Print out a warning if any 3.2.x servers linked (TKLEXT but no TKLEXT2) */ + if (mixed_network()) { - sendto_server(cptr, PROTO_TKLEXT, PROTO_TKLEXT2, NULL, - ":%s TKL %s %s %s %s %s %s %s %s %s :%s", sptr->name, - parv[1], parv[2], parv[3], parv[4], parv[5], - parv[6], parv[7], parv[8], parv[9], parv[11]); - sendto_server(cptr, 0, PROTO_TKLEXT, NULL, - ":%s TKL %s %s %s %s %s %s %s :%s", sptr->name, - parv[1], parv[2], parv[3], parv[4], parv[5], - parv[6], parv[7], parv[11]); - } else { - /* Print out a warning if any 3.2.x servers linked (TKLEXT but no TKLEXT2) */ - if (mixed_network()) - { - sendto_realops("WARNING: Spamfilter '%s' added of type '%s' and 3.2.x servers are linked. " - "Spamfilter will not execute on non-UnrealIRCd-4 servers.", - parv[11] , parv[10]); - } + sendto_realops("WARNING: Spamfilter '%s' added of type '%s' and 3.2.x servers are linked. " + "Spamfilter will not execute on non-UnrealIRCd-4 servers.", + parv[11] , parv[10]); } } else if ((parc == 11) && (type & TKL_SPAMF)) diff --git a/src/s_conf.c b/src/s_conf.c index 897e08130..5e9ac8f8b 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -6260,6 +6260,15 @@ int _test_spamfilter(ConfigFile *conf, ConfigEntry *ce) cep->ce_varlinenum, "spamfilter::match-type"); continue; } + if (!strcasecmp(cep->ce_vardata, "posix")) + { + config_error("%s:%i: this spamfilter uses match-type 'posix' which is no longer supported. " + "You must switch over to match-type 'regex' instead. " + "See https://www.unrealircd.org/docs/FAQ#spamfilter-posix-deprecated", + ce->ce_fileptr->cf_filename, ce->ce_varlinenum); + errors++; + return errors; /* return now, otherwise there will be issues */ + } match_type = unreal_match_method_strtoval(cep->ce_vardata); if (match_type == 0) { @@ -6270,22 +6279,6 @@ int _test_spamfilter(ConfigFile *conf, ConfigEntry *ce) errors++; continue; } - if (match_type == MATCH_TRE_REGEX) - { -#ifdef USE_TRE - config_warn("%s:%i: this spamfilter uses match-type 'posix' which is DEPRECATED. " - "You should switch over to match-type 'regex' instead. " - "See https://www.unrealircd.org/docs/FAQ#spamfilter-posix-deprecated", - ce->ce_fileptr->cf_filename, ce->ce_varlinenum); -#else - config_error("%s:%i: this spamfilter uses match-type 'posix' which is no longer supported. " - "You must switch over to match-type 'regex' instead. " - "See https://www.unrealircd.org/docs/FAQ#spamfilter-posix-deprecated", - ce->ce_fileptr->cf_filename, ce->ce_varlinenum); - errors++; - return errors; /* return now, otherwise there will be issues */ -#endif - } has_match_type = 1; } else diff --git a/src/win32/unrealinst.iss b/src/win32/unrealinst.iss index cb8dfed54..3e84754b4 100644 --- a/src/win32/unrealinst.iss +++ b/src/win32/unrealinst.iss @@ -71,7 +71,6 @@ Source: "src\modules\snomasks\*.dll"; DestDir: "{app}\modules\snomasks"; Flags: Source: "src\modules\extbans\*.dll"; DestDir: "{app}\modules\extbans"; Flags: ignoreversion Source: "src\modules\cap\*.dll"; DestDir: "{app}\modules\cap"; Flags: ignoreversion -Source: "c:\dev\tre\win32\release\tre.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "c:\dev\pcre2\bin\pcre*.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "c:\dev\argon2\vs2015\build\*.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "c:\dev\c-ares\msvc\cares\dll-release\cares.dll"; DestDir: "{app}"; Flags: ignoreversion