Browse Source

Revert set::spamfilter::utf8-support from yesterday.

This will be for a later release, needs more thought and work.
pull/41/head
Bram Matthys 11 months ago
parent
commit
329fd07f3a
No known key found for this signature in database
GPG Key ID: BF8116B163EAAE98
  1. 16
      configure
  2. 2
      configure.ac
  3. 21
      doc/RELEASE-NOTES.md
  4. 1
      include/dynconf.h
  5. 7
      src/conf.c
  6. 9
      src/match.c
  7. 1
      src/modules/stats.c

16
configure vendored

@ -7392,12 +7392,12 @@ if test -n "$PCRE2_CFLAGS"; then
pkg_cv_PCRE2_CFLAGS="$PCRE2_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.36\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.36") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.34\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.34") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_PCRE2_CFLAGS=`$PKG_CONFIG --cflags "libpcre2-8 >= 10.36" 2>/dev/null`
pkg_cv_PCRE2_CFLAGS=`$PKG_CONFIG --cflags "libpcre2-8 >= 10.34" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -7409,12 +7409,12 @@ if test -n "$PCRE2_LIBS"; then
pkg_cv_PCRE2_LIBS="$PCRE2_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.36\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.36") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.34\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.34") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_PCRE2_LIBS=`$PKG_CONFIG --libs "libpcre2-8 >= 10.36" 2>/dev/null`
pkg_cv_PCRE2_LIBS=`$PKG_CONFIG --libs "libpcre2-8 >= 10.34" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -7435,9 +7435,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
PCRE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre2-8 >= 10.36" 2>&1`
PCRE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre2-8 >= 10.34" 2>&1`
else
PCRE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre2-8 >= 10.36" 2>&1`
PCRE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre2-8 >= 10.34" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$PCRE2_PKG_ERRORS" >&5

2
configure.ac

@ -578,7 +578,7 @@ export PATH_SEPARATOR
dnl Use system pcre2 when available, unless --without-system-pcre2.
has_system_pcre2="no"
AS_IF([test "x$with_system_pcre2" = "xyes"],[
PKG_CHECK_MODULES([PCRE2], libpcre2-8 >= 10.36,[has_system_pcre2=yes
PKG_CHECK_MODULES([PCRE2], libpcre2-8 >= 10.34,[has_system_pcre2=yes
AS_IF([test "x$PRIVATELIBDIR" != "x"], [rm -f "$PRIVATELIBDIR/"libpcre2*])],[has_system_pcre2=no])])
AS_IF([test "$has_system_pcre2" = "no"], [

21
doc/RELEASE-NOTES.md

@ -28,28 +28,9 @@ Enhancements:
now an `unrealircdctl.exe` that can be used to do similar things to what
you can do on *NIX. Supported operations are: `rehash`, `reloadtls`,
`mkpasswd`, `gencloak` and `spkifp`.
* New experimental [Spamfilter](https://www.unrealircd.org/docs/Spamfilter)
support for UTF8. You need to `set { spamfilter { utf8-support yes; } }`
* Case insensitive matches work better. For example, with extended
Latin, a spamfilter on `ę` now also matches `Ę`.
* Other PCRE2 features such as [\p](https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC5)
are now available. For example you can now set a spamfilter with the regex
`\p{Arabic}` to block all Arabic script, or `\p{Cyrillic}` to
block all Cyrillic script (such as Russian).
Please do use these new tools with care. Blocking an entire language
or script is quite a drastic measure.
* These new features require the PCRE2 10.36 regex library. Most people
will have a lower version of PCRE2 on the system, so then UnrealIRCd
will fallback to using the UnrealIRCd-shipped-library (10.39).
The downside to that is that compiling during `./Config` may take
a little longer than usual.
* As said, this is an experimental feature. In the past there have been
issues with it, causing a hanging ircd or matchin too much or too little.
If you try this new utf8-support for spamfilter, let us know if it
works well for you or not.
* New option [set::server-notice-show-event](https://www.unrealircd.org/docs/Set_block#set::server-notice-show-event)
which can be set to `no` to hide the event information (eg `connect.LOCAL_CLIENT_CONNECT`)
in server notices. This can be overriden per-oper in the
in server notices. This can be overridden per-oper in the
[Oper block](https://www.unrealircd.org/docs/Oper_block) via oper::server-notice-show-event.
* Support for IRC over UNIX sockets (on the same machine), if you specify a
listen::file instead of ip/port. This probably won't be used much, but

1
include/dynconf.h

@ -128,7 +128,6 @@ struct Configuration {
long spamfilter_detectslow_warn;
long spamfilter_detectslow_fatal;
int spamfilter_stop_on_first_match;
int spamfilter_utf8_support;
int maxbans;
int maxbanlength;
int watch_away_notification;

7
src/conf.c

@ -7666,10 +7666,6 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
{
tempiConf.spamfilter_stop_on_first_match = config_checkval(cepp->value, CFG_YESNO);
}
else if (!strcmp(cepp->name, "utf8-support"))
{
tempiConf.spamfilter_utf8_support = config_checkval(cepp->value, CFG_YESNO);
}
}
}
else if (!strcmp(cep->name, "default-bantime"))
@ -8796,9 +8792,6 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
if (!strcmp(cepp->name, "stop-on-first-match"))
{
} else
if (!strcmp(cepp->name, "utf8-support"))
{
} else
{
config_error_unknown(cepp->file->filename,
cepp->line_number, "set::spamfilter",

9
src/match.c

@ -405,13 +405,8 @@ Match *unreal_create_match(MatchType type, const char *str, char **error)
int options = 0;
char buf2[512];
options = PCRE2_CASELESS;
if (iConf.spamfilter_utf8_support)
options |= PCRE2_MATCH_INVALID_UTF;
else
options |= PCRE2_NEVER_UTF|PCRE2_NEVER_UCP;
options = PCRE2_CASELESS|PCRE2_NEVER_UTF|PCRE2_NEVER_UCP;
m->ext.pcre2_expr = pcre2_compile(str, PCRE2_ZERO_TERMINATED, options, &errorcode, &erroroffset, NULL);
if (m->ext.pcre2_expr == NULL)
{

1
src/modules/stats.c

@ -917,7 +917,6 @@ int stats_set(Client *client, const char *para)
sendtxtnumeric(client, "spamfilter::virus-help-channel: %s", SPAMFILTER_VIRUSCHAN);
if (SPAMFILTER_EXCEPT)
sendtxtnumeric(client, "spamfilter::except: %s", SPAMFILTER_EXCEPT);
sendtxtnumeric(client, "spamfilter::utf8-support: %s", iConf.spamfilter_utf8_support ? "yes" : "no");
sendtxtnumeric(client, "check-target-nick-bans: %s", CHECK_TARGET_NICK_BANS ? "yes" : "no");
sendtxtnumeric(client, "plaintext-policy::user: %s", policy_valtostr(iConf.plaintext_policy_user));
sendtxtnumeric(client, "plaintext-policy::oper: %s", policy_valtostr(iConf.plaintext_policy_oper));

Loading…
Cancel
Save