4
mirror of git://git.acid.vegas/unrealircd.git synced 2024-12-24 15:26:37 +00:00

Updated to 6.0.1.1

This commit is contained in:
Dionysus 2022-01-15 00:16:34 -05:00
parent aa3cc227c5
commit 4e71d6fead
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
337 changed files with 33201 additions and 26248 deletions

4
BSDmakefile Normal file
View File

@ -0,0 +1,4 @@
.DONE:
@echo "Please use GNU Make (gmake) to build UnrealIRCd"
.DEFAULT:
@echo "Please use GNU Make (gmake) to build UnrealIRCd"

5
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,5 @@
Help out and make UnrealIRCd a better product!
You can do so by reporting issues, testing, programming, documenting,
translating, helping others, and more.
See https://www.unrealircd.org/docs/Contributing

247
Config
View File

@ -1,7 +1,7 @@
#!/bin/sh
#
# Config script for UnrealIRCd
# (C) 2001-2019 The UnrealIRCd Team
# (C) 2001-2021 The UnrealIRCd Team
#
# This configure script is free software; the UnrealIRCd Team gives
# unlimited permission to copy, distribute and modify as long as the
@ -37,9 +37,6 @@ mkdir -p $TMPDIR
mkdir -p $PRIVATELIBDIR
# Do this even if we're not in advanced mode
if [ "$SHOWLISTMODES" = "1" ] ; then
ARG="$ARG--with-showlistmodes "
fi
if [ "$ADVANCED" = "1" ] ; then
if [ "$NOOPEROVERRIDE" = "1" ] ; then
ARG="$ARG--with-no-operoverride "
@ -53,12 +50,21 @@ ARG="$ARG--enable-ssl "
else
ARG="$ARG--enable-ssl=$SSLDIR "
fi
# Ensure we install curl even if someone does ./Config -quick...
if [ "x$CURLDIR" = "x$UNREALCWD/extras/curl" ]; then
INSTALLCURL=1
else
# And that the path does not refer to eg an old unrealircd-1.2.3 either ;)
if echo "$CURLDIR"|egrep -qi extras.*curl; then
echo "WARNING: Potentially old cURL directory encountered ($CURLDIR)."
echo "I am changing the cURL directory to $UNREALCWD/extras/curl and forcing a rebuild of cURL."
CURLDIR="$UNREALCWD/extras/curl"
INSTALLCURL=1
fi
fi
if [ "$REMOTEINC" = "1" ] ; then
ARG="$ARG--enable-libcurl=$CURLDIR "
fi
if [ "$PREFIXAQ" != "1" ]; then
ARG="$ARG--disable-prefixaq "
fi
if [ "$MAXCONNECTIONS_REQUEST" != "auto" ]; then
ARG="$ARG--with-maxconnections=$MAXCONNECTIONS_REQUEST "
fi
@ -77,14 +83,19 @@ ARG="$ARG--with-scriptdir=$BASEPATH "
ARG="$ARG--with-nick-history=$NICKNAMEHISTORYLENGTH "
ARG="$ARG--with-permissions=$DEFPERM "
ARG="$ARG--enable-dynamic-linking "
if [ "$GEOIP" = "classic" ]; then
ARG="$ARG--enable-geoip-classic "
fi
if [ "$GEOIP" = "libmaxminddb" ]; then
ARG="$ARG--enable-libmaxminddb "
fi
if [ "$SANITIZER" = "asan" ]; then
ARG="$ARG--enable-asan "
fi
ARG="$ARG $EXTRAPARA "
CONF="./configure $ARG"
# remove possibly old instances of curl in ~/unrealircd/lib/
rm -f $PRIVATELIBDIR/*curl* 1>/dev/null 2>&1
# Ensure we install curl even if someone does ./Config -quick...
if [ "x$CURLDIR" = "x$UNREALCWD/extras/curl" ]; then
INSTALLCURL=1
fi
if [ "x$INSTALLCURL" = "x1" ]; then
extras/curlinstall "$PRIVATELIBDIR" || exit 1
fi
@ -127,8 +138,8 @@ if [ "$QUICK" != "1" ] ; then
TEST="No"
fi
echo ""
echo "UnrealIRCd requires an SSL certificate in order to work."
echo "Do you want to generate an SSL certificate for the IRCd?"
echo "UnrealIRCd requires a TLS certificate in order to work."
echo "Do you want to generate a TLS certificate for the IRCd?"
echo "Only answer No if you already have one."
echo $n "[$TEST] -> $c"
read cc
@ -152,60 +163,31 @@ if [ "$QUICK" != "1" ] ; then
if [ "$GENCERTIFICATE" = 1 ]; then
echo
echo "*******************************************************************************"
echo "Next you will be asked some questions in order to generate the SSL certificate."
echo "Next you will be asked some questions in order to generate the TLS certificate."
echo "IMPORTANT: If you don't own a domain or don't know what to answer, then you can"
echo " simply press ENTER or use fictional names for each question!"
echo "*******************************************************************************"
echo "Press ENTER to continue"
read cc
make pem
$MAKE pem
echo "Certificate created successfully."
sleep 1
else
echo "Ok, not generating SSL certificate. Make sure that the certificate and key"
echo "Ok, not generating TLS certificate. Make sure that the certificate and key"
echo "are installed in conf/tls/server.cert.pem and conf/tls/server.key.pem prior to starting the IRCd."
fi
else
echo "SSL certificate already exists in configuration directory, no need to regenerate."
echo "TLS certificate already exists in configuration directory, no need to regenerate."
fi
fi
# Silently force a 'make clean' as otherwise part (or whole) of the
# compiled source could be using different settings than the user
# just requested when re-running ./Config.
make clean 1>/dev/null 2>&1
$MAKE clean 1>/dev/null 2>&1
}
RUN_ADVANCED () {
TEST=""
while [ -z "$TEST" ] ; do
if [ "$SHOWLISTMODES" = "1" ] ; then
TEST="Yes"
else
TEST="No"
fi
echo ""
echo "Do you want to show the modes a channel has set in the /list output?"
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
cc=$TEST
fi
case "$cc" in
[Yy]*)
SHOWLISTMODES="1"
;;
[Nn]*)
SHOWLISTMODES=""
;;
*)
echo ""
echo "You must enter either Yes or No"
TEST=""
;;
esac
done
TEST=""
while [ -z "$TEST" ] ; do
if [ "$NOOPEROVERRIDE" = "1" ] ; then
@ -271,16 +253,16 @@ UNREALCWD="`pwd`"
BASEPATH="$HOME/unrealircd"
DEFPERM="0600"
SSLDIR=""
NICKNAMEHISTORYLENGTH="100"
NICKNAMEHISTORYLENGTH="2000"
MAXCONNECTIONS_REQUEST="auto"
REMOTEINC="1"
CURLDIR=""
PREFIXAQ="0"
SHOWLISTMODES="0"
NOOPEROVERRIDE=""
OPEROVERRIDEVERIFY=""
GENCERTIFICATE="1"
EXTRAPARA=""
SANITIZER=""
GEOIP="classic"
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
c="\c"
else
@ -333,6 +315,33 @@ if [ "`id -u`" = "0" ]; then
exit
fi
# Check for gmake early...
if [ "$MAKE" = "" ]; then
MAKE="make"
fi
if ! $MAKE --version 2>&1|grep -q "GNU Make"; then
# So $MAKE is not GNU make, but do we have gmake?
if gmake --version 2>&1|grep -q "GNU Make"; then
# Great, use that one!
MAKE="gmake"
else
# Both $MAKE and gmake are not GNU make, do we have a working $MAKE at all?
if $MAKE --version 1>/dev/null 2>&1; then
echo "Your system has 'make' but UnrealIRCd requires GNU Make ('gmake')"
echo "Please install 'gmake' (eg 'pkg install gmake' on BSD)."
exit 1
else
echo "Your system does not have the required tools installed to build UnrealIRCd."
echo "Please check https://www.unrealircd.org/docs/Installing_from_source"
echo "and install the required tools listed under 'Prerequisites'."
echo "After that, you can run ./Config again"
exit 1
fi
fi
fi
clear
if [ -f "doc/Config.header" -a -z "$NOINTRO" ] ; then
@ -347,7 +356,7 @@ echo "We will now ask you a number of questions. You can just press ENTER to acc
echo ""
# This needs to be updated each release so auto-upgrading works for settings, modules, etc!!:
UNREALRELEASES="unrealircd-5.2.0 unrealircd-5.2.0-rc1 unrealircd-5.0.9.1 unrealircd-5.0.9 unrealircd-5.0.9-rc1 unrealircd-5.0.8 unrealircd-5.0.8-rc1 unrealircd-5.0.7 unrealircd-5.0.7-rc1 unrealircd-5.0.6 unrealircd-5.0.5.1 unrealircd-5.0.5 unrealircd-5.0.4 unrealircd-5.0.3.1 unrealircd-5.0.3 unrealircd-5.0.2 unrealircd-5.0.1 unrealircd-5.0.0"
UNREALRELEASES="unrealircd-6.0.1 unrealircd-6.0.0 unrealircd-6.0.0-rc2 unrealircd-6.0.0-rc1 unrealircd-6.0.0-beta4 unrealircd-6.0.0-beta3 unrealircd-6.0.0-beta2 unrealircd-6.0.0-beta1 unrealircd-5.2.3 unrealircd-5.2.2 unrealircd-5.2.1.1 unrealircd-5.2.1 unrealircd-5.2.1-rc1 unrealircd-5.2.0.2 unrealircd-5.2.0.1 unrealircd-5.2.0 unrealircd-5.2.0-rc1 unrealircd-5.0.9.1 unrealircd-5.0.9 unrealircd-5.0.9-rc1 unrealircd-5.0.8 unrealircd-5.0.8-rc1 unrealircd-5.0.7 unrealircd-5.0.7-rc1 unrealircd-5.0.6"
if [ -f "config.settings" ]; then
. ./config.settings
else
@ -421,7 +430,7 @@ fi
TEST="$BASEPATH"
echo ""
echo "In what directory do you want to install UnrealIRCd?"
echo "(Note: UnrealIRCd 5 will need to be installed somewhere."
echo "(Note: UnrealIRCd 6 will need to be installed somewhere."
echo " If this directory does not exist it will be created.)"
echo $n "[$TEST] -> $c"
read cc
@ -507,9 +516,12 @@ while [ -z "$TEST" ] ; do
TEST="No"
fi
echo ""
echo "Do you want to enable remote includes?"
echo "This allows stuff like this in your configuration file:"
echo "include \"https://www.somesite.org/files/opers.conf\";"
echo "UnrealIRCd comes with support for 'remote includes', this allows things like:"
echo "include \"https://www.example.org/files/opers.conf\";"
echo "Do you want to compile with the libcurl library to enable additional protocols?"
echo "If you answer 'No' then only https:// links will work for remote includes."
echo "Answer 'Yes' if you need other protocols, such as plaintext http, ftp, tftp or smb."
echo "Most people answer 'No' here because they don't use remote includes or only need https."
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
@ -661,39 +673,6 @@ if [ "$REMOTEINC" = "1" ] ; then
fi
TEST=""
while [ -z "$TEST" ] ; do
if [ "$PREFIXAQ" = "1" ] ; then
TEST="Yes"
else
TEST="No"
fi
echo ""
echo "Do you want to enable prefixes for chanadmin and chanowner?"
echo "This will give +a the & prefix and ~ for +q (just like +o is @)"
echo "Supported by the major clients (mIRC, xchat, epic, eggdrop, Klient,"
echo "PJIRC, irssi, CGI:IRC, etc.)"
echo "This feature should be enabled/disabled network-wide."
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
cc=$TEST
fi
case "$cc" in
[Yy]*)
PREFIXAQ="1"
;;
[Nn]*)
PREFIXAQ=""
;;
*)
echo ""
echo "You must enter either Yes or No"
TEST=""
;;
esac
done
TEST=""
while [ -z "$TEST" ] ; do
TEST="$NICKNAMEHISTORYLENGTH"
@ -717,6 +696,41 @@ while [ -z "$TEST" ] ; do
esac
done
TEST=""
while [ -z "$TEST" ] ; do
TEST="$GEOIP"
echo ""
echo "GeoIP is a feature that allows converting an IP address to a location (country)"
echo "You have three options in UnrealIRCd:"
echo " classic: This is the DEFAULT geoip engine that should work on all systems"
echo "libmaxminddb: This uses the libmaxminddb library. If you want to use it then"
echo " you need to install the libmaxminddb library on your system first"
echo " none: Don't built with any geoip feature"
echo "Choose one of: classic, libmaxminddb, none"
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
GEOIP=$TEST
break
fi
case "$cc" in
classic)
GEOIP="$cc"
;;
libmaxminddb)
GEOIP="$cc"
;;
none)
GEOIP="$cc"
;;
*)
echo ""
echo "Invalid choice: $cc"
TEST=""
;;
esac
done
echo ""
TEST=""
while [ -z "$TEST" ] ; do
@ -753,6 +767,42 @@ if [ -n "$ADVANCED" ] ; then
RUN_ADVANCED
fi
TEST=""
while [ -z "$TEST" ] ; do
if [ "$SANITIZER" = "asan" ] ; then
TEST="Yes"
else
TEST="No"
fi
echo ""
echo "Are you running UnrealIRCd as a test, debugging a problem or developing a module?"
echo "Then it is possible to run with AddressSanitizer enabled. This will make it"
echo "catch bugs such as out-of-bounds and other memory corruption issues, which can"
echo "be really helpful in some cases. The downside is that it will consume a lot"
echo "more memory and run slower too. So, only answer 'Yes' if you are OK with this."
echo "Also, on some systems (notably FreeBSD), when you enable AddressSanitizer,"
echo "UnrealIRCd may fail to start. So when in doubt, answer 'No'."
echo "Do you want to enable AddressSanitizer?"
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
cc=$TEST
fi
case "$cc" in
[Yy]*)
SANITIZER="asan"
;;
[Nn]*)
SANITIZER=""
;;
*)
echo ""
echo "You must enter either Yes or No"
TEST=""
;;
esac
done
TEST="$EXTRAPARA"
echo ""
echo "Would you like to pass any custom parameters to configure?"
@ -784,17 +834,17 @@ CACHEDIR="$CACHEDIR"
DOCDIR="$DOCDIR"
TMPDIR="$TMPDIR"
PRIVATELIBDIR="$PRIVATELIBDIR"
PREFIXAQ="$PREFIXAQ"
MAXCONNECTIONS_REQUEST="$MAXCONNECTIONS_REQUEST"
NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
GEOIP="$GEOIP"
DEFPERM="$DEFPERM"
SSLDIR="$SSLDIR"
REMOTEINC="$REMOTEINC"
CURLDIR="$CURLDIR"
SHOWLISTMODES="$SHOWLISTMODES"
NOOPEROVERRIDE="$NOOPEROVERRIDE"
OPEROVERRIDEVERIFY="$OPEROVERRIDEVERIFY"
GENCERTIFICATE="$GENCERTIFICATE"
SANITIZER="$SANITIZER"
EXTRAPARA="$EXTRAPARA"
ADVANCED="$ADVANCED"
__EOF__
@ -808,16 +858,17 @@ cat << __EOF__
|_______________________________________________________________________|
|_______________________________________________________________________|
| |
| Now all you have to do is type 'make' and let it compile. When that's |
| done, you will receive other instructions on what to do next. |
| |
|_______________________________________________________________________|
|_______________________________________________________________________|
| - The UnrealIRCd Team - |
| |
| * Bram Matthys (Syzop) syzop@unrealircd.org |
| * Gottem gottem@unrealircd.org |
| * i i@unrealircd.org |
| Bram Matthys (Syzop) - syzop@unrealircd.org |
| Krzysztof Beresztant (k4be) - k4be@unrealircd.org |
| Gottem - gottem@unrealircd.org |
| i - i@unrealircd.org |
|_______________________________________________________________________|
|_______________________________________________________________________|
| |
| Now all you have to do is type '$MAKE' and let it compile. When that's |
| done, you will receive other instructions on what to do next. |
|_______________________________________________________________________|
__EOF__

View File

@ -34,11 +34,11 @@ FROMDOS=/home/cmunk/bin/4dos
#
#XCFLAGS=-O -g -export-dynamic
IRCDLIBS=@IRCDLIBS@ @PCRE2_LIBS@ @ARGON2_LIBS@ @CARES_LIBS@ @SODIUM_LIBS@ @PTHREAD_LIBS@
IRCDLIBS=@IRCDLIBS@ @PCRE2_LIBS@ @ARGON2_LIBS@ @CARES_LIBS@ @SODIUM_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@
CRYPTOLIB=@CRYPTOLIB@
OPENSSLINCLUDES=
XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @SODIUM_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@
XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @SODIUM_CFLAGS@ @JANSSON_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@
#
# use the following on MIPS:
#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
@ -89,7 +89,14 @@ XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @SODIUM_C
# you are not defining CMDLINE_CONFIG
IRCDMODE = 711
# Objects that are optional due to optional libraries:
URL=@URL@
GEOIP_CLASSIC_OBJECTS=@GEOIP_CLASSIC_OBJECTS@
GEOIP_CLASSIC_LIBS=@GEOIP_CLASSIC_LIBS@
GEOIP_CLASSIC_CFLAGS=@GEOIP_CLASSIC_CFLAGS@
GEOIP_MAXMIND_OBJECTS=@GEOIP_MAXMIND_OBJECTS@
LIBMAXMINDDB_CFLAGS=@LIBMAXMINDDB_CFLAGS@
LIBMAXMINDDB_LIBS=@LIBMAXMINDDB_LIBS@
# Where is your openssl binary
OPENSSLPATH=@OPENSSLPATH@
@ -116,7 +123,13 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
'SHELL=${SHELL}' \
'CRYPTOLIB=${CRYPTOLIB}' \
'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \
'URL=${URL}'
'URL=${URL}' \
'GEOIP_CLASSIC_OBJECTS=${GEOIP_CLASSIC_OBJECTS}' \
'GEOIP_CLASSIC_LIBS=${GEOIP_CLASSIC_LIBS}' \
'GEOIP_CLASSIC_CFLAGS=${GEOIP_CLASSIC_CFLAGS}' \
'GEOIP_MAXMIND_OBJECTS=${GEOIP_MAXMIND_OBJECTS}' \
'LIBMAXMINDDB_CFLAGS=${LIBMAXMINDDB_CFLAGS}' \
'LIBMAXMINDDB_LIBS=${LIBMAXMINDDB_LIBS}'
custommodule:
@if test -z "${MODULEFILE}"; then echo "Please set MODULEFILE when calling \`\`make custommodule''. For example, \`\`make custommodule MODULEFILE=callerid''." >&2; exit 1; fi
@ -135,7 +148,7 @@ build: Makefile
done
@echo ''
@echo '* UnrealIRCd compiled successfully'
@echo '* YOU ARE NOT DONE YET! Run "make install" to install UnrealIRCd !'
@echo '* YOU ARE NOT DONE YET! Run "${MAKE} install" to install UnrealIRCd !'
@echo ''
clean:
@ -183,9 +196,6 @@ install: all
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/chanmodes
@rm -f $(DESTDIR)@MODULESDIR@/chanmodes/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/chanmodes/*.so $(DESTDIR)@MODULESDIR@/chanmodes
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/snomasks
@rm -f $(DESTDIR)@MODULESDIR@/snomasks/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/snomasks/*.so $(DESTDIR)@MODULESDIR@/snomasks
$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/extbans
@rm -f $(DESTDIR)@MODULESDIR@/extbans/*.so 1>/dev/null 2>&1
$(INSTALL) -m 0700 src/modules/extbans/*.so $(DESTDIR)@MODULESDIR@/extbans
@ -248,7 +258,7 @@ pem: extras/tls.cnf
-config extras/tls.cnf -sha256 -out server.req.pem \
-key server.key.pem -nodes
@echo "Generating self-signed certificate..."
$(OPENSSLPATH) req -x509 -days 3650 -sha256 -in server.req.pem \
$(OPENSSLPATH) req -x509 -days 3650 -sha256 -nodes -in server.req.pem \
-key server.key.pem -out server.cert.pem
@echo "Setting permissions on server.*.pem files..."
chmod o-rwx server.req.pem server.key.pem server.cert.pem

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,11 @@ Key features include SSL/TLS, cloaking, its advanced anti-flood and anti-spam sy
swear filtering and module support. We are also particularly proud on our extensive
online documentation.
## Versions
* UnrealIRCd 6 is the *stable* series since December 2021. All new features go in there.
* UnrealIRCd 5 is the *oldstable* series. It will receive bug fixes until
July 1, 2022 plus another 12 months of security fixes.
## How to get started
Please consult our excellent online documentation at https://www.unrealircd.org/docs/
when setting up the IRCd!

View File

@ -1,7 +1,8 @@
# Security Policy
## Supported Versions
* The latest *stable* release of the 5.x branch
* The latest *stable* release of UnrealIRCd 5 (until 2023-07-01)
* The latest *stable* release of UnrealIRCd 6
See [UnrealIRCd releases](https://www.unrealircd.org/docs/UnrealIRCd_releases) for information on older versions and End Of Life dates.

1680
autoconf/config.guess vendored

File diff suppressed because it is too large Load Diff

2962
autoconf/config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@ -130,9 +130,13 @@ AC_DEFUN([CHECK_LIBCURL],
LIBS="$LIBS_SAVEDA"
CFLAGS="$CFLAGS_SAVEDA"
URL="url.o"
AC_SUBST(URL)
dnl Finally, choose the cURL implementation of url.c
URL="url_curl.o"
],[
dnl Choose UnrealIRCds internal implementation of url.c
URL="url_unreal.o"
]) dnl AS_IF(enable_curl)
AC_SUBST(URL)
])
dnl the following 2 macros are based on CHECK_SSL by Mark Ethan Trostler <trostler@juniper.net>
@ -178,7 +182,11 @@ AS_IF([test $enable_ssl != "no"],
else
CRYPTOLIB="-lssl -lcrypto";
if test ! "$ssldir" = "/usr" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib";
if test -d "$ssldir/lib64" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib64";
else
LDFLAGS="$LDFLAGS -L$ssldir/lib";
fi
dnl check if binary path exists
if test -f "$ssldir/bin/openssl"; then
OPENSSLPATH="$ssldir/bin/openssl";
@ -312,3 +320,94 @@ else
AC_MSG_RESULT([no])
fi
])
dnl For geoip-api-c
AC_DEFUN([CHECK_GEOIP_CLASSIC],
[
AC_ARG_ENABLE(geoip_classic,
[AC_HELP_STRING([--enable-geoip-classic=no/yes],[enable GeoIP Classic support])],
[enable_geoip_classic=$enableval],
[enable_geoip_classic=no])
AS_IF([test "x$enable_geoip_classic" = "xyes"],
[
dnl First see if the system provides it
has_system_geoip_classic="no"
PKG_CHECK_MODULES([GEOIP_CLASSIC], [geoip >= 1.6.0],
[has_system_geoip_classic=yes
AS_IF([test "x$PRIVATELIBDIR" != "x"], [rm -f "$PRIVATELIBDIR/"libGeoIP.*])],
[has_system_geoip_classic=no])
dnl Otherwise fallback to our own..
AS_IF([test "$has_system_geoip_classic" = "no"],[
dnl REMEMBER TO CHANGE WITH A NEW GEOIP LIBRARY RELEASE!
geoip_classic_version="1.6.12"
AC_MSG_RESULT(extracting GeoIP Classic library)
cur_dir=`pwd`
cd extras
dnl remove old directory to force a recompile...
dnl and remove its installation prefix just to clean things up.
rm -rf GeoIP-$geoip_classic_version geoip-classic
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz geoip-classic.tar.gz
else
cp geoip-classic.tar.gz geoip-classic.tar.gz.bak
gunzip -f geoip-classic.tar.gz
cp geoip-classic.tar.gz.bak geoip-classic.tar.gz
tar xf geoip-classic.tar
fi
AC_MSG_RESULT(configuring GeoIP Classic library)
cd GeoIP-$geoip_classic_version
save_cflags="$CFLAGS"
CFLAGS="$orig_cflags"
export CFLAGS
./configure --prefix=$cur_dir/extras/geoip-classic --libdir=$PRIVATELIBDIR --enable-shared --disable-static || exit 1
CFLAGS="$save_cflags"
AC_MSG_RESULT(compiling GeoIP Classic library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing GeoIP Classic library)
$ac_cv_prog_MAKER install || exit 1
dnl Try pkg-config first...
AS_IF([test -n "$ac_cv_path_PKGCONFIG"],
[GEOIP_CLASSIC_LIBS="`$ac_cv_path_PKGCONFIG --libs geoip.pc`"
GEOIP_CLASSIC_CFLAGS="`$ac_cv_path_PKGCONFIG --cflags geoip.pc`"])
dnl In case the system does not have pkg-config, fallback to hardcoded settings...
AS_IF([test -z "$GEOIP_CLASSIC_LIBS"],
[GEOIP_CLASSIC_LIBS="-L$PRIVATELIBDIR -lGeoIP"
GEOIP_CLASSIC_CFLAGS="-I$cur_dir/extras/geoip-classic/include"])
cd $cur_dir
])
AC_SUBST(GEOIP_CLASSIC_LIBS)
AC_SUBST(GEOIP_CLASSIC_CFLAGS)
GEOIP_CLASSIC_OBJECTS="geoip_classic.so"
AC_SUBST(GEOIP_CLASSIC_OBJECTS)
]) dnl AS_IF(enable_geoip_classic)
])
AC_DEFUN([CHECK_LIBMAXMINDDB],
[
AC_ARG_ENABLE(libmaxminddb,
[AC_HELP_STRING([--enable-libmaxminddb=no/yes],[enable GeoIP libmaxminddb support])],
[enable_libmaxminddb=$enableval],
[enable_libmaxminddb=no])
AS_IF([test "x$enable_libmaxminddb" = "xyes"],
[
dnl see if the system provides it
has_system_libmaxminddb="no"
PKG_CHECK_MODULES([LIBMAXMINDDB], [libmaxminddb >= 1.4.3],
[has_system_libmaxminddb=yes])
AS_IF([test "x$has_system_libmaxminddb" = "xyes"],
[
AC_SUBST(LIBMAXMINDDB_LIBS)
AC_SUBST(LIBMAXMINDDB_CFLAGS)
GEOIP_MAXMIND_OBJECTS="geoip_maxmind.so"
AC_SUBST(GEOIP_MAXMIND_OBJECTS)
])
])
])

660
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for unrealircd 5.2.0.1.
# Generated by GNU Autoconf 2.69 for unrealircd 6.0.1.1.
#
# Report bugs to <https://bugs.unrealircd.org/>.
#
@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='unrealircd'
PACKAGE_TARNAME='unrealircd'
PACKAGE_VERSION='5.2.0.1'
PACKAGE_STRING='unrealircd 5.2.0.1'
PACKAGE_VERSION='6.0.1.1'
PACKAGE_STRING='unrealircd 6.0.1.1'
PACKAGE_BUGREPORT='https://bugs.unrealircd.org/'
PACKAGE_URL='https://unrealircd.org/'
@ -626,6 +626,12 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
UNRLINCDIR
IRCDLIBS
GEOIP_MAXMIND_OBJECTS
LIBMAXMINDDB_LIBS
LIBMAXMINDDB_CFLAGS
GEOIP_CLASSIC_OBJECTS
GEOIP_CLASSIC_LIBS
GEOIP_CLASSIC_CFLAGS
URL
PTHREAD_CFLAGS
PTHREAD_LIBS
@ -639,6 +645,8 @@ build_os
build_vendor
build_cpu
build
JANSSON_LIBS
JANSSON_CFLAGS
CARES_LIBS
CARES_CFLAGS
SODIUM_LIBS
@ -746,19 +754,20 @@ with_docdir
with_pidfile
with_privatelibdir
with_maxconnections
enable_prefixaq
with_showlistmodes
with_no_operoverride
with_operoverride_verify
with_system_pcre2
with_system_argon2
with_system_sodium
with_system_cares
with_system_jansson
enable_ssl
enable_dynamic_linking
enable_werror
enable_asan
enable_libcurl
enable_geoip_classic
enable_libmaxminddb
'
ac_precious_vars='build_alias
host_alias
@ -779,7 +788,13 @@ ARGON2_LIBS
SODIUM_CFLAGS
SODIUM_LIBS
CARES_CFLAGS
CARES_LIBS'
CARES_LIBS
JANSSON_CFLAGS
JANSSON_LIBS
GEOIP_CLASSIC_CFLAGS
GEOIP_CLASSIC_LIBS
LIBMAXMINDDB_CFLAGS
LIBMAXMINDDB_LIBS'
# Initialize some variables set by options.
@ -1330,7 +1345,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures unrealircd 5.2.0.1 to adapt to many kinds of systems.
\`configure' configures unrealircd 6.0.1.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1396,7 +1411,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of unrealircd 5.2.0.1:";;
short | recursive ) echo "Configuration of unrealircd 6.0.1.1:";;
esac
cat <<\_ACEOF
@ -1406,7 +1421,6 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-hardening Enable compiler and linker options to frustrate
memory corruption exploits [yes]
--disable-prefixaq Disable chanadmin (+a) and chanowner (+q) prefixes
--enable-ssl= enable ssl will check /usr/local/opt/openssl
/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg
/usr/sfw /usr/local /usr
@ -1418,6 +1432,10 @@ Optional Features:
--enable-asan Enable address sanitizer and other debugging
options, not recommended for production servers!
--enable-libcurl=DIR enable libcurl (remote include) support
--enable-geoip-classic=no/yes
enable GeoIP Classic support
--enable-libmaxminddb=no/yes
enable GeoIP libmaxminddb support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -1447,7 +1465,6 @@ Optional Packages:
stored. Disable when building a package for a distro
--with-maxconnections=size
Specify the max file descriptors to use
--with-showlistmodes Specify whether modes are shown in /list
--with-no-operoverride Disable OperOverride
--with-operoverride-verify
Require opers to invite themselves to +s/+p channels
@ -1459,6 +1476,9 @@ Optional Packages:
library. Normally autodetected via pkg-config
--without-system-cares Use bundled version instead of system c-ares.
Normally autodetected via pkg-config.
--without-system-jansson
Use bundled version instead of system jansson.
Normally autodetected via pkg-config.
Some influential environment variables:
CC C compiler command
@ -1486,6 +1506,18 @@ Some influential environment variables:
CARES_CFLAGS
C compiler flags for CARES, overriding pkg-config
CARES_LIBS linker flags for CARES, overriding pkg-config
JANSSON_CFLAGS
C compiler flags for JANSSON, overriding pkg-config
JANSSON_LIBS
linker flags for JANSSON, overriding pkg-config
GEOIP_CLASSIC_CFLAGS
C compiler flags for GEOIP_CLASSIC, overriding pkg-config
GEOIP_CLASSIC_LIBS
linker flags for GEOIP_CLASSIC, overriding pkg-config
LIBMAXMINDDB_CFLAGS
C compiler flags for LIBMAXMINDDB, overriding pkg-config
LIBMAXMINDDB_LIBS
linker flags for LIBMAXMINDDB, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@ -1554,7 +1586,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
unrealircd configure 5.2.0.1
unrealircd configure 6.0.1.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1923,7 +1955,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by unrealircd $as_me 5.2.0.1, which was
It was created by unrealircd $as_me 6.0.1.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2315,7 +2347,7 @@ orig_cflags="$CFLAGS"
BUILDDIR_NOW="`pwd`"
# Generation version number (e.g.: X in X.Y.Z)
UNREAL_VERSION_GENERATION="5"
UNREAL_VERSION_GENERATION="6"
cat >>confdefs.h <<_ACEOF
#define UNREAL_VERSION_GENERATION $UNREAL_VERSION_GENERATION
@ -2323,7 +2355,7 @@ _ACEOF
# Major version number (e.g.: Y in X.Y.Z)
UNREAL_VERSION_MAJOR="2"
UNREAL_VERSION_MAJOR="0"
cat >>confdefs.h <<_ACEOF
#define UNREAL_VERSION_MAJOR $UNREAL_VERSION_MAJOR
@ -2331,7 +2363,7 @@ _ACEOF
# Minor version number (e.g.: Z in X.Y.Z)
UNREAL_VERSION_MINOR="0"
UNREAL_VERSION_MINOR="1"
cat >>confdefs.h <<_ACEOF
#define UNREAL_VERSION_MINOR $UNREAL_VERSION_MINOR
@ -5121,6 +5153,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CFLAGS="$CFLAGS -funsigned-char"
CFLAGS="$CFLAGS -Wall"
ac_ext=c
@ -5217,6 +5250,54 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wformat-nonliteral" >&5
$as_echo_n "checking whether C compiler accepts -Wformat-nonliteral... " >&6; }
if ${ax_cv_check_cflags__Werror___Wformat_nonliteral+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror -Wformat-nonliteral"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags__Werror___Wformat_nonliteral=yes
else
ax_cv_check_cflags__Werror___Wformat_nonliteral=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Wformat_nonliteral" >&5
$as_echo "$ax_cv_check_cflags__Werror___Wformat_nonliteral" >&6; }
if test x"$ax_cv_check_cflags__Werror___Wformat_nonliteral" = xyes; then :
CFLAGS="$CFLAGS -Wformat-nonliteral"
else
:
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -5312,6 +5393,55 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wparentheses" >&5
$as_echo_n "checking whether C compiler accepts -Wparentheses... " >&6; }
if ${ax_cv_check_cflags__Werror___Wparentheses+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror -Wparentheses"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags__Werror___Wparentheses=yes
else
ax_cv_check_cflags__Werror___Wparentheses=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Wparentheses" >&5
$as_echo "$ax_cv_check_cflags__Werror___Wparentheses" >&6; }
if test x"$ax_cv_check_cflags__Werror___Wparentheses" = xyes; then :
CFLAGS="$CFLAGS -Wparentheses"
else
:
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@ -5791,20 +5921,24 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if $CC --version | grep -q "clang version 3."; then :
CFLAGS="$CFLAGS -Wno-tautological-compare -Wno-pragmas"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Waddress" >&5
$as_echo_n "checking whether C compiler accepts -Waddress... " >&6; }
if ${ax_cv_check_cflags__Werror___Waddress+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wpragmas" >&5
$as_echo_n "checking whether C compiler accepts -Wpragmas... " >&6; }
if ${ax_cv_check_cflags__Werror___Wpragmas+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror -Waddress"
CFLAGS="$CFLAGS -Werror -Wpragmas"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -5817,19 +5951,19 @@ main ()
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags__Werror___Waddress=yes
ax_cv_check_cflags__Werror___Wpragmas=yes
else
ax_cv_check_cflags__Werror___Waddress=no
ax_cv_check_cflags__Werror___Wpragmas=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Waddress" >&5
$as_echo "$ax_cv_check_cflags__Werror___Waddress" >&6; }
if test x"$ax_cv_check_cflags__Werror___Waddress" = xyes; then :
CFLAGS="$CFLAGS -Wno-address"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Wpragmas" >&5
$as_echo "$ax_cv_check_cflags__Werror___Wpragmas" >&6; }
if test x"$ax_cv_check_cflags__Werror___Wpragmas" = xyes; then :
no_pragmas=1
else
:
no_pragmas=0
fi
ac_ext=c
@ -5838,21 +5972,20 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wcast-function-type" >&5
$as_echo_n "checking whether C compiler accepts -Wcast-function-type... " >&6; }
if ${ax_cv_check_cflags__Werror___Wcast_function_type+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wunknown-warning-option" >&5
$as_echo_n "checking whether C compiler accepts -Wunknown-warning-option... " >&6; }
if ${ax_cv_check_cflags__Werror___Wunknown_warning_option+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Werror -Wcast-function-type"
CFLAGS="$CFLAGS -Werror -Wunknown-warning-option"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -5865,19 +5998,19 @@ main ()
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags__Werror___Wcast_function_type=yes
ax_cv_check_cflags__Werror___Wunknown_warning_option=yes
else
ax_cv_check_cflags__Werror___Wcast_function_type=no
ax_cv_check_cflags__Werror___Wunknown_warning_option=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Wcast_function_type" >&5
$as_echo "$ax_cv_check_cflags__Werror___Wcast_function_type" >&6; }
if test x"$ax_cv_check_cflags__Werror___Wcast_function_type" = xyes; then :
CFLAGS="$CFLAGS -Wno-cast-function-type"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Wunknown_warning_option" >&5
$as_echo "$ax_cv_check_cflags__Werror___Wunknown_warning_option" >&6; }
if test x"$ax_cv_check_cflags__Werror___Wunknown_warning_option" = xyes; then :
unknown_warning_option=1
else
:
unknown_warning_option=0
fi
ac_ext=c
@ -5887,6 +6020,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "$unknown_warning_option" = "1"; then
CFLAGS="$CFLAGS -Wno-unknown-warning-option"
else
if test "$no_pragmas" = "1"; then
CFLAGS="$CFLAGS -Wno-pragmas"
fi
fi
@ -6008,6 +6149,19 @@ $as_echo "#define HAVE_STRLNCAT /**/" >>confdefs.h
fi
done
for ac_func in strlncpy
do :
ac_fn_c_check_func "$LINENO" "strlncpy" "ac_cv_func_strlncpy"
if test "x$ac_cv_func_strlncpy" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRLNCPY 1
_ACEOF
$as_echo "#define HAVE_STRLNCPY /**/" >>confdefs.h
fi
done
for ac_func in getrusage
do :
@ -6448,29 +6602,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
# Check whether --enable-prefixaq was given.
if test "${enable_prefixaq+set}" = set; then :
enableval=$enable_prefixaq;
else
enable_prefixaq=yes
fi
if test $enable_prefixaq = "yes"; then :
$as_echo "#define PREFIX_AQ /**/" >>confdefs.h
fi
# Check whether --with-showlistmodes was given.
if test "${with_showlistmodes+set}" = set; then :
withval=$with_showlistmodes; if test $withval = "yes"; then :
$as_echo "#define LIST_SHOW_MODES /**/" >>confdefs.h
fi
fi
# Check whether --with-no-operoverride was given.
if test "${with_no_operoverride+set}" = set; then :
@ -6524,6 +6655,14 @@ else
fi
# Check whether --with-system-jansson was given.
if test "${with_system_jansson+set}" = set; then :
withval=$with_system_jansson;
else
with_system_jansson=yes
fi
# Check whether --enable-ssl was given.
if test "${enable_ssl+set}" = set; then :
enableval=$enable_ssl;
@ -6570,7 +6709,11 @@ $as_echo "not found" >&6; }
else
CRYPTOLIB="-lssl -lcrypto";
if test ! "$ssldir" = "/usr" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib";
if test -d "$ssldir/lib64" ; then
LDFLAGS="$LDFLAGS -L$ssldir/lib64";
else
LDFLAGS="$LDFLAGS -L$ssldir/lib";
fi
if test -f "$ssldir/bin/openssl"; then
OPENSSLPATH="$ssldir/bin/openssl";
fi
@ -7655,7 +7798,7 @@ fi
if test "$has_system_cares" = "no"; then :
cares_version="1.17.1"
cares_version="1.17.2"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting c-ares resolver library" >&5
$as_echo "extracting c-ares resolver library" >&6; }
cur_dir=`pwd`
@ -7716,6 +7859,130 @@ cd $cur_dir
fi
has_system_jansson="no"
if test "x$with_system_jansson" = "xyes"; then :
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JANSSON" >&5
$as_echo_n "checking for JANSSON... " >&6; }
if test -n "$JANSSON_CFLAGS"; then
pkg_cv_JANSSON_CFLAGS="$JANSSON_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jansson >= 2.0.0\""; } >&5
($PKG_CONFIG --exists --print-errors "jansson >= 2.0.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_JANSSON_CFLAGS=`$PKG_CONFIG --cflags "jansson >= 2.0.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$JANSSON_LIBS"; then
pkg_cv_JANSSON_LIBS="$JANSSON_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jansson >= 2.0.0\""; } >&5
($PKG_CONFIG --exists --print-errors "jansson >= 2.0.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_JANSSON_LIBS=`$PKG_CONFIG --libs "jansson >= 2.0.0" 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
JANSSON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "jansson >= 2.0.0" 2>&1`
else
JANSSON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "jansson >= 2.0.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$JANSSON_PKG_ERRORS" >&5
has_system_jansson=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
has_system_jansson=no
else
JANSSON_CFLAGS=$pkg_cv_JANSSON_CFLAGS
JANSSON_LIBS=$pkg_cv_JANSSON_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
has_system_jansson=yes
if test "x$PRIVATELIBDIR" != "x"; then :
rm -f "$PRIVATELIBDIR/"libjansson*
fi
fi
fi
if test "$has_system_jansson" = "no"; then :
jansson_version="2.13.1"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting jansson library" >&5
$as_echo "extracting jansson library" >&6; }
cur_dir=`pwd`
cd extras
rm -rf jansson-$jansson_version jansson
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz jansson.tar.gz
else
cp jansson.tar.gz jansson.tar.gz.bak
gunzip -f jansson.tar.gz
cp jansson.tar.gz.bak jansson.tar.gz
tar xf jansson.tar
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling jansson library" >&5
$as_echo "compiling jansson library" >&6; }
cd jansson-$jansson_version
save_cflags="$CFLAGS"
CFLAGS="$orig_cflags"
export CFLAGS
./configure --prefix=$cur_dir/extras/jansson --libdir=$PRIVATELIBDIR --enable-shared --disable-static --enable-opt || exit 1
CFLAGS="$save_cflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling jansson resolver library" >&5
$as_echo "compiling jansson resolver library" >&6; }
$ac_cv_prog_MAKER || exit 1
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: installing jansson resolver library" >&5
$as_echo "installing jansson resolver library" >&6; }
$ac_cv_prog_MAKER install || exit 1
JANSSON_CFLAGS="-I$cur_dir/extras/jansson/include"
JANSSON_LIBS=
if test -n "$ac_cv_path_PKGCONFIG"; then :
JANSSON_LIBS="`$ac_cv_path_PKGCONFIG --libs jansson.pc`"
fi
if test -z "$JANSSON_LIBS"; then :
JANSSON_LIBS="-L$PRIVATELIBDIR -ljansson"
fi
cd $cur_dir
fi
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@ -8338,11 +8605,269 @@ rm -f core conftest.err conftest.$ac_objext \
LIBS="$LIBS_SAVEDA"
CFLAGS="$CFLAGS_SAVEDA"
URL="url.o"
URL="url_curl.o"
else
URL="url_unreal.o"
fi
# Check whether --enable-geoip_classic was given.
if test "${enable_geoip_classic+set}" = set; then :
enableval=$enable_geoip_classic; enable_geoip_classic=$enableval
else
enable_geoip_classic=no
fi
if test "x$enable_geoip_classic" = "xyes"; then :
has_system_geoip_classic="no"
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GEOIP_CLASSIC" >&5
$as_echo_n "checking for GEOIP_CLASSIC... " >&6; }
if test -n "$GEOIP_CLASSIC_CFLAGS"; then
pkg_cv_GEOIP_CLASSIC_CFLAGS="$GEOIP_CLASSIC_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"geoip >= 1.6.0\""; } >&5
($PKG_CONFIG --exists --print-errors "geoip >= 1.6.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GEOIP_CLASSIC_CFLAGS=`$PKG_CONFIG --cflags "geoip >= 1.6.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$GEOIP_CLASSIC_LIBS"; then
pkg_cv_GEOIP_CLASSIC_LIBS="$GEOIP_CLASSIC_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"geoip >= 1.6.0\""; } >&5
($PKG_CONFIG --exists --print-errors "geoip >= 1.6.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GEOIP_CLASSIC_LIBS=`$PKG_CONFIG --libs "geoip >= 1.6.0" 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
GEOIP_CLASSIC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "geoip >= 1.6.0" 2>&1`
else
GEOIP_CLASSIC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "geoip >= 1.6.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GEOIP_CLASSIC_PKG_ERRORS" >&5
has_system_geoip_classic=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
has_system_geoip_classic=no
else
GEOIP_CLASSIC_CFLAGS=$pkg_cv_GEOIP_CLASSIC_CFLAGS
GEOIP_CLASSIC_LIBS=$pkg_cv_GEOIP_CLASSIC_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
has_system_geoip_classic=yes
if test "x$PRIVATELIBDIR" != "x"; then :
rm -f "$PRIVATELIBDIR/"libGeoIP.*
fi
fi
if test "$has_system_geoip_classic" = "no"; then :
geoip_classic_version="1.6.12"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting GeoIP Classic library" >&5
$as_echo "extracting GeoIP Classic library" >&6; }
cur_dir=`pwd`
cd extras
rm -rf GeoIP-$geoip_classic_version geoip-classic
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz geoip-classic.tar.gz
else
cp geoip-classic.tar.gz geoip-classic.tar.gz.bak
gunzip -f geoip-classic.tar.gz
cp geoip-classic.tar.gz.bak geoip-classic.tar.gz
tar xf geoip-classic.tar
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring GeoIP Classic library" >&5
$as_echo "configuring GeoIP Classic library" >&6; }
cd GeoIP-$geoip_classic_version
save_cflags="$CFLAGS"
CFLAGS="$orig_cflags"
export CFLAGS
./configure --prefix=$cur_dir/extras/geoip-classic --libdir=$PRIVATELIBDIR --enable-shared --disable-static || exit 1
CFLAGS="$save_cflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling GeoIP Classic library" >&5
$as_echo "compiling GeoIP Classic library" >&6; }
$ac_cv_prog_MAKER || exit 1
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: installing GeoIP Classic library" >&5
$as_echo "installing GeoIP Classic library" >&6; }
$ac_cv_prog_MAKER install || exit 1
if test -n "$ac_cv_path_PKGCONFIG"; then :
GEOIP_CLASSIC_LIBS="`$ac_cv_path_PKGCONFIG --libs geoip.pc`"
GEOIP_CLASSIC_CFLAGS="`$ac_cv_path_PKGCONFIG --cflags geoip.pc`"
fi
if test -z "$GEOIP_CLASSIC_LIBS"; then :
GEOIP_CLASSIC_LIBS="-L$PRIVATELIBDIR -lGeoIP"
GEOIP_CLASSIC_CFLAGS="-I$cur_dir/extras/geoip-classic/include"
fi
cd $cur_dir
fi
GEOIP_CLASSIC_OBJECTS="geoip_classic.so"
fi
# Check whether --enable-libmaxminddb was given.
if test "${enable_libmaxminddb+set}" = set; then :
enableval=$enable_libmaxminddb; enable_libmaxminddb=$enableval
else
enable_libmaxminddb=no
fi
if test "x$enable_libmaxminddb" = "xyes"; then :
has_system_libmaxminddb="no"
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBMAXMINDDB" >&5
$as_echo_n "checking for LIBMAXMINDDB... " >&6; }
if test -n "$LIBMAXMINDDB_CFLAGS"; then
pkg_cv_LIBMAXMINDDB_CFLAGS="$LIBMAXMINDDB_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmaxminddb >= 1.4.3\""; } >&5
($PKG_CONFIG --exists --print-errors "libmaxminddb >= 1.4.3") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBMAXMINDDB_CFLAGS=`$PKG_CONFIG --cflags "libmaxminddb >= 1.4.3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBMAXMINDDB_LIBS"; then
pkg_cv_LIBMAXMINDDB_LIBS="$LIBMAXMINDDB_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmaxminddb >= 1.4.3\""; } >&5
($PKG_CONFIG --exists --print-errors "libmaxminddb >= 1.4.3") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBMAXMINDDB_LIBS=`$PKG_CONFIG --libs "libmaxminddb >= 1.4.3" 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
LIBMAXMINDDB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmaxminddb >= 1.4.3" 2>&1`
else
LIBMAXMINDDB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmaxminddb >= 1.4.3" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBMAXMINDDB_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (libmaxminddb >= 1.4.3) were not met:
$LIBMAXMINDDB_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 LIBMAXMINDDB_CFLAGS
and LIBMAXMINDDB_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 LIBMAXMINDDB_CFLAGS
and LIBMAXMINDDB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
LIBMAXMINDDB_CFLAGS=$pkg_cv_LIBMAXMINDDB_CFLAGS
LIBMAXMINDDB_LIBS=$pkg_cv_LIBMAXMINDDB_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
has_system_libmaxminddb=yes
fi
if test "x$has_system_libmaxminddb" = "xyes"; then :
GEOIP_MAXMIND_OBJECTS="geoip_maxmind.so"
fi
fi
UNRLINCDIR="`pwd`/include"
if test "$ac_cv_werror" = "yes" ; then
@ -8358,7 +8883,7 @@ fi
ac_config_files="$ac_config_files Makefile src/Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/snomasks/Makefile src/modules/extbans/Makefile src/modules/third/Makefile extras/unrealircd-upgrade-script unrealircd"
ac_config_files="$ac_config_files Makefile src/Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/extbans/Makefile src/modules/third/Makefile extras/unrealircd-upgrade-script unrealircd"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -8866,7 +9391,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by unrealircd $as_me 5.2.0.1, which was
This file was extended by unrealircd $as_me 6.0.1.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -8929,7 +9454,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
unrealircd config.status 5.2.0.1
unrealircd config.status 6.0.1.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@ -9056,7 +9581,6 @@ do
"src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;;
"src/modules/chanmodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/chanmodes/Makefile" ;;
"src/modules/usermodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/usermodes/Makefile" ;;
"src/modules/snomasks/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/snomasks/Makefile" ;;
"src/modules/extbans/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/extbans/Makefile" ;;
"src/modules/third/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/third/Makefile" ;;
"extras/unrealircd-upgrade-script") CONFIG_FILES="$CONFIG_FILES extras/unrealircd-upgrade-script" ;;

View File

@ -7,7 +7,7 @@ dnl src/windows/unrealinst.iss
dnl doc/Config.header
dnl src/version.c.SH
AC_INIT([unrealircd], [5.2.0.1], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
AC_INIT([unrealircd], [6.0.1.1], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
AC_CONFIG_SRCDIR([src/ircd.c])
AC_CONFIG_HEADER([include/setup.h])
AC_CONFIG_AUX_DIR([autoconf])
@ -26,15 +26,15 @@ BUILDDIR_NOW="`pwd`"
dnl Calculate the versions. Perhaps the use of expr is a little too extravagant
# Generation version number (e.g.: X in X.Y.Z)
UNREAL_VERSION_GENERATION=["5"]
UNREAL_VERSION_GENERATION=["6"]
AC_DEFINE_UNQUOTED([UNREAL_VERSION_GENERATION], [$UNREAL_VERSION_GENERATION], [Generation version number (e.g.: X for X.Y.Z)])
# Major version number (e.g.: Y in X.Y.Z)
UNREAL_VERSION_MAJOR=["2"]
UNREAL_VERSION_MAJOR=["0"]
AC_DEFINE_UNQUOTED([UNREAL_VERSION_MAJOR], [$UNREAL_VERSION_MAJOR], [Major version number (e.g.: Y for X.Y.Z)])
# Minor version number (e.g.: Z in X.Y.Z)
UNREAL_VERSION_MINOR=["0"]
UNREAL_VERSION_MINOR=["1"]
AC_DEFINE_UNQUOTED([UNREAL_VERSION_MINOR], [$UNREAL_VERSION_MINOR], [Minor version number (e.g.: Z for X.Y.Z)])
# The version suffix such as a beta marker or release candidate
@ -189,18 +189,26 @@ CFLAGS="$CFLAGS -funsigned-char"
dnl Compiler -W checks...
dnl == ADD THESE WARNINGS ==
dnl We should be able to turn this on unconditionally:
CFLAGS="$CFLAGS -Wall"
dnl More warnings (if the compiler supports it):
check_cc_flag([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
check_cc_flag([-Waggregate-return], [CFLAGS="$CFLAGS -Waggregate-return"])
check_cc_flag([-Wformat-nonliteral], [CFLAGS="$CFLAGS -Wformat-nonliteral"])
dnl The following few are more experimental, if they have false positives we'll have
dnl to disable them:
dnl Can't use this, too bad: check_cc_flag([-Wlogical-op], [CFLAGS="$CFLAGS -Wlogical-op"])
check_cc_flag([-Wduplicated-cond], [CFLAGS="$CFLAGS -Wduplicated-cond"])
check_cc_flag([-Wduplicated-branches], [CFLAGS="$CFLAGS -Wduplicated-branches"])
check_cc_flag([-Wparentheses], [CFLAGS="$CFLAGS -Wparentheses"])
dnl == REMOVE THESE WARNINGS ==
dnl And now to filter out certain warnings:
dnl [!] NOTE REGARDING THE check_cc_flag used by these:
dnl We check for the -Woption even though we are going to use -Wno-option.
@ -247,12 +255,31 @@ check_cc_flag([-Wsign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"])
dnl Don't warn about empty body, we use this, eg via Debug(()) or in if's.
check_cc_flag([-Wempty-body], [CFLAGS="$CFLAGS -Wno-empty-body"])
dnl This one fails with ircstrdup(var, staticstring)
dnl Shame we have to turn it off completely...
check_cc_flag([-Waddress], [CFLAGS="$CFLAGS -Wno-address"])
dnl Yeah this old clang version is a bit problematic
dnl (ships in Ubuntu 16.04 for example)
dnl -Wtautological-compare has false positives
dnl -Wno-pragmas is needed, despite -Wno-unknown-warning-option
AS_IF([$CC --version | grep -q "clang version 3."],
[CFLAGS="$CFLAGS -Wno-tautological-compare -Wno-pragmas"])
dnl This one breaks our TO_INTFUNC() that is used in m_tkl for tkl_typetochar
check_cc_flag([-Wcast-function-type], [CFLAGS="$CFLAGS -Wno-cast-function-type"])
dnl This one MUST be LAST!!
dnl It disables -Wsomeunknownoption being an error. Which is needed for
dnl the pragma's in individual files to selectively disable some warnings
dnl on clang/gcc (that may exist in eg gcc but not in clang or vice versa).
check_cc_flag([-Wpragmas], [no_pragmas=1],[no_pragmas=0])
check_cc_flag([-Wunknown-warning-option], [unknown_warning_option=1], [unknown_warning_option=0])
if test "$unknown_warning_option" = "1"; then
dnl This is the best option
CFLAGS="$CFLAGS -Wno-unknown-warning-option"
else
if test "$no_pragmas" = "1"; then
dnl This is a fallback needed for older gcc/clang, it also
dnl disables several other useful warnings/errors related
dnl to pragma's unfortunately.
CFLAGS="$CFLAGS -Wno-pragmas"
fi
fi
dnl End of -W... compiler checks.
@ -352,6 +379,8 @@ AC_CHECK_FUNCS(strlcat,
AC_DEFINE([HAVE_STRLCAT], [], [Define if you have strlcat]))
AC_CHECK_FUNCS(strlncat,
AC_DEFINE([HAVE_STRLNCAT], [], [Define if you have strlncat]))
AC_CHECK_FUNCS(strlncpy,
AC_DEFINE([HAVE_STRLNCPY], [], [Define if you have strlncpy]))
AC_CHECK_FUNCS([getrusage],
[AC_DEFINE([GETRUSAGE_2], [], [Define if you have getrusage])],
@ -492,17 +521,6 @@ AC_ARG_WITH(maxconnections, [AS_HELP_STRING([--with-maxconnections=size], [Speci
[ac_fd=0])
AC_DEFINE_UNQUOTED([MAXCONNECTIONS_REQUEST], [$ac_fd], [Set to the maximum number of connections you want])
AC_ARG_ENABLE([prefixaq],
[AS_HELP_STRING([--disable-prefixaq],[Disable chanadmin (+a) and chanowner (+q) prefixes])],
[],
[enable_prefixaq=yes])
AS_IF([test $enable_prefixaq = "yes"],
[AC_DEFINE([PREFIX_AQ], [], [Define if you want +a/+q prefixes])])
AC_ARG_WITH(showlistmodes,
[AS_HELP_STRING([--with-showlistmodes], [Specify whether modes are shown in /list])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([LIST_SHOW_MODES], [], [Define if you want modes shown in /list])])])
AC_ARG_WITH(no-operoverride, [AS_HELP_STRING([--with-no-operoverride], [Disable OperOverride])],
[AS_IF([test $withval = "yes"],
[AC_DEFINE([NO_OPEROVERRIDE], [], [Define if you want OperOverride disabled])])])
@ -513,6 +531,7 @@ AC_ARG_WITH(system-pcre2, [AS_HELP_STRING([--without-system-pcre2], [Use the sys
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-sodium, [AS_HELP_STRING([--without-system-sodium], [Use bundled version instead of system sodium library. Normally autodetected via pkg-config])], [], [with_system_sodium=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])
AC_ARG_WITH(system-jansson, [AS_HELP_STRING([--without-system-jansson], [Use bundled version instead of system jansson. Normally autodetected via pkg-config.])], [], [with_system_jansson=yes])
CHECK_SSL
CHECK_SSL_CTX_SET1_CURVES_LIST
CHECK_SSL_CTX_SET_MIN_PROTO_VERSION
@ -697,7 +716,7 @@ AS_IF([test "$has_system_cares" = "no"], [
dnl REMEMBER TO CHANGE WITH A NEW C-ARES RELEASE!
dnl NOTE: when changing this here, ALSO change it in extras/curlinstall
dnl and in the comment in this file around line 400!
cares_version="1.17.1"
cares_version="1.17.2"
AC_MSG_RESULT(extracting c-ares resolver library)
cur_dir=`pwd`
cd extras
@ -763,10 +782,65 @@ AC_SUBST(CARES_LIBS)
cd $cur_dir
])
dnl Use system jansson when available, unless --without-system-jansson
has_system_jansson="no"
AS_IF([test "x$with_system_jansson" = "xyes"],[
PKG_CHECK_MODULES([JANSSON], [jansson >= 2.0.0],[has_system_jansson=yes
AS_IF([test "x$PRIVATELIBDIR" != "x"], [rm -f "$PRIVATELIBDIR/"libjansson*])],[has_system_jansson=no])])
AS_IF([test "$has_system_jansson" = "no"],[
dnl REMEMBER TO CHANGE WITH A NEW JANSSON RELEASE!
jansson_version="2.13.1"
AC_MSG_RESULT(extracting jansson library)
cur_dir=`pwd`
cd extras
dnl remove old jansson directory to force a recompile...
dnl and remove its installation prefix just to clean things up.
rm -rf jansson-$jansson_version jansson
if test "x$ac_cv_path_GUNZIP" = "x" ; then
tar xfz jansson.tar.gz
else
cp jansson.tar.gz jansson.tar.gz.bak
gunzip -f jansson.tar.gz
cp jansson.tar.gz.bak jansson.tar.gz
tar xf jansson.tar
fi
AC_MSG_RESULT(compiling jansson library)
cd jansson-$jansson_version
save_cflags="$CFLAGS"
CFLAGS="$orig_cflags"
export CFLAGS
./configure --prefix=$cur_dir/extras/jansson --libdir=$PRIVATELIBDIR --enable-shared --disable-static --enable-opt || exit 1
CFLAGS="$save_cflags"
AC_MSG_RESULT(compiling jansson resolver library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing jansson resolver library)
$ac_cv_prog_MAKER install || exit 1
JANSSON_CFLAGS="-I$cur_dir/extras/jansson/include"
AC_SUBST(JANSSON_CFLAGS)
JANSSON_LIBS=
dnl See c-ares's compilation section for more info on this hack.
dnl ensure that we're linking against the bundled version
dnl (we only reach this code if linking against the bundled version is desired).
AS_IF([test -n "$ac_cv_path_PKGCONFIG"],
[JANSSON_LIBS="`$ac_cv_path_PKGCONFIG --libs jansson.pc`"])
dnl ^^^ FIXME FIXME this is likely incorrect the .pc etc
dnl For when pkg-config isn't available
AS_IF([test -z "$JANSSON_LIBS"],
[JANSSON_LIBS="-L$PRIVATELIBDIR -ljansson"])
AC_SUBST(JANSSON_LIBS)
cd $cur_dir
])
AX_PTHREAD()
CHECK_LIBCURL
CHECK_GEOIP_CLASSIC
CHECK_LIBMAXMINDDB
UNRLINCDIR="`pwd`/include"
dnl Moved to the very end to ensure it doesn't affect any libs or tests.
@ -789,7 +863,6 @@ AC_CONFIG_FILES([Makefile
src/modules/Makefile
src/modules/chanmodes/Makefile
src/modules/usermodes/Makefile
src/modules/snomasks/Makefile
src/modules/extbans/Makefile
src/modules/third/Makefile
extras/unrealircd-upgrade-script

View File

@ -7,7 +7,7 @@
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for UnrealIRCd 5.2.0.1
for UnrealIRCd 6.0.1.1
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.
@ -16,15 +16,15 @@ A short installation guide is available online at:
https://www.unrealircd.org/docs/Installing_from_source
Full documentation is available at:
https://www.unrealircd.org/docs/UnrealIRCd_5_documentation
https://www.unrealircd.org/docs/UnrealIRCd_6_documentation
--------------------------------------------------------------------------------------
The full release notes are available in doc/RELEASE-NOTES.md
For easier viewing, check out the latest online release notes at:
https://github.com/unrealircd/unrealircd/blob/unreal52/doc/RELEASE-NOTES.md
https://github.com/unrealircd/unrealircd/blob/unreal60_dev/doc/RELEASE-NOTES.md
UnrealIRCd 5 is compatible with the following services:
UnrealIRCd 6 is compatible with the following services:
* anope with the "unreal4" protocol module - version 2.0.7 or higher required!
* atheme with the "unreal4" protocol module - tested with version 7.2.9

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,44 @@
badword channel { word "bitch"; replace "wombat"; }
badword channel { word "bro"; replace "bo"; }
badword channel { word "(brother)"; replace "bredda"; }
badword channel { word "car"; replace "taxi"; }
badword channel { word "discord"; replace "dicsord"; }
badword channel { word "efnet"; replace "efrael"; }
badword channel { word "hate"; replace "04 hate "; }
badword channel { word "hello"; replace "smello"; }
badword channel { word "house"; replace "flat"; }
badword channel { word "gaming"; replace "gaymen"; }
badword channel { word "im"; replace "m"; }
badword channel { word "i'm"; replace "m"; }
badword channel { word "i am"; replace "m"; }
badword channel { word "ima"; replace "m"; }
badword channel { word "my"; replace "me"; }
badword channel { word "(nigger)"; replace "angel"; }
badword channel { word "np"; replace "mp"; }
badword channel { word "on"; replace "pon"; }
badword channel { word "same"; replace "salami"; }
badword channel { word "(skyp)"; replace "skik"; }
badword channel { word "(ss)"; replace "ϟϟ"; }
badword channel { word "(troll)"; replace "papillion"; }
badword channel { word "uber"; replace "HELLS ANGELS"; }
badword channel { word "(year)"; replace "yonk"; }
badword channel { word "apartment"; replace "flat"; }
badword channel { word "banana"; replace "bogoya"; }
badword channel { word "bitch"; replace "wombat"; }
badword channel { word "bro"; replace "bo"; }
badword channel { word "(brother)"; replace "bredda"; }
badword channel { word "bruh"; replace "bredda"; }
badword channel { word "car"; replace "taxi"; }
badword channel { word "cool"; replace "safe"; }
badword channel { word "drunk"; replace "buck"; }
badword channel { word "dude"; replace "blud"; }
badword channel { word "discord"; replace "dicksword"; }
badword channel { word "elaborate"; replace "ebloggerate"; }
badword channel { word "efnet"; replace "efrael"; }
badword channel { word "fuckin"; replace "blood clot"; }
badword channel { word "fucking"; replace "blood clot"; }
badword channel { word "fuckn"; replace "blood clot"; }
badword channel { word "hate"; replace "04 hate "; }
badword channel { word "hello"; replace "smello"; }
badword channel { word "high"; replace "HIE"; }
badword channel { word "home"; replace "flat"; }
badword channel { word "house"; replace "flat"; }
badword channel { word "gaming"; replace "gaymen"; }
badword channel { word "im"; replace "m"; }
badword channel { word "i'm"; replace "m"; }
badword channel { word "i am"; replace "m"; }
badword channel { word "ima"; replace "m"; }
badword channel { word "jfc"; replace "bloody hell"; }
badword channel { word "my"; replace "me"; }
badword channel { word "nice"; replace "safe"; }
badword channel { word "(nigger)"; replace "angel"; }
badword channel { word "np"; replace "mp"; }
badword channel { word "on"; replace "pon"; }
badword channel { word "same"; replace "salami"; }
badword channel { word "shitfaced"; replace "buck"; }
badword channel { word "shit faced"; replace "buck"; }
badword channel { word "shoes"; replace "kicks"; }
badword channel { word "(skyp)"; replace "skik"; }
badword channel { word "(ss)"; replace "ϟϟ"; }
badword channel { word "(troll)"; replace "papillion"; }
badword channel { word "uber"; replace "HELLS ANGELS"; }
badword channel { word "(year)"; replace "yonk"; }
badword channel { word "sup"; replace "wah gwaan"; }
badword channel { word "wussup"; replace "wah gwaan"; }
@ -33,15 +50,18 @@ badword channel { word "what's up"; replace "wah gwaan"; }
badword channel { word "wuddup"; replace "wah gwaan"; }
badword channel { word "gal"; replace "bint"; }
badword channel { word "gf"; replace "bint"; }
badword channel { word "(girl)"; replace "bint"; }
badword channel { word "lady"; replace "bint"; }
badword channel { word "ladies"; replace "bints"; }
badword channel { word "(woman)"; replace "bint"; }
badword channel { word "wife"; replace "bint"; }
badword channel { word "women"; replace "bints"; }
badword channel { word "ganja"; replace "bobby brown"; }
badword channel { word "marijuana"; replace "bobby brown"; }
badword channel { word "pot"; replace "bobby brown"; }
badword channel { word "reefer"; replace "bobby brown"; }
badword channel { word "weed"; replace "bobby brown"; }
badword channel { word "kek"; replace "%%"; }

View File

@ -1,28 +1,34 @@
# IRCCloud
except ban { mask *@5.254.36.56/29; }
except ban { mask *@192.184.9.108/32; }
except ban { mask *@192.184.9.112/32; }
except ban { mask *@192.184.10.118/32; }
except ban { mask *@192.184.10.9/32; }
except ban { mask *@192.184.8.103/32; }
except ban { mask *@2001:67c:2f08::/48; }
except ban { mask *@2a03:5180:f::/62; }
except ban { mask *@2a03:5180:f:4::/63; }
except ban { mask *@2a03:5180:f:6::/64; }
except ban {
mask *@5.254.36.56/29;
mask *@192.184.9.108/32;
mask *@192.184.9.112/32;
mask *@192.184.10.118/32;
mask *@192.184.10.9/32;
mask *@192.184.8.103/32;
mask *@2001:67c:2f08::/48;
mask *@2a03:5180:f::/62;
mask *@2a03:5180:f:4::/63;
mask *@2a03:5180:f:6::/64;
}
# KiwiIRC
except ban { mask *@107.161.19.53; }
except ban { mask *@107.161.19.109; }
except ban { mask *@109.169.31.4; }
except ban { mask *@109.169.31.13; } # KiwiIRC Verify Bot (out.kiwiirc.com)
except ban {
mask *@107.161.19.53;
mask *@107.161.19.109;
mask *@109.169.31.4;
mask *@109.169.31.13; # KiwiIRC Verify Bot (out.kiwiirc.com)
}
# Mibbit
except ban { mask *@207.192.75.252; } # ircip1.mibbit.com
except ban { mask *@64.62.228.82; } # ircip2.mibbit.com
except ban { mask *@78.129.202.38; } # ircip3.mibbit.com
except ban { mask *@109.169.29.95; } # ircip4.mibbit.com
except ban { mask *@97.107.138.109; } # bot.search.mibbit.com
except ban { mask *@2600:3c03::f03c:91ff:fe96:c1fa; } # bot.search.mibbit.com
except ban {
mask *@207.192.75.252; # ircip1.mibbit.com
mask *@64.62.228.82; # ircip2.mibbit.com
mask *@78.129.202.38; # ircip3.mibbit.com
mask *@109.169.29.95; # ircip4.mibbit.com
mask *@97.107.138.109; # bot.search.mibbit.com
mask *@2600:3c03::f03c:91ff:fe96:c1fa; # bot.search.mibbit.com
}
# Netsplit
except ban { mask *@85.25.10.40; } # anaconda.netsplit.de
except ban { mask *@85.25.10.40; } # anaconda.netsplit.de

View File

@ -1,5 +1,5 @@
// Cloaking (+x)
loadmodule "cloak";
loadmodule "cloak_sha256";
// User Commands (Minimal)
#loadmodule "admin";
@ -63,6 +63,7 @@ loadmodule "kill";
#loadmodule "locops";
loadmodule "mkpasswd";
loadmodule "oper";
loadmodule "operinfo";
#loadmodule "opermotd";
loadmodule "sajoin";
loadmodule "samode";
@ -76,7 +77,6 @@ loadmodule "tkl";
loadmodule "trace";
loadmodule "tsctl";
loadmodule "unsqline";
#loadmodule "wallops";
// Server-2-Server Commands
loadmodule "eos";
@ -86,9 +86,11 @@ loadmodule "netinfo";
loadmodule "server";
loadmodule "sinfo";
loadmodule "sjoin";
loadmodule "slog";
loadmodule "sqline";
loadmodule "swhois";
loadmodule "umode2";
loadmodule "unreal_server_compat";
// Services Commands
loadmodule "sendsno";
@ -108,25 +110,39 @@ loadmodule "svssno";
loadmodule "svswatch";
// Channel Modes
loadmodule "chanmodes/censor"; /* +G */
loadmodule "chanmodes/delayjoin"; /* +D */
loadmodule "chanmodes/floodprot"; /* +f */
loadmodule "chanmodes/history"; /* +H */
loadmodule "chanmodes/issecure"; /* +Z */
loadmodule "chanmodes/link"; /* +L */
loadmodule "chanmodes/nocolor"; /* +c */
loadmodule "chanmodes/noctcp"; /* +C */
loadmodule "chanmodes/noinvite"; /* +V */
loadmodule "chanmodes/nokick"; /* +Q */
loadmodule "chanmodes/noknock"; /* +K */
loadmodule "chanmodes/nonickchange"; /* +N */
loadmodule "chanmodes/nonotice"; /* +T */
loadmodule "chanmodes/operonly"; /* +O */
loadmodule "chanmodes/permanent"; /* +P */
loadmodule "chanmodes/regonly"; /* +R */
loadmodule "chanmodes/regonlyspeak"; /* +M */
loadmodule "chanmodes/secureonly"; /* +z */
loadmodule "chanmodes/stripcolor"; /* +S */
loadmodule "chanmodes/chanowner"; /* +q */
loadmodule "chanmodes/chanadmin"; /* +a */
loadmodule "chanmodes/chanop"; /* +o */
loadmodule "chanmodes/halfop"; /* +h */
loadmodule "chanmodes/voice"; /* +v */
loadmodule "chanmodes/censor"; /* +G */
loadmodule "chanmodes/delayjoin"; /* +D */
loadmodule "chanmodes/floodprot"; /* +f */
loadmodule "chanmodes/history"; /* +H */
loadmodule "chanmodes/inviteonly"; /* +i */
loadmodule "chanmodes/isregistered"; /* +r */
loadmodule "chanmodes/issecure"; /* +Z */
loadmodule "chanmodes/key"; /* +k */
loadmodule "chanmodes/limit"; /* +l */
loadmodule "chanmodes/link"; /* +L */
loadmodule "chanmodes/moderated"; /* +m */
loadmodule "chanmodes/nocolor"; /* +c */
loadmodule "chanmodes/noctcp"; /* +C */
loadmodule "chanmodes/noexternalmsgs"; /* +n */
loadmodule "chanmodes/noinvite"; /* +V */
loadmodule "chanmodes/nokick"; /* +Q */
loadmodule "chanmodes/noknock"; /* +K */
loadmodule "chanmodes/nonickchange"; /* +N */
loadmodule "chanmodes/nonotice"; /* +T */
loadmodule "chanmodes/operonly"; /* +O */
loadmodule "chanmodes/permanent"; /* +P */
loadmodule "chanmodes/private"; /* +p */
loadmodule "chanmodes/regonly"; /* +R */
loadmodule "chanmodes/regonlyspeak"; /* +M */
loadmodule "chanmodes/secret"; /* +s */
loadmodule "chanmodes/secureonly"; /* +z */
loadmodule "chanmodes/stripcolor"; /* +S */
loadmodule "chanmodes/topiclimit"; /* +t */
// User Modes
loadmodule "usermodes/bot"; /* +B */
@ -139,24 +155,23 @@ loadmodule "usermodes/regonlymsg"; /* +R */
loadmodule "usermodes/secureonlymsg"; /* +Z */
loadmodule "usermodes/servicebot"; /* +S */
#loadmodule "usermodes/showwhois"; /* +W */
// Snomasks
#loadmodule "snomasks/dccreject"; /* +D */
#loadmodule "usermodes/wallops"; /* +w */
// Extended Bans
loadmodule "extbans/account"; /* +b ~a */
#loadmodule "extbans/certfp"; /* +b ~S */
#loadmodule "extbans/inchannel"; /* +b ~c */
loadmodule "extbans/join"; /* +b ~j */
loadmodule "extbans/msgbypass"; /* +e ~m */
#loadmodule "extbans/nickchange"; /* +b ~n */
#loadmodule "extbans/operclass"; /* +b ~O */
#loadmodule "extbans/partmsg"; /* +b ~p */
loadmodule "extbans/quiet"; /* +b ~q */
#loadmodule "extbans/realname"; /* +b ~r */
#loadmodule "extbans/textban"; /* +b ~T */
loadmodule "extbans/timedban"; /* +b ~t */
loadmodule "extbans/securitygroup"; /* +b ~G */
loadmodule "extbans/account"; /* +b ~account */
loadmodule "extbans/certfp"; /* +b ~certfp */
#loadmodule "extbans/country"; /* +b ~country */
loadmodule "extbans/inchannel"; /* +b ~channel */
loadmodule "extbans/join"; /* +b ~join */
loadmodule "extbans/msgbypass"; /* +e ~msgbypass */
#loadmodule "extbans/nickchange"; /* +b ~nickchange */
#loadmodule "extbans/operclass"; /* +b ~operclass */
#loadmodule "extbans/partmsg"; /* +b ~partmsg */
loadmodule "extbans/quiet"; /* +b ~quiet */
#loadmodule "extbans/realname"; /* +b ~realname */
loadmodule "extbans/textban"; /* +b ~text */
loadmodule "extbans/timedban"; /* +b ~time */
loadmodule "extbans/securitygroup"; /* +b ~security-group */
// IRCv3 Extensions
loadmodule "account-notify";
@ -166,10 +181,12 @@ loadmodule "bot-tag";
loadmodule "chathistory";
loadmodule "clienttagdeny";
loadmodule "echo-message";
loadmodule "extended-monitor";
loadmodule "labeled-response";
loadmodule "link-security";
loadmodule "message-ids";
loadmodule "message-tags";
loadmodule "monitor";
loadmodule "plaintext-policy";
loadmodule "reply-tag";
loadmodule "server-time";
@ -178,24 +195,29 @@ loadmodule "typing-indicator";
// Other
loadmodule "antimixedutf8";
loadmodule "authprompt";
#loadmodule "authprompt";
loadmodule "blacklist";
loadmodule "certfp";
loadmodule "channeldb";
loadmodule "charsys";
loadmodule "connthrottle";
#loadmodule "geoip_base";
#loadmodule "geoip_classic";
loadmodule "hideserver";
loadmodule "history_backend_mem";
#loadmodule "history_backend_null";
loadmodule "ident_lookup";
loadmodule "jointhrottle";
loadmodule "json-log-tag";
loadmodule "targetfloodprot";
loadmodule "tkldb";
loadmodule "tls_antidos";
loadmodule "tls_cipher";
loadmodule "userhost-tag";
loadmodule "userip-tag";
loadmodule "reputation";
loadmodule "restrict-commands";
loadmodule "rmtkl";
loadmodule "watch-backend";
#loadmodule "webirc";
#loadmodule "websocket";

228
doc/conf/snomasks.conf Normal file
View File

@ -0,0 +1,228 @@
/* Server bans snomask - 'b' */
log {
source {
tkl.BAN_REALNAME;
tkl.TKL_ADD;
tkl.TKL_DEL;
tkl.TKL_ADD_TEMPSHUN;
tkl.TKL_DEL_TEMPSHUN;
tkl.TKL_EXPIRE;
tkl.RMTKL_COMMAND;
}
destination {
snomask b;
}
}
/* Blacklist snomask: 'B' */
log {
source {
blacklist;
}
destination {
snomask B;
}
}
/* Local client connects snomask - 'c' */
log {
source {
connect.LOCAL_CLIENT_CONNECT;
connect.LOCAL_CLIENT_DISCONNECT;
}
destination {
snomask c;
}
}
/* Remote client connects snomask - 'C' */
log {
source {
connect.REMOTE_CLIENT_CONNECT;
connect.REMOTE_CLIENT_DISCONNECT;
}
destination {
snomask C;
}
}
/* DCC rejections snomask - 'd' */
log {
source {
dcc;
}
destination {
snomask d;
}
}
/* Debug snomask (not recommended) - 'D' */
log {
source {
debug;
}
destination {
snomask D;
}
}
/* Floods snomask - 'f' */
log {
source {
flood;
}
destination {
snomask f;
}
}
/* Join, parts, kicks - 'j' */
log {
source {
// TODO: these don't exist yet..
join.LOCAL_CLIENT_JOIN;
join.REMOTE_CLIENT_JOIN;
part.LOCAL_CLIENT_PART;
part.REMOTE_CLIENT_PART;
kick.LOCAL_CLIENT_KICK;
kick.REMOTE_CLIENT_KICK;
}
destination {
snomask j;
}
}
/* Kill snomask */
log {
source {
kill;
}
destination {
snomask k;
}
}
/* Local nick changes snomask - 'n' */
log {
source {
nick.LOCAL_NICK_CHANGE;
}
destination {
snomask n;
}
}
/* Remote nick changes snomask - 'N' */
log {
source {
nick.REMOTE_NICK_CHANGE;
}
destination {
snomask N;
}
}
/* Deny nick (QLINE) rejections snomask - 'q' */
log {
source {
nick.QLINE_NICK_LOCAL_ATTEMPT;
nick.QLINE_NICK_REMOTE;
}
destination {
snomask q;
}
}
/* Spamfilter hits snomask - 'S' */
log {
source {
tkl.SPAMFILTER_MATCH;
}
destination {
snomask S;
}
}
/* IRCOp overriding in channels (OperOverride) - 'o' */
log {
source {
operoverride;
}
destination {
snomask o;
}
}
/* IRCOp changing user properties or forcing users to do things - 'O' */
log {
source {
chgcmds;
sacmds;
}
destination {
snomask O;
}
}
/* VHOST usage - 'v' */
log {
source {
vhost;
}
destination {
snomask v;
}
}
/* Snomask s (server notices) - the "catch all" snomask for all other things */
log {
source {
link;
oper;
!debug;
nomatch;
}
destination {
snomask s;
}
}
/* These log sources are sent to all servers (globally).
* These are generally two categories:
* 1) Things that affect the network as a whole, eg linking
* 2) Things that otherwise cannot be logged by a remote server
* that may interest ircops. Eg: a spamfilter match,
* since that would otherwise not be propagated.
*/
log {
source {
/* All link messages affect the network so
* these should be global. Except for the
* link connecting... and timeout while
* connecting.. messages, which can be noisy.
*/
link;
!link.LINK_CONNECTING;
!link.LINK_CONNECT_TIMEOUT;
!link.SERVER_LINKED_REMOTE;
!link.SERVER_LINKED;
/* All oper up/downs */
oper;
/* Flood messages, important to keep an eye on, network-wide */
flood;
/* TEMPSHUN: these are otherwise missing for snomask 'b' */
tkl.TKL_ADD_TEMPSHUN;
tkl.TKL_DEL_TEMPSHUN;
/* Spamfilter matches: needed for snomask 'S' */
tkl.SPAMFILTER_MATCH;
/* Critical issue: */
tls.TLS_CERT_EXPIRING;
/* SAMODE: needed for snomask 'o' */
samode.SAMODE_COMMAND;
/* Never any debug messages */
!debug;
}
destination {
remote;
}
}

View File

@ -1,7 +1,7 @@
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Tue Jan 19 04:12:04 2021 GMT
## Certificate data from Mozilla as of: Tue Oct 26 03:12:05 2021 GMT
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
@ -14,7 +14,7 @@
## Just configure this file as the SSLCACertificateFile.
##
## Conversion done with mk-ca-bundle.pl version 1.28.
## SHA256: 3bdc63d1de27058fec943a999a2a8a01fcc6806a611b19221a7727d3d9bbbdfd
## SHA256: bb36818a81feaa4cca61101e6d6276cd09e972efcb08112dfed846918ca41d7f
##
@ -156,38 +156,6 @@ Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z
12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
-----END CERTIFICATE-----
QuoVadis Root CA
================
-----BEGIN CERTIFICATE-----
MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE
ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz
MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp
cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD
EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk
J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL
F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL
YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen
AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w
PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y
ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7
MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj
YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs
ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW
Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu
BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw
FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0
aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6
tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo
fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul
LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x
gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi
5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi
5nrQNiOKSnQ2+Q==
-----END CERTIFICATE-----
QuoVadis Root CA 2
==================
-----BEGIN CERTIFICATE-----
@ -275,26 +243,6 @@ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ
FL39vmwLAw==
-----END CERTIFICATE-----
Sonera Class 2 Root CA
======================
-----BEGIN CERTIFICATE-----
MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG
U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw
NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh
IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3
/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT
dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG
f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P
tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH
nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT
XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt
0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI
cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph
Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx
EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH
llpwrN9M
-----END CERTIFICATE-----
XRamp Global CA Root
====================
-----BEGIN CERTIFICATE-----
@ -433,26 +381,6 @@ mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
-----END CERTIFICATE-----
DST Root CA X3
==============
-----BEGIN CERTIFICATE-----
MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK
ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X
DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1
cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT
rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9
UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy
xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d
utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T
AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ
MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug
dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE
GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw
RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS
fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
-----END CERTIFICATE-----
SwissSign Gold CA - G2
======================
-----BEGIN CERTIFICATE-----
@ -718,51 +646,6 @@ vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz
TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD
-----END CERTIFICATE-----
GeoTrust Primary Certification Authority - G2
=============================================
-----BEGIN CERTIFICATE-----
MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC
VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu
Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD
ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1
OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl
b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG
BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc
KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD
VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+
EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m
ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2
npaqBA+K
-----END CERTIFICATE-----
VeriSign Universal Root Certification Authority
===============================================
-----BEGIN CERTIFICATE-----
MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0
aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj
1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP
MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72
9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I
AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR
tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G
CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O
a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3
Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx
Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
mJO37M2CYfE45k+XmCpajQ==
-----END CERTIFICATE-----
NetLock Arany (Class Gold) Főtanúsítvány
========================================
-----BEGIN CERTIFICATE-----
@ -938,82 +821,6 @@ Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z
WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw==
-----END CERTIFICATE-----
Chambers of Commerce Root - 2008
================================
-----BEGIN CERTIFICATE-----
MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD
MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy
Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl
ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF
EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl
cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC
AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA
XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj
h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/
ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk
NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g
D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331
lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ
0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj
ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2
EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI
G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ
BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh
bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh
bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC
CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH
AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1
wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH
3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU
RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6
M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1
YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF
9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK
zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG
nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ
-----END CERTIFICATE-----
Global Chambersign Root - 2008
==============================
-----BEGIN CERTIFICATE-----
MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD
MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv
bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu
QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx
NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg
Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ
QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf
VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf
XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0
ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB
/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA
TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M
H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe
Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF
HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh
wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB
AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT
BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE
BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm
aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm
aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp
1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0
dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG
/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6
ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s
dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg
9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH
foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du
qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr
P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq
c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z
09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
-----END CERTIFICATE-----
Go Daddy Root Certificate Authority - G2
========================================
-----BEGIN CERTIFICATE-----
@ -1315,27 +1122,6 @@ OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9
vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==
-----END CERTIFICATE-----
Trustis FPS Root CA
===================
-----BEGIN CERTIFICATE-----
MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG
EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290
IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV
BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ
RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk
H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa
cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt
o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA
AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd
BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c
GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC
yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P
8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV
l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl
iB6XzCGcKQENZetX2fNXlrtIzYE=
-----END CERTIFICATE-----
Buypass Class 2 Root CA
=======================
-----BEGIN CERTIFICATE-----
@ -1980,36 +1766,6 @@ uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7
yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3
-----END CERTIFICATE-----
Staat der Nederlanden Root CA - G3
==================================
-----BEGIN CERTIFICATE-----
MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE
CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g
Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC
TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l
ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y
olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t
x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy
EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K
Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUur
mkVLoR9BvUhTFXFkC4az5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU5
1nus6+N86U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7Ngzp
07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHPbMk7ccHViLVlvMDo
FxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXtBznaqB16nzaeErAMZRKQFWDZJkBE
41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTtXUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMB
AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleu
yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD
U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq
KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1
v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA
8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b
8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r
mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq
1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI
JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV
tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk=
-----END CERTIFICATE-----
Staat der Nederlanden EV Root CA
================================
-----BEGIN CERTIFICATE-----
@ -3226,3 +2982,251 @@ qqFJu3FS8r/2/yehNq+4tneI3TqkbZs0kNwUXTC/t+sX5Ie3cdCh13cV1ELX8vMxmV2b3RZtP+oG
I/hGoiLtk/bdmuYqh7GYVPEi92tF4+KOdh2ajcQGjTa3FPOdVGm3jjzVpG2Tgbet9r1ke8LJaDmg
kpzNNIaRkPpkUZ3+/uul9XXeifdy
-----END CERTIFICATE-----
AC RAIZ FNMT-RCM SERVIDORES SEGUROS
===================================
-----BEGIN CERTIFICATE-----
MIICbjCCAfOgAwIBAgIQYvYybOXE42hcG2LdnC6dlTAKBggqhkjOPQQDAzB4MQswCQYDVQQGEwJF
UzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNlcmVzMRgwFgYDVQRhDA9WQVRFUy1RMjgy
NjAwNEoxLDAqBgNVBAMMI0FDIFJBSVogRk5NVC1SQ00gU0VSVklET1JFUyBTRUdVUk9TMB4XDTE4
MTIyMDA5MzczM1oXDTQzMTIyMDA5MzczM1oweDELMAkGA1UEBhMCRVMxETAPBgNVBAoMCEZOTVQt
UkNNMQ4wDAYDVQQLDAVDZXJlczEYMBYGA1UEYQwPVkFURVMtUTI4MjYwMDRKMSwwKgYDVQQDDCNB
QyBSQUlaIEZOTVQtUkNNIFNFUlZJRE9SRVMgU0VHVVJPUzB2MBAGByqGSM49AgEGBSuBBAAiA2IA
BPa6V1PIyqvfNkpSIeSX0oNnnvBlUdBeh8dHsVnyV0ebAAKTRBdp20LHsbI6GA60XYyzZl2hNPk2
LEnb80b8s0RpRBNm/dfF/a82Tc4DTQdxz69qBdKiQ1oKUm8BA06Oi6NCMEAwDwYDVR0TAQH/BAUw
AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAG5L++/EYZg8k/QQW6rcx/n0m5JMAoGCCqG
SM49BAMDA2kAMGYCMQCuSuMrQMN0EfKVrRYj3k4MGuZdpSRea0R7/DjiT8ucRRcRTBQnJlU5dUoD
zBOQn5ICMQD6SmxgiHPz7riYYqnOK8LZiqZwMR2vsJRM60/G49HzYqc8/5MuB1xJAWdpEgJyv+c=
-----END CERTIFICATE-----
GlobalSign Root R46
===================
-----BEGIN CERTIFICATE-----
MIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUAMEYxCzAJBgNV
BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQDExNHbG9iYWxTaWduIFJv
b3QgUjQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAX
BgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBSNDYwggIi
MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCsrHQy6LNl5brtQyYdpokNRbopiLKkHWPd08Es
CVeJOaFV6Wc0dwxu5FUdUiXSE2te4R2pt32JMl8Nnp8semNgQB+msLZ4j5lUlghYruQGvGIFAha/
r6gjA7aUD7xubMLL1aa7DOn2wQL7Id5m3RerdELv8HQvJfTqa1VbkNud316HCkD7rRlr+/fKYIje
2sGP1q7Vf9Q8g+7XFkyDRTNrJ9CG0Bwta/OrffGFqfUo0q3v84RLHIf8E6M6cqJaESvWJ3En7YEt
bWaBkoe0G1h6zD8K+kZPTXhc+CtI4wSEy132tGqzZfxCnlEmIyDLPRT5ge1lFgBPGmSXZgjPjHvj
K8Cd+RTyG/FWaha/LIWFzXg4mutCagI0GIMXTpRW+LaCtfOW3T3zvn8gdz57GSNrLNRyc0NXfeD4
12lPFzYE+cCQYDdF3uYM2HSNrpyibXRdQr4G9dlkbgIQrImwTDsHTUB+JMWKmIJ5jqSngiCNI/on
ccnfxkF0oE32kRbcRoxfKWMxWXEM2G/CtjJ9++ZdU6Z+Ffy7dXxd7Pj2Fxzsx2sZy/N78CsHpdls
eVR2bJ0cpm4O6XkMqCNqo98bMDGfsVR7/mrLZqrcZdCinkqaByFrgY/bxFn63iLABJzjqls2k+g9
vXqhnQt2sQvHnf3PmKgGwvgqo6GDoLclcqUC4wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYD
VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA1yrc4GHqMywptWU4jaWSf8FmSwwDQYJKoZIhvcNAQEM
BQADggIBAHx47PYCLLtbfpIrXTncvtgdokIzTfnvpCo7RGkerNlFo048p9gkUbJUHJNOxO97k4Vg
JuoJSOD1u8fpaNK7ajFxzHmuEajwmf3lH7wvqMxX63bEIaZHU1VNaL8FpO7XJqti2kM3S+LGteWy
gxk6x9PbTZ4IevPuzz5i+6zoYMzRx6Fcg0XERczzF2sUyQQCPtIkpnnpHs6i58FZFZ8d4kuaPp92
CC1r2LpXFNqD6v6MVenQTqnMdzGxRBF6XLE+0xRFFRhiJBPSy03OXIPBNvIQtQ6IbbjhVp+J3pZm
OUdkLG5NrmJ7v2B0GbhWrJKsFjLtrWhV/pi60zTe9Mlhww6G9kuEYO4Ne7UyWHmRVSyBQ7N0H3qq
JZ4d16GLuc1CLgSkZoNNiTW2bKg2SnkheCLQQrzRQDGQob4Ez8pn7fXwgNNgyYMqIgXQBztSvwye
qiv5u+YfjyW6hY0XHgL+XVAEV8/+LbzvXMAaq7afJMbfc2hIkCwU9D9SGuTSyxTDYWnP4vkYxboz
nxSjBF25cfe1lNj2M8FawTSLfJvdkzrnE6JwYZ+vj+vYxXX4M2bUdGc6N3ec592kD3ZDZopD8p/7
DEJ4Y9HiD2971KE9dJeFt0g5QdYg/NA6s/rob8SKunE3vouXsXgxT7PntgMTzlSdriVZzH81Xwj3
QEUxeCp6
-----END CERTIFICATE-----
GlobalSign Root E46
===================
-----BEGIN CERTIFICATE-----
MIICCzCCAZGgAwIBAgISEdK7ujNu1LzmJGjFDYQdmOhDMAoGCCqGSM49BAMDMEYxCzAJBgNVBAYT
AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQDExNHbG9iYWxTaWduIFJvb3Qg
RTQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNV
BAoTEEdsb2JhbFNpZ24gbnYtc2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBFNDYwdjAQBgcq
hkjOPQIBBgUrgQQAIgNiAAScDrHPt+ieUnd1NPqlRqetMhkytAepJ8qUuwzSChDH2omwlwxwEwkB
jtjqR+q+soArzfwoDdusvKSGN+1wCAB16pMLey5SnCNoIwZD7JIvU4Tb+0cUB+hflGddyXqBPCCj
QjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQxCpCPtsad0kRL
gLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZk
vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+
CAezNIm8BZ/3Hobui3A=
-----END CERTIFICATE-----
GLOBALTRUST 2020
================
-----BEGIN CERTIFICATE-----
MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx
IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT
VCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYxMDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAh
BgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAy
MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWi
D59bRatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9ZYybNpyrO
VPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3QWPKzv9pj2gOlTblzLmM
CcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPwyJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCm
fecqQjuCgGOlYx8ZzHyyZqjC0203b+J+BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKA
A1GqtH6qRNdDYfOiaxaJSaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9OR
JitHHmkHr96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj04KlG
DfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9MedKZssCz3AwyIDMvU
clOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIwq7ejMZdnrY8XD2zHc+0klGvIg5rQ
mjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUw
AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1Ud
IwQYMBaAFNwuH9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA
VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJCXtzoRlgHNQIw
4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd6IwPS3BD0IL/qMy/pJTAvoe9
iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS
8cE54+X1+NZK3TTN+2/BT+MAi1bikvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2
HcqtbepBEX4tdJP7wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxS
vTOBTI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6CMUO+1918
oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn4rnvyOL2NSl6dPrFf4IF
YqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+IaFvowdlxfv1k7/9nR4hYJS8+hge9+6jl
gqispdNpQ80xiEmEU5LAsTkbOYMBMMTyqfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg==
-----END CERTIFICATE-----
ANF Secure Server Root CA
=========================
-----BEGIN CERTIFICATE-----
MIIF7zCCA9egAwIBAgIIDdPjvGz5a7EwDQYJKoZIhvcNAQELBQAwgYQxEjAQBgNVBAUTCUc2MzI4
NzUxMDELMAkGA1UEBhMCRVMxJzAlBgNVBAoTHkFORiBBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lv
bjEUMBIGA1UECxMLQU5GIENBIFJhaXoxIjAgBgNVBAMTGUFORiBTZWN1cmUgU2VydmVyIFJvb3Qg
Q0EwHhcNMTkwOTA0MTAwMDM4WhcNMzkwODMwMTAwMDM4WjCBhDESMBAGA1UEBRMJRzYzMjg3NTEw
MQswCQYDVQQGEwJFUzEnMCUGA1UEChMeQU5GIEF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uMRQw
EgYDVQQLEwtBTkYgQ0EgUmFpejEiMCAGA1UEAxMZQU5GIFNlY3VyZSBTZXJ2ZXIgUm9vdCBDQTCC
AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANvrayvmZFSVgpCjcqQZAZ2cC4Ffc0m6p6zz
BE57lgvsEeBbphzOG9INgxwruJ4dfkUyYA8H6XdYfp9qyGFOtibBTI3/TO80sh9l2Ll49a2pcbnv
T1gdpd50IJeh7WhM3pIXS7yr/2WanvtH2Vdy8wmhrnZEE26cLUQ5vPnHO6RYPUG9tMJJo8gN0pcv
B2VSAKduyK9o7PQUlrZXH1bDOZ8rbeTzPvY1ZNoMHKGESy9LS+IsJJ1tk0DrtSOOMspvRdOoiXse
zx76W0OLzc2oD2rKDF65nkeP8Nm2CgtYZRczuSPkdxl9y0oukntPLxB3sY0vaJxizOBQ+OyRp1RM
VwnVdmPF6GUe7m1qzwmd+nxPrWAI/VaZDxUse6mAq4xhj0oHdkLePfTdsiQzW7i1o0TJrH93PB0j
7IKppuLIBkwC/qxcmZkLLxCKpvR/1Yd0DVlJRfbwcVw5Kda/SiOL9V8BY9KHcyi1Swr1+KuCLH5z
JTIdC2MKF4EA/7Z2Xue0sUDKIbvVgFHlSFJnLNJhiQcND85Cd8BEc5xEUKDbEAotlRyBr+Qc5RQe
8TZBAQIvfXOn3kLMTOmJDVb3n5HUA8ZsyY/b2BzgQJhdZpmYgG4t/wHFzstGH6wCxkPmrqKEPMVO
Hj1tyRRM4y5Bu8o5vzY8KhmqQYdOpc5LMnndkEl/AgMBAAGjYzBhMB8GA1UdIwQYMBaAFJxf0Gxj
o1+TypOYCK2Mh6UsXME3MB0GA1UdDgQWBBScX9BsY6Nfk8qTmAitjIelLFzBNzAOBgNVHQ8BAf8E
BAMCAYYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEATh65isagmD9uw2nAalxJ
UqzLK114OMHVVISfk/CHGT0sZonrDUL8zPB1hT+L9IBdeeUXZ701guLyPI59WzbLWoAAKfLOKyzx
j6ptBZNscsdW699QIyjlRRA96Gejrw5VD5AJYu9LWaL2U/HANeQvwSS9eS9OICI7/RogsKQOLHDt
dD+4E5UGUcjohybKpFtqFiGS3XNgnhAY3jyB6ugYw3yJ8otQPr0R4hUDqDZ9MwFsSBXXiJCZBMXM
5gf0vPSQ7RPi6ovDj6MzD8EpTBNO2hVWcXNyglD2mjN8orGoGjR0ZVzO0eurU+AagNjqOknkJjCb
5RyKqKkVMoaZkgoQI1YS4PbOTOK7vtuNknMBZi9iPrJyJ0U27U1W45eZ/zo1PqVUSlJZS2Db7v54
EX9K3BR5YLZrZAPbFYPhor72I5dQ8AkzNqdxliXzuUJ92zg/LFis6ELhDtjTO0wugumDLmsx2d1H
hk9tl5EuT+IocTUW0fJz/iUrB0ckYyfI+PbZa/wSMVYIwFNCr5zQM378BvAxRAMU8Vjq8moNqRGy
g77FGr8H6lnco4g175x2MjxNBiLOFeXdntiP2t7SxDnlF4HPOEfrf4htWRvfn0IUrn7PqLBmZdo3
r5+qPeoott7VMVgWglvquxl1AnMaykgaIZOQCo6ThKd9OyMYkomgjaw=
-----END CERTIFICATE-----
Certum EC-384 CA
================
-----BEGIN CERTIFICATE-----
MIICZTCCAeugAwIBAgIQeI8nXIESUiClBNAt3bpz9DAKBggqhkjOPQQDAzB0MQswCQYDVQQGEwJQ
TDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2Vy
dGlmaWNhdGlvbiBBdXRob3JpdHkxGTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwHhcNMTgwMzI2
MDcyNDU0WhcNNDMwMzI2MDcyNDU0WjB0MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERh
dGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx
GTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATEKI6rGFtq
vm5kN2PkzeyrOvfMobgOgknXhimfoZTy42B4mIF4Bk3y7JoOV2CDn7TmFy8as10CW4kjPMIRBSqn
iBMY81CE1700LCeJVf/OTOffph8oxPBUw7l8t1Ot68KjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD
VR0OBBYEFI0GZnQkdjrzife81r1HfS+8EF9LMA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNo
ADBlAjADVS2m5hjEfO/JUG7BJw+ch69u1RsIGL2SKcHvlJF40jocVYli5RsJHrpka/F2tNQCMQC0
QoSZ/6vnnvuRlydd3LBbMHHOXjgaatkl5+r3YZJW+OraNsKHZZYuciUvf9/DE8k=
-----END CERTIFICATE-----
Certum Trusted Root CA
======================
-----BEGIN CERTIFICATE-----
MIIFwDCCA6igAwIBAgIQHr9ZULjJgDdMBvfrVU+17TANBgkqhkiG9w0BAQ0FADB6MQswCQYDVQQG
EwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0g
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0Ew
HhcNMTgwMzE2MTIxMDEzWhcNNDMwMzE2MTIxMDEzWjB6MQswCQYDVQQGEwJQTDEhMB8GA1UEChMY
QXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBB
dXRob3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEB
AQUAA4ICDwAwggIKAoICAQDRLY67tzbqbTeRn06TpwXkKQMlzhyC93yZn0EGze2jusDbCSzBfN8p
fktlL5On1AFrAygYo9idBcEq2EXxkd7fO9CAAozPOA/qp1x4EaTByIVcJdPTsuclzxFUl6s1wB52
HO8AU5853BSlLCIls3Jy/I2z5T4IHhQqNwuIPMqw9MjCoa68wb4pZ1Xi/K1ZXP69VyywkI3C7Te2
fJmItdUDmj0VDT06qKhF8JVOJVkdzZhpu9PMMsmN74H+rX2Ju7pgE8pllWeg8xn2A1bUatMn4qGt
g/BKEiJ3HAVz4hlxQsDsdUaakFjgao4rpUYwBI4Zshfjvqm6f1bxJAPXsiEodg42MEx51UGamqi4
NboMOvJEGyCI98Ul1z3G4z5D3Yf+xOr1Uz5MZf87Sst4WmsXXw3Hw09Omiqi7VdNIuJGmj8PkTQk
fVXjjJU30xrwCSss0smNtA0Aq2cpKNgB9RkEth2+dv5yXMSFytKAQd8FqKPVhJBPC/PgP5sZ0jeJ
P/J7UhyM9uH3PAeXjA6iWYEMspA90+NZRu0PqafegGtaqge2Gcu8V/OXIXoMsSt0Puvap2ctTMSY
njYJdmZm/Bo/6khUHL4wvYBQv3y1zgD2DGHZ5yQD4OMBgQ692IU0iL2yNqh7XAjlRICMb/gv1SHK
HRzQ+8S1h9E6Tsd2tTVItQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSM+xx1
vALTn04uSNn5YFSqxLNP+jAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQENBQADggIBAEii1QAL
LtA/vBzVtVRJHlpr9OTy4EA34MwUe7nJ+jW1dReTagVphZzNTxl4WxmB82M+w85bj/UvXgF2Ez8s
ALnNllI5SW0ETsXpD4YN4fqzX4IS8TrOZgYkNCvozMrnadyHncI013nR03e4qllY/p0m+jiGPp2K
h2RX5Rc64vmNueMzeMGQ2Ljdt4NR5MTMI9UGfOZR0800McD2RrsLrfw9EAUqO0qRJe6M1ISHgCq8
CYyqOhNf6DR5UMEQGfnTKB7U0VEwKbOukGfWHwpjscWpxkIxYxeU72nLL/qMFH3EQxiJ2fAyQOaA
4kZf5ePBAFmo+eggvIksDkc0C+pXwlM2/KfUrzHN/gLldfq5Jwn58/U7yn2fqSLLiMmq0Uc9Nneo
WWRrJ8/vJ8HjJLWG965+Mk2weWjROeiQWMODvA8s1pfrzgzhIMfatz7DP78v3DSk+yshzWePS/Tj
6tQ/50+6uaWTRRxmHyH6ZF5v4HaUMst19W7l9o/HuKTMqJZ9ZPskWkoDbGs4xugDQ5r3V7mzKWmT
OPQD8rv7gmsHINFSH5pkAnuYZttcTVoP0ISVoDwUQwbKytu4QTbaakRnh6+v40URFWkIsr4WOZck
bxJF0WddCajJFdr60qZfE2Efv4WstK2tBZQIgx51F9NxO5NQI1mg7TyRVJ12AMXDuDjb
-----END CERTIFICATE-----
TunTrust Root CA
================
-----BEGIN CERTIFICATE-----
MIIFszCCA5ugAwIBAgIUEwLV4kBMkkaGFmddtLu7sms+/BMwDQYJKoZIhvcNAQELBQAwYTELMAkG
A1UEBhMCVE4xNzA1BgNVBAoMLkFnZW5jZSBOYXRpb25hbGUgZGUgQ2VydGlmaWNhdGlvbiBFbGVj
dHJvbmlxdWUxGTAXBgNVBAMMEFR1blRydXN0IFJvb3QgQ0EwHhcNMTkwNDI2MDg1NzU2WhcNNDQw
NDI2MDg1NzU2WjBhMQswCQYDVQQGEwJUTjE3MDUGA1UECgwuQWdlbmNlIE5hdGlvbmFsZSBkZSBD
ZXJ0aWZpY2F0aW9uIEVsZWN0cm9uaXF1ZTEZMBcGA1UEAwwQVHVuVHJ1c3QgUm9vdCBDQTCCAiIw
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMPN0/y9BFPdDCA61YguBUtB9YOCfvdZn56eY+hz
2vYGqU8ftPkLHzmMmiDQfgbU7DTZhrx1W4eI8NLZ1KMKsmwb60ksPqxd2JQDoOw05TDENX37Jk0b
bjBU2PWARZw5rZzJJQRNmpA+TkBuimvNKWfGzC3gdOgFVwpIUPp6Q9p+7FuaDmJ2/uqdHYVy7BG7
NegfJ7/Boce7SBbdVtfMTqDhuazb1YMZGoXRlJfXyqNlC/M4+QKu3fZnz8k/9YosRxqZbwUN/dAd
gjH8KcwAWJeRTIAAHDOFli/LQcKLEITDCSSJH7UP2dl3RxiSlGBcx5kDPP73lad9UKGAwqmDrViW
VSHbhlnUr8a83YFuB9tgYv7sEG7aaAH0gxupPqJbI9dkxt/con3YS7qC0lH4Zr8GRuR5KiY2eY8f
Tpkdso8MDhz/yV3A/ZAQprE38806JG60hZC/gLkMjNWb1sjxVj8agIl6qeIbMlEsPvLfe/ZdeikZ
juXIvTZxi11Mwh0/rViizz1wTaZQmCXcI/m4WEEIcb9PuISgjwBUFfyRbVinljvrS5YnzWuioYas
DXxU5mZMZl+QviGaAkYt5IPCgLnPSz7ofzwB7I9ezX/SKEIBlYrilz0QIX32nRzFNKHsLA4KUiwS
VXAkPcvCFDVDXSdOvsC9qnyW5/yeYa1E0wCXAgMBAAGjYzBhMB0GA1UdDgQWBBQGmpsfU33x9aTI
04Y+oXNZtPdEITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFAaamx9TffH1pMjThj6hc1m0
90QhMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAqgVutt0Vyb+zxiD2BkewhpMl
0425yAA/l/VSJ4hxyXT968pk21vvHl26v9Hr7lxpuhbI87mP0zYuQEkHDVneixCwSQXi/5E/S7fd
Ao74gShczNxtr18UnH1YeA32gAm56Q6XKRm4t+v4FstVEuTGfbvE7Pi1HE4+Z7/FXxttbUcoqgRY
YdZ2vyJ/0Adqp2RT8JeNnYA/u8EH22Wv5psymsNUk8QcCMNE+3tjEUPRahphanltkE8pjkcFwRJp
adbGNjHh/PqAulxPxOu3Mqz4dWEX1xAZufHSCe96Qp1bWgvUxpVOKs7/B9dPfhgGiPEZtdmYu65x
xBzndFlY7wyJz4sfdZMaBBSSSFCp61cpABbjNhzI+L/wM9VBD8TMPN3pM0MBkRArHtG5Xc0yGYuP
jCB31yLEQtyEFpslbei0VXF/sHyz03FJuc9SpAQ/3D2gu68zngowYI7bnV2UqL1g52KAdoGDDIzM
MEZJ4gzSqK/rYXHv5yJiqfdcZGyfFoxnNidF9Ql7v/YQCvGwjVRDjAS6oz/v4jXH+XTgbzRB0L9z
ZVcg+ZtnemZoJE6AZb0QmQZZ8mWvuMZHu/2QeItBcy6vVR/cO5JyboTT0GFMDcx2V+IthSIVNg3r
AZ3r2OvEhJn7wAzMMujjd9qDRIueVSjAi1jTkD5OGwDxFa2DK5o=
-----END CERTIFICATE-----
HARICA TLS RSA Root CA 2021
===========================
-----BEGIN CERTIFICATE-----
MIIFpDCCA4ygAwIBAgIQOcqTHO9D88aOk8f0ZIk4fjANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQG
EwJHUjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u
cyBDQTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBSU0EgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTEwNTUz
OFoXDTQ1MDIxMzEwNTUzN1owbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRl
bWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgUlNB
IFJvb3QgQ0EgMjAyMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIvC569lmwVnlskN
JLnQDmT8zuIkGCyEf3dRywQRNrhe7Wlxp57kJQmXZ8FHws+RFjZiPTgE4VGC/6zStGndLuwRo0Xu
a2s7TL+MjaQenRG56Tj5eg4MmOIjHdFOY9TnuEFE+2uva9of08WRiFukiZLRgeaMOVig1mlDqa2Y
Ulhu2wr7a89o+uOkXjpFc5gH6l8Cct4MpbOfrqkdtx2z/IpZ525yZa31MJQjB/OCFks1mJxTuy/K
5FrZx40d/JiZ+yykgmvwKh+OC19xXFyuQnspiYHLA6OZyoieC0AJQTPb5lh6/a6ZcMBaD9YThnEv
dmn8kN3bLW7R8pv1GmuebxWMevBLKKAiOIAkbDakO/IwkfN4E8/BPzWr8R0RI7VDIp4BkrcYAuUR
0YLbFQDMYTfBKnya4dC6s1BG7oKsnTH4+yPiAwBIcKMJJnkVU2DzOFytOOqBAGMUuTNe3QvboEUH
GjMJ+E20pwKmafTCWQWIZYVWrkvL4N48fS0ayOn7H6NhStYqE613TBoYm5EPWNgGVMWX+Ko/IIqm
haZ39qb8HOLubpQzKoNQhArlT4b4UEV4AIHrW2jjJo3Me1xR9BQsQL4aYB16cmEdH2MtiKrOokWQ
CPxrvrNQKlr9qEgYRtaQQJKQCoReaDH46+0N0x3GfZkYVVYnZS6NRcUk7M7jAgMBAAGjQjBAMA8G
A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFApII6ZgpJIKM+qTW8VX6iVNvRLuMA4GA1UdDwEB/wQE
AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAPpBIqm5iFSVmewzVjIuJndftTgfvnNAUX15QvWiWkKQU
EapobQk1OUAJ2vQJLDSle1mESSmXdMgHHkdt8s4cUCbjnj1AUz/3f5Z2EMVGpdAgS1D0NTsY9FVq
QRtHBmg8uwkIYtlfVUKqrFOFrJVWNlar5AWMxajaH6NpvVMPxP/cyuN+8kyIhkdGGvMA9YCRotxD
QpSbIPDRzbLrLFPCU3hKTwSUQZqPJzLB5UkZv/HywouoCjkxKLR9YjYsTewfM7Z+d21+UPCfDtcR
j88YxeMn/ibvBZ3PzzfF0HvaO7AWhAw6k9a+F9sPPg4ZeAnHqQJyIkv3N3a6dcSFA1pj1bF1BcK5
vZStjBWZp5N99sXzqnTPBIWUmAD04vnKJGW/4GKvyMX6ssmeVkjaef2WdhW+o45WxLM0/L5H9MG0
qPzVMIho7suuyWPEdr6sOBjhXlzPrjoiUevRi7PzKzMHVIf6tLITe7pTBGIBnfHAT+7hOtSLIBD6
Alfm78ELt5BGnBkpjNxvoEppaZS3JGWg/6w/zgH7IS79aPib8qXPMThcFarmlwDB31qlpzmq6YR/
PFGoOtmUW4y/Twhx5duoXNTSpv4Ao8YWxw/ogM4cKGR0GQjTQuPOAF1/sdwTsOEFy9EgqoZ0njnn
kf3/W9b3raYvAwtt41dU63ZTGI0RmLo=
-----END CERTIFICATE-----
HARICA TLS ECC Root CA 2021
===========================
-----BEGIN CERTIFICATE-----
MIICVDCCAdugAwIBAgIQZ3SdjXfYO2rbIvT/WeK/zjAKBggqhkjOPQQDAzBsMQswCQYDVQQGEwJH
UjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBD
QTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBFQ0MgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTExMDExMFoX
DTQ1MDIxMzExMDEwOVowbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRlbWlj
IGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgRUNDIFJv
b3QgQ0EgMjAyMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABDgI/rGgltJ6rK9JOtDA4MM7KKrxcm1l
AEeIhPyaJmuqS7psBAqIXhfyVYf8MLA04jRYVxqEU+kw2anylnTDUR9YSTHMmE5gEYd103KUkE+b
ECUqqHgtvpBBWJAVcqeht6NCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUyRtTgRL+BNUW
0aq8mm+3oJUZbsowDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2cAMGQCMBHervjcToiwqfAi
rcJRQO9gcS3ujwLEXQNwSaSS6sUUiHCm0w2wqsosQJz76YJumgIwK0eaB8bRwoF8yguWGEEbo/Qw
CZ61IygNnxS2PFOiTAZpffpskcYqSUXm7LcT4Tps
-----END CERTIFICATE-----

View File

@ -16,9 +16,10 @@ link services.supernets.org {
class servers;
}
log "ircd.log" { flags { errors; } maxsize 1K; }
except ban { mask *@127.0.0.1; }
log {
source { error; fatal; warn; }
destination { file "ircd.log" { maxsize 10M; } }
}
ulines { services.supernets.org; }

View File

@ -14,8 +14,8 @@ alias os { target operserv; type services; }
class clients { pingfreq 120; maxclients 100; sendq 1M; options { nofakelag; } }
class servers { pingfreq 120; maxclients 10; sendq 1M; connfreq 30; }
allow { ip *; class clients; maxperip 2; global-maxperip 2; }
allow { ip 127.0.0.1; class clients; maxperip 10; global-maxperip 10; }
allow { mask *; class clients; maxperip 2; global-maxperip 2; }
allow { mask 127.0.0.1; class clients; maxperip 10; global-maxperip 10; }
#require authentication {
# mask *@*;
@ -26,9 +26,10 @@ listen { ip *; port 6667; options { clientsonly; } }
listen { ip *; port 6697; options { clientsonly; tls; } }
listen { ip *; port REDACTED; options { serversonly; tls; } }
deny channel { channel "#pumpcoin"; reason "This channel has moved to #exchange"; redirect "#exchange"; }
deny channel { channel "#dev"; reason "This channel has moved to #superbowl"; redirect "#superbowl"; }
deny channel { channel "#help"; reason "This channel has moved to #superbowl"; redirect "#superbowl"; }
deny channel { channel "#mensa"; reason "This channel has been closed"; redirect "#superbowl"; }
deny channel { channel "#pumpcoin"; reason "This channel has moved to #exchange"; redirect "#exchange"; }
link irc.supernets.org {
incoming { mask REDACTED; }
@ -42,7 +43,15 @@ link irc.supernets.org {
class servers;
}
log "errors.log" { flags { errors; } maxsize 10K; }
log {
source { error; fatal; warn; }
destination { file "ircd.log" { maxsize 10M; } }
}
log {
source { all; }
destination { channel "#REDACTED" }
}
tld { mask *@*; motd remote.motd; rules remote.motd; options { remote; } }
@ -81,39 +90,28 @@ blacklist torbl {
reason "8,4 E N T E R T H E V O I D ";
}
webirc { mask 107.161.19.53; password "REDACTED"; } # KiwiIRC
webirc { mask 107.161.19.109; password "REDACTED"; }
webirc { mask 107.161.31.4; password "REDACTED"; }
webirc { mask 207.192.75.252; password "REDACTED"; } # Mibbit
webirc { mask 64.62.228.82; password "REDACTED"; }
webirc { mask 78.129.202.38; password "REDACTED"; }
webirc { mask 109.169.29.95 ; password "REDACTED"; }
set {
kline-address "enterthevoid@supernets.org";
gline-address "enterthevoid@supernets.org";
modes-on-connect "+iIpTx";
modes-on-oper "+Hq";
snomask-on-oper "+bcFfkGsSo";
snomask-on-oper "+bBcCfksSoO";
modes-on-join "+ns";
level-on-join "op";
restrict-usermodes "ips";
restrict-channelmodes "nLpPs";
restrict-commands {
channel-message { connect-delay 60; exempt-identified yes; exempt-reputation-score 100; }
channel-notice { connect-delay 60; exempt-identified yes; exempt-reputation-score 100; }
invite { connect-delay 3600; exempt-identified yes; exempt-reputation-score 100; }
join { connect-delay 15; exempt-identified yes; exempt-reputation-score 100; }
list { connect-delay 30; exempt-identified yes; exempt-reputation-score 100; }
private-message { connect-delay 300; exempt-identified yes; exempt-reputation-score 100; }
private-notice { connect-delay 3600; exempt-identified yes; exempt-reputation-score 100; }
channel-message { connect-delay 60; exempt-identified yes; exempt-reputation-score 100; }
channel-notice { connect-delay 60; exempt-identified yes; exempt-reputation-score 100; }
invite { connect-delay 300; exempt-identified yes; exempt-reputation-score 100; }
join { connect-delay 15; exempt-identified yes; exempt-reputation-score 100; }
list { connect-delay 30; exempt-identified yes; exempt-reputation-score 100; }
private-message { connect-delay 300; exempt-identified yes; exempt-reputation-score 100; }
private-notice { connect-delay 300; exempt-identified yes; exempt-reputation-score 100; }
}
#auto-join "#superbowl";
oper-auto-join "#superbowl";
auto-join "#superbowl";
static-quit "EMO-QUIT";
static-part "EMO-PART";
who-limit 100;
nick-length 20;
maxchannelsperuser 10;
channel-command-prefix "`!@$.";
@ -134,15 +132,15 @@ set {
user warn;
oper deny;
server deny;
user-message "4WARNING: You are not using a secure (SSL/TLS) connection";
oper-message "Network operators must connect using SSL/TLS";
user-message "4WARNING: You are not on a secure TLS connection";
oper-message "Network operators must be on a secure TLS connection";
}
outdated-tls-policy {
user warn;
oper deny;
server deny;
user-message "4WARNING: You are using an outdated SSL/TLS protocol or cipher";
oper-message "Network operators must connect using an up-to-date SSL/TLS protocol or cipher";
oper-message "Network operators must be using an up-to-date SSL/TLS protocol & cipher";
}
anti-flood {
everyone {
@ -152,14 +150,14 @@ set {
ban-action gzline;
ban-time 1h;
}
target-flood {
channel-notice 15:5;
channel-privmsg 45:5;
channel-tagmsg 15:5;
private-notice 10:5;
private-privmsg 30:5;
private-tagmsg 10:5;
}
#target-flood {
# channel-notice 15:5;
# channel-privmsg 45:5;
# channel-tagmsg 15:5;
# private-notice 10:5;
# private-privmsg 30:5;
# private-tagmsg 10:5;
#}
}
known-users {
away-flood 3:300;
@ -171,6 +169,8 @@ set {
users 5;
new-user-every 60s;
}
lag-penalty 10; # update?
lag-penalty-bytes 0;
}
unknown-users {
away-flood 3:300;
@ -182,6 +182,8 @@ set {
users 3;
new-user-every 60s;
}
lag-penalty 1000;
lag-penalty-bytes 90;
}
}
default-bantime 30d;
@ -207,32 +209,50 @@ set {
ban-reason "8,4 E N T E R T H E V O I D ";
}
connthrottle {
known-users { minimum-reputation-score 100; sasl-bypass yes; }
new-users { local-throttle 20:60; global-throttle 30:60; }
disabled-when { reputation-gathering 1w; start-delay 3m; }
known-users { minimum-reputation-score 25; sasl-bypass yes; }
new-users { local-throttle 20:60; global-throttle 30:60; }
disabled-when { reputation-gathering 1w; start-delay 3m; }
}
history {
channel {
playback-on-join { lines 100; time 1d; }
playback-on-join { lines 1000; time 1d; }
max-storage-per-channel {
registered { lines 100; time 1d; }
unregistered { lines 50; time 1h; }
registered { lines 1000; time 1d; }
unregistered { lines 100; time 1h; }
}
}
}
hide-idle-time { policy usermode; }
hide-idle-time { policy always; }
whois-details {
basic { everyone full; }
modes { everyone none; self full; oper full; }
realhost { everyone none; self full; oper full; }
registered-nick { everyone full; }
channels { everyone limited; self full; oper full; }
server { everyone full; }
away { everyone full; }
oper { everyone limited; self full; oper full; }
secure { everyone limited; self full; oper full; }
bot { everyone full; }
services { everyone full; }
reputation { everyone none; self none; oper full; }
geo { everyone none; self none; oper full; }
certfp { everyone full; }
shunned { everyone none; self none; oper full; }
account { everyone full; }
swhois { everyone full; }
idle { everyone limited; self full; oper full; }
}
}
hideserver {
disable-map yes;
disable-links yes;
map-deny-message "Denied";
links-deny-message "Denied";
map-deny-message "8,4 E N T E R T H E V O I D ";
links-deny-message "8,4 E N T E R T H E V O I D ";
}
security-group known-users {
identified yes;
webirc no;
tls no;
reputation-score 100;
reputation-score 25;
}

View File

@ -1,6 +1,6 @@
==[ Translations ]===========================================================
In UnrealIRCd 5 we support the following translations:
In UnrealIRCd we support the following translations:
* on-line documentation at https://www.unrealircd.org/docs/ (wiki!)
* help.conf
* example.conf

View File

@ -16,7 +16,7 @@ else
export MAKE="make -j4"
fi
export CPPFLAGS="-DFAKELAG_CONFIGURABLE -DNOREMOVETMP"
export CPPFLAGS="-DFAKELAG_CONFIGURABLE -DNOREMOVETMP -DRAWCMDLOGGING"
# !! skipped for now: extras/build-tests/nix/select-config $BUILDCONFIG !!
# !! temporary use this:
@ -27,6 +27,16 @@ if lsb_release -av 2>&1|egrep 'Debian.*jessie'; then
echo "Disabling ASan due to false positives on deb8"
echo 'EXTRAPARA="--enable-werror --disable-asan"' >>config.settings
fi
if uname -s|grep -i freebsd; then
echo "Disabling ASan on FreeBSD due to 100% CPU loop in OpenSSL initialization routine"
echo 'EXTRAPARA="--enable-werror --disable-asan"' >>config.settings
fi
# If SSLDIR is set the environment, this overrides config.settings
# Used for example in the openssl3 build tests.
if [ "$SSLDIR" != "" ]; then
echo 'SSLDIR="'"$SSLDIR"'"' >>config.settings
fi
# Read config.settings, this makes a couple of variables available to us.
. ./config.settings
@ -36,10 +46,10 @@ if [ "$SSLDIR" != "" ]; then
fi
./Config -quick || (tail -n 5000 config.log; exit 1)
$MAKE
yes ''|make pem
make
yes ''|$MAKE pem
$MAKE || exit 1
./unrealircd module install third/dumpcmds
make install
$MAKE install || exit 1
set +x
echo ""

View File

@ -1,3 +1,9 @@
# These are the settings saved from running './Config'.
# Note that it is not recommended to edit config.settings by hand!
# Chances are you misunderstand what a variable does or what the
# supported values are. You better just re-run the ./Config script
# and answer appropriately there, to get a correct config.settings
# file.
#
BASEPATH=$HOME/unrealircd
BINDIR=$HOME/unrealircd/bin
@ -9,16 +15,16 @@ CACHEDIR=$HOME/unrealircd/cache
DOCDIR=$HOME/unrealircd/doc
TMPDIR=$HOME/unrealircd/tmp
PRIVATELIBDIR=$HOME/unrealircd/lib
PREFIXAQ="1"
MAXCONNECTIONS="1024"
MAXCONNECTIONS_REQUEST="auto"
NICKNAMEHISTORYLENGTH="2000"
GEOIP="classic"
DEFPERM="0600"
SSLDIR=""
REMOTEINC=""
CURLDIR=""
SHOWLISTMODES="1"
NOOPEROVERRIDE=""
OPEROVERRIDEVERIFY=""
GENCERTIFICATE="0"
EXTRAPARA="--enable-werror --enable-asan"
SANITIZER="asan"
EXTRAPARA="--enable-werror"
ADVANCED=""

View File

@ -19,8 +19,13 @@ if [ ! -d ~/cipherscan ]; then
git clone -q https://github.com/mozilla/cipherscan
fi
if [ "$HOSTNAME" = "deb8" ]; then
echo "Not running tests on Debian 8. It's LTS is EOL and trouble with running tests."
exit 0
fi
# Install 'unrealircd-tests'
git clone -q https://github.com/unrealircd/unrealircd-tests.git
git clone -q --branch unreal60 https://github.com/unrealircd/unrealircd-tests.git unrealircd-tests
cd unrealircd-tests
# FreeBSD has various issues with the tests from us and others,

View File

@ -16,35 +16,44 @@ rem cinst innosetup -y
rem Installing UnrealIRCd dependencies
cd \projects
mkdir unrealircd-5-libs
cd unrealircd-5-libs
curl -fsS -o unrealircd-libraries-5-devel.zip https://www.unrealircd.org/files/dev/win/libs/unrealircd-libraries-5-devel.zip
unzip unrealircd-libraries-5-devel.zip
copy dlltool.exe \users\user\worker\unreal5-w10\build /y
mkdir unrealircd-6-libs
cd unrealircd-6-libs
curl -fsS -o unrealircd-libraries-6-devel.zip https://www.unrealircd.org/files/dev/win/libs/unrealircd-libraries-6-devel.zip
unzip unrealircd-libraries-6-devel.zip
copy dlltool.exe \users\user\worker\unreal6-w10\build /y
rem for appveyor: cd \projects\unrealircd
cd \users\user\worker\unreal5-w10\build
rem for appveyor, use: cd \projects\unrealircd
cd \users\user\worker\unreal6-w10\build
rem Install 'unrealircd-tests'
cd ..
rd /q/s unrealircd-tests
git clone -q --branch unreal60 https://github.com/unrealircd/unrealircd-tests.git unrealircd-tests
if %ERRORLEVEL% NEQ 0 EXIT /B 1
cd build
rem Now the actual build
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
rem The above command will fail, due to missing symbol file
rem However the symbol file can only be generated after the above command
rem So... we create the symbolfile...
rem - First this, otherwise JOM will fail
IF NOT EXIST src\version.c nmake -f Makefile.windows CONF
rem - Then build most of UnrealIRCd.exe etc
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe
rem - It will fail due to missing symbolfile, which we create here..
nmake -f makefile.windows SYMBOLFILE
rem And we re-run the exact same command:
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
rem - Then we finalize building UnrealIRCd.exe: should be no error
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem - Build all the modules (DLL files): should be no error
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat MODULES
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Compile dependencies for unrealircd-tests -- this doesn't belong here though..
curl -fsS -o src\modules\third\fakereputation.c https://raw.githubusercontent.com/unrealircd/unrealircd-tests/master/serverconfig/unrealircd/modules/fakereputation.c
copy ..\unrealircd-tests\serverconfig\unrealircd\modules\fakereputation.c src\modules\third /Y
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat CUSTOMMODULE MODULEFILE=fakereputation
if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Convert c:\dev to c:\projects\unrealircd-5-libs
rem Convert c:\dev to c:\projects\unrealircd-6-libs
rem TODO: should use environment variable in innosetup script?
sed -i "s/c:\\dev\\unrealircd-5-libs/c:\\projects\\unrealircd-5-libs/gi" src\windows\unrealinst.iss
sed -i "s/c:\\dev\\unrealircd-6-libs/c:\\projects\\unrealircd-6-libs/gi" src\windows\unrealinst.iss
rem Build installer file
"c:\Program Files (x86)\Inno Setup 5\iscc.exe" /Q- src\windows\unrealinst.iss
@ -60,7 +69,7 @@ taskkill -im unrealircd.exe -f
sleep 2
rem Just a safety measure so we don't end up testing
rem some old version...
del "C:\Program Files\UnrealIRCd 5\bin\unrealircd.exe"
del "C:\Program Files\UnrealIRCd 6\bin\unrealircd.exe"
echo Running installer...
start /WAIT unrealircd-dev-build.exe /VERYSILENT /LOG=setup.log
@ -70,12 +79,7 @@ rem Upload artifact
rem appveyor PushArtifact unrealircd-dev-build.exe
rem if %ERRORLEVEL% NEQ 0 EXIT /B 1
rem Install 'unrealircd-tests'
cd ..
rd /q/s unrealircd-tests
git clone https://github.com/unrealircd/unrealircd-tests.git
if %ERRORLEVEL% NEQ 0 EXIT /B 1
cd unrealircd-tests
cd ..\unrealircd-tests
dir
rem All tests except db:

View File

@ -1,21 +1,30 @@
rem Build command for Visual Studio 2019
nmake -f makefile.windows ^
LIBRESSL_INC_DIR="c:\projects\unrealircd-5-libs\libressl\include" ^
LIBRESSL_LIB_DIR="c:\projects\unrealircd-5-libs\libressl\lib" ^
SSLLIB="crypto-46.lib ssl-48.lib" ^
rem This used to start with:
rem nmake -f makefile.windows ^
rem But nowadays we use JOM for parallel builds:
jom /j32 -f makefile.windows ^
LIBRESSL_INC_DIR="c:\projects\unrealircd-6-libs\libressl\include" ^
LIBRESSL_LIB_DIR="c:\projects\unrealircd-6-libs\libressl\lib" ^
SSLLIB="crypto-47.lib ssl-50.lib" ^
USE_REMOTEINC=1 ^
LIBCURL_INC_DIR="c:\projects\unrealircd-5-libs\curl\include" ^
LIBCURL_LIB_DIR="c:\projects\unrealircd-5-libs\curl\builds\libcurl-vc-x64-release-dll-ssl-dll-cares-dll-ipv6-obj-lib" ^
CARES_LIB_DIR="c:\projects\unrealircd-5-libs\c-ares\msvc\cares\dll-release" ^
CARES_INC_DIR="c:\projects\unrealircd-5-libs\c-ares\include" ^
LIBCURL_INC_DIR="c:\projects\unrealircd-6-libs\curl\include" ^
LIBCURL_LIB_DIR="c:\projects\unrealircd-6-libs\curl\builds\libcurl-vc-x64-release-dll-ssl-dll-cares-dll-ipv6-obj-lib" ^
CARES_LIB_DIR="c:\projects\unrealircd-6-libs\c-ares\msvc\cares\dll-release" ^
CARES_INC_DIR="c:\projects\unrealircd-6-libs\c-ares\include" ^
CARESLIB="cares.lib" ^
PCRE2_INC_DIR="c:\projects\unrealircd-5-libs\pcre2\include" ^
PCRE2_LIB_DIR="c:\projects\unrealircd-5-libs\pcre2\lib" ^
PCRE2_INC_DIR="c:\projects\unrealircd-6-libs\pcre2\include" ^
PCRE2_LIB_DIR="c:\projects\unrealircd-6-libs\pcre2\lib" ^
PCRE2LIB="pcre2-8.lib" ^
ARGON2_LIB_DIR="c:\projects\unrealircd-5-libs\argon2\vs2015\build" ^
ARGON2_INC_DIR="c:\projects\unrealircd-5-libs\argon2\include" ^
ARGON2_LIB_DIR="c:\projects\unrealircd-6-libs\argon2\vs2015\build" ^
ARGON2_INC_DIR="c:\projects\unrealircd-6-libs\argon2\include" ^
ARGON2LIB="Argon2RefDll.lib" ^
SODIUM_LIB_DIR="c:\projects\unrealircd-5-libs\libsodium\bin\x64\Release\v142\dynamic" ^
SODIUM_INC_DIR="c:\projects\unrealircd-5-libs\libsodium\src\libsodium\include" ^
SODIUMLIB="libsodium.lib" %*
SODIUM_LIB_DIR="c:\projects\unrealircd-6-libs\libsodium\bin\x64\Release\v142\dynamic" ^
SODIUM_INC_DIR="c:\projects\unrealircd-6-libs\libsodium\src\libsodium\include" ^
SODIUMLIB="libsodium.lib" ^
JANSSON_LIB_DIR="c:\projects\unrealircd-6-libs\jansson\lib" ^
JANSSON_INC_DIR="c:\projects\unrealircd-6-libs\jansson\include" ^
JANSSONLIB="jansson.lib" ^
GEOIPCLASSIC_LIB_DIR="c:\projects\unrealircd-6-libs\GeoIP\libGeoIP" ^
GEOIPCLASSIC_INC_DIR="c:\projects\unrealircd-6-libs\GeoIP\libGeoIP" ^
GEOIPCLASSICLIB="GeoIP.lib" %*

Binary file not shown.

View File

@ -4,7 +4,7 @@ OUTF="curl-latest.tar.gz"
OUTD="curl-latest"
ARESPATH="`pwd`/extras/c-ares"
UNREALDIR="`pwd`"
CARESVERSION="1.17.1"
CARESVERSION="1.17.2"
LIBDIR="$1"
if [ "x$1" = "x" ]; then

View File

@ -1,4 +1,4 @@
Welcome to the doxygen-generated documentation for the UnrealIRCd 5.x API.
Welcome to the doxygen-generated documentation for the UnrealIRCd 6.x API.
This is intended **for developers only!**
If you are creating a 3rd party module for UnrealIRCd or are interested

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "UnrealIRCd"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 5.2.0.1
PROJECT_NUMBER = 6.0.1.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

BIN
extras/geoip-classic.tar.gz Normal file

Binary file not shown.

BIN
extras/jansson.tar.gz Normal file

Binary file not shown.

View File

@ -1,9 +1,9 @@
# AppArmor profile for UnrealIRCd 5
# AppArmor profile for UnrealIRCd 6
#
# Note that you may still see some DENIED warnings in logs with
# operation="chmod". These are harmless and can be safely ignored.
#
# Tested on Ubuntu 16.04 LTS and Ubuntu 18.04 LTS
# Tested on Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS
#
# IMPORTANT: you will have to modify the path to executable below
# if it's not /home/ircd/unrealircd/bin/unrealircd !

View File

@ -0,0 +1,27 @@
Target: 127.0.0.1:5901
prio ciphersuite protocols pfs curves
1 ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 ECDH,P-521,521bits secp521r1,secp384r1
2 ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 ECDH,P-521,521bits secp521r1,secp384r1
3 ECDHE-ECDSA-AES256-SHA384 TLSv1.2 ECDH,P-521,521bits secp521r1,secp384r1
4 ECDHE-ECDSA-AES128-SHA256 TLSv1.2 ECDH,P-521,521bits secp521r1,secp384r1
5 ECDHE-ECDSA-AES256-SHA TLSv1.2 ECDH,P-521,521bits secp521r1,secp384r1
6 ECDHE-ECDSA-AES128-SHA TLSv1.2 ECDH,P-521,521bits secp521r1,secp384r1
Certificate: untrusted, 384 bits, ecdsa-with-SHA256 signature
TLS ticket lifetime hint: None
NPN protocols: None
OCSP stapling: not supported
Cipher ordering: server
Curves ordering: server - fallback: no
Server supports secure renegotiation
Server supported compression methods: NONE
TLS Tolerance: yes
Intolerance to:
SSL 3.254 : absent
TLS 1.0 : PRESENT
TLS 1.1 : PRESENT
TLS 1.2 : absent
TLS 1.3 : absent
TLS 1.4 : absent

View File

@ -18,7 +18,7 @@ stateOrProvinceName_default = New York
localityName = Locality Name (eg, city)
0.organizationName = Organization Name (eg, company)
0.organizationName_default = SuperNETs
0.organizationName_default = IRC geeks
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = IRCd

View File

@ -1,11 +1,11 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This is stage 1 of the UnrealIRCd upgrade script
# It downloads stage 2 online, verifies the integrity, and then
# passes control to it to proceed with the rest of the upgrade.
#
# This is a bash script, so it is less cross-platform than
# the rest of UnrealIRCd. We also mostly assume Linux here.
# This is a bash script, so it is less cross-platform than the
# rest of UnrealIRCd. We also mostly assume Linux/FreeBSD here.
#
BUILDDIR="@BUILDDIR@"
@ -55,13 +55,19 @@ if [ ! -d "$BUILDDIR" ]; then
exit 1
fi
FETCHER="wget"
if ! wget --help 1>/dev/null 2>&1; then
echo "The tool 'wget' is missing, which is used by this script."
echo "On Linux consider running 'sudo apt install wget' or 'sudo yum install wget'"
echo "and run this script again."
echo "Or, don't use this script and follow the manual upgrade procedure from"
echo "https://www.unrealircd.org/docs/Upgrading"
exit 1
# fetch is a pain: it always returns 1 (false) even for usage info and has no --version
fetch 1>/dev/null 2>&1
if [ "$?" -ne 1 ]; then
echo "The tool 'wget' is missing, which is used by this script."
echo "On Linux consider running 'sudo apt install wget' or 'sudo yum install wget'"
echo "and run this script again."
echo "Or, don't use this script and follow the manual upgrade procedure from"
echo "https://www.unrealircd.org/docs/Upgrading"
exit 1
fi
FETCHER="fetch"
fi
# Weird way to get version, but ok.
@ -70,11 +76,16 @@ UNREALVER="`./configure --version|head -n1|awk '{ print $3 }'`"
cd .. || fail "Could not cd back"
# Set and export all variables with settings
export UNREALVER BUILDDIR SCRIPTDIR DOCDIR TMPDIR
export UNREALVER BUILDDIR SCRIPTDIR DOCDIR TMPDIR FETCHER
# Download the install script
wget -O unrealircd-upgrade-script.stage2 "https://www.unrealircd.org/downloads/unrealircd-upgrade-script.stage2?from=$UNREALVER" || fail "Could not download online installer"
wget -O unrealircd-upgrade-script.stage2.asc "https://www.unrealircd.org/downloads/unrealircd-upgrade-script.stage2.asc" || fail "Could not download online installer signature"
if [ "$FETCHER" = "wget" ]; then
wget -O unrealircd-upgrade-script.stage2 "https://www.unrealircd.org/downloads/unrealircd-upgrade-script.stage2?from=$UNREALVER" || fail "Could not download online installer"
wget -O unrealircd-upgrade-script.stage2.asc "https://www.unrealircd.org/downloads/unrealircd-upgrade-script.stage2.asc" || fail "Could not download online installer signature"
else
fetch -o unrealircd-upgrade-script.stage2 "https://www.unrealircd.org/downloads/unrealircd-upgrade-script.stage2?from=$UNREALVER" || fail "Could not download online installer"
fetch -o unrealircd-upgrade-script.stage2.asc "https://www.unrealircd.org/downloads/unrealircd-upgrade-script.stage2.asc" || fail "Could not download online installer signature"
fi
# GPG verification - if available
if gpg --version 1>/dev/null 2>&1; then
@ -94,7 +105,11 @@ if gpg --version 1>/dev/null 2>&1; then
fi
else
echo "WARNING: The GnuPG (GPG/PGP) verification tool 'gpg' is not installed."
echo "Consider running 'sudo apt install gpg' or 'yum install gnupg2'"
if [[ "$OSTYPE" == "freebsd"* ]] ; then
echo "Consider running 'sudo pkg install gnupg'"
else
echo "Consider running 'sudo apt install gpg' or 'yum install gnupg2'"
fi
echo "When 'gpg' is installed then the UnrealIRCd upgrade script can"
echo "verify the digital signature of the download file."
warn "Unable to check download integrity"
@ -103,3 +118,6 @@ fi
chmod +x unrealircd-upgrade-script.stage2
./unrealircd-upgrade-script.stage2 $*
SAVERET="$?"
rm -f unrealircd-upgrade-script.stage2 unrealircd-upgrade-script.stage2
exit $SAVERET

View File

@ -26,7 +26,7 @@
#define MODEBUFLEN 200
#define ChannelExists(n) (find_channel(n, NULL))
#define ChannelExists(n) (find_channel(n))
/* NOTE: Timestamps will be added to MODE-commands, so never make
* RESYNCMODES and MODEPARAMS higher than MAXPARA-3. DALnet servers

View File

@ -98,7 +98,6 @@ extern int myncmp(const char *, const char *, int);
extern char *strtoken(char **, char *, char *);
extern MODVAR int global_count, max_global_count;
extern char *myctime(time_t);
#ifdef _WIN32
extern int gettimeofday(struct timeval *tp, void *tzp);
#endif
@ -174,18 +173,7 @@ extern MODVAR unsigned char char_atribs[];
#define EXPAR2 extchmstr[1]
#define EXPAR3 extchmstr[2]
#define EXPAR4 extchmstr[3]
#ifdef PREFIX_AQ
#define CHPFIX "(qaohv)~&@%+"
#define CHPAR1 "beI"
#else
#define CHPFIX "(ohv)@%+"
#define CHPAR1 "beIqa"
#endif /* PREFIX_AQ */
#define CHPAR2 "k"
#define CHPAR3 "l"
#define CHPAR4 "psmntir"
#define CHPAR1 "beI"
#ifdef _WIN32
/*

View File

@ -98,9 +98,6 @@
*/
/* #undef DEBUGMODE */
/* Similarly, DEBUG_IOENGINE can be used to debug the I/O engine. */
/* #undef DEBUG_IOENGINE */
/*
* Full pathnames and defaults of irc system's support files.
*/
@ -126,7 +123,7 @@
* Common usage for this are: a trusted bot ran by an IRCOp, that you only
* want to give "flood access" and nothing else, and other such things.
*/
#define FAKELAG_CONFIGURABLE
//#undef FAKELAG_CONFIGURABLE
/* The default value for class::sendq */
#define DEFAULT_SENDQ 3000000
@ -212,10 +209,25 @@
* when there is no socket data waiting for us (no clients sending anything).
* Was 2000ms in 3.2.x, 1000ms for versions below 3.4-alpha4.
* 500ms in UnrealIRCd 4 (?)
* 250ms in UnrealIRCd 5.
* 250ms in UnrealIRCd 5 and UnrealIRCd 6.
*/
#define SOCKETLOOP_MAX_DELAY 250
/* After how much time should we timeout downloads:
* DOWNLOAD_CONNECT_TIMEOUT: for the DNS and connect() / TLS_connect() call
* DOWNLOAD_TRANSFER_TIMEOUT: for the complete transfer (including connect)
* This can't be in the configuration file, as we need it while
* fetching the configuration file.. ;)
*/
#define DOWNLOAD_CONNECT_TIMEOUT 15
#define DOWNLOAD_TRANSFER_TIMEOUT 45
/* Maximum number of HTTP redirects to follow.
* Keep this reasonably low, as this may delay booting up to
* DOWNLOAD_TRANSFER_TIMEOUT * DOWNLOAD_MAX_REDIRECTS
*/
#define DOWNLOAD_MAX_REDIRECTS 2
/*
* Max time from the nickname change that still causes KILL
* automaticly to switch for the current nick of that user. (seconds)
@ -233,25 +245,34 @@
#endif
/* Maximum number of ModData objects that may be attached to an object */
/* UnrealIRCd 4.0.0 - 4.0.13: 8, 8, 4, 4
* UnrealIRCd 4.0.14+ : 12, 8, 4, 4
* UnrealIRCd 5.0.0 : 12, 8, 8, 4, 4, 500, 500
/* UnrealIRCd 4.0.0 - 4.0.13: 8, 8, 4, 4
* UnrealIRCd 4.0.14+ : 12, 8, 4, 4
* UnrealIRCd 5.0.0 : 12, 8, 8, 4, 4, 500, 500
* UnrealIRCd 6.0.0 : 24, 12, 8, 4, 4, 500, 500
*/
#define MODDATA_MAX_CLIENT 12
#define MODDATA_MAX_LOCAL_CLIENT 8
#define MODDATA_MAX_CLIENT 24
#define MODDATA_MAX_LOCAL_CLIENT 12
#define MODDATA_MAX_CHANNEL 8
#define MODDATA_MAX_MEMBER 4
#define MODDATA_MAX_MEMBERSHIP 4
#define MODDATA_MAX_LOCAL_VARIABLE 500
#define MODDATA_MAX_GLOBAL_VARIABLE 500
/** Size of the member modes buffer, so can be max this-1 modes
* assigned to an individual user (and thus max prefixes as well).
* The default is 8, so 7 max modes, and is a bit tight.
* It allows for vhoaq (5) and then 2 additional ones from 3rd
* party modules.
*/
#define MEMBERMODESLEN 8
/* If EXPERIMENTAL is #define'd then all users will receive a notice about
* this when they connect, along with a pointer to bugs.unrealircd.org where
* they can report any problems. This is mainly to help UnrealIRCd development.
*/
#undef EXPERIMENTAL
/* Default SSL/TLS cipherlist (except for TLS1.3, see further down).
/* Default TLS cipherlist (except for TLS1.3, see further down).
* This can be changed via set::ssl::options::ciphers in the config file.
*/
#define UNREALIRCD_DEFAULT_CIPHERS "TLS13-CHACHA20-POLY1305-SHA256 TLS13-AES-256-GCM-SHA384 TLS13-AES-128-GCM-SHA256 EECDH+CHACHA20 EECDH+AESGCM EECDH+AES AES256-GCM-SHA384 AES128-GCM-SHA256 AES256-SHA256 AES128-SHA256 AES256-SHA AES128-SHA"
@ -261,7 +282,7 @@
*/
#define UNREALIRCD_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_8_SHA256:TLS_AES_128_CCM_SHA256"
/* Default SSL/TLS curves for ECDH(E)
/* Default TLS curves for ECDH(E)
* This can be changed via set::ssl::options::ecdh-curve in the config file.
* NOTE: This requires openssl 1.0.2 or newer, otherwise these defaults
* are not applied, due to the missing openssl API call.
@ -280,10 +301,8 @@
#define IRCD_PIDFILE PIDFILE
#ifdef DEBUGMODE
#define Debug(x) debug x
#define LOGFILE LPATH
#else
#define Debug(x) ;
#define LOGFILE "/dev/null"
#endif

View File

@ -70,7 +70,7 @@ typedef struct dbufbuf {
** memory as needed. Bytes are copied into internal buffers
** from users buffer.
*/
void dbuf_put(dbuf *, char *, size_t);
void dbuf_put(dbuf *, const char *, size_t);
/* Dynamic buffer header */
/* Pointer to data to be stored */
/* Number of bytes to store */

View File

@ -32,26 +32,12 @@ struct FloodSettings {
long period[MAXFLOODOPTIONS];
};
typedef struct NetworkConfiguration NetworkConfiguration;
struct NetworkConfiguration {
unsigned x_inah:1;
char *x_ircnetwork;
char *x_ircnet005;
char *x_defserv;
char *x_services_name;
char *x_hidden_host;
char *x_prefix_quit;
char *x_helpchan;
char *x_stats_server;
char *x_sasl_server;
};
enum UHAllowed { UHALLOW_ALWAYS, UHALLOW_NOCHANS, UHALLOW_REJOIN, UHALLOW_NEVER };
struct ChMode {
long mode;
long mode;
long extmodes;
char *extparams[EXTCMODETABLESZ];
char *extparams[256];
};
typedef struct OperStat {
@ -70,10 +56,9 @@ typedef enum HideIdleTimePolicy { HIDE_IDLE_TIME_NEVER=1, HIDE_IDLE_TIME_ALWAYS=
/** The set { } block configuration */
typedef struct Configuration Configuration;
struct Configuration {
unsigned som:1;
unsigned show_opermotd:1;
unsigned hide_ulines:1;
unsigned flat_map:1;
unsigned allow_chatops:1;
unsigned ident_check:1;
unsigned fail_oper_warn:1;
unsigned show_connect_info:1;
@ -86,8 +71,6 @@ struct Configuration {
unsigned allow_part_if_shunned:1;
unsigned disable_cap:1;
unsigned check_target_nick_bans:1;
unsigned use_egd : 1;
char *dns_bindip;
char *link_bindip;
long throttle_period;
char throttle_count;
@ -100,11 +83,10 @@ struct Configuration {
char *oper_auto_join_chans;
char *allow_user_stats;
OperStat *allow_user_stats_ext;
int ping_warning;
int maxchannelsperuser;
int maxdccallow;
int anti_spam_quit_message_time;
char *egd_path;
int ping_warning;
int maxchannelsperuser;
int maxdccallow;
int anti_spam_quit_message_time;
char *static_quit;
char *static_part;
TLSOptions *tls_options;
@ -122,12 +104,14 @@ struct Configuration {
char *restrict_usermodes;
char *restrict_channelmodes;
char *restrict_extendedbans;
int named_extended_bans;
char *channel_command_prefix;
long handshake_data_flood_amount;
long handshake_data_flood_ban_time;
int handshake_data_flood_ban_action;
struct ChMode modes_on_join;
int level_on_join;
int modes_on_join_set;
char *level_on_join;
FloodSettings *floodsettings;
int ident_connect_timeout;
int ident_read_timeout;
@ -148,7 +132,6 @@ struct Configuration {
int maxbanlength;
int watch_away_notification;
int uhnames;
NetworkConfiguration network;
unsigned short default_ipv6_clone_mask;
int ping_cookie;
int min_nick_length;
@ -176,6 +159,17 @@ struct Configuration {
BroadcastChannelMessagesOption broadcast_channel_messages;
AllowedChannelChars allowed_channelchars;
HideIdleTimePolicy hide_idle_time;
unsigned inah:1;
char *network_name;
char *network_name_005;
char *default_server;
char *services_name;
char *cloak_prefix;
char *prefix_quit;
char *helpchan;
char *stats_server;
char *sasl_server;
int server_notice_colors;
};
extern MODVAR Configuration iConf;
@ -187,7 +181,7 @@ extern MODVAR int ipv6_disabled;
#define CONN_MODES iConf.conn_modes
#define OPER_MODES iConf.oper_modes
#define OPER_SNOMASK iConf.oper_snomask
#define SHOWOPERMOTD iConf.som
#define SHOWOPERMOTD iConf.show_opermotd
#define HIDE_ULINES iConf.hide_ulines
#define FLAT_MAP iConf.flat_map
#define ALLOW_CHATOPS iConf.allow_chatops
@ -197,7 +191,6 @@ extern MODVAR int ipv6_disabled;
#define DONT_RESOLVE iConf.dont_resolve
#define AUTO_JOIN_CHANS iConf.auto_join_chans
#define OPER_AUTO_JOIN_CHANS iConf.oper_auto_join_chans
#define DNS_BINDIP iConf.dns_bindip
#define LINK_BINDIP iConf.link_bindip
#define IDENT_CHECK iConf.ident_check
#define FAILOPER_WARN iConf.fail_oper_warn
@ -205,23 +198,17 @@ extern MODVAR int ipv6_disabled;
#define NOCONNECTTLSLINFO iConf.no_connect_tls_info
#define ALLOW_USER_STATS iConf.allow_user_stats
#define ANTI_SPAM_QUIT_MSG_TIME iConf.anti_spam_quit_message_time
#ifdef HAVE_RAND_EGD
#define USE_EGD iConf.use_egd
#else
#define USE_EGD 0
#endif
#define EGD_PATH iConf.egd_path
#define ircnetwork iConf.network.x_ircnetwork
#define ircnet005 iConf.network.x_ircnet005
#define defserv iConf.network.x_defserv
#define SERVICES_NAME iConf.network.x_services_name
#define hidden_host iConf.network.x_hidden_host
#define helpchan iConf.network.x_helpchan
#define STATS_SERVER iConf.network.x_stats_server
#define SASL_SERVER iConf.network.x_sasl_server
#define iNAH iConf.network.x_inah
#define PREFIX_QUIT iConf.network.x_prefix_quit
#define NETWORK_NAME iConf.network_name
#define NETWORK_NAME_005 iConf.network_name_005
#define DEFAULT_SERVER iConf.default_server
#define SERVICES_NAME iConf.services_name
#define CLOAK_PREFIX iConf.cloak_prefix
#define HELP_CHANNEL iConf.helpchan
#define STATS_SERVER iConf.stats_server
#define SASL_SERVER iConf.sasl_server
#define iNAH iConf.inah
#define PREFIX_QUIT iConf.prefix_quit
#define STATIC_QUIT iConf.static_quit
#define STATIC_PART iConf.static_part
@ -232,7 +219,7 @@ extern MODVAR int ipv6_disabled;
#define THROTTLING_PERIOD iConf.throttle_period
#define THROTTLING_COUNT iConf.throttle_count
#define USE_BAN_VERSION iConf.use_ban_version
#define MODES_ON_JOIN iConf.modes_on_join.mode
#define MODES_ON_JOIN iConf.modes_on_join.extmodes
#define LEVEL_ON_JOIN iConf.level_on_join
#define IDENT_CONNECT_TIMEOUT iConf.ident_connect_timeout
@ -309,7 +296,6 @@ struct SetCheck {
unsigned has_maxchannelsperuser:1;
unsigned has_maxdccallow:1;
unsigned has_anti_spam_quit_message_time:1;
unsigned has_egd_path:1;
unsigned has_static_quit:1;
unsigned has_static_part:1;
unsigned has_allow_userhost_change:1;

View File

@ -7,6 +7,8 @@
typedef void (*IOCallbackFunc)(int fd, int revents, void *data);
typedef enum FDCloseMethod { FDCLOSE_SOCKET=0, FDCLOSE_FILE=1, FDCLOSE_NONE=3 } FDCloseMethod;
typedef struct fd_entry {
int fd;
char desc[FD_DESC_SZ];
@ -15,14 +17,14 @@ typedef struct fd_entry {
void *data;
time_t deadline;
unsigned char is_open;
FDCloseMethod close_method;
unsigned int backend_flags;
} FDEntry;
extern MODVAR FDEntry fd_table[MAXCONNECTIONS + 1];
extern int fd_open(int fd, const char *desc);
extern void fd_close(int fd);
extern int fd_unmap(int fd);
extern int fd_open(int fd, const char *desc, FDCloseMethod close_method);
extern int fd_close(int fd);
extern void fd_unnotify(int fd);
extern int fd_socket(int family, int type, int protocol, const char *desc);
extern int fd_accept(int sockfd);

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@
# define FORMAT_STRING(p) p
#endif
extern char *ircvsnprintf(char *str, size_t size, const char *format, va_list);
extern char *ircvsnprintf(char *str, size_t size, const char *format, va_list) __attribute__((format(printf,3,0)));
extern char *ircsnprintf(char *str, size_t size, FORMAT_STRING(const char *format), ...) __attribute__((format(printf,3,4)));
#endif

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,6 @@
#define MSG_PONG "PONG" /* PONG */
#define MSG_OPER "OPER" /* OPER */
#define MSG_PASS "PASS" /* PASS */
#define MSG_WALLOPS "WALLOPS" /* WALL */
#define MSG_TIME "TIME" /* TIME */
#define MSG_NAMES "NAMES" /* NAME */
#define MSG_ADMIN "ADMIN" /* ADMI */

View File

@ -36,7 +36,6 @@
#define RPL_ISUPPORT 005
#define RPL_REDIR 10
#define RPL_YOURID 42
#define RPL_REMOTEISUPPORT 105
@ -51,29 +50,23 @@
#define ERR_TOOMANYCHANNELS 405
#define ERR_WASNOSUCHNICK 406
#define ERR_TOOMANYTARGETS 407
#define ERR_NOSUCHSERVICE 408
#define ERR_NOORIGIN 409
#define ERR_INVALIDCAPCMD 410
#define ERR_NORECIPIENT 411
#define ERR_NOTEXTTOSEND 412
#define ERR_NOTOPLEVEL 413
#define ERR_WILDTOPLEVEL 414
#define ERR_TOOMANYMATCHES 416
#define ERR_UNKNOWNCOMMAND 421
#define ERR_NOMOTD 422
#define ERR_NOADMININFO 423
#define ERR_FILEERROR 424
#define ERR_NOOPERMOTD 425
#define ERR_TOOMANYAWAY 429
#define ERR_NONICKNAMEGIVEN 431
#define ERR_ERRONEUSNICKNAME 432
#define ERR_NICKNAMEINUSE 433
#define ERR_NORULES 434
#define ERR_SERVICECONFUSED 435
#define ERR_NICKCOLLISION 436
#define ERR_BANNICKCHANGE 437
#define ERR_NCHANGETOOFAST 438
#define ERR_TARGETTOOFAST 439
@ -82,53 +75,36 @@
#define ERR_USERNOTINCHANNEL 441
#define ERR_NOTONCHANNEL 442
#define ERR_USERONCHANNEL 443
#define ERR_NOLOGIN 444
#define ERR_SUMMONDISABLED 445
#define ERR_USERSDISABLED 446
#define ERR_NONICKCHANGE 447
#define ERR_FORBIDDENCHANNEL 448
#define ERR_NOTREGISTERED 451
#define ERR_HOSTILENAME 455
#define ERR_NOHIDING 459
#define ERR_NOTFORHALFOPS 460
#define ERR_NEEDMOREPARAMS 461
#define ERR_ALREADYREGISTRED 462
#define ERR_NOPERMFORHOST 463
#define ERR_PASSWDMISMATCH 464
#define ERR_YOUREBANNEDCREEP 465
#define ERR_YOUWILLBEBANNED 466
#define ERR_KEYSET 467
#define ERR_ONLYSERVERSCANCHANGE 468
#define ERR_LINKSET 469
#define ERR_LINKCHANNEL 470
#define ERR_CHANNELISFULL 471
#define ERR_UNKNOWNMODE 472
#define ERR_INVITEONLYCHAN 473
#define ERR_BANNEDFROMCHAN 474
#define ERR_BADCHANNELKEY 475
#define ERR_BADCHANMASK 476
#define ERR_NEEDREGGEDNICK 477
#define ERR_BANLISTFULL 478
#define ERR_LINKFAIL 479
#define ERR_CANNOTKNOCK 480
#define ERR_NOPRIVILEGES 481
#define ERR_CHANOPRIVSNEEDED 482
#define ERR_CANTKILLSERVER 483
#define ERR_ATTACKDENY 484
#define ERR_KILLDENY 485
#define ERR_NONONREG 486
#define ERR_NOTFORUSERS 487
#define ERR_SECUREONLYCHAN 489
#define ERR_NOSWEAR 490
#define ERR_NOOPERHOST 491
#define ERR_NOCTCP 492
#define ERR_CHANOWNPRIVNEEDED 499
@ -138,13 +114,11 @@
#define ERR_SILELISTFULL 511
#define ERR_TOOMANYWATCH 512
#define ERR_NEEDPONG 513
#define ERR_TOOMANYDCC 514
#define ERR_DISABLED 517
#define ERR_NOINVITE 518
#define ERR_ADMONLY 519
#define ERR_OPERONLY 520
#define ERR_LISTSYNTAX 521
@ -163,7 +137,6 @@
#define RPL_WHOISREGNICK 307
#define RPL_RULESSTART 308
#define RPL_ENDOFRULES 309
#define RPL_WHOISHELPOP 310 /* -Donwulff */
#define RPL_WHOISUSER 311
#define RPL_WHOISSERVER 312
@ -173,7 +146,6 @@
/* rpl_endofwho below (315) */
#define RPL_ENDOFWHOWAS 369
#define RPL_WHOISCHANOP 316 /* redundant and not needed but reserved */
#define RPL_WHOISIDLE 317
#define RPL_ENDOFWHOIS 318
@ -198,7 +170,7 @@
#define RPL_WHOISBOT 335
#define RPL_USERIP 340
#define RPL_INVITING 341
#define RPL_SUMMONING 342
#define RPL_WHOISCOUNTRY 344
#define RPL_VERSION 351
@ -211,7 +183,6 @@
#define RPL_EXLIST 348
#define RPL_ENDOFEXLIST 349
#define RPL_KILLDONE 361
#define RPL_CLOSING 362
#define RPL_CLOSEEND 363
#define RPL_LINKS 364
@ -223,7 +194,6 @@
#define RPL_INFO 371
#define RPL_MOTD 372
#define RPL_INFOSTART 373
#define RPL_ENDOFINFO 374
#define RPL_MOTDSTART 375
#define RPL_ENDOFMOTD 376
@ -232,9 +202,6 @@
#define RPL_WHOISMODES 379
#define RPL_YOUREOPER 381
#define RPL_REHASHING 382
#define RPL_YOURESERVICE 383
#define RPL_MYPORTIS 384
#define RPL_NOTOPERANYMORE 385
#define RPL_QLIST 386
#define RPL_ENDOFQLIST 387
#define RPL_ALIST 388
@ -255,7 +222,6 @@
#define RPL_TRACEOPERATOR 204
#define RPL_TRACEUSER 205
#define RPL_TRACESERVER 206
#define RPL_TRACESERVICE 207
#define RPL_TRACENEWTYPE 208
#define RPL_TRACECLASS 209
@ -263,37 +229,28 @@
#define RPL_STATSLINKINFO 211
#define RPL_STATSCOMMANDS 212
#define RPL_STATSCLINE 213
#define RPL_STATSOLDNLINE 214
#define RPL_STATSILINE 215
#define RPL_STATSKLINE 216
#define RPL_STATSQLINE 217
#define RPL_STATSYLINE 218
#define RPL_ENDOFSTATS 219
#define RPL_STATSBLINE 220
#define RPL_UMODEIS 221
#define RPL_SQLINE_NICK 222
#define RPL_STATSGLINE 223
#define RPL_STATSTLINE 224
#define RPL_STATSELINE 225
#define RPL_STATSNLINE 226
#define RPL_STATSVLINE 227
#define RPL_STATSBANVER 228
#define RPL_STATSSPAMF 229
#define RPL_STATSEXCEPTTKL 230
#define RPL_SERVICEINFO 231
#define RPL_RULES 232
#define RPL_SERVICE 233
#define RPL_SERVLIST 234
#define RPL_SERVLISTEND 235
#define RPL_STATSLLINE 241
#define RPL_STATSUPTIME 242
#define RPL_STATSOLINE 243
#define RPL_STATSHLINE 244
#define RPL_STATSSLINE 245
#define RPL_STATSXLINE 247
#define RPL_STATSULINE 248
#define RPL_STATSDEBUG 249
@ -319,14 +276,6 @@
#define RPL_STATSDLINE 275
#define RPL_WHOISCERTFP 276
#define RPL_HELPHDR 290
#define RPL_HELPOP 291
#define RPL_HELPTLR 292
#define RPL_HELPHLP 293
#define RPL_HELPFWD 294
#define RPL_HELPIGN 295
/*
* New /MAP format.
*/
@ -335,7 +284,6 @@
#define RPL_MAPEND 007
#define ERR_WHOSYNTAX 522
#define ERR_WHOLIMEXCEED 523
#define ERR_OPERSPVERIFY 524
@ -357,7 +305,6 @@
#define RPL_NOWOFF 605
#define RPL_WATCHLIST 606
#define RPL_ENDOFWATCHLIST 607
#define RPL_CLEARWATCH 608
#define RPL_NOWISAWAY 609
#define RPL_DCCSTATUS 617
@ -365,16 +312,18 @@
#define RPL_ENDOFDCCLIST 619
#define RPL_DCCINFO 620
#define RPL_DUMPING 640
#define RPL_DUMPRPL 641
#define RPL_EODUMP 642
#define RPL_SPAMCMDFWD 659
#define RPL_STARTTLS 670
#define RPL_WHOISSECURE 671
#define RPL_MONONLINE 730
#define RPL_MONOFFLINE 731
#define RPL_MONLIST 732
#define RPL_ENDOFMONLIST 733
#define ERR_MONLISTFULL 734
#define ERR_MLOCKRESTRICTED 742
#define ERR_CANNOTDOCOMMAND 972
@ -382,15 +331,242 @@
#define ERR_STARTTLS 691
#define ERR_INVALIDMODEPARAM 696
#define RPL_LOGGEDIN 900
#define RPL_LOGGEDOUT 901
#define ERR_NICKLOCKED 902
#define RPL_SASLSUCCESS 903
#define ERR_SASLFAIL 904
#define ERR_SASLTOOLONG 905
#define ERR_SASLABORTED 906
#define ERR_SASLALREADY 907
#define RPL_SASLMECHS 908
#define ERR_NUMERICERR 999
/* Numeric texts */
#define STR_RPL_WELCOME /* 001 */ ":Welcome to the %s IRC Network %s!%s@%s"
#define STR_RPL_YOURHOST /* 002 */ ":Your host is %s, running version %s"
#define STR_RPL_CREATED /* 003 */ ":This server was created %s"
#define STR_RPL_MYINFO /* 004 */ "%s %s %s %s"
#define STR_RPL_ISUPPORT /* 005 */ "%s :are supported by this server"
#define STR_RPL_MAP /* 006 */ ":%s%-*s(%ld) %s"
#define STR_RPL_MAPEND /* 007 */ ":End of /MAP"
#define STR_RPL_SNOMASK /* 008 */ "+%s :Server notice mask"
#define STR_RPL_REDIR /* 010 */ "%s %d :Please use this Server/Port instead"
#define STR_RPL_REMOTEISUPPORT /* 105 */ "%s :are supported by this server"
#define STR_RPL_TRACELINK /* 200 */ "Link %s%s %s %s"
#define STR_RPL_TRACECONNECTING /* 201 */ "Attempt %s %s"
#define STR_RPL_TRACEHANDSHAKE /* 202 */ "Handshaking %s %s"
#define STR_RPL_TRACEUNKNOWN /* 203 */ "???? %s %s"
#define STR_RPL_TRACEOPERATOR /* 204 */ "Operator %s %s [%s] %lld"
#define STR_RPL_TRACEUSER /* 205 */ "User %s %s [%s] %lld"
#define STR_RPL_TRACESERVER /* 206 */ "Server %s %dS %dC %s %s!%s@%s %lld"
#define STR_RPL_TRACENEWTYPE /* 208 */ "%s 0 %s"
#define STR_RPL_TRACECLASS /* 209 */ "Class %s %d"
#define STR_RPL_STATSHELP /* 210 */ ":%s"
#define STR_RPL_STATSCOMMANDS /* 212 */ "%s %u %lu"
#define STR_RPL_STATSCLINE /* 213 */ "%c %s * %s %d %d %s"
#define STR_RPL_STATSILINE /* 215 */ "I %s %s %d %d %s %s %d"
#define STR_RPL_STATSQLINE /* 217 */ "%c %s %lld %lld %s :%s"
#define STR_RPL_STATSYLINE /* 218 */ "Y %s %d %d %d %d %d"
#define STR_RPL_ENDOFSTATS /* 219 */ "%c :End of /STATS report"
#define STR_RPL_UMODEIS /* 221 */ "%s"
#define STR_RPL_STATSGLINE /* 223 */ "%c %s %lld %lld %s :%s"
#define STR_RPL_STATSTLINE /* 224 */ "T %s %s %s"
#define STR_RPL_STATSNLINE /* 226 */ "n %s %s"
#define STR_RPL_STATSVLINE /* 227 */ "v %s %s %s"
#define STR_RPL_STATSBANVER /* 228 */ "%s %s"
#define STR_RPL_STATSSPAMF /* 229 */ "%c %s %s %s %lld %lld %lld %s %s :%s"
#define STR_RPL_STATSEXCEPTTKL /* 230 */ "%s %s %lld %lld %s :%s"
#define STR_RPL_RULES /* 232 */ ":- %s"
#define STR_RPL_STATSLLINE /* 241 */ "%c %s * %s %d %d"
#define STR_RPL_STATSUPTIME /* 242 */ ":Server Up %lld days, %lld:%02lld:%02lld"
#define STR_RPL_STATSOLINE /* 243 */ "%c %s * %s %s %s"
#define STR_RPL_STATSHLINE /* 244 */ "%c %s * %s %d %d"
#define STR_RPL_STATSXLINE /* 247 */ "X %s %d"
#define STR_RPL_STATSULINE /* 248 */ "U %s"
#define STR_RPL_STATSDEBUG /* 249 */ ":%s"
#define STR_RPL_STATSCONN /* 250 */ ":Highest connection count: %d (%d clients)"
#define STR_RPL_LUSERCLIENT /* 251 */ ":There are %d users and %d invisible on %d servers"
#define STR_RPL_LUSEROP /* 252 */ "%d :operator(s) online"
#define STR_RPL_LUSERUNKNOWN /* 253 */ "%d :unknown connection(s)"
#define STR_RPL_LUSERCHANNELS /* 254 */ "%d :channels formed"
#define STR_RPL_LUSERME /* 255 */ ":I have %d clients and %d servers"
#define STR_RPL_ADMINME /* 256 */ ":Administrative info about %s"
#define STR_RPL_ADMINLOC1 /* 257 */ ":%s"
#define STR_RPL_ADMINLOC2 /* 258 */ ":%s"
#define STR_RPL_ADMINEMAIL /* 259 */ ":%s"
#define STR_RPL_TRACELOG /* 261 */ "File %s %d"
#define STR_RPL_TRYAGAIN /* 263 */ "%s :Flooding detected. Please wait a while and try again."
#define STR_RPL_LOCALUSERS /* 265 */ "%d %d :Current local users %d, max %d"
#define STR_RPL_GLOBALUSERS /* 266 */ "%d %d :Current global users %d, max %d"
#define STR_RPL_SILELIST /* 271 */ "%s"
#define STR_RPL_ENDOFSILELIST /* 272 */ ":End of Silence List"
#define STR_RPL_STATSDLINE /* 275 */ "%c %s %s"
#define STR_RPL_WHOISCERTFP /* 276 */ "%s :has client certificate fingerprint %s"
#define STR_RPL_AWAY /* 301 */ "%s :%s"
#define STR_RPL_USERHOST /* 302 */ ":%s %s %s %s %s"
#define STR_RPL_ISON /* 303 */ ":"
#define STR_RPL_UNAWAY /* 305 */ ":You are no longer marked as being away"
#define STR_RPL_NOWAWAY /* 306 */ ":You have been marked as being away"
#define STR_RPL_WHOISREGNICK /* 307 */ "%s :is identified for this nick"
#define STR_RPL_RULESSTART /* 308 */ ":- %s Server Rules - "
#define STR_RPL_ENDOFRULES /* 309 */ ":End of RULES command."
#define STR_RPL_WHOISUSER /* 311 */ "%s %s %s * :%s"
#define STR_RPL_WHOISSERVER /* 312 */ "%s %s :%s"
#define STR_RPL_WHOISOPERATOR /* 313 */ "%s :is %s"
#define STR_RPL_WHOWASUSER /* 314 */ "%s %s %s * :%s"
#define STR_RPL_ENDOFWHO /* 315 */ "%s :End of /WHO list."
#define STR_RPL_WHOISIDLE /* 317 */ "%s %lld %lld :seconds idle, signon time"
#define STR_RPL_ENDOFWHOIS /* 318 */ "%s :End of /WHOIS list."
#define STR_RPL_WHOISCHANNELS /* 319 */ "%s :%s"
#define STR_RPL_WHOISSPECIAL /* 320 */ "%s :%s"
#define STR_RPL_LISTSTART /* 321 */ "Channel :Users Name"
#define STR_RPL_LIST /* 322 */ "%s %d :%s %s"
#define STR_RPL_LISTEND /* 323 */ ":End of /LIST"
#define STR_RPL_CHANNELMODEIS /* 324 */ "%s %s %s"
#define STR_RPL_CREATIONTIME /* 329 */ "%s %lld"
#define STR_RPL_WHOISLOGGEDIN /* 330 */ "%s %s :is logged in as"
#define STR_RPL_NOTOPIC /* 331 */ "%s :No topic is set."
#define STR_RPL_TOPIC /* 332 */ "%s :%s"
#define STR_RPL_TOPICWHOTIME /* 333 */ "%s %s %lld"
#define STR_RPL_LISTSYNTAX /* 334 */ ":%s"
#define STR_RPL_WHOISBOT /* 335 */ "%s :is a \2Bot\2 on %s"
#define STR_RPL_INVITELIST /* 336 */ ":%s"
#define STR_RPL_ENDOFINVITELIST /* 337 */ ":End of /INVITE list."
#define STR_RPL_USERIP /* 340 */ ":%s %s %s %s %s"
#define STR_RPL_INVITING /* 341 */ "%s %s"
#define STR_RPL_WHOISCOUNTRY /* 344 */ "%s %s :is connecting from %s"
#define STR_RPL_INVEXLIST /* 346 */ "%s %s %s %lld"
#define STR_RPL_ENDOFINVEXLIST /* 347 */ "%s :End of Channel Invite List"
#define STR_RPL_EXLIST /* 348 */ "%s %s %s %lld"
#define STR_RPL_ENDOFEXLIST /* 349 */ "%s :End of Channel Exception List"
#define STR_RPL_VERSION /* 351 */ "%s.%s %s :%s%s%s [%s=%d]"
#define STR_RPL_WHOREPLY /* 352 */ "%s %s %s %s %s %s :%d %s"
#define STR_RPL_NAMREPLY /* 353 */ "%s"
#define STR_RPL_CLOSING /* 362 */ "%s :Closed. Status = %d"
#define STR_RPL_CLOSEEND /* 363 */ "%d: Connections Closed"
#define STR_RPL_LINKS /* 364 */ "%s %s :%d %s"
#define STR_RPL_ENDOFLINKS /* 365 */ "%s :End of /LINKS list."
#define STR_RPL_ENDOFNAMES /* 366 */ "%s :End of /NAMES list."
#define STR_RPL_BANLIST /* 367 */ "%s %s %s %lld"
#define STR_RPL_ENDOFBANLIST /* 368 */ "%s :End of Channel Ban List"
#define STR_RPL_ENDOFWHOWAS /* 369 */ "%s :End of WHOWAS"
#define STR_RPL_INFO /* 371 */ ":%s"
#define STR_RPL_MOTD /* 372 */ ":- %s"
#define STR_RPL_ENDOFINFO /* 374 */ ":End of /INFO list."
#define STR_RPL_MOTDSTART /* 375 */ ":- %s Message of the Day - "
#define STR_RPL_ENDOFMOTD /* 376 */ ":End of /MOTD command."
#define STR_RPL_WHOISHOST /* 378 */ "%s :is connecting from %s@%s %s"
#define STR_RPL_WHOISMODES /* 379 */ "%s :is using modes %s %s"
#define STR_RPL_YOUREOPER /* 381 */ ":You are now an IRC Operator"
#define STR_RPL_REHASHING /* 382 */ "%s :Rehashing"
#define STR_RPL_QLIST /* 386 */ "%s %s"
#define STR_RPL_ENDOFQLIST /* 387 */ "%s :End of Channel Owner List"
#define STR_RPL_ALIST /* 388 */ "%s %s"
#define STR_RPL_ENDOFALIST /* 389 */ "%s :End of Protected User List"
#define STR_RPL_TIME /* 391 */ "%s :%s"
#define STR_RPL_HOSTHIDDEN /* 396 */ "%s :is now your displayed host"
#define STR_ERR_NOSUCHNICK /* 401 */ "%s :No such nick/channel"
#define STR_ERR_NOSUCHSERVER /* 402 */ "%s :No such server"
#define STR_ERR_NOSUCHCHANNEL /* 403 */ "%s :No such channel"
#define STR_ERR_CANNOTSENDTOCHAN /* 404 */ "%s :%s (%s)"
#define STR_ERR_TOOMANYCHANNELS /* 405 */ "%s :You have joined too many channels"
#define STR_ERR_WASNOSUCHNICK /* 406 */ "%s :There was no such nickname"
#define STR_ERR_TOOMANYTARGETS /* 407 */ "%s :Too many targets. The maximum is %d for %s."
#define STR_ERR_NOORIGIN /* 409 */ ":No origin specified"
#define STR_ERR_INVALIDCAPCMD /* 410 */ "%s :Invalid CAP subcommand"
#define STR_ERR_NORECIPIENT /* 411 */ ":No recipient given (%s)"
#define STR_ERR_NOTEXTTOSEND /* 412 */ ":No text to send"
#define STR_ERR_TOOMANYMATCHES /* 416 */ "%s :%s"
#define STR_ERR_UNKNOWNCOMMAND /* 421 */ "%s :Unknown command"
#define STR_ERR_NOMOTD /* 422 */ ":MOTD File is missing"
#define STR_ERR_NOADMININFO /* 423 */ "%s :No administrative info available"
#define STR_ERR_NOOPERMOTD /* 425 */ ":OPERMOTD File is missing"
#define STR_ERR_TOOMANYAWAY /* 429 */ ":Too Many aways - Flood Protection activated"
#define STR_ERR_NONICKNAMEGIVEN /* 431 */ ":No nickname given"
#define STR_ERR_ERRONEUSNICKNAME /* 432 */ "%s :Nickname is unavailable: %s"
#define STR_ERR_NICKNAMEINUSE /* 433 */ "%s :Nickname is already in use."
#define STR_ERR_NORULES /* 434 */ ":RULES File is missing"
#define STR_ERR_BANNICKCHANGE /* 437 */ "%s :Cannot change nickname while banned on channel"
#define STR_ERR_NCHANGETOOFAST /* 438 */ "%s :Nick change too fast. Please try again later."
#define STR_ERR_TARGETTOOFAST /* 439 */ "%s :Message target change too fast. Please wait %lld seconds"
#define STR_ERR_SERVICESDOWN /* 440 */ "%s :Services are currently down. Please try again later."
#define STR_ERR_USERNOTINCHANNEL /* 441 */ "%s %s :They aren't on that channel"
#define STR_ERR_NOTONCHANNEL /* 442 */ "%s :You're not on that channel"
#define STR_ERR_USERONCHANNEL /* 443 */ "%s %s :is already on channel"
#define STR_ERR_NONICKCHANGE /* 447 */ ":Can not change nickname while on %s (+N)"
#define STR_ERR_FORBIDDENCHANNEL /* 448 */ "%s :Cannot join channel: %s"
#define STR_ERR_NOTREGISTERED /* 451 */ ":You have not registered"
#define STR_ERR_NOTFORHALFOPS /* 460 */ ":Halfops cannot set mode %c"
#define STR_ERR_NEEDMOREPARAMS /* 461 */ "%s :Not enough parameters"
#define STR_ERR_ALREADYREGISTRED /* 462 */ ":You may not reregister"
#define STR_ERR_PASSWDMISMATCH /* 464 */ ":Password Incorrect"
#define STR_ERR_YOUREBANNEDCREEP /* 465 */ ":%s"
#define STR_ERR_ONLYSERVERSCANCHANGE /* 468 */ "%s :Only servers can change that mode"
#define STR_ERR_LINKCHANNEL /* 470 */ "%s %s :[Link] %s has become full, so you are automatically being transferred to the linked channel %s"
#define STR_ERR_CHANNELISFULL /* 471 */ "%s :Cannot join channel (+l)"
#define STR_ERR_UNKNOWNMODE /* 472 */ "%c :is unknown mode char to me"
#define STR_ERR_INVITEONLYCHAN /* 473 */ "%s :Cannot join channel (+i)"
#define STR_ERR_BANNEDFROMCHAN /* 474 */ "%s :Cannot join channel (+b)"
#define STR_ERR_BADCHANNELKEY /* 475 */ "%s :Cannot join channel (+k)"
#define STR_ERR_NEEDREGGEDNICK /* 477 */ "%s :You need a registered nick to join that channel."
#define STR_ERR_BANLISTFULL /* 478 */ "%s %s :Channel ban/ignore list is full"
#define STR_ERR_CANNOTKNOCK /* 480 */ ":Cannot knock on %s (%s)"
#define STR_ERR_NOPRIVILEGES /* 481 */ ":Permission Denied- You do not have the correct IRC operator privileges"
#define STR_ERR_CHANOPRIVSNEEDED /* 482 */ "%s :You're not channel operator"
#define STR_ERR_KILLDENY /* 485 */ ":Cannot kill protected user %s."
#define STR_ERR_NOTFORUSERS /* 487 */ ":%s is a server only command"
#define STR_ERR_SECUREONLYCHAN /* 489 */ "%s :Cannot join channel (Secure connection is required)"
#define STR_ERR_NOOPERHOST /* 491 */ ":No O-lines for your host"
#define STR_ERR_CHANOWNPRIVNEEDED /* 499 */ "%s :You're not a channel owner"
#define STR_ERR_TOOMANYJOINS /* 500 */ "%s :Too many join requests. Please wait a while and try again."
#define STR_ERR_UMODEUNKNOWNFLAG /* 501 */ ":Unknown MODE flag"
#define STR_ERR_USERSDONTMATCH /* 502 */ ":Cant change mode for other users"
#define STR_ERR_SILELISTFULL /* 511 */ "%s :Your silence list is full"
#define STR_ERR_TOOMANYWATCH /* 512 */ "%s :Maximum size for WATCH-list is 128 entries"
#define STR_ERR_TOOMANYDCC /* 514 */ "%s :Your dcc allow list is full. Maximum size is %d entries"
#define STR_ERR_DISABLED /* 517 */ "%s :%s" /* ircu */
#define STR_ERR_NOINVITE /* 518 */ ":Cannot invite (+V) at channel %s"
#define STR_ERR_OPERONLY /* 520 */ ":Cannot join channel %s (IRCops only)"
#define STR_ERR_LISTSYNTAX /* 521 */ ":Bad list syntax, type /quote list ? or /raw list ?"
#define STR_ERR_WHOLIMEXCEED /* 523 */ ":Error, /who limit of %d exceeded. Please narrow your search down and try again"
#define STR_ERR_OPERSPVERIFY /* 524 */ ":Trying to join +s or +p channel as an oper. Please invite yourself first."
#define STR_ERR_CANTSENDTOUSER /* 531 */ "%s :%s"
#define STR_RPL_REAWAY /* 597 */ "%s %s %s %lld :%s"
#define STR_RPL_GONEAWAY /* 598 */ "%s %s %s %lld :%s"
#define STR_RPL_NOTAWAY /* 599 */ "%s %s %s %lld :is no longer away"
#define STR_RPL_LOGON /* 600 */ "%s %s %s %lld :logged online"
#define STR_RPL_LOGOFF /* 601 */ "%s %s %s %lld :logged offline"
#define STR_RPL_WATCHOFF /* 602 */ "%s %s %s %lld :stopped watching"
#define STR_RPL_WATCHSTAT /* 603 */ ":You have %d and are on %d WATCH entries"
#define STR_RPL_NOWON /* 604 */ "%s %s %s %lld :is online"
#define STR_RPL_NOWOFF /* 605 */ "%s %s %s %lld :is offline"
#define STR_RPL_WATCHLIST /* 606 */ ":%s"
#define STR_RPL_ENDOFWATCHLIST /* 607 */ ":End of WATCH %c"
#define STR_RPL_NOWISAWAY /* 609 */ "%s %s %s %lld :is away"
#define STR_RPL_MAPMORE /* 610 */ ":%s%-*s --> *more*"
#define STR_RPL_DCCSTATUS /* 617 */ ":%s has been %s your DCC allow list"
#define STR_RPL_DCCLIST /* 618 */ ":%s"
#define STR_RPL_ENDOFDCCLIST /* 619 */ ":End of DCCALLOW %s"
#define STR_RPL_DCCINFO /* 620 */ ":%s"
#define STR_RPL_SPAMCMDFWD /* 659 */ "%s :Command processed, but a copy has been sent to ircops for evaluation (anti-spam) purposes. [%s]"
#define STR_RPL_STARTTLS /* 670 */ ":STARTTLS successful, go ahead with TLS handshake" /* kineircd */
#define STR_RPL_WHOISSECURE /* 671 */ "%s :%s" /* our variation on the kineircd numeric */
#define STR_ERR_STARTTLS /* 691 */ ":%s"
#define STR_ERR_INVALIDMODEPARAM /* 696 */ "%s %c %s :%s"
#define STR_RPL_MONONLINE /* 730 */ ":%s!%s@%s"
#define STR_RPL_MONOFFLINE /* 731 */ ":%s"
#define STR_RPL_MONLIST /* 732 */ ":%s"
#define STR_RPL_ENDOFMONLIST /* 733 */ ":End of MONITOR list"
#define STR_ERR_MONLISTFULL /* 734 */ "%d %s :Monitor list is full."
#define STR_ERR_MLOCKRESTRICTED /* 742 */ "%s %c %s :MODE cannot be set due to channel having an active MLOCK restriction policy"
#define STR_RPL_LOGGEDIN /* 900 */ "%s!%s@%s %s :You are now logged in as %s."
#define STR_RPL_LOGGEDOUT /* 901 */ "%s!%s@%s :You are now logged out."
#define STR_RPL_SASLSUCCESS /* 903 */ ":SASL authentication successful"
#define STR_ERR_SASLFAIL /* 904 */ ":SASL authentication failed"
#define STR_ERR_SASLTOOLONG /* 905 */ ":SASL message too long"
#define STR_ERR_SASLABORTED /* 906 */ ":SASL authentication aborted"
#define STR_RPL_SASLMECHS /* 908 */ "%s :are available SASL mechanisms"
#define STR_ERR_CANNOTDOCOMMAND /* 972 */ "%s :%s"
#define STR_ERR_CANNOTCHANGECHANMODE /* 974 */ "%c :%s"

View File

@ -1,68 +0,0 @@
/************************************************************************
* Unreal Internet Relay Chat Daemon, include/proto.h
* (C) Dominick Meglio <codemastr@unrealircd.com> 2000
*
* See file AUTHORS in IRC package for additional names of
* the programmers.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef proto_h
#define proto_h
/* lusers.c */
extern void init_irccounts(void);
/* match.c */
extern char *collapse(char *pattern);
/* scache.c */
extern void clear_scache_hash_table(void);
/* send.c */
extern void sendto_one(Client *, MessageTag *mtags, FORMAT_STRING(const char *), ...) __attribute__((format(printf,3,4)));
extern void sendto_realops(FORMAT_STRING(const char *pattern), ...) __attribute__((format(printf,1,2)));
/* ircd.c */
extern EVENT(garbage_collect);
extern EVENT(loop_event);
extern EVENT(check_pings);
extern EVENT(handshake_timeout);
extern EVENT(check_deadsockets);
extern EVENT(try_connections);
/* support.c */
extern char *my_itoa(int i);
/* s_serv.c */
extern void load_tunefile(void);
extern EVENT(save_tunefile);
extern void read_motd(const char *filename, MOTDFile *motd);
/* s_user.c */
extern int target_limit_exceeded(Client *client, void *target, const char *name);
extern void make_umodestr(void);
extern char *get_usermode_string(Client *acptr);
/* s_misc.c */
extern char *convert_time(time_t ltime);
/* whowas.c */
extern void initwhowas(void);
/* uid.c */
extern void uid_init(void);
extern const char *uid_get(void);
#endif /* proto_h */

View File

@ -115,6 +115,9 @@
/* Define to 1 if you have the `strlncat' function. */
#undef HAVE_STRLNCAT
/* Define to 1 if you have the `strlncpy' function. */
#undef HAVE_STRLNCPY
/* Define to 1 if you have the `syslog' function. */
#undef HAVE_SYSLOG
@ -130,9 +133,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you want modes shown in /list */
#undef LIST_SHOW_MODES
/* Define the location of the log files */
#undef LOGDIR
@ -181,9 +181,6 @@
/* Define the path of the pid file */
#undef PIDFILE
/* Define if you want +a/+q prefixes */
#undef PREFIX_AQ
/* Define the location of private libraries */
#undef PRIVATELIBDIR

File diff suppressed because it is too large Load Diff

View File

@ -55,9 +55,6 @@
#endif /* HAVE_INTTYPES_H */
#endif /* HAVE_STDINT_H */
#ifdef SSL
#include <openssl/ssl.h>
#endif
#ifndef _WIN32
#include <netinet/in.h>
#include <sys/socket.h>

View File

@ -10,7 +10,6 @@
#include "numeric.h"
#include "msg.h"
#include "mempool.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
@ -31,7 +30,6 @@
#include <fcntl.h>
#include <signal.h>
#include "h.h"
#include "url.h"
#include "version.h"
#ifdef USE_LIBCURL
#include <curl/curl.h>

View File

@ -1,13 +0,0 @@
#ifndef URL_H
#define URL_H
#include "types.h"
int MODFUNC url_is_valid(const char *);
extern const char MODFUNC *displayurl(const char *url);
char MODFUNC *url_getfilename(const char *url);
char MODFUNC *download_file(const char *, char **);
void MODFUNC download_file_async(const char *, time_t, vFP, void *callback_data);
void MODFUNC url_do_transfers_async(void);
void MODFUNC url_init(void);
#endif

View File

@ -54,9 +54,10 @@
* Can be useful if the above 3 versionids are insufficient for you (eg: you want to support CVS).
* This is updated automatically on the CVS server every Monday. so don't touch it.
*/
#define UNREAL_VERSION_TIME 202120
#define UNREAL_VERSION_TIME 202148
#define UnrealProtocol 5002
#define UNREAL_VERSION ((UNREAL_VERSION_GENERATION << 24) + (UNREAL_VERSION_MAJOR << 16) + (UNREAL_VERSION_MINOR << 8))
#define UnrealProtocol 6000
#define PATCH1 macro_to_str(UNREAL_VERSION_GENERATION)
#define PATCH2 "." macro_to_str(UNREAL_VERSION_MAJOR)
#define PATCH3 "." macro_to_str(UNREAL_VERSION_MINOR)

View File

@ -59,7 +59,7 @@ void off_history(Client *);
** nickname within the timelimit. Returns NULL, if no
** one found...
*/
Client *get_history(char *, time_t);
Client *get_history(const char *, time_t);
/* Nick name */
/* Time limit in seconds */

View File

@ -35,8 +35,6 @@
#define PIDFILE PERMDATADIR"/unrealircd.pid"
#define NO_U_TYPES
#define NEED_U_INT32_T
#define PREFIX_AQ
#define LIST_SHOW_MODES
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define HAVE_EXPLICIT_BZERO
@ -57,13 +55,13 @@
#define _WIN32_WINNT 0x0601
/* Generation version number (e.g.: 3 for Unreal3*) */
#define UNREAL_VERSION_GENERATION 5
#define UNREAL_VERSION_GENERATION 6
/* Major version number (e.g.: 2 for Unreal3.2*) */
#define UNREAL_VERSION_MAJOR 2
#define UNREAL_VERSION_MAJOR 0
/* Minor version number (e.g.: 1 for Unreal3.2.1) */
#define UNREAL_VERSION_MINOR 0
#define UNREAL_VERSION_MINOR 1
/* Version suffix such as a beta marker or release candidate marker. (e.g.:
-rcX for unrealircd-3.2.9-rcX) */

View File

@ -24,15 +24,15 @@ CC = "==== DO NOT RUN MAKE FROM THIS DIRECTORY ===="
OBJS=dns.o auth.o channel.o crule.o dbuf.o \
fdlist.o hash.o ircd.o ircsprintf.o list.o \
match.o modules.o parse.o mempool.o operclass.o \
conf_preprocessor.o conf.o debug.o dispatch.o numeric.o \
conf_preprocessor.o conf.o debug.o dispatch.o \
misc.o serv.o aliases.o socket.o \
tls.o user.o scache.o send.o support.o \
version.o whowas.o random.o api-usermode.o api-channelmode.o \
api-moddata.o api-extban.o api-isupport.o api-command.o \
api-clicap.o api-messagetag.o api-history-backend.o api-efunctions.o \
api-event.o \
crypt_blowfish.o unrealdb.o updconf.o crashreport.o modulemanager.o \
utf8.o \
crypt_blowfish.o unrealdb.o crashreport.o modulemanager.o \
utf8.o log.o \
openssl_hostname_validation.o $(URL)
SRC=$(OBJS:%.o=%.c)
@ -48,13 +48,16 @@ INCLUDES = ../include/channel.h \
../include/ircsprintf.h \
../include/license.h \
../include/modules.h ../include/modversion.h ../include/msg.h \
../include/numeric.h ../include/proto.h \
../include/numeric.h \
../include/resource.h ../include/setup.h \
../include/struct.h ../include/sys.h \
../include/types.h ../include/url.h \
../include/types.h \
../include/version.h ../include/whowas.h \
../include/openssl_hostname_validation.h
.SUFFIXES:
.SUFFIXES: .c .h .o
all: build
build:
@ -80,170 +83,16 @@ mods:
version.c: version.c.SH
$(SHELL) version.c.SH
version.o: version.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c version.c
parse.o: parse.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c parse.c
socket.o: socket.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c socket.c
dispatch.o: dispatch.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c dispatch.c
dbuf.o: dbuf.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c dbuf.c
auth.o: auth.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c auth.c
send.o: send.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c send.c
tls.o: tls.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c tls.c
match.o: match.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c match.c
modules.o: modules.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c modules.c
mempool.o: mempool.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c mempool.c
support.o: support.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c support.c
userload.o: userload.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c userload.c
aliases.o: aliases.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c aliases.c
%.o: %.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c $<
clean:
$(RM) -f *.o *.so *~ core ircd version.c; \
cd modules; make clean
cd modules; ${MAKE} clean
cleandir: clean
depend:
makedepend -I${INCLUDEDIR} ${SRC}
channel.o: channel.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c channel.c
ircd.o: ircd.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c ircd.c
list.o: list.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c list.c
dns.o: dns.c $(INCLUDES) ../include/dns.h
$(CC) $(CFLAGS) $(BINCFLAGS) -c dns.c
fdlist.o: fdlist.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c fdlist.c
conf_preprocessor.o: conf_preprocessor.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c conf_preprocessor.c
conf.o: conf.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c conf.c
debug.o: debug.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c debug.c
numeric.o: numeric.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c numeric.c
misc.o: misc.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c misc.c
scache.o: scache.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c scache.c
ircsprintf.o: ircsprintf.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c ircsprintf.c
user.o: user.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c user.c
serv.o: serv.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c serv.c
whowas.o: whowas.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c whowas.c
hash.o: hash.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c hash.c
crule.o: crule.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c crule.c
random.o: random.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c random.c
operclass.o: operclass.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c operclass.c
api-usermode.o: api-usermode.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-usermode.c
api-event.o: api-event.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-event.c
api-channelmode.o: api-channelmode.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-channelmode.c
api-moddata.o: api-moddata.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-moddata.c
api-extban.o: api-extban.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-extban.c
api-command.o: api-command.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-command.c
api-isupport.o: api-isupport.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-isupport.c
api-clicap.o: api-clicap.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-clicap.c
api-messagetag.o: api-messagetag.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-messagetag.c
api-history-backend.o: api-history-backend.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-history-backend.c
api-efunctions.o: api-efunctions.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c api-efunctions.c
crypt_blowfish.o: crypt_blowfish.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c crypt_blowfish.c
unrealdb.o: unrealdb.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c unrealdb.c
updconf.o: updconf.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c updconf.c
crashreport.o: crashreport.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c crashreport.c
modulemanager.o: modulemanager.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c modulemanager.c
utf8.o: utf8.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c utf8.c
openssl_hostname_validation.o: openssl_hostname_validation.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c openssl_hostname_validation.c
url.o: url.c $(INCLUDES)
$(CC) $(CFLAGS) $(BINCFLAGS) -c url.c
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -42,11 +42,12 @@ void strrangetok(char *in, char *out, char tok, short first, short last) {
/* cmd_alias is a special type of command, it has an extra argument 'cmd'. */
static int recursive_alias = 0;
void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *cmd)
void cmd_alias(Client *client, MessageTag *mtags, int parc, const char *parv[], const char *cmd)
{
ConfigItem_alias *alias;
Client *acptr;
int ret;
char request[BUFSIZE];
if (!(alias = find_alias(cmd)))
{
@ -64,7 +65,7 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
if (alias->type == ALIAS_SERVICES)
{
if (SERVICES_NAME && (acptr = find_person(alias->nick, NULL)))
if (SERVICES_NAME && (acptr = find_user(alias->nick, NULL)))
{
if (alias->spamfilter && match_spamfilter(client, parv[1], SPAMF_USERMSG, cmd, alias->nick, 0, NULL))
return;
@ -76,7 +77,7 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
}
else if (alias->type == ALIAS_STATS)
{
if (STATS_SERVER && (acptr = find_person(alias->nick, NULL)))
if (STATS_SERVER && (acptr = find_user(alias->nick, NULL)))
{
if (alias->spamfilter && match_spamfilter(client, parv[1], SPAMF_USERMSG, cmd, alias->nick, 0, NULL))
return;
@ -88,7 +89,7 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
}
else if (alias->type == ALIAS_NORMAL)
{
if ((acptr = find_person(alias->nick, NULL)))
if ((acptr = find_user(alias->nick, NULL)))
{
if (alias->spamfilter && match_spamfilter(client, parv[1], SPAMF_USERMSG, cmd, alias->nick, 0, NULL))
return;
@ -106,19 +107,19 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
else if (alias->type == ALIAS_CHANNEL)
{
Channel *channel;
if ((channel = find_channel(alias->nick, NULL)))
if ((channel = find_channel(alias->nick)))
{
char *msg = parv[1];
char *errmsg = NULL;
const char *msg = parv[1];
const char *errmsg = NULL;
if (can_send_to_channel(client, channel, &msg, &errmsg, 0))
{
if (alias->spamfilter && match_spamfilter(client, parv[1], SPAMF_CHANMSG, cmd, channel->chname, 0, NULL))
if (alias->spamfilter && match_spamfilter(client, parv[1], SPAMF_CHANMSG, cmd, channel->name, 0, NULL))
return;
new_message(client, NULL, &mtags);
sendto_channel(channel, client, client->direction,
PREFIX_ALL, 0, SEND_ALL|SKIP_DEAF, mtags,
NULL, 0, SEND_ALL|SKIP_DEAF, mtags,
":%s PRIVMSG %s :%s",
client->name, channel->chname, parv[1]);
client->name, channel->name, parv[1]);
free_message_tags(mtags);
return;
}
@ -132,7 +133,10 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
char *ptr = "";
if (!(parc < 2 || *parv[1] == '\0'))
ptr = parv[1];
{
strlcpy(request, parv[1], sizeof(request));
ptr = request;
}
for (format = alias->format; format; format = format->next)
{
@ -201,7 +205,7 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
if (format->type == ALIAS_SERVICES)
{
if (SERVICES_NAME && (acptr = find_person(format->nick, NULL)))
if (SERVICES_NAME && (acptr = find_user(format->nick, NULL)))
{
if (alias->spamfilter && match_spamfilter(client, output, SPAMF_USERMSG, cmd, format->nick, 0, NULL))
return;
@ -212,7 +216,7 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
}
else if (format->type == ALIAS_STATS)
{
if (STATS_SERVER && (acptr = find_person(format->nick, NULL)))
if (STATS_SERVER && (acptr = find_user(format->nick, NULL)))
{
if (alias->spamfilter && match_spamfilter(client, output, SPAMF_USERMSG, cmd, format->nick, 0, NULL))
return;
@ -223,7 +227,7 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
}
else if (format->type == ALIAS_NORMAL)
{
if ((acptr = find_person(format->nick, NULL)))
if ((acptr = find_user(format->nick, NULL)))
{
if (alias->spamfilter && match_spamfilter(client, output, SPAMF_USERMSG, cmd, format->nick, 0, NULL))
return;
@ -241,19 +245,19 @@ void cmd_alias(Client *client, MessageTag *mtags, int parc, char *parv[], char *
else if (format->type == ALIAS_CHANNEL)
{
Channel *channel;
if ((channel = find_channel(format->nick, NULL)))
if ((channel = find_channel(format->nick)))
{
char *msg = output;
char *errmsg = NULL;
const char *msg = output;
const char *errmsg = NULL;
if (!can_send_to_channel(client, channel, &msg, &errmsg, 0))
{
if (alias->spamfilter && match_spamfilter(client, output, SPAMF_CHANMSG, cmd, channel->chname, 0, NULL))
if (alias->spamfilter && match_spamfilter(client, output, SPAMF_CHANMSG, cmd, channel->name, 0, NULL))
return;
new_message(client, NULL, &mtags);
sendto_channel(channel, client, client->direction,
PREFIX_ALL, 0, SEND_ALL|SKIP_DEAF, mtags,
NULL, 0, SEND_ALL|SKIP_DEAF, mtags,
":%s PRIVMSG %s :%s",
client->name, channel->chname, parv[1]);
client->name, channel->name, parv[1]);
free_message_tags(mtags);
return;
}

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,9 @@ long ClientCapabilityBit(const char *token)
#ifdef DEBUGMODE
if (!clicap)
{
ircd_log(LOG_ERROR, "WARNING: ClientCapabilityBit(): unknown token '%s'", token);
unreal_log(ULOG_WARNING, "main", "BUG_CLIENTCAPABILITYBIT_UNKNOWN_TOKEN", NULL,
"[BUG] ClientCapabilityBit() check for unknown token: $token",
log_data_string("token", token));
}
#endif
@ -102,7 +104,7 @@ long clicap_allocate_cap(void)
ClientCapability *clicap;
/* The first bit (v=1) is used by the "invert" marker */
for (v=2; v < LONG_MAX; v = v * 2)
for (v=2; v; v <<= 1)
{
unsigned char found = 0;
for (clicap = clicaps; clicap; clicap = clicap->next)
@ -162,8 +164,8 @@ ClientCapability *ClientCapabilityAdd(Module *module, ClientCapabilityInfo *clic
v = clicap_allocate_cap();
if (v == 0)
{
sendto_realops("ClientCapabilityAdd: out of space!!!");
ircd_log(LOG_ERROR, "ClientCapabilityAdd: out of space!!!");
unreal_log(ULOG_ERROR, "module", "CLIENTCAPABILITY_OUT_OF_SPACE", NULL,
"ClientCapabilityAdd: out of space!!!");
if (module)
module->errorcode = MODERR_NOSPACE;
return NULL;
@ -204,8 +206,9 @@ ClientCapability *ClientCapabilityAdd(Module *module, ClientCapabilityInfo *clic
void unload_clicap_commit(ClientCapability *clicap)
{
/* This is an unusual operation, I think we should log it. */
ircd_log(LOG_ERROR, "Unloading client capability '%s'", clicap->name);
sendto_realops("Unloading client capability '%s'", clicap->name);
unreal_log(ULOG_INFO, "module", "UNLOAD_CLICAP", NULL,
"Unloading client capability '$token'",
log_data_string("token", clicap->name));
/* NOTE: Stripping the CAP from local clients is done
* in clicap_post_rehash(), so not here.
@ -245,7 +248,7 @@ void ClientCapabilityDel(ClientCapability *clicap)
clicap->owner = NULL;
}
if (loop.ircd_rehashing)
if (loop.rehashing)
clicap->unloaded = 1;
else
unload_clicap_commit(clicap);
@ -263,7 +266,12 @@ void unload_all_unused_caps(void)
}
}
#define MAXCLICAPS 64
#define ADVERTISEONLYCAPS 16
/* Advertise only caps are not counted anywhere, this only provides space in rehash temporary storage arrays.
* If exceeded, the caps just won't be stored and will be re-added safely. --k4be
*/
#define MAXCLICAPS ((int)(sizeof(long)*8 - 1 + ADVERTISEONLYCAPS)) /* how many cap bits will fit in `long`? */
static char *old_caps[MAXCLICAPS]; /**< List of old CAP names - used for /rehash */
int old_caps_proto[MAXCLICAPS]; /**< List of old CAP protocol values - used for /rehash */
@ -279,7 +287,9 @@ void clicap_pre_rehash(void)
{
if (i == MAXCLICAPS)
{
ircd_log(LOG_ERROR, "More than %d caps loaded - what???", MAXCLICAPS);
unreal_log(ULOG_ERROR, "module", "BUG_TOO_MANY_CLIENTCAPABILITIES", NULL,
"[BUG] clicap_pre_rehash: More than $count caps loaded - this should never happen",
log_data_integer("count", MAXCLICAPS));
break;
}
safe_strdup(old_caps[i], clicap->name);
@ -318,13 +328,13 @@ void clicap_post_rehash(void)
int i;
int found;
if (!loop.ircd_rehashing)
if (!loop.rehashing)
return; /* First boot */
/* Let's deal with CAP DEL first:
* Go through the old caps and see what's missing now.
*/
for (i = 0; old_caps[i]; i++)
for (i = 0; i < MAXCLICAPS && old_caps[i]; i++)
{
name = old_caps[i];
found = 0;
@ -351,7 +361,7 @@ void clicap_post_rehash(void)
{
name = clicap->name;
found = 0;
for (i = 0; old_caps[i]; i++)
for (i = 0; i < MAXCLICAPS && old_caps[i]; i++)
{
if (!strcmp(old_caps[i], name))
{
@ -368,6 +378,6 @@ void clicap_post_rehash(void)
}
/* Now free the old caps. */
for (i = 0; old_caps[i]; i++)
for (i = 0; i < MAXCLICAPS && old_caps[i]; i++)
safe_free(old_caps[i]);
}

View File

@ -23,8 +23,8 @@
#include "unrealircd.h"
/* Forward declarations */
static Command *CommandAddInternal(Module *module, char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags);
static RealCommand *add_Command_backend(char *cmd);
static Command *CommandAddInternal(Module *module, const char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags);
static RealCommand *add_Command_backend(const char *cmd);
/** @defgroup CommandAPI Command API
* @{
@ -32,7 +32,7 @@ static RealCommand *add_Command_backend(char *cmd);
/** Returns 1 if the specified command exists
*/
int CommandExists(char *name)
int CommandExists(const char *name)
{
RealCommand *p;
@ -53,7 +53,7 @@ int CommandExists(char *name)
* @param flags Who may execute this command - one or more CMD_* flags
* @returns The newly registered command, or NULL in case of error (eg: already exist)
*/
Command *CommandAdd(Module *module, char *cmd, CmdFunc func, unsigned char params, int flags)
Command *CommandAdd(Module *module, const char *cmd, CmdFunc func, unsigned char params, int flags)
{
if (flags & CMD_ALIAS)
{
@ -75,7 +75,7 @@ Command *CommandAdd(Module *module, char *cmd, CmdFunc func, unsigned char param
* @param flags Who may execute this command - one or more CMD_* flags
* @returns The newly registered command (alias), or NULL in case of error (eg: already exist)
*/
Command *AliasAdd(Module *module, char *cmd, AliasCmdFunc aliasfunc, unsigned char params, int flags)
Command *AliasAdd(Module *module, const char *cmd, AliasCmdFunc aliasfunc, unsigned char params, int flags)
{
if (!(flags & CMD_ALIAS))
flags |= CMD_ALIAS;
@ -84,7 +84,7 @@ Command *AliasAdd(Module *module, char *cmd, AliasCmdFunc aliasfunc, unsigned ch
/** @} */
static Command *CommandAddInternal(Module *module, char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags)
static Command *CommandAddInternal(Module *module, const char *cmd, CmdFunc func, AliasCmdFunc aliasfunc, unsigned char params, int flags)
{
Command *command = NULL;
RealCommand *c;
@ -191,7 +191,7 @@ void CommandDel(Command *command)
* @note If mtags is NULL then new message tags are created for the command
* (and destroyed before return).
*/
void do_cmd(Client *client, MessageTag *mtags, char *cmd, int parc, char *parv[])
void do_cmd(Client *client, MessageTag *mtags, const char *cmd, int parc, const char *parv[])
{
RealCommand *cmptr;
@ -233,7 +233,7 @@ void init_CommandHash(void)
CommandAdd(NULL, MSG_MODULE, cmd_module, MAXPARA, CMD_USER);
}
static RealCommand *add_Command_backend(char *cmd)
static RealCommand *add_Command_backend(const char *cmd)
{
RealCommand *c = safe_alloc(sizeof(RealCommand));
@ -250,7 +250,7 @@ static RealCommand *add_Command_backend(char *cmd)
*/
/** Find a command by name and flags */
RealCommand *find_command(char *cmd, int flags)
RealCommand *find_command(const char *cmd, int flags)
{
RealCommand *p;
for (p = CommandHash[toupper(*cmd)]; p; p = p->next) {
@ -269,7 +269,7 @@ RealCommand *find_command(char *cmd, int flags)
}
/** Find a command by name (no access rights check) */
RealCommand *find_command_simple(char *cmd)
RealCommand *find_command_simple(const char *cmd)
{
RealCommand *c;

View File

@ -34,47 +34,50 @@ static Efunction *Efunctions[MAXEFUNCTIONS]; /* Efunction objects (used for reha
static EfunctionsList efunction_table[MAXEFUNCTIONS];
/* Efuncs */
void (*do_join)(Client *client, int parc, char *parv[]);
void (*join_channel)(Channel *channel, Client *client, MessageTag *mtags, int flags);
int (*can_join)(Client *client, Channel *channel, char *key, char *parv[]);
void (*do_mode)(Channel *channel, Client *client, MessageTag *mtags, int parc, char *parv[], time_t sendts, int samode);
void (*set_mode)(Channel *channel, Client *client, int parc, char *parv[], u_int *pcount,
char pvar[MAXMODEPARAMS][MODEBUFLEN + 3], int bounce);
void (*cmd_umode)(Client *client, MessageTag *mtags, int parc, char *parv[]);
int (*register_user)(Client *client, char *nick, char *username, char *umode, char *virthost, char *ip);
void (*do_join)(Client *client, int parc, const char *parv[]);
void (*join_channel)(Channel *channel, Client *client, MessageTag *mtags, const char *member_modes);
int (*can_join)(Client *client, Channel *channel, const char *key, char **errmsg);
void (*do_mode)(Channel *channel, Client *client, MessageTag *mtags, int parc, const char *parv[], time_t sendts, int samode);
MultiLineMode *(*set_mode)(Channel *channel, Client *client, int parc, const char *parv[], u_int *pcount,
char pvar[MAXMODEPARAMS][MODEBUFLEN + 3]);
void (*set_channel_mode)(Channel *channel, char *modes, char *parameters);
void (*cmd_umode)(Client *client, MessageTag *mtags, int parc, const char *parv[]);
int (*register_user)(Client *client);
int (*tkl_hash)(unsigned int c);
char (*tkl_typetochar)(int type);
int (*tkl_chartotype)(char c);
char *(*tkl_type_string)(TKL *tk);
TKL *(*tkl_add_serverban)(int type, char *usermask, char *hostmask, char *reason, char *setby,
const char *(*tkl_type_string)(TKL *tk);
const char *(*tkl_type_config_string)(TKL *tk);
char *(*tkl_uhost)(TKL *tkl, char *buf, size_t buflen, int options);
TKL *(*tkl_add_serverban)(int type, const char *usermask, const char *hostmask, const char *reason, const char *setby,
time_t expire_at, time_t set_at, int soft, int flags);
TKL *(*tkl_add_nameban)(int type, char *name, int hold, char *reason, char *setby,
TKL *(*tkl_add_nameban)(int type, const char *name, int hold, const char *reason, const char *setby,
time_t expire_at, time_t set_at, int flags);
TKL *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, char *setby,
TKL *(*tkl_add_spamfilter)(int type, unsigned short target, unsigned short action, Match *match, const char *setby,
time_t expire_at, time_t set_at,
time_t spamf_tkl_duration, char *spamf_tkl_reason,
time_t spamf_tkl_duration, const char *spamf_tkl_reason,
int flags);
TKL *(*tkl_add_banexception)(int type, char *usermask, char *hostmask, char *reason, char *set_by,
time_t expire_at, time_t set_at, int soft, char *bantypes, int flags);
TKL *(*tkl_add_banexception)(int type, const char *usermask, const char *hostmask, const char *reason, const char *set_by,
time_t expire_at, time_t set_at, int soft, const char *bantypes, int flags);
TKL *(*tkl_del_line)(TKL *tkl);
void (*tkl_check_local_remove_shun)(TKL *tmp);
int (*find_tkline_match)(Client *client, int skip_soft);
int (*find_shun)(Client *client);
int(*find_spamfilter_user)(Client *client, int flags);
TKL *(*find_qline)(Client *client, char *nick, int *ishold);
TKL *(*find_qline)(Client *client, const char *nick, int *ishold);
TKL *(*find_tkline_match_zap)(Client *client);
void (*tkl_stats)(Client *client, int type, char *para, int *cnt);
void (*tkl_stats)(Client *client, int type, const char *para, int *cnt);
void (*tkl_sync)(Client *client);
void (*cmd_tkl)(Client *client, MessageTag *mtags, int parc, char *parv[]);
int (*place_host_ban)(Client *client, BanAction action, char *reason, long duration);
int (*match_spamfilter)(Client *client, char *str_in, int type, char *cmd, char *target, int flags, TKL **rettk);
int (*match_spamfilter_mtags)(Client *client, MessageTag *mtags, char *cmd);
void (*cmd_tkl)(Client *client, MessageTag *mtags, int parc, const char *parv[]);
int (*place_host_ban)(Client *client, BanAction action, const char *reason, long duration);
int (*match_spamfilter)(Client *client, const char *str_in, int type, const char *cmd, const char *target, int flags, TKL **rettk);
int (*match_spamfilter_mtags)(Client *client, MessageTag *mtags, const char *cmd);
int (*join_viruschan)(Client *client, TKL *tk, int type);
unsigned char *(*StripColors)(unsigned char *text);
const char *(*StripControlCodes)(unsigned char *text);
void (*spamfilter_build_user_string)(char *buf, char *nick, Client *client);
const char *(*StripColors)(const char *text);
const char *(*StripControlCodes)(const char *text);
void (*spamfilter_build_user_string)(char *buf, const char *nick, Client *client);
void (*send_protoctl_servers)(Client *client, int response);
int (*verify_link)(Client *client, char *servername, ConfigItem_link **link_out);
int (*verify_link)(Client *client, ConfigItem_link **link_out);
void (*introduce_user)(Client *to, Client *client);
void (*send_server_message)(Client *client);
void (*broadcast_md_client)(ModDataInfo *mdi, Client *client, ModData *md);
@ -82,37 +85,40 @@ void (*broadcast_md_channel)(ModDataInfo *mdi, Channel *channel, ModData *md);
void (*broadcast_md_member)(ModDataInfo *mdi, Channel *channel, Member *m, ModData *md);
void (*broadcast_md_membership)(ModDataInfo *mdi, Client *client, Membership *m, ModData *md);
int (*check_banned)(Client *client, int exitflags);
int (*check_deny_version)(Client *client, char *software, int protocol, char *flags);
void (*broadcast_md_client_cmd)(Client *except, Client *sender, Client *acptr, char *varname, char *value);
void (*broadcast_md_channel_cmd)(Client *except, Client *sender, Channel *channel, char *varname, char *value);
void (*broadcast_md_member_cmd)(Client *except, Client *sender, Channel *channel, Client *acptr, char *varname, char *value);
void (*broadcast_md_membership_cmd)(Client *except, Client *sender, Client *acptr, Channel *channel, char *varname, char *value);
int (*check_deny_version)(Client *client, const char *software, int protocol, const char *flags);
void (*broadcast_md_client_cmd)(Client *except, Client *sender, Client *acptr, const char *varname, const char *value);
void (*broadcast_md_channel_cmd)(Client *except, Client *sender, Channel *channel, const char *varname, const char *value);
void (*broadcast_md_member_cmd)(Client *except, Client *sender, Channel *channel, Client *acptr, const char *varname, const char *value);
void (*broadcast_md_membership_cmd)(Client *except, Client *sender, Client *acptr, Channel *channel, const char *varname, const char *value);
void (*moddata_add_s2s_mtags)(Client *client, MessageTag **mtags);
void (*moddata_extract_s2s_mtags)(Client *client, MessageTag *mtags);
void (*send_moddata_client)(Client *srv, Client *client);
void (*send_moddata_channel)(Client *srv, Channel *channel);
void (*send_moddata_members)(Client *srv);
void (*broadcast_moddata_client)(Client *client);
int (*match_user)(char *rmask, Client *client, int options);
int (*match_user)(const char *rmask, Client *client, int options);
void (*userhost_changed)(Client *client);
void (*userhost_save_current)(Client *client);
void (*send_join_to_local_users)(Client *client, Channel *channel, MessageTag *mtags);
int (*do_nick_name)(char *nick);
int (*do_remote_nick_name)(char *nick);
char *(*charsys_get_current_languages)(void);
const char *(*charsys_get_current_languages)(void);
void (*broadcast_sinfo)(Client *client, Client *to, Client *except);
void (*connect_server)(ConfigItem_link *aconf, Client *by, struct hostent *hp);
void (*parse_message_tags)(Client *client, char **str, MessageTag **mtag_list);
char *(*mtags_to_string)(MessageTag *m, Client *client);
int (*can_send_to_channel)(Client *client, Channel *channel, char **msgtext, char **errmsg, int notice);
const char *(*mtags_to_string)(MessageTag *m, Client *client);
int (*can_send_to_channel)(Client *client, Channel *channel, const char **msgtext, const char **errmsg, int notice);
void (*broadcast_md_globalvar)(ModDataInfo *mdi, ModData *md);
void (*broadcast_md_globalvar_cmd)(Client *except, Client *sender, char *varname, char *value);
int (*tkl_ip_hash)(char *ip);
void (*broadcast_md_globalvar_cmd)(Client *except, Client *sender, const char *varname, const char *value);
int (*tkl_ip_hash)(const char *ip);
int (*tkl_ip_hash_type)(int type);
void (*sendnotice_tkl_del)(char *removed_by, TKL *tkl);
void (*sendnotice_tkl_del)(const char *removed_by, TKL *tkl);
void (*sendnotice_tkl_add)(TKL *tkl);
void (*free_tkl)(TKL *tkl);
TKL *(*find_tkl_serverban)(int type, char *usermask, char *hostmask, int softban);
TKL *(*find_tkl_banexception)(int type, char *usermask, char *hostmask, int softban);
TKL *(*find_tkl_nameban)(int type, char *name, int hold);
TKL *(*find_tkl_spamfilter)(int type, char *match_string, unsigned short action, unsigned short target);
TKL *(*find_tkl_serverban)(int type, const char *usermask, const char *hostmask, int softban);
TKL *(*find_tkl_banexception)(int type, const char *usermask, const char *hostmask, int softban);
TKL *(*find_tkl_nameban)(int type, const char *name, int hold);
TKL *(*find_tkl_spamfilter)(int type, const char *match_string, unsigned short action, unsigned short target);
int (*find_tkl_exception)(int ban_type, Client *client);
int (*is_silenced)(Client *client, Client *acptr);
int (*del_silence)(Client *client, const char *mask);
@ -120,9 +126,17 @@ int (*add_silence)(Client *client, const char *mask, int senderr);
void *(*labeled_response_save_context)(void);
void (*labeled_response_set_context)(void *ctx);
void (*labeled_response_force_end)(void);
void (*kick_user)(MessageTag *mtags, Channel *channel, Client *client, Client *victim, char *comment);
void (*kick_user)(MessageTag *mtags, Channel *channel, Client *client, Client *victim, const char *comment);
int (*watch_add)(const char *nick, Client *client, int flags);
int (*watch_del)(const char *nick, Client *client, int flags);
int (*watch_del_list)(Client *client, int flags);
Watch *(*watch_get)(const char *nick);
int (*watch_check)(Client *client, int reply, int (*watch_notify)(Client *client, Watch *watch, Link *lp, int event));
void (*do_unreal_log_remote_deliver)(LogLevel loglevel, const char *subsystem, const char *event_id, MultiLine *msg, const char *json_serialized);
char *(*get_chmodes_for_user)(Client *client, const char *flags);
WhoisConfigDetails (*whois_get_policy)(Client *client, Client *target, const char *name);
Efunction *EfunctionAddMain(Module *module, EfunctionType eftype, int (*func)(), void (*vfunc)(), void *(*pvfunc)(), char *(*cfunc)())
Efunction *EfunctionAddMain(Module *module, EfunctionType eftype, int (*func)(), void (*vfunc)(), void *(*pvfunc)(), char *(*stringfunc)(), const char *(*conststringfunc)())
{
Efunction *p;
@ -140,8 +154,10 @@ Efunction *EfunctionAddMain(Module *module, EfunctionType eftype, int (*func)(),
p->func.voidfunc = vfunc;
if (pvfunc)
p->func.pvoidfunc = pvfunc;
if (cfunc)
p->func.pcharfunc = cfunc;
if (stringfunc)
p->func.stringfunc = stringfunc;
if (conststringfunc)
p->func.conststringfunc = conststringfunc;
p->type = eftype;
p->owner = module;
AddListItem(p, Efunctions[eftype]);
@ -256,7 +272,9 @@ void efunctions_switchover(void)
continue;
if (!efunction_table[i].funcptr)
{
ircd_log(LOG_ERROR, "[BUG] efunctions_switchover(): someone forgot to initialize the function table for efunc %d", i);
unreal_log(ULOG_FATAL, "module", "BUG_EFUNCTIONS_SWITCHOVER", NULL,
"[BUG] efunctions_switchover(): someone forgot to initialize the function table for efunc $efunction_number",
log_data_integer("efunction_number", i));
abort();
}
*efunction_table[i].funcptr = e->func.voidfunc; /* This is the new one. */
@ -273,10 +291,19 @@ void efunctions_switchover(void)
}
}
#define efunc_init_function(what, func, default_func) efunc_init_function_(what, #func, (void *)&func, default_func)
#define efunc_init_function(what, func, default_func) efunc_init_function_(what, #func, (void *)&func, (void *)default_func)
void efunc_init_function_(EfunctionType what, char *name, void *func, void *default_func)
{
if (what >= MAXEFUNCTIONS)
{
/* increase MAXEFUNCTIONS if you ever encounter that --k4be */
unreal_log(ULOG_FATAL, "module", "BUG_EFUNC_INIT_FUNCTION_TOO_MANY", NULL,
"Too many efunctions! ($efunctions_request > $efunctions_max)",
log_data_integer("efunctions_request", what),
log_data_integer("efunctions_max", MAXEFUNCTIONS));
abort();
}
safe_strdup(efunction_table[what].name, name);
efunction_table[what].funcptr = func;
efunction_table[what].deffunc = default_func;
@ -290,6 +317,7 @@ void efunctions_init(void)
efunc_init_function(EFUNC_CAN_JOIN, can_join, NULL);
efunc_init_function(EFUNC_DO_MODE, do_mode, NULL);
efunc_init_function(EFUNC_SET_MODE, set_mode, NULL);
efunc_init_function(EFUNC_SET_CHANNEL_MODE, set_channel_mode, NULL);
efunc_init_function(EFUNC_CMD_UMODE, cmd_umode, NULL);
efunc_init_function(EFUNC_REGISTER_USER, register_user, NULL);
efunc_init_function(EFUNC_TKL_HASH, tkl_hash, NULL);
@ -327,6 +355,8 @@ void efunctions_init(void)
efunc_init_function(EFUNC_BROADCAST_MD_CHANNEL_CMD, broadcast_md_channel_cmd, NULL);
efunc_init_function(EFUNC_BROADCAST_MD_MEMBER_CMD, broadcast_md_member_cmd, NULL);
efunc_init_function(EFUNC_BROADCAST_MD_MEMBERSHIP_CMD, broadcast_md_membership_cmd, NULL);
efunc_init_function(EFUNC_MODDATA_ADD_S2S_MTAGS, moddata_add_s2s_mtags, NULL);
efunc_init_function(EFUNC_MODDATA_EXTRACT_S2S_MTAGS, moddata_extract_s2s_mtags, NULL);
efunc_init_function(EFUNC_SEND_MODDATA_CLIENT, send_moddata_client, NULL);
efunc_init_function(EFUNC_SEND_MODDATA_CHANNEL, send_moddata_channel, NULL);
efunc_init_function(EFUNC_SEND_MODDATA_MEMBERS, send_moddata_members, NULL);
@ -339,10 +369,12 @@ void efunctions_init(void)
efunc_init_function(EFUNC_DO_REMOTE_NICK_NAME, do_remote_nick_name, NULL);
efunc_init_function(EFUNC_CHARSYS_GET_CURRENT_LANGUAGES, charsys_get_current_languages, NULL);
efunc_init_function(EFUNC_BROADCAST_SINFO, broadcast_sinfo, NULL);
efunc_init_function(EFUNC_CONNECT_SERVER, connect_server, NULL);
efunc_init_function(EFUNC_PARSE_MESSAGE_TAGS, parse_message_tags, &parse_message_tags_default_handler);
efunc_init_function(EFUNC_MTAGS_TO_STRING, mtags_to_string, &mtags_to_string_default_handler);
efunc_init_function(EFUNC_TKL_CHARTOTYPE, tkl_chartotype, NULL);
efunc_init_function(EFUNC_TKL_TYPE_STRING, tkl_type_string, NULL);
efunc_init_function(EFUNC_TKL_TYPE_CONFIG_STRING, tkl_type_config_string, NULL);
efunc_init_function(EFUNC_CAN_SEND_TO_CHANNEL, can_send_to_channel, NULL);
efunc_init_function(EFUNC_BROADCAST_MD_GLOBALVAR, broadcast_md_globalvar, NULL);
efunc_init_function(EFUNC_BROADCAST_MD_GLOBALVAR_CMD, broadcast_md_globalvar_cmd, NULL);
@ -365,4 +397,13 @@ void efunctions_init(void)
efunc_init_function(EFUNC_LABELED_RESPONSE_SET_CONTEXT, labeled_response_set_context, labeled_response_set_context_default_handler);
efunc_init_function(EFUNC_LABELED_RESPONSE_FORCE_END, labeled_response_force_end, labeled_response_force_end_default_handler);
efunc_init_function(EFUNC_KICK_USER, kick_user, NULL);
efunc_init_function(EFUNC_WATCH_ADD, watch_add, NULL);
efunc_init_function(EFUNC_WATCH_DEL, watch_del, NULL);
efunc_init_function(EFUNC_WATCH_DEL_LIST, watch_del_list, NULL);
efunc_init_function(EFUNC_WATCH_GET, watch_get, NULL);
efunc_init_function(EFUNC_WATCH_CHECK, watch_check, NULL);
efunc_init_function(EFUNC_TKL_UHOST, tkl_uhost, NULL);
efunc_init_function(EFUNC_DO_UNREAL_LOG_REMOTE_DELIVER, do_unreal_log_remote_deliver, do_unreal_log_remote_deliver_default_handler);
efunc_init_function(EFUNC_GET_CHMODES_FOR_USER, get_chmodes_for_user, NULL);
efunc_init_function(EFUNC_WHOIS_GET_POLICY, whois_get_policy, NULL);
}

View File

@ -45,7 +45,7 @@ extern EVENT(unrealdb_expire_secret_cache);
* can be later, in case of high load, in very extreme cases even up to 1000 or 2000
* msec later but that would be very unusual. Just saying, it's not a guarantee..
*/
Event *EventAdd(Module *module, char *name, vFP event, void *data, long every_msec, int count)
Event *EventAdd(Module *module, const char *name, vFP event, void *data, long every_msec, int count)
{
Event *newevent;
@ -56,16 +56,6 @@ Event *EventAdd(Module *module, char *name, vFP event, void *data, long every_ms
return NULL;
}
if ((every_msec < 100) && (count == 0))
{
ircd_log(LOG_ERROR, "[BUG] EventAdd() '%s' from module '%s' with suspiciously low every_msec value (%ld). "
"Note that it is in milliseconds now (1000 = 1 second)!",
name,
module ? module->header->name : "???",
every_msec);
every_msec = 100;
}
newevent = safe_alloc(sizeof(Event));
safe_strdup(newevent->name, name);
newevent->count = count;
@ -128,12 +118,16 @@ static void EventDelReal(Event *e)
{
if (!e->deleted)
{
ircd_log(LOG_ERROR, "EventDelReal called while e->deleted is 0. This cannot happen. Event name: %s.", e->name);
unreal_log(ULOG_FATAL, "module", "BUG_EVENTDELREAL_ZERO", NULL,
"[BUG] EventDelReal called while e->deleted is 0. This cannot happen. Event name: $event_name",
log_data_string("event_name", e->name));
abort();
}
if (e->owner)
{
ircd_log(LOG_ERROR, "EventDelReal called while e->owner is non-NULL. This cannot happen. Event name: %s.", e->name);
unreal_log(ULOG_FATAL, "module", "BUG_EVENTDELREAL_NULL", NULL,
"[BUG] EventDelReal called while e->owner is NULL. This cannot happen. Event name: $event_name",
log_data_string("event_name", e->name));
abort();
}
safe_free(e->name);
@ -153,7 +147,7 @@ static void CleanupEvents(void)
}
}
Event *EventFind(char *name)
Event *EventFind(const char *name)
{
Event *eventptr;
@ -173,19 +167,7 @@ int EventMod(Event *event, EventInfo *mods)
}
if (mods->flags & EMOD_EVERY)
{
if (mods->every_msec < 100)
{
ircd_log(LOG_ERROR, "[BUG] EventMod() for '%s' from module '%s' with suspiciously low every_msec value (%lld). "
"Note that it is in milliseconds now (1000 = 1 second)!",
event->name,
event->owner ? event->owner->header->name : "???",
(long long)mods->every_msec);
mods->every_msec = 100;
}
event->every_msec = mods->every_msec;
}
if (mods->flags & EMOD_HOWMANY)
event->count = mods->count;
if (mods->flags & EMOD_NAME)
@ -240,7 +222,7 @@ void SetupEvents(void)
EventAdd(NULL, "check_pings", check_pings, NULL, 1000, 0);
EventAdd(NULL, "check_deadsockets", check_deadsockets, NULL, 1000, 0);
EventAdd(NULL, "handshake_timeout", handshake_timeout, NULL, 1000, 0);
EventAdd(NULL, "try_connections", try_connections, NULL, 2000, 0);
EventAdd(NULL, "tls_check_expiry", tls_check_expiry, NULL, (86400/2)*1000, 0);
EventAdd(NULL, "unrealdb_expire_secret_cache", unrealdb_expire_secret_cache, NULL, 61000, 0);
EventAdd(NULL, "throttling_check_expire", throttling_check_expire, NULL, 1000, 0);
}

View File

@ -22,144 +22,285 @@
#include "unrealircd.h"
Extban MODVAR ExtBan_Table[EXTBANTABLESZ]; /* this should be fastest */
unsigned MODVAR short ExtBan_highest = 0;
/** List of all extbans, their handlers, etc */
MODVAR Extban *extbans = NULL;
void set_isupport_extban(void)
{
int i;
char extbanstr[EXTBANTABLESZ+1], *m;
char extbanstr[512];
Extban *e;
char *p = extbanstr;
for (e = extbans; e; e = e->next)
*p++ = e->letter;
*p = '\0';
m = extbanstr;
for (i = 0; i <= ExtBan_highest; i++)
{
if (ExtBan_Table[i].flag)
*m++ = ExtBan_Table[i].flag;
}
*m = 0;
ISupportSetFmt(NULL, "EXTBAN", "~,%s", extbanstr);
}
Extban *findmod_by_bantype(char c)
Extban *findmod_by_bantype(const char *str, const char **remainder)
{
int i;
Extban *e;
int ban_name_length;
const char *p = strchr(str, ':');
for (i=0; i <= ExtBan_highest; i++)
if (ExtBan_Table[i].flag == c)
return &ExtBan_Table[i];
if (!p || !p[1])
{
if (remainder)
*remainder = NULL;
return NULL;
}
if (remainder)
*remainder = p+1;
ban_name_length = p - str - 1;
for (e=extbans; e; e = e->next)
{
if ((ban_name_length == 1) && (e->letter == str[1]))
return e;
if (e->name)
{
int namelen = strlen(e->name);
if ((namelen == ban_name_length) && !strncmp(e->name, str+1, namelen))
return e;
}
}
return NULL;
}
/* Check if this is a valid extended ban name */
int is_valid_extban_name(const char *p)
{
if (!*p)
return 0; /* empty name */
for (; *p; p++)
if (!isalnum(*p) && !strchr("_-", *p))
return 0;
return 1;
}
static void extban_add_sorted(Extban *n)
{
Extban *m;
if (extbans == NULL)
{
extbans = n;
return;
}
for (m = extbans; m; m = m->next)
{
if (m->letter == '\0')
abort();
if (sort_character_lowercase_before_uppercase(n->letter, m->letter))
{
/* Insert us before */
if (m->prev)
m->prev->next = n;
else
extbans = n; /* new head */
n->prev = m->prev;
n->next = m;
m->prev = n;
return;
}
if (!m->next)
{
/* Append us at end */
m->next = n;
n->prev = m;
return;
}
}
}
Extban *ExtbanAdd(Module *module, ExtbanInfo req)
{
int slot;
Extban *e;
int existing = 0;
if (findmod_by_bantype(req.flag))
if (!req.name)
{
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
/* TODO: perhaps some sanity checking on a-zA-Z0-9? */
for (slot = 0; slot < EXTBANTABLESZ; slot++)
if (ExtBan_Table[slot].flag == '\0')
break;
if (slot >= EXTBANTABLESZ - 1)
{
if (module)
module->errorcode = MODERR_NOSPACE;
module->errorcode = MODERR_INVALID;
unreal_log(ULOG_ERROR, "module", "EXTBANADD_API_ERROR", NULL,
"ExtbanAdd(): name must be specified for ban (new in U6). Module: $module_name",
log_data_string("module_name", module->header->name));
return NULL;
}
ExtBan_Table[slot].flag = req.flag;
ExtBan_Table[slot].is_ok = req.is_ok;
ExtBan_Table[slot].conv_param = req.conv_param;
ExtBan_Table[slot].is_banned = req.is_banned;
ExtBan_Table[slot].owner = module;
ExtBan_Table[slot].options = req.options;
if (!req.is_banned_events && req.is_banned)
{
module->errorcode = MODERR_INVALID;
unreal_log(ULOG_ERROR, "module", "EXTBANADD_API_ERROR", NULL,
"ExtbanAdd(): module must indicate via .is_banned_events on which BANCHK_* "
"events to listen on (new in U6). Module: $module_name",
log_data_string("module_name", module->header->name));
return NULL;
}
if (!isalnum(req.letter))
{
module->errorcode = MODERR_INVALID;
unreal_log(ULOG_ERROR, "module", "EXTBANADD_API_ERROR", NULL,
"ExtbanAdd(): module tried to add extban which is not alphanumeric. "
"Module: $module_name",
log_data_string("module_name", module->header->name));
return NULL;
}
if (!is_valid_extban_name(req.name))
{
module->errorcode = MODERR_INVALID;
unreal_log(ULOG_ERROR, "module", "EXTBANADD_API_ERROR", NULL,
"ExtbanAdd(): module tried to add extban with an invalid name ($extban_name). "
"Module: $module_name",
log_data_string("module_name", module->header->name),
log_data_string("extban_name", req.name));
return NULL;
}
for (e=extbans; e; e = e->next)
{
if (e->letter == req.letter)
{
if (e->unloaded)
{
e->unloaded = 0;
existing = 1;
break;
} else {
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
}
}
if (!e)
{
/* Not found, create */
e = safe_alloc(sizeof(Extban));
e->letter = req.letter;
extban_add_sorted(e);
}
e->letter = req.letter;
safe_strdup(e->name, req.name);
e->is_ok = req.is_ok;
e->conv_param = req.conv_param;
e->is_banned = req.is_banned;
e->is_banned_events = req.is_banned_events;
e->owner = module;
e->options = req.options;
if (module)
{
ModuleObject *banobj = safe_alloc(sizeof(ModuleObject));
banobj->object.extban = &ExtBan_Table[slot];
banobj->object.extban = e;
banobj->type = MOBJ_EXTBAN;
AddListItem(banobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
ExtBan_highest = slot;
set_isupport_extban();
return &ExtBan_Table[slot];
return e;
}
void ExtbanDel(Extban *eb)
static void unload_extban_commit(Extban *e)
{
/* Just zero it all away.. */
/* Should we mass unban everywhere?
* Hmmm. Not needed per se, user can always unset
* themselves. Leaning towards no atm.
*/
// noop
if (eb->owner)
/* Then unload the extban */
DelListItem(e, extbans);
safe_free(e);
set_isupport_extban();
}
void ExtbanDel(Extban *e)
{
/* Always free the module object */
if (e->owner)
{
ModuleObject *banobj;
for (banobj = eb->owner->objects; banobj; banobj = banobj->next)
for (banobj = e->owner->objects; banobj; banobj = banobj->next)
{
if (banobj->type == MOBJ_EXTBAN && banobj->object.extban == eb)
if (banobj->type == MOBJ_EXTBAN && banobj->object.extban == e)
{
DelListItem(banobj, eb->owner->objects);
DelListItem(banobj, e->owner->objects);
safe_free(banobj);
break;
}
}
}
memset(eb, 0, sizeof(Extban));
set_isupport_extban();
/* Hmm do we want to go trough all chans and remove the bans?
* I would say 'no' because perhaps we are just reloading,
* and else.. well... screw them?
*/
}
/* NOTE: the routines below can safely assume the ban has at
* least the '~t:' part (t=type). -- Syzop
*/
/* Whether we can actually (already) free the Extban, it depends... */
if (loop.rehashing)
e->unloaded = 1;
else
unload_extban_commit(e);
}
/** General is_ok for n!u@h stuff that also deals with recursive extbans.
*/
int extban_is_ok_nuh_extban(Client *client, Channel* channel, char *para, int checkt, int what, int what2)
int extban_is_ok_nuh_extban(BanContext *b)
{
char *mask = (para + 3);
Extban *p = NULL;
int isok;
static int extban_is_ok_recursion = 0;
/* Mostly copied from clean_ban_mask - but note MyUser checks aren't needed here: extban->is_ok() according to cmd_mode isn't called for nonlocal. */
if (is_extended_ban(mask))
if (is_extended_ban(b->banstr))
{
if (extban_is_ok_recursion)
return 0; /* Fail: more than one stacked extban */
const char *nextbanstr;
Extban *extban = NULL;
if ((checkt == EXBCHK_PARAM) && RESTRICT_EXTENDEDBANS && !ValidatePermissionsForPath("immune:restrict-extendedbans",client,NULL,channel,NULL))
/* We're dealing with a stacked extended ban.
* Rules:
* 1) You can only stack once, so: ~x:~y:something and not ~x:~y:~z...
* 2) The second item may never be an action modifier, nor have the
* EXTBOPT_NOSTACKCHILD letter set (for things like a textban).
*/
if (extban_is_ok_recursion)
return 0; /* Rule #1 violation (more than one stacked extban) */
if ((b->is_ok_check == EXBCHK_PARAM) && RESTRICT_EXTENDEDBANS && !ValidatePermissionsForPath("immune:restrict-extendedbans",b->client,NULL,b->channel,NULL))
{
/* Test if this specific extban has been disabled.
* (We can be sure RESTRICT_EXTENDEDBANS is not *. Else this extended ban wouldn't be happening at all.)
*/
if (strchr(RESTRICT_EXTENDEDBANS, mask[1]))
if (strchr(RESTRICT_EXTENDEDBANS, b->banstr[1]))
{
sendnotice(client, "Setting/removing of extended bantypes '%s' has been disabled.", RESTRICT_EXTENDEDBANS);
sendnotice(b->client, "Setting/removing of extended bantypes '%s' has been disabled.", RESTRICT_EXTENDEDBANS);
return 0; /* Fail */
}
}
p = findmod_by_bantype(mask[1]);
if (!p)
extban = findmod_by_bantype(b->banstr, &nextbanstr);
if (!extban)
{
if (what == MODE_DEL)
if (b->what == MODE_DEL)
{
return 1; /* Always allow killing unknowns. */
}
return 0; /* Don't add unknown extbans. */
}
/* Now we have to ask the stacked extban if it's ok. */
if (p->is_ok)
if ((extban->options & EXTBOPT_ACTMODIFIER) || (extban->options & EXTBOPT_NOSTACKCHILD))
{
/* Rule #2 violation */
return 0;
}
/* Now we have to ask the stacked extban if it's ok. */
if (extban->is_ok)
{
b->banstr = nextbanstr;
extban_is_ok_recursion++;
isok = p->is_ok(client, channel, mask, checkt, what, what2);
isok = extban->is_ok(b);
extban_is_ok_recursion--;
return isok;
}
@ -171,19 +312,15 @@ int extban_is_ok_nuh_extban(Client *client, Channel* channel, char *para, int ch
* to ensure the parameter is nick!user@host.
* most of the code is just copied from clean_ban_mask.
*/
char *extban_conv_param_nuh(char *para)
const char *extban_conv_param_nuh(BanContext *b, Extban *extban)
{
char *cp, *user, *host, *mask, *ret = NULL;
static char retbuf[USERLEN + NICKLEN + HOSTLEN + 32];
char tmpbuf[USERLEN + NICKLEN + HOSTLEN + 32];
char pfix[8];
if (strlen(para)<3)
return NULL; /* normally impossible */
strlcpy(tmpbuf, para, sizeof(retbuf));
mask = tmpbuf + 3;
strlcpy(pfix, tmpbuf, mask - tmpbuf + 1);
/* Work on a copy */
strlcpy(tmpbuf, b->banstr, sizeof(retbuf));
mask = tmpbuf;
if (!*mask)
return NULL; /* empty extban */
@ -202,13 +339,13 @@ char *extban_conv_param_nuh(char *para)
if (!ret)
ret = make_nick_user_host(trim_str(cp,NICKLEN), trim_str(user,USERLEN), trim_str(host,HOSTLEN));
ircsnprintf(retbuf, sizeof(retbuf), "%s%s", pfix, ret);
strlcpy(retbuf, ret, sizeof(retbuf));
return retbuf;
}
/** conv_param to deal with stacked extbans.
*/
char *extban_conv_param_nuh_or_extban(char *para)
const char *extban_conv_param_nuh_or_extban(BanContext *b, Extban *self_extban)
{
#if (USERLEN + NICKLEN + HOSTLEN + 32) > 256
#error "wtf?"
@ -217,83 +354,77 @@ char *extban_conv_param_nuh_or_extban(char *para)
static char printbuf[256];
char *mask;
char tmpbuf[USERLEN + NICKLEN + HOSTLEN + 32];
char bantype = para[1];
char *ret = NULL;
Extban *p = NULL;
const char *ret = NULL;
const char *nextbanstr;
Extban *extban = NULL;
static int extban_recursion = 0;
if ((strlen(para)>3) && is_extended_ban(para+3))
{
/* We're dealing with a stacked extended ban.
* Rules:
* 1) You can only stack once, so: ~x:~y:something and not ~x:~y:~z...
* 2) The first item must be an action modifier, such as ~q/~n/~j
* 3) The second item may never be an action modifier, nor have the
* EXTBOPT_NOSTACKCHILD flag set (for things like a textban).
*/
/* Rule #1. Yes the recursion check is also in extban_is_ok_nuh_extban,
* but it's possible to get here without the is_ok() function ever
* being called (think: non-local client). And no, don't delete it
* there either. It needs to be in BOTH places. -- Syzop
*/
if (extban_recursion)
return NULL;
if (!is_extended_ban(b->banstr))
return extban_conv_param_nuh(b, self_extban);
/* Rule #2 */
p = findmod_by_bantype(para[1]);
if (p && !(p->options & EXTBOPT_ACTMODIFIER))
{
/* Rule #2 violation */
return NULL;
}
strlcpy(tmpbuf, para, sizeof(tmpbuf));
mask = tmpbuf + 3;
/* Already did restrict-extended bans check. */
p = findmod_by_bantype(mask[1]);
if (!p)
{
/* Handling unknown bantypes in is_ok. Assume that it's ok here. */
return para;
}
if ((p->options & EXTBOPT_ACTMODIFIER) || (p->options & EXTBOPT_NOSTACKCHILD))
{
/* Rule #3 violation */
return NULL;
}
if (p->conv_param)
{
extban_recursion++;
ret = p->conv_param(mask);
extban_recursion--;
if (ret)
{
/*
* If bans are stacked, then we have to use two buffers
* to prevent ircsnprintf() from going into a loop.
*/
ircsnprintf(printbuf, sizeof(printbuf), "~%c:%s", bantype, ret); /* Make sure our extban prefix sticks. */
memcpy(retbuf, printbuf, sizeof(retbuf));
return retbuf;
}
else
{
return NULL; /* Fail. */
}
}
/* I honestly don't know what the deal is with the 80 char cap in clean_ban_mask is about. So I'm leaving it out here. -- aquanight */
/* I don't know why it's 80, but I like a limit anyway. A ban of 500 characters can never be good... -- Syzop */
if (strlen(para) > 80)
{
strlcpy(retbuf, para, 128);
return retbuf;
}
return para;
}
else
/* We're dealing with a stacked extended ban.
* Rules:
* 1) You can only stack once, so: ~x:~y:something and not ~x:~y:~z...
* 2) The second item may never be an action modifier, nor have the
* EXTBOPT_NOSTACKCHILD letter set (for things like a textban).
*/
/* Rule #1. Yes the recursion check is also in extban_is_ok_nuh_extban,
* but it's possible to get here without the is_ok() function ever
* being called (think: non-local client). And no, don't delete it
* there either. It needs to be in BOTH places. -- Syzop
*/
if (extban_recursion)
return NULL;
strlcpy(tmpbuf, b->banstr, sizeof(tmpbuf));
extban = findmod_by_bantype(tmpbuf, &nextbanstr);
if (!extban)
{
return extban_conv_param_nuh(para);
/* Handling unknown bantypes in is_ok. Assume that it's ok here. */
return b->banstr;
}
b->banstr = nextbanstr;
if ((extban->options & EXTBOPT_ACTMODIFIER) || (extban->options & EXTBOPT_NOSTACKCHILD))
{
/* Rule #2 violation */
return NULL;
}
if (extban->conv_param)
{
//BanContext *b = safe_alloc(sizeof(BanContext));
//b->banstr = mask; <-- this is redundant right? we can use existing 'b' context??
extban_recursion++;
ret = extban->conv_param(b, extban);
extban_recursion--;
ret = prefix_with_extban(ret, b, extban, retbuf, sizeof(retbuf));
//safe_free(b);
return ret;
}
/* I honestly don't know what the deal is with the 80 char cap in clean_ban_mask is about. So I'm leaving it out here. -- aquanight */
/* I don't know why it's 80, but I like a limit anyway. A ban of 500 characters can never be good... -- Syzop */
if (strlen(b->banstr) > 80)
{
strlcpy(retbuf, b->banstr, 128);
return retbuf;
}
return b->banstr;
}
char *prefix_with_extban(const char *remainder, BanContext *b, Extban *extban, char *buf, size_t buflen)
{
/* Yes, we support this because it makes code at the caller cleaner */
if (remainder == NULL)
return NULL;
if (iConf.named_extended_bans && !(b->conv_options & BCTX_CONV_OPTION_WRITE_LETTER_BANS))
snprintf(buf, buflen, "~%s:%s", extban->name, remainder);
else
snprintf(buf, buflen, "~%c:%s", extban->letter, remainder);
return buf;
}

View File

@ -60,13 +60,15 @@ HistoryBackend *HistoryBackendAdd(Module *module, HistoryBackendInfo *mreq)
{
HistoryBackend *m;
int exists = 0;
ModuleObject *mobj;
if (!mreq->history_add || !mreq->history_request ||
!mreq->history_destroy || !mreq->history_set_limit)
{
if (module)
module->errorcode = MODERR_INVALID;
ircd_log(LOG_ERROR, "HistoryBackendAdd(): missing a handler for add/del/request/destroy/set_limit");
module->errorcode = MODERR_INVALID;
unreal_log(ULOG_ERROR, "module", "HISTORYBACKENDADD_API_ERROR", NULL,
"HistoryBackendAdd(): missing a handler for add/del/request/destroy/set_limit. Module: $module_name",
log_data_string("module_name", module->header->name));
return NULL;
}
m = HistoryBackendFind(mreq->name);
@ -77,8 +79,7 @@ HistoryBackend *HistoryBackendAdd(Module *module, HistoryBackendInfo *mreq)
{
m->unloaded = 0;
} else {
if (module)
module->errorcode = MODERR_EXISTS;
module->errorcode = MODERR_EXISTS;
return NULL;
}
} else {
@ -97,14 +98,11 @@ HistoryBackend *HistoryBackendAdd(Module *module, HistoryBackendInfo *mreq)
if (!exists)
AddListItem(m, historybackends);
if (module)
{
ModuleObject *mobj = safe_alloc(sizeof(ModuleObject));
mobj->type = MOBJ_HISTORY_BACKEND;
mobj->object.history_backend = m;
AddListItem(mobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
mobj = safe_alloc(sizeof(ModuleObject));
mobj->type = MOBJ_HISTORY_BACKEND;
mobj->object.history_backend = m;
AddListItem(mobj, module->objects);
module->errorcode = MODERR_NOERROR;
return m;
}
@ -138,7 +136,7 @@ void HistoryBackendDel(HistoryBackend *m)
m->owner = NULL;
}
if (loop.ircd_rehashing)
if (loop.rehashing)
m->unloaded = 1;
else
unload_history_backend_commit(m);
@ -156,7 +154,7 @@ void unload_all_unused_history_backends(void)
}
}
int history_add(char *object, MessageTag *mtags, char *line)
int history_add(const char *object, MessageTag *mtags, const char *line)
{
HistoryBackend *hb;
@ -166,7 +164,7 @@ int history_add(char *object, MessageTag *mtags, char *line)
return 1;
}
HistoryResult *history_request(char *object, HistoryFilter *filter)
HistoryResult *history_request(const char *object, HistoryFilter *filter)
{
HistoryBackend *hb = historybackends;
HistoryResult *r;
@ -183,7 +181,7 @@ HistoryResult *history_request(char *object, HistoryFilter *filter)
return NULL;
}
int history_destroy(char *object)
int history_destroy(const char *object)
{
HistoryBackend *hb;
@ -193,7 +191,7 @@ int history_destroy(char *object)
return 1;
}
int history_set_limit(char *object, int max_lines, long max_t)
int history_set_limit(const char *object, int max_lines, long max_t)
{
HistoryBackend *hb;
@ -230,7 +228,7 @@ int can_receive_history(Client *client)
return 0;
}
static void history_send_result_line(Client *client, HistoryLogLine *l, char *batchid)
static void history_send_result_line(Client *client, HistoryLogLine *l, const char *batchid)
{
if (BadPtr(batchid))
{
@ -238,9 +236,10 @@ static void history_send_result_line(Client *client, HistoryLogLine *l, char *ba
} else {
MessageTag *m = safe_alloc(sizeof(MessageTag));
m->name = "batch";
m->value = batchid;
m->value = strdup(batchid);
AddListItem(m, l->mtags);
sendto_one(client, l->mtags, "%s", l->line);
safe_free(m->value);
DelListItem(m, l->mtags);
safe_free(m);
}

View File

@ -86,18 +86,12 @@ void isupport_init(void)
{
ISupportSet(NULL, "INVEX", NULL);
ISupportSet(NULL, "EXCEPTS", NULL);
#ifdef PREFIX_AQ
ISupportSet(NULL, "STATUSMSG", "~&@%+");
#else
ISupportSet(NULL, "STATUSMSG", "@%+");
#endif
ISupportSet(NULL, "ELIST", "MNUCT");
ISupportSet(NULL, "CASEMAPPING", "ascii");
ISupportSet(NULL, "NETWORK", ircnet005);
ISupportSet(NULL, "NETWORK", NETWORK_NAME_005);
ISupportSetFmt(NULL, "CHANMODES",
CHPAR1 "%s," CHPAR2 "%s," CHPAR3 "%s," CHPAR4 "%s",
CHPAR1 "%s,%s,%s,%s",
EXPAR1, EXPAR2, EXPAR3, EXPAR4);
ISupportSet(NULL, "PREFIX", CHPFIX);
ISupportSet(NULL, "CHANTYPES", "#");
ISupportSetFmt(NULL, "MODES", "%d", MAXMODEPARAMS);
ISupportSetFmt(NULL, "SILENCE", "%d", SILENCE_LIMIT);
@ -118,7 +112,6 @@ void isupport_init(void)
ISupportSetFmt(NULL, "MAXLIST", "b:%d,e:%d,I:%d", MAXBANS, MAXBANS, MAXBANS);
ISupportSetFmt(NULL, "CHANLIMIT", "#:%d", MAXCHANNELSPERUSER);
ISupportSetFmt(NULL, "MAXCHANNELS", "%d", MAXCHANNELSPERUSER);
ISupportSet(NULL, "HCN", NULL);
ISupportSet(NULL, "SAFELIST", NULL);
ISupportSet(NULL, "NAMESX", NULL);
if (UHNAMES_ENABLED)

View File

@ -52,15 +52,21 @@ MessageTagHandler *MessageTagHandlerAdd(Module *module, MessageTagHandlerInfo *m
/* Some consistency checks to avoid a headache for module devs later on: */
if ((mreq->flags & MTAG_HANDLER_FLAGS_NO_CAP_NEEDED) && mreq->clicap_handler)
{
ircd_log(LOG_ERROR, "MessageTagHandlerAdd(): .flags is set to MTAG_HANDLER_FLAGS_NO_CAP_NEEDED "
"but a .clicap_handler is passed as well. These options are mutually "
"exclusive, choose one or the other.");
unreal_log(ULOG_ERROR, "module", "MESSAGETAGHANDLERADD_API_ERROR", NULL,
"MessageTagHandlerAdd() from module $module_name: "
".flags is set to MTAG_HANDLER_FLAGS_NO_CAP_NEEDED "
"but a .clicap_handler is passed as well. These options are mutually "
"exclusive, choose one or the other.",
log_data_string("module_name", module->header->name));
abort();
} else if (!(mreq->flags & MTAG_HANDLER_FLAGS_NO_CAP_NEEDED) && !mreq->clicap_handler)
{
ircd_log(LOG_ERROR, "MessageTagHandlerAdd(): no .clicap_handler is passed. If the "
"message tag really does not require a cap then you must "
"set .flags to MTAG_HANDLER_FLAGS_NO_CAP_NEEDED");
unreal_log(ULOG_ERROR, "module", "MESSAGETAGHANDLERADD_API_ERROR", NULL,
"MessageTagHandlerAdd() from module $module_name: "
"no .clicap_handler is passed. If the "
"message tag really does not require a cap then you must "
"set .flags to MTAG_HANDLER_FLAGS_NO_CAP_NEEDED",
log_data_string("module_name", module->header->name));
abort();
}
@ -85,7 +91,7 @@ MessageTagHandler *MessageTagHandlerAdd(Module *module, MessageTagHandlerInfo *m
m->owner = module;
m->flags = mreq->flags;
m->is_ok = mreq->is_ok;
m->can_send = mreq->can_send;
m->should_send_to_client = mreq->should_send_to_client;
m->clicap_handler = mreq->clicap_handler;
/* Update reverse dependency (if any) */
@ -141,7 +147,7 @@ void MessageTagHandlerDel(MessageTagHandler *m)
m->owner = NULL;
}
if (loop.ircd_rehashing)
if (loop.rehashing)
m->unloaded = 1;
else
unload_mtag_handler_commit(m);
@ -152,8 +158,9 @@ void MessageTagHandlerDel(MessageTagHandler *m)
static void unload_mtag_handler_commit(MessageTagHandler *m)
{
/* This is an unusual operation, I think we should log it. */
ircd_log(LOG_ERROR, "Unloading message-tag handler for '%s'", m->name);
sendto_realops("Unloading message-tag handler for '%s'", m->name);
unreal_log(ULOG_INFO, "module", "UNLOAD_MESSAGE_TAG", NULL,
"Unloading message-tag handler for '$token'",
log_data_string("token", m->name));
/* Remove reverse dependency, if any */
if (m->clicap_handler)

View File

@ -65,6 +65,8 @@ ModDataInfo *ModDataAdd(Module *module, ModDataInfo req)
((req.type == MODDATATYPE_MEMBER) && (slotav >= MODDATA_MAX_MEMBER)) ||
((req.type == MODDATATYPE_MEMBERSHIP) && (slotav >= MODDATA_MAX_MEMBERSHIP)))
{
unreal_log(ULOG_ERROR, "module", "MOD_DATA_OUT_OF_SPACE", NULL,
"ModDataAdd: out of space!!!");
if (module)
module->errorcode = MODERR_NOSPACE;
return NULL;
@ -80,6 +82,8 @@ moddataadd_isok:
m->serialize = req.serialize;
m->unserialize = req.unserialize;
m->sync = req.sync;
m->remote_write = req.remote_write;
m->self_write = req.self_write;
m->owner = module;
if (new_struct)
@ -272,7 +276,7 @@ void ModDataDel(ModDataInfo *md)
md->owner = NULL;
}
if (loop.ircd_rehashing)
if (loop.rehashing)
md->unloaded = 1;
else
unload_moddata_commit(md);
@ -290,7 +294,7 @@ ModDataInfo *md, *md_next;
}
}
ModDataInfo *findmoddata_byname(char *name, ModDataType type)
ModDataInfo *findmoddata_byname(const char *name, ModDataType type)
{
ModDataInfo *md;
@ -313,7 +317,7 @@ int module_has_moddata(Module *mod)
}
/** Set ModData for client (via variable name, string value) */
int moddata_client_set(Client *client, char *varname, char *value)
int moddata_client_set(Client *client, const char *varname, const char *value)
{
ModDataInfo *md;
@ -344,7 +348,7 @@ int moddata_client_set(Client *client, char *varname, char *value)
}
/** Get ModData for client (via variable name) */
char *moddata_client_get(Client *client, char *varname)
const char *moddata_client_get(Client *client, const char *varname)
{
ModDataInfo *md;
@ -356,8 +360,21 @@ char *moddata_client_get(Client *client, char *varname)
return md->serialize(&moddata_client(client, md)); /* can be NULL */
}
/** Get ModData for client (via variable name) */
ModData *moddata_client_get_raw(Client *client, const char *varname)
{
ModDataInfo *md;
md = findmoddata_byname(varname, MODDATATYPE_CLIENT);
if (!md)
return NULL;
return &moddata_client(client, md); /* can be NULL */
}
/** Set ModData for LocalClient (via variable name, string value) */
int moddata_local_client_set(Client *client, char *varname, char *value)
int moddata_local_client_set(Client *client, const char *varname, const char *value)
{
ModDataInfo *md;
@ -391,7 +408,7 @@ int moddata_local_client_set(Client *client, char *varname, char *value)
}
/** Get ModData for LocalClient (via variable name) */
char *moddata_local_client_get(Client *client, char *varname)
const char *moddata_local_client_get(Client *client, const char *varname)
{
ModDataInfo *md;
@ -407,7 +424,7 @@ char *moddata_local_client_get(Client *client, char *varname)
}
/** Set local variable moddata (via variable name, string value) */
int moddata_local_variable_set(char *varname, char *value)
int moddata_local_variable_set(const char *varname, const char *value)
{
ModDataInfo *md;
@ -432,7 +449,7 @@ int moddata_local_variable_set(char *varname, char *value)
}
/** Set global variable moddata (via variable name, string value) */
int moddata_global_variable_set(char *varname, char *value)
int moddata_global_variable_set(const char *varname, const char *value)
{
ModDataInfo *md;

View File

@ -24,16 +24,11 @@
char umodestring[UMODETABLESZ+1];
Umode *Usermode_Table = NULL;
short Usermode_highest = 0;
/** User modes and their handlers */
Umode *usermodes = NULL;
Snomask *Snomask_Table = NULL;
short Snomask_highest = 0;
/* client->umodes (32 bits): 26 used, 6 free */
long UMODE_INVISIBLE = 0L; /* makes user invisible */
long UMODE_OPER = 0L; /* Operator */
long UMODE_WALLOP = 0L; /* send wallops to them */
long UMODE_REGNICK = 0L; /* Nick set by services as registered */
long UMODE_SERVNOTICE = 0L; /* server notices such as kill */
long UMODE_HIDE = 0L; /* Hide from Nukes */
@ -63,32 +58,13 @@ long SendUmodes; /* All umodes which are sent to other servers (global umodes) *
/* Forward declarations */
int umode_hidle_allow(Client *client, int what);
static void unload_usermode_commit(Umode *m);
void umode_init(void)
void umode_init(void)
{
long val = 1;
int i;
Usermode_Table = safe_alloc(sizeof(Umode) * UMODETABLESZ);
for (i = 0; i < UMODETABLESZ; i++)
{
Usermode_Table[i].mode = val;
val *= 2;
}
Usermode_highest = 0;
Snomask_Table = safe_alloc(sizeof(Snomask) * UMODETABLESZ);
val = 1;
for (i = 0; i < UMODETABLESZ; i++)
{
Snomask_Table[i].mode = val;
val *= 2;
}
Snomask_highest = 0;
/* Set up modes */
/* Some built-in modes */
UmodeAdd(NULL, 'i', UMODE_GLOBAL, 0, umode_allow_all, &UMODE_INVISIBLE);
UmodeAdd(NULL, 'o', UMODE_GLOBAL, 1, umode_allow_opers, &UMODE_OPER);
UmodeAdd(NULL, 'w', UMODE_GLOBAL, 0, umode_allow_all, &UMODE_WALLOP);
UmodeAdd(NULL, 'r', UMODE_GLOBAL, 0, umode_allow_none, &UMODE_REGNICK);
UmodeAdd(NULL, 's', UMODE_LOCAL, 0, umode_allow_all, &UMODE_SERVNOTICE);
UmodeAdd(NULL, 'x', UMODE_GLOBAL, 0, umode_allow_all, &UMODE_HIDE);
@ -97,34 +73,17 @@ void umode_init(void)
UmodeAdd(NULL, 'H', UMODE_GLOBAL, 1, umode_allow_opers, &UMODE_HIDEOPER);
UmodeAdd(NULL, 't', UMODE_GLOBAL, 0, umode_allow_unset, &UMODE_SETHOST);
UmodeAdd(NULL, 'I', UMODE_GLOBAL, 0, umode_hidle_allow, &UMODE_HIDLE);
SnomaskAdd(NULL, 'k', umode_allow_opers, &SNO_KILLS);
SnomaskAdd(NULL, 'c', umode_allow_opers, &SNO_CLIENT);
SnomaskAdd(NULL, 'f', umode_allow_opers, &SNO_FLOOD);
SnomaskAdd(NULL, 'F', umode_allow_opers, &SNO_FCLIENT);
SnomaskAdd(NULL, 'j', umode_allow_opers, &SNO_JUNK);
SnomaskAdd(NULL, 'v', umode_allow_opers, &SNO_VHOST);
SnomaskAdd(NULL, 'e', umode_allow_opers, &SNO_EYES);
SnomaskAdd(NULL, 'G', umode_allow_opers, &SNO_TKL);
SnomaskAdd(NULL, 'n', umode_allow_opers, &SNO_NICKCHANGE);
SnomaskAdd(NULL, 'N', umode_allow_opers, &SNO_FNICKCHANGE);
SnomaskAdd(NULL, 'q', umode_allow_opers, &SNO_QLINE);
SnomaskAdd(NULL, 'S', umode_allow_opers, &SNO_SPAMF);
SnomaskAdd(NULL, 's', umode_allow_opers, &SNO_SNOTICE);
SnomaskAdd(NULL, 'o', umode_allow_opers, &SNO_OPER);
}
void make_umodestr(void)
{
int i;
char *m;
Umode *um;
char *p = umodestring;
m = umodestring;
for (i = 0; i <= Usermode_highest; i++)
{
if (Usermode_Table[i].flag)
*m++ = Usermode_Table[i].flag;
}
*m = '\0';
for (um=usermodes; um; um = um->next)
if (um->letter)
*p++ = um->letter;
*p = '\0';
}
static char previous_umodestring[256];
@ -132,7 +91,7 @@ static char previous_umodestring[256];
void umodes_check_for_changes(void)
{
make_umodestr();
safe_strdup(me.serv->features.usermodes, umodestring);
safe_strdup(me.server->features.usermodes, umodestring);
if (!*previous_umodestring)
{
@ -142,10 +101,10 @@ void umodes_check_for_changes(void)
if (*previous_umodestring && strcmp(umodestring, previous_umodestring))
{
ircd_log(LOG_ERROR, "User modes changed at runtime: %s -> %s",
previous_umodestring, umodestring);
sendto_realops("User modes changed at runtime: %s -> %s",
previous_umodestring, umodestring);
unreal_log(ULOG_INFO, "mode", "USER_MODES_CHANGED", NULL,
"User modes changed at runtime: $old_user_modes -> $new_user_modes",
log_data_string("old_user_modes", previous_umodestring),
log_data_string("new_user_modes", umodestring));
/* Broadcast change to all (locally connected) servers */
sendto_server(NULL, 0, 0, NULL, "PROTOCTL USERMODES=%s", umodestring);
}
@ -153,102 +112,134 @@ void umodes_check_for_changes(void)
strlcpy(previous_umodestring, umodestring, sizeof(previous_umodestring));
}
void usermode_add_sorted(Umode *n)
{
Umode *m;
if (usermodes == NULL)
{
usermodes = n;
return;
}
for (m = usermodes; m; m = m->next)
{
if (m->letter == '\0')
abort();
if (sort_character_lowercase_before_uppercase(n->letter, m->letter))
{
/* Insert us before */
if (m->prev)
m->prev->next = n;
else
usermodes = n; /* new head */
n->prev = m->prev;
n->next = m;
m->prev = n;
return;
}
if (!m->next)
{
/* Append us at end */
m->next = n;
n->prev = m;
return;
}
}
}
/* UmodeAdd:
* Add a usermode with character 'ch', if global is set to 1 the usermode is global
* (sent to other servers) otherwise it's a local usermode
*/
Umode *UmodeAdd(Module *module, char ch, int global, int unset_on_deoper, int (*allowed)(Client *client, int what), long *mode)
{
short i = 0;
short j = 0;
short save = -1;
while (i < UMODETABLESZ)
Umode *um;
int existing = 0;
for (um=usermodes; um; um = um->next)
{
if (!Usermode_Table[i].flag && save == -1)
save = i;
else if (Usermode_Table[i].flag == ch)
if (um->letter == ch)
{
if (Usermode_Table[i].unloaded)
if (um->unloaded)
{
save = i;
Usermode_Table[i].unloaded = 0;
um->unloaded = 0;
existing = 1;
break;
}
else
{
} else {
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
}
i++;
}
i = save;
if (i != UMODETABLESZ)
if (!um)
{
Usermode_Table[i].flag = ch;
Usermode_Table[i].allowed = allowed;
Usermode_Table[i].unset_on_deoper = unset_on_deoper;
Debug((DEBUG_DEBUG, "UmodeAdd(%c) returning %04lx",
ch, Usermode_Table[i].mode));
/* Update usermode table highest */
for (j = 0; j < UMODETABLESZ; j++)
if (Usermode_Table[i].flag)
if (i > Usermode_highest)
Usermode_highest = i;
make_umodestr();
AllUmodes |= Usermode_Table[i].mode;
if (global)
SendUmodes |= Usermode_Table[i].mode;
*mode = Usermode_Table[i].mode;
Usermode_Table[i].owner = module;
if (module)
/* Not found, create */
long l, found = 0;
for (l = 1; l < LONG_MAX/2; l *= 2)
{
ModuleObject *umodeobj = safe_alloc(sizeof(ModuleObject));
umodeobj->object.umode = &(Usermode_Table[i]);
umodeobj->type = MOBJ_UMODE;
AddListItem(umodeobj, module->objects);
module->errorcode = MODERR_NOERROR;
found = 0;
for (um=usermodes; um; um = um->next)
{
if (um->mode == l)
{
found = 1;
break;
}
}
if (!found)
break;
}
return &(Usermode_Table[i]);
/* If 'found' is still true, then we are out of space */
if (found)
{
unreal_log(ULOG_ERROR, "module", "USER_MODE_OUT_OF_SPACE", NULL,
"UmodeAdd: out of space!!!");
if (module)
module->errorcode = MODERR_NOSPACE;
return NULL;
}
um = safe_alloc(sizeof(Umode));
um->letter = ch;
um->mode = l;
usermode_add_sorted(um);
}
else
um->letter = ch;
um->allowed = allowed;
um->unset_on_deoper = unset_on_deoper;
make_umodestr();
AllUmodes |= um->mode;
if (global)
SendUmodes |= um->mode;
*mode = um->mode;
um->owner = module;
if (module)
{
Debug((DEBUG_DEBUG, "UmodeAdd failed, no space"));
if (module)
module->errorcode = MODERR_NOSPACE;
return NULL;
ModuleObject *umodeobj = safe_alloc(sizeof(ModuleObject));
umodeobj->object.umode = um;
umodeobj->type = MOBJ_UMODE;
AddListItem(umodeobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
return um;
}
void UmodeDel(Umode *umode)
{
if (loop.ircd_rehashing)
umode->unloaded = 1;
else
/* Always free the module object */
if (umode->owner)
{
Client *client;
list_for_each_entry(client, &client_list, client_node)
{
long oldumode = 0;
if (!IsUser(client))
continue;
oldumode = client->umodes;
client->umodes &= ~umode->mode;
if (MyUser(client))
send_umode_out(client, 1, oldumode);
}
umode->flag = '\0';
AllUmodes &= ~(umode->mode);
SendUmodes &= ~(umode->mode);
make_umodestr();
}
if (umode->owner) {
ModuleObject *umodeobj;
for (umodeobj = umode->owner->objects; umodeobj; umodeobj = umodeobj->next) {
if (umodeobj->type == MOBJ_UMODE && umodeobj->object.umode == umode) {
for (umodeobj = umode->owner->objects; umodeobj; umodeobj = umodeobj->next)
{
if (umodeobj->type == MOBJ_UMODE && umodeobj->object.umode == umode)
{
DelListItem(umodeobj, umode->owner->objects);
safe_free(umodeobj);
break;
@ -256,100 +247,13 @@ void UmodeDel(Umode *umode)
}
umode->owner = NULL;
}
return;
}
Snomask *SnomaskAdd(Module *module, char ch, int (*allowed)(Client *client, int what), long *mode)
{
short i = 0;
short j = 0;
short save = -1;
while (i < UMODETABLESZ)
{
if (!Snomask_Table[i].flag && save == -1)
save = i;
else if (Snomask_Table[i].flag == ch)
{
if (Snomask_Table[i].unloaded)
{
save = i;
Snomask_Table[i].unloaded = 0;
break;
}
else
{
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
}
i++;
}
i = save;
if (i != UMODETABLESZ)
{
Snomask_Table[i].flag = ch;
Snomask_Table[i].allowed = allowed;
/* Update usermode table highest */
for (j = 0; j < UMODETABLESZ; j++)
if (Snomask_Table[i].flag)
if (i > Snomask_highest)
Snomask_highest = i;
*mode = Snomask_Table[i].mode;
Snomask_Table[i].owner = module;
if (module)
{
ModuleObject *snoobj = safe_alloc(sizeof(ModuleObject));
snoobj->object.snomask = &(Snomask_Table[i]);
snoobj->type = MOBJ_SNOMASK;
AddListItem(snoobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
return &(Snomask_Table[i]);
}
/* Whether we can actually (already) free the Umode depends... */
if (loop.rehashing)
umode->unloaded = 1;
else
{
Debug((DEBUG_DEBUG, "SnomaskAdd failed, no space"));
*mode = 0;
if (module)
module->errorcode = MODERR_NOSPACE;
return NULL;
}
}
void SnomaskDel(Snomask *sno)
{
if (loop.ircd_rehashing)
sno->unloaded = 1;
else
{
Client *client;
list_for_each_entry(client, &lclient_list, lclient_node)
{
long oldsno;
if (!client || !IsUser(client))
continue;
oldsno = client->user->snomask;
client->user->snomask &= ~sno->mode;
if (oldsno != client->user->snomask)
sendnumeric(client, RPL_SNOMASK, get_snomask_string_raw(client->user->snomask));
}
sno->flag = '\0';
}
if (sno->owner) {
ModuleObject *snoobj;
for (snoobj = sno->owner->objects; snoobj; snoobj = snoobj->next) {
if (snoobj->type == MOBJ_SNOMASK && snoobj->object.snomask == sno) {
DelListItem(snoobj, sno->owner->objects);
safe_free(snoobj);
break;
}
}
sno->owner = NULL;
}
return;
unload_usermode_commit(umode);
}
int umode_allow_all(Client *client, int what)
@ -392,68 +296,42 @@ int umode_hidle_allow(Client *client, int what)
return 0; /* if set::hide-idle-time is 'never' or 'always' then +I makes no sense */
}
void unload_all_unused_umodes(void)
static void unload_usermode_commit(Umode *um)
{
long removed_umode = 0;
int i;
Client *client;
for (i = 0; i < UMODETABLESZ; i++)
{
if (Usermode_Table[i].unloaded)
removed_umode |= Usermode_Table[i].mode;
}
if (!removed_umode) /* Nothing was unloaded */
long removed_umode;
if (!um)
return;
removed_umode = um->mode;
/* First send the -mode regarding all users */
list_for_each_entry(client, &lclient_list, lclient_node)
{
long oldumode = 0;
if (!IsUser(client))
continue;
oldumode = client->umodes;
client->umodes &= ~(removed_umode);
if (MyUser(client))
send_umode_out(client, 1, oldumode);
}
for (i = 0; i < UMODETABLESZ; i++)
{
if (Usermode_Table[i].unloaded)
if (MyUser(client) && (client->umodes & removed_umode))
{
AllUmodes &= ~(Usermode_Table[i].mode);
SendUmodes &= ~(Usermode_Table[i].mode);
Usermode_Table[i].flag = '\0';
Usermode_Table[i].unloaded = 0;
long oldumode = client->umodes;
client->umodes &= ~(removed_umode);
send_umode_out(client, 1, oldumode);
}
}
/* Then unload the mode */
DelListItem(um, usermodes);
safe_free(um);
make_umodestr();
}
void unload_all_unused_snomasks(void)
void unload_all_unused_umodes(void)
{
Client *client;
long removed_sno = 0;
int i;
Umode *um, *um_next;
for (i = 0; i < UMODETABLESZ; i++)
for (um=usermodes; um; um = um_next)
{
if (Snomask_Table[i].unloaded)
{
removed_sno |= Snomask_Table[i].mode;
Snomask_Table[i].flag = '\0';
Snomask_Table[i].unloaded = 0;
}
}
if (!removed_sno) /* Nothing was unloaded */
return;
list_for_each_entry(client, &lclient_list, lclient_node)
{
long oldsno;
if (!client || !IsUser(client))
continue;
oldsno = client->user->snomask;
client->user->snomask &= ~(removed_sno);
if (oldsno != client->user->snomask)
sendnumeric(client, RPL_SNOMASK, get_snomask_string_raw(client->user->snomask));
um_next = um->next;
if (um->letter && um->unloaded)
unload_usermode_commit(um);
}
}
@ -463,25 +341,24 @@ void unload_all_unused_snomasks(void)
* This used to be a bit more complex but nowadays we just erase all
* snomasks since all of them are IRCOp-only. Easy.
*/
void remove_oper_snomasks(Client *client)
void remove_all_snomasks(Client *client)
{
client->user->snomask = 0;
safe_free(client->user->snomask);
client->umodes &= ~UMODE_SERVNOTICE;
}
/*
* This function removes any oper-only user modes from the user.
* You may also want to call remove_oper_snomasks(), see above.
* You may also want to call remove_all_snomasks(), see above.
*/
void remove_oper_modes(Client *client)
{
int i;
Umode *um;
for (i = 0; i <= Usermode_highest; i++)
for (um = usermodes; um; um = um->next)
{
if (!Usermode_Table[i].flag)
continue;
if (Usermode_Table[i].unset_on_deoper)
client->umodes &= ~Usermode_Table[i].mode;
if (um->unset_on_deoper)
client->umodes &= ~um->mode;
}
/* Bit of a hack, since this is a dynamic permission umode */
@ -493,7 +370,7 @@ void remove_oper_privileges(Client *client, int broadcast_mode_change)
{
long oldumodes = client->umodes;
remove_oper_modes(client);
remove_oper_snomasks(client);
remove_all_snomasks(client);
if (broadcast_mode_change && (client->umodes != oldumodes))
send_umode_out(client, 1, oldumodes);
if (MyUser(client)) /* only do if it's our client, remote servers will send a SWHOIS cmd */
@ -501,15 +378,14 @@ void remove_oper_privileges(Client *client, int broadcast_mode_change)
}
/** Return long integer mode for a user mode character (eg: 'x' -> 0x10) */
long find_user_mode(char flag)
long find_user_mode(char letter)
{
int i;
Umode *um;
for (um = usermodes; um; um = um->next)
if ((um->letter == letter) && !um->unloaded)
return um->mode;
for (i = 0; i < UMODETABLESZ; i++)
{
if ((Usermode_Table[i].flag == flag) && !(Usermode_Table[i].unloaded))
return Usermode_Table[i].mode;
}
return 0;
}

View File

@ -46,10 +46,10 @@ AuthTypeList MODVAR AuthTypeLists[] = {
};
/* Helper function for Auth_AutoDetectHashType() */
static int parsepass(char *str, char **salt, char **hash)
static int parsepass(const char *str, char **salt, char **hash)
{
static char saltbuf[512], hashbuf[512];
char *p;
const char *p;
int max;
/* Syntax: $<salt>$<hash> */
@ -72,7 +72,7 @@ static int parsepass(char *str, char **salt, char **hash)
/** Auto detect hash type for input hash 'hash'.
* Will fallback to AUTHTYPE_PLAINTEXT when not found (or invalid).
*/
int Auth_AutoDetectHashType(char *hash)
int Auth_AutoDetectHashType(const char *hash)
{
static char hashbuf[256];
char *saltstr, *hashstr;
@ -80,12 +80,12 @@ int Auth_AutoDetectHashType(char *hash)
if (!strchr(hash, '$'))
{
/* SHA256 SSL fingerprint perhaps?
/* SHA256 certificate fingerprint perhaps?
* These are exactly 64 bytes (00112233..etc..) or 95 bytes (00:11:22:33:etc) in size.
*/
if ((strlen(hash) == 64) || (strlen(hash) == 95))
{
char *p;
const char *p;
char *hexchars = "0123456789abcdefABCDEF";
for (p = hash; *p; p++)
if ((*p != ':') && !strchr(hexchars, *p))
@ -96,7 +96,7 @@ int Auth_AutoDetectHashType(char *hash)
if (strlen(hash) == 44)
{
char *p;
const char *p;
char *b64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
for (p = hash; *p; p++)
if (!strchr(b64chars, *p))
@ -134,7 +134,7 @@ int Auth_AutoDetectHashType(char *hash)
* than trying to determine the type on the 'hash' parameter.
* Or leave NULL, then we use hash autodetection.
*/
AuthenticationType Auth_FindType(char *hash, char *type)
AuthenticationType Auth_FindType(const char *hash, const char *type)
{
if (type)
{
@ -163,25 +163,25 @@ int Auth_CheckError(ConfigEntry *ce)
AuthenticationType type = AUTHTYPE_PLAINTEXT;
X509 *x509_filecert = NULL;
FILE *x509_f = NULL;
if (!ce->ce_vardata)
if (!ce->value)
{
config_error("%s:%i: authentication module failure: missing parameter",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
ce->file->filename, ce->line_number);
return -1;
}
if (ce->ce_entries && ce->ce_entries->ce_next)
if (ce->items && ce->items->next)
{
config_error("%s:%i: you may not have multiple authentication methods",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
ce->file->filename, ce->line_number);
return -1;
}
type = Auth_FindType(ce->ce_vardata, ce->ce_entries ? ce->ce_entries->ce_varname : NULL);
type = Auth_FindType(ce->value, ce->items ? ce->items->name : NULL);
if (type == -1)
{
config_error("%s:%i: authentication module failure: %s is not an implemented/enabled authentication method",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
ce->ce_entries->ce_varname);
ce->file->filename, ce->line_number,
ce->items->name);
return -1;
}
@ -189,19 +189,19 @@ int Auth_CheckError(ConfigEntry *ce)
{
case AUTHTYPE_UNIXCRYPT:
/* If our data is like 1 or none, we just let em through .. */
if (strlen(ce->ce_vardata) < 2)
if (strlen(ce->value) < 2)
{
config_error("%s:%i: authentication module failure: AUTHTYPE_UNIXCRYPT: no salt (crypt strings will always be >2 in length)",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
ce->file->filename, ce->line_number);
return -1;
}
break;
case AUTHTYPE_TLS_CLIENTCERT:
convert_to_absolute_path(&ce->ce_vardata, CONFDIR);
if (!(x509_f = fopen(ce->ce_vardata, "r")))
convert_to_absolute_path(&ce->value, CONFDIR);
if (!(x509_f = fopen(ce->value, "r")))
{
config_error("%s:%i: authentication module failure: AUTHTYPE_TLS_CLIENTCERT: error opening file %s: %s",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata, strerror(errno));
ce->file->filename, ce->line_number, ce->value, strerror(errno));
return -1;
}
x509_filecert = PEM_read_X509(x509_f, NULL, NULL, NULL);
@ -209,7 +209,7 @@ int Auth_CheckError(ConfigEntry *ce)
if (!x509_filecert)
{
config_error("%s:%i: authentication module failure: AUTHTYPE_TLS_CLIENTCERT: PEM_read_X509 errored in file %s (format error?)",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata);
ce->file->filename, ce->line_number, ce->value);
return -1;
}
X509_free(x509_filecert);
@ -226,19 +226,19 @@ int Auth_CheckError(ConfigEntry *ce)
* with normally at least 5000 rounds (unless deliberately weakened
* by the user).
*/
if ((type == AUTHTYPE_UNIXCRYPT) && strncmp(ce->ce_vardata, "$5", 2) &&
strncmp(ce->ce_vardata, "$6", 2) && !strstr(ce->ce_vardata, "$rounds"))
if ((type == AUTHTYPE_UNIXCRYPT) && strncmp(ce->value, "$5", 2) &&
strncmp(ce->value, "$6", 2) && !strstr(ce->value, "$rounds"))
{
config_warn("%s:%i: Using simple crypt for authentication is not recommended. "
"Consider using the more secure auth-type 'argon2' instead. "
"See https://www.unrealircd.org/docs/Authentication_types for the complete list.",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
ce->file->filename, ce->line_number);
/* do not return, not an error. */
}
if ((type == AUTHTYPE_PLAINTEXT) && (strlen(ce->ce_vardata) > PASSWDLEN))
if ((type == AUTHTYPE_PLAINTEXT) && (strlen(ce->value) > PASSWDLEN))
{
config_error("%s:%i: passwords length may not exceed %d",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, PASSWDLEN);
ce->file->filename, ce->line_number, PASSWDLEN);
return -1;
}
return 1;
@ -252,12 +252,12 @@ AuthConfig *AuthBlockToAuthConfig(ConfigEntry *ce)
AuthenticationType type = AUTHTYPE_PLAINTEXT;
AuthConfig *as = NULL;
type = Auth_FindType(ce->ce_vardata, ce->ce_entries ? ce->ce_entries->ce_varname : NULL);
type = Auth_FindType(ce->value, ce->items ? ce->items->name : NULL);
if (type == AUTHTYPE_INVALID)
type = AUTHTYPE_PLAINTEXT;
as = safe_alloc(sizeof(AuthConfig));
safe_strdup(as->data, ce->ce_vardata);
safe_strdup(as->data, ce->value);
as->type = type;
return as;
}
@ -279,7 +279,7 @@ void Auth_FreeAuthConfig(AuthConfig *as)
#define RAWSALTLEN 6
#define REALSALTLEN 12
static int authcheck_argon2(Client *client, AuthConfig *as, char *para)
static int authcheck_argon2(Client *client, AuthConfig *as, const char *para)
{
argon2_type hashtype;
@ -304,7 +304,7 @@ static int authcheck_argon2(Client *client, AuthConfig *as, char *para)
return 0; /* NO MATCH or error */
}
static int authcheck_bcrypt(Client *client, AuthConfig *as, char *para)
static int authcheck_bcrypt(Client *client, AuthConfig *as, const char *para)
{
char data[512]; /* NOTE: only 64 required by BF_crypt() */
char *str;
@ -324,7 +324,7 @@ static int authcheck_bcrypt(Client *client, AuthConfig *as, char *para)
return 0; /* NO MATCH */
}
static int authcheck_tls_clientcert(Client *client, AuthConfig *as, char *para)
static int authcheck_tls_clientcert(Client *client, AuthConfig *as, const char *para)
{
X509 *x509_clientcert = NULL;
X509 *x509_filecert = NULL;
@ -358,11 +358,11 @@ static int authcheck_tls_clientcert(Client *client, AuthConfig *as, char *para)
return 1;
}
static int authcheck_tls_clientcert_fingerprint(Client *client, AuthConfig *as, char *para)
static int authcheck_tls_clientcert_fingerprint(Client *client, AuthConfig *as, const char *para)
{
int i, k;
char hexcolon[EVP_MAX_MD_SIZE * 3 + 1];
char *fp;
const char *fp;
if (!client->local->ssl)
return 0;
@ -389,12 +389,12 @@ static int authcheck_tls_clientcert_fingerprint(Client *client, AuthConfig *as,
return 1;
}
static int authcheck_spkifp(Client *client, AuthConfig *as, char *para)
static int authcheck_spkifp(Client *client, AuthConfig *as, const char *para)
{
char *fp = spki_fingerprint(client);
const char *fp = spki_fingerprint(client);
if (!fp)
return 0; /* auth failed: not SSL (or other failure) */
return 0; /* auth failed: not TLS or some other failure */
if (strcasecmp(as->data, fp))
return 0; /* auth failed: mismatch */
@ -420,7 +420,7 @@ static int authcheck_spkifp(Client *client, AuthConfig *as, char *para)
* - The return value was different in versions before UnrealIRCd 5.0.0!
* - In older versions a NULL 'as' was treated as an allow, now it's deny.
*/
int Auth_Check(Client *client, AuthConfig *as, char *para)
int Auth_Check(Client *client, AuthConfig *as, const char *para)
{
extern char *crypt();
char *res;
@ -435,8 +435,9 @@ int Auth_Check(Client *client, AuthConfig *as, char *para)
return 0;
if (!strcmp(as->data, "changemeplease") && !strcmp(para, as->data))
{
sendto_realops("Rejecting default password 'changemeplease'. "
"Please change the password in the configuration file.");
unreal_log(ULOG_INFO, "auth", "AUTH_REJECT_DEFAULT_PASSWORD", client,
"Rejecting default password 'changemeplease'. "
"Please change the password in the configuration file.");
return 0;
}
/* plain text compare */
@ -479,7 +480,7 @@ int Auth_Check(Client *client, AuthConfig *as, char *para)
#define UNREALIRCD_ARGON2_DEFAULT_HASH_LENGTH 32
#define UNREALIRCD_ARGON2_DEFAULT_SALT_LENGTH (128/8)
static char *mkpass_argon2(char *para)
static char *mkpass_argon2(const char *para)
{
static char buf[512];
char salt[UNREALIRCD_ARGON2_DEFAULT_SALT_LENGTH];
@ -511,7 +512,7 @@ static char *mkpass_argon2(char *para)
return buf;
}
static char *mkpass_bcrypt(char *para)
static char *mkpass_bcrypt(const char *para)
{
static char buf[128];
char data[512]; /* NOTE: only 64 required by BF_crypt() */
@ -547,7 +548,7 @@ static char *mkpass_bcrypt(char *para)
* @param text The password in plaintext.
* @returns The hashed password.
*/
char *Auth_Hash(AuthenticationType type, char *text)
const char *Auth_Hash(AuthenticationType type, const char *text)
{
switch (type)
{

View File

@ -1,4 +1,5 @@
#!/bin/sh
MAKE="$1"
echo ""
echo "Checking for updates for third party modules..."
# We can't use the "unrealircd" script, since possibly the ircd
@ -13,7 +14,7 @@ if [ "$x" != "*.c" ]; then
x="`echo $x|sed 's/\.c//'`"
if [ ! -f $x.so -o $x.c -nt $x.so ]; then
echo "Building 3rd party module $x..."
make custommodule MODULEFILE=$x || (echo "*****"; echo "Building 3rd party module $x failed."; echo "Contact the module author of the $x module (not the UnrealIRCd team), or simply delete the $PWD/$x.c file"; echo "*****"; exit 1)
$MAKE custommodule MODULEFILE=$x || (echo "*****"; echo "Building 3rd party module $x failed."; echo "Contact the module author of the $x module (not the UnrealIRCd team), or simply delete the $PWD/$x.c file"; echo "*****"; exit 1)
fi
fi
done

File diff suppressed because it is too large Load Diff

6120
src/conf.c

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ static inline int ValidVarCharacter(char x)
return 0;
}
PreprocessorItem evaluate_preprocessor_if(char *statement, char *filename, int linenumber, ConditionalConfig **cc_out)
PreprocessorItem evaluate_preprocessor_if(char *statement, const char *filename, int linenumber, ConditionalConfig **cc_out)
{
char *p=statement, *name;
int negative = 0;
@ -176,7 +176,7 @@ PreprocessorItem evaluate_preprocessor_if(char *statement, char *filename, int l
return PREPROCESSOR_ERROR;
}
PreprocessorItem evaluate_preprocessor_define(char *statement, char *filename, int linenumber)
PreprocessorItem evaluate_preprocessor_define(char *statement, const char *filename, int linenumber)
{
char *p = statement;
char *name, *name_terminator;
@ -246,7 +246,7 @@ PreprocessorItem evaluate_preprocessor_define(char *statement, char *filename,
return PREPROCESSOR_DEFINE;
}
PreprocessorItem parse_preprocessor_item(char *start, char *end, char *filename, int linenumber, ConditionalConfig **cc)
PreprocessorItem parse_preprocessor_item(char *start, char *end, const char *filename, int linenumber, ConditionalConfig **cc)
{
char buf[512];
int max;
@ -262,7 +262,7 @@ PreprocessorItem parse_preprocessor_item(char *start, char *end, char *filename
return evaluate_preprocessor_define(buf+7, filename, linenumber);
else if (!strncmp(buf, "@if ", 4))
return evaluate_preprocessor_if(buf+4, filename, linenumber, cc);
else if (!strcmp(buf, "@endif"))
else if (!strncmp(buf, "@endif", 6))
return PREPROCESSOR_ENDIF;
config_error("%s:%i: Unknown preprocessor directive: %s", filename, linenumber, buf);
@ -382,29 +382,29 @@ int preprocessor_resolve_if(ConditionalConfig *cc, PreprocessorPhase phase)
void preprocessor_resolve_conditionals_ce(ConfigEntry **ce_list, PreprocessorPhase phase)
{
ConfigEntry *ce, *ce_next, *ce_prev;
ConfigEntry *ce, *next, *ce_prev;
ConfigEntry *cep, *cep_next, *cep_prev;
ce_prev = NULL;
for (ce = *ce_list; ce; ce = ce_next)
for (ce = *ce_list; ce; ce = next)
{
ce_next = ce->ce_next;
next = ce->next;
/* This is for an @if before a block start */
if (!preprocessor_resolve_if(ce->ce_cond, phase))
if (!preprocessor_resolve_if(ce->conditional_config, phase))
{
/* Delete this entry */
if (ce == *ce_list)
{
/* we are head, so new head */
*ce_list = ce->ce_next; /* can be NULL now */
*ce_list = ce->next; /* can be NULL now */
} else {
/* non-head */
ce_prev->ce_next = ce->ce_next; /* can be NULL now */
ce_prev->next = ce->next; /* can be NULL now */
}
config_entry_free(ce);
continue;
}
preprocessor_resolve_conditionals_ce(&ce->ce_entries, phase);
preprocessor_resolve_conditionals_ce(&ce->items, phase);
ce_prev = ce;
}
}
@ -413,8 +413,8 @@ void preprocessor_resolve_conditionals_all(PreprocessorPhase phase)
{
ConfigFile *cfptr;
for (cfptr = conf; cfptr; cfptr = cfptr->cf_next)
preprocessor_resolve_conditionals_ce(&cfptr->cf_entries, phase);
for (cfptr = conf; cfptr; cfptr = cfptr->next)
preprocessor_resolve_conditionals_ce(&cfptr->items, phase);
}
/** Frees the list of config_defines, so all @defines */
@ -502,7 +502,7 @@ void preprocessor_replace_defines(char **item, ConfigEntry *ce)
if ((limit > 2) && ((*varend == '\0') || strchr("\t ,.", *varend)))
{
config_warn("%s:%d: Variable %s used here but there's no @define for it earlier.",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, varname);
ce->file->filename, ce->line_number, varname);
}
#endif
value = varname; /* not found? then use varname, including the '$' */

View File

@ -109,7 +109,7 @@ char *find_best_asan_log(void)
}
}
closedir(fd);
return BadPtr(best_fname) ? NULL : best_fname;
return *best_fname ? best_fname : NULL;
#else
return NULL;
#endif
@ -531,7 +531,7 @@ char *generate_crash_report(char *coredump, int *thirdpartymods)
#define CRASH_REPORT_HOST "crash.unrealircd.org"
SSL_CTX *crashreport_init_ssl(void)
SSL_CTX *crashreport_init_tls(void)
{
SSL_CTX *ctx_client;
char buf[512];
@ -587,7 +587,7 @@ int crashreport_send(char *fname)
delimiter);
snprintf(footer, sizeof(footer), "\r\n--%s--\r\n", delimiter);
ctx_client = crashreport_init_ssl();
ctx_client = crashreport_init_tls();
if (!ctx_client)
{
printf("ERROR: TLS initalization failure (I)\n");

View File

@ -186,7 +186,7 @@ int crule_via(int numargs, void *crulearg[])
{
if (!match_simple((char *)crulearg[1], client->name))
continue;
if (!match_simple((char *)crulearg[0], client->serv->up))
if (!match_simple((char *)crulearg[0], client->uplink->name))
continue;
return (1);
}
@ -372,11 +372,6 @@ char *crule_parse(char *rule)
}
if (ruleroot != NULL)
crule_free((char **)&ruleroot);
#if !defined(CR_DEBUG) && !defined(CR_CHKCONF)
Debug((DEBUG_ERROR, "%s in rule: %s", crule_errstr[errcode], rule));
#else
(void)fprintf(stderr, "%s in rule: %s\n", crule_errstr[errcode], rule);
#endif
return NULL;
}

View File

@ -61,7 +61,7 @@ void dbuf_queue_init(dbuf *dyn)
INIT_LIST_HEAD(&dyn->dbuf_list);
}
void dbuf_put(dbuf *dyn, char *buf, size_t length)
void dbuf_put(dbuf *dyn, const char *buf, size_t length)
{
struct dbufbuf *block;
size_t amount;

View File

@ -48,9 +48,6 @@ MODVAR char serveropts[] = {
'Y',
#endif
'6',
#ifdef USE_SSL
'e',
#endif
#ifndef NO_OPEROVERRIDE
'O',
#endif
@ -150,11 +147,16 @@ void debug(int level, FORMAT_STRING(const char *form), ...)
SET_ERRNO(err);
}
int checkprotoflags(Client *client, int flags, char *file, int line)
int checkprotoflags(Client *client, int flags, const char *file, int line)
{
if (!MyConnect(client))
ircd_log(LOG_ERROR, "[Debug] [BUG] ERROR: %s:%d: IsToken(<%s>,%d) on remote client",
file, line, client->name, flags);
{
unreal_log(ULOG_ERROR, "main", "BUG_ISTOKEN_REMOTE_CLIENT", client,
"IsToken($token_value) used on remote client in $file:$line",
log_data_integer("token_value", flags),
log_data_string("file", file),
log_data_integer("line", line));
}
return ((client->local->proto & flags) == flags) ? 1 : 0;
}
#endif

View File

@ -39,6 +39,11 @@
#include <sys/ioctl.h>
#endif
/* Not sure if this is suitable for production,
* but let's turn it on for U6 development.
*/
//#define DETECT_HIGH_CPU
/***************************************************************************************
* Backend-independent functions. fd_setselect() and friends *
***************************************************************************************/
@ -47,14 +52,18 @@ void fd_setselect(int fd, int flags, IOCallbackFunc iocb, void *data)
FDEntry *fde;
int changed = 0;
#if 0
ircd_log(LOG_ERROR, "fd_setselect(): fd %d flags %d func %p", fd, flags, &iocb);
unreal_log(ULOG_DEBUG, "io", "IO_DEBUG_FD_SETSELECT", NULL,
"fd_setselect(): fd $fd flags $fd_flags function $function_pointer",
log_data_integer("fd", fd),
log_data_integer("fd_flags", flags),
log_data_integer("function_pointer", (long long)iocb));
#endif
if ((fd < 0) || (fd >= MAXCONNECTIONS))
{
sendto_realops("[BUG] trying to modify fd #%d in fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
ircd_log(LOG_ERROR, "[BUG] trying to modify fd #%d in fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
unreal_log(ULOG_ERROR, "io", "BUG_FD_SETSELECT_OUT_OF_RANGE", NULL,
"[BUG] trying to modify fd $fd in fd table, but MAXCONNECTIONS is $maxconnections",
log_data_integer("fd", fd),
log_data_integer("maxconnections", MAXCONNECTIONS));
#ifdef DEBUGMODE
abort();
#endif
@ -143,7 +152,11 @@ void fd_debug(fd_set *f, int highest, char *name)
//if (fcntl(i, F_GETFL) < 0)
int nonb = 1;
if (ioctlsocket(i, FIONBIO, &nonb) < 0)
ircd_log(LOG_ERROR, "fd_debug: FD #%d is invalid!!!", i);
{
unreal_log(ULOG_ERROR, "io", "FD_DEBUG", NULL,
"[BUG] fd_debug: fd $fd is invalid!!!",
log_data_integer("fd", i));
}
}
}
}
@ -168,10 +181,6 @@ void fd_select(time_t delay)
to.tv_sec = delay / 1000;
to.tv_usec = (delay % 1000) * 1000;
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "fd_select() on 0-%d...", highest_fd+1);
#endif
#ifdef _WIN32
num = select(highest_fd + 1, &work_read_fds, &work_write_fds, &work_except_fds, &to);
#else
@ -179,8 +188,9 @@ void fd_select(time_t delay)
#endif
if (num < 0)
{
extern void report_baderror(char *text, Client *client);
report_baderror("select %s:%s", &me);
unreal_log(ULOG_FATAL, "io", "SELECT_ERROR", NULL,
"select() returned error ($socket_error) -- SERIOUS TROUBLE!",
log_data_socket_error(-1));
/* DEBUG the actual problem: */
memcpy(&work_read_fds, &read_fds, sizeof(fd_set));
memcpy(&work_write_fds, &write_fds, sizeof(fd_set));
@ -204,10 +214,6 @@ void fd_select(time_t delay)
if (!fde->is_open)
continue;
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "fd_select(): checking %d...", fd);
#endif
if (FD_ISSET(fd, &work_read_fds))
evflags |= FD_SELECT_READ;
@ -223,10 +229,6 @@ void fd_select(time_t delay)
if (!evflags)
continue;
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "fd_select(): events for %d (%d)... processing...", fd, evflags);
#endif
if (evflags & FD_SELECT_READ)
{
iocb = fde->read_callback;
@ -280,7 +282,9 @@ void fd_fork()
continue;
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "[BUG?] kevent returned %d", errno);
unreal_log(ULOG_ERROR, "io", "KEVENT_FAILED", NULL,
"[io] fd_fork(): kevent returned error: $system_error",
log_data_string("system_error", strerror(errno)));
#endif
}
}
@ -308,8 +312,13 @@ void fd_refresh(int fd)
#ifdef DEBUGMODE
if (ERRNO != P_EWOULDBLOCK && ERRNO != P_EAGAIN)
{
ircd_log(LOG_ERROR, "[BUG?] fd_refresh(): kevent returned %d for fd %d for read callback (%s)",
errno, fd, (fde->read_callback ? "add" : "delete"));
int save_err = errno;
unreal_log(ULOG_ERROR, "io", "KEVENT_FAILED_REFRESH", NULL,
"fd_refresh(): kevent returned error for fd $fd ($fd_action) ($callback): $system_error",
log_data_string("system_error", strerror(save_err)),
log_data_integer("fd", fd),
log_data_string("fd_action", (fde->read_callback ? "add" : "delete")),
log_data_string("callback", "read_callback"));
}
#endif
}
@ -323,8 +332,13 @@ void fd_refresh(int fd)
#ifdef DEBUGMODE
if (ERRNO != P_EWOULDBLOCK && ERRNO != P_EAGAIN && fde->write_callback)
{
ircd_log(LOG_ERROR, "[BUG?] fd_refresh(): kevent returned %d for fd %d for write callback (%s)",
errno, fd, "add" /*(fde->write_callback ? "add" : "delete")*/);
int save_err = errno;
unreal_log(ULOG_ERROR, "io", "KEVENT_FAILED_REFRESH", NULL,
"[io] fd_refresh(): kevent returned error for fd $fd ($fd_action) ($callback): $system_error",
log_data_string("system_error", strerror(save_err)),
log_data_integer("fd", fd),
log_data_string("fd_action", "add"),
log_data_string("callback", "write_callback"));
}
#endif
}
@ -440,11 +454,15 @@ void fd_refresh(int fd)
if (epoll_ctl(epoll_fd, op, fd, &ep_event) != 0)
{
if (ERRNO == P_EWOULDBLOCK || ERRNO == P_EAGAIN)
int save_errno = errno;
if ((save_errno == P_EWOULDBLOCK) || (save_errno == P_EAGAIN))
return;
ircd_log(LOG_ERROR, "[BUG] fd_refresh(): epoll_ctl returned error %d (%s) for fd %d (%s)",
errno, STRERROR(ERRNO), fd, fde->desc);
unreal_log(ULOG_ERROR, "io", "EPOLL_CTL_FAILED", NULL,
"[io] fd_refresh(): epoll_ctl returned error for fd $fd ($fd_description): $system_error",
log_data_string("system_error", strerror(save_errno)),
log_data_integer("fd", fd),
log_data_string("fd_description", fde->desc));
return;
}
@ -455,7 +473,7 @@ void fd_select(time_t delay)
{
int num, p, revents, fd;
struct epoll_event *epfd;
#ifdef DEBUG_IOENGINE
#ifdef DETECT_HIGH_CPU
int read_callbacks = 0, write_callbacks = 0;
struct timeval oldt, t;
long long tdiff;
@ -467,7 +485,7 @@ void fd_select(time_t delay)
if (num <= 0)
return;
#ifdef DEBUG_IOENGINE
#ifdef DETECT_HIGH_CPU
gettimeofday(&oldt, NULL);
#endif
@ -499,7 +517,7 @@ void fd_select(time_t delay)
if (iocb != NULL)
iocb(fd, evflags, fde->data);
#ifdef DEBUG_IOENGINE
#ifdef DETECT_HIGH_CPU
read_callbacks++;
#endif
}
@ -511,7 +529,7 @@ void fd_select(time_t delay)
if (iocb != NULL)
iocb(fd, evflags, fde->data);
#ifdef DEBUG_IOENGINE
#ifdef DETECT_HIGH_CPU
write_callbacks++;
#endif
}
@ -524,14 +542,18 @@ void fd_select(time_t delay)
#endif
}
#ifdef DEBUG_IOENGINE
#ifdef DETECT_HIGH_CPU
gettimeofday(&t, NULL);
tdiff = ((t.tv_sec - oldt.tv_sec) * 1000000) + (t.tv_usec - oldt.tv_usec);
if (tdiff > 1000000)
{
sendto_realops_and_log("WARNING: Slow I/O engine or high load: fd_select() took %lld ms! read_callbacks=%d, write_callbacks=%d",
tdiff / 1000, read_callbacks, write_callbacks);
unreal_log(ULOG_WARNING, "io", "HIGH_LOAD", NULL,
"HIGH CPU LOAD! fd_select() took $time_msec msec "
"(read: $num_read_callbacks, write: $num_write_callbacks)",
log_data_integer("time_msec", tdiff/1000),
log_data_integer("num_read_callbacks", read_callbacks),
log_data_integer("num_write_callbacks", write_callbacks));
}
#endif
}
@ -601,7 +623,7 @@ void fd_select(time_t delay)
pfd = &pollfds[p];
revents = pfd->revents;
fd = pfd->local->fd;
fd = pfd->fd;
if (revents == 0 || fd == -1)
continue;

105
src/dns.c
View File

@ -40,9 +40,9 @@ void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct ho
void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct hostent *he);
void unrealdns_delasyncconnects(void);
static uint64_t unrealdns_hash_ip(const char *ip);
static void unrealdns_addtocache(char *name, char *ip);
static char *unrealdns_findcache_ip(char *ip);
struct hostent *unreal_create_hostent(char *name, char *ip);
static void unrealdns_addtocache(const char *name, const char *ip);
static const char *unrealdns_findcache_ip(const char *ip);
struct hostent *unreal_create_hostent(const char *name, const char *ip);
static void unrealdns_freeandremovereq(DNSReq *r);
void unrealdns_removecacherecord(DNSCache *c);
@ -87,10 +87,7 @@ static void unrealdns_sock_state_cb(void *data, ares_socket_t fd, int read, int
if (!read && !write)
{
/* Socket is going to be closed *BY C-ARES*..
* so don't call fd_close() but fd_unmap().
*/
fd_unmap(fd);
fd_close(fd);
return;
}
@ -108,7 +105,11 @@ static void unrealdns_sock_state_cb(void *data, ares_socket_t fd, int read, int
*/
static int unrealdns_sock_create_cb(ares_socket_t fd, int type, void *data)
{
fd_open(fd, "DNS Resolver Socket");
/* NOTE: We use FDCLOSE_NONE here because c-ares
* will take care of the closing. So *WE* must
* never close the socket.
*/
fd_open(fd, "DNS Resolver Socket", FDCLOSE_NONE);
return ARES_SUCCESS;
}
@ -174,12 +175,10 @@ void reinit_resolver(Client *client)
{
EventDel(unrealdns_timeout_hdl);
sendto_ops_and_log("%s requested reinitalization of resolver!", client->name);
sendto_realops("Destroying resolver channel, along with all currently pending queries...");
unreal_log(ULOG_INFO, "dns", "REINIT_RESOLVER", client,
"$client requested reinitalization of the DNS resolver");
ares_destroy(resolver_channel);
sendto_realops("Initializing resolver again...");
init_resolver(0);
sendto_realops("Reinitalization finished successfully.");
}
void unrealdns_addreqtolist(DNSReq *r)
@ -202,7 +201,7 @@ void unrealdns_addreqtolist(DNSReq *r)
struct hostent *unrealdns_doclient(Client *client)
{
DNSReq *r;
char *cache_name;
const char *cache_name;
cache_name = unrealdns_findcache_ip(client->ip);
if (cache_name)
@ -233,7 +232,7 @@ struct hostent *unrealdns_doclient(Client *client)
/** Resolve a name to an IP, for a link block.
*/
void unrealdns_gethostbyname_link(char *name, ConfigItem_link *conf, int ipv4_only)
void unrealdns_gethostbyname_link(const char *name, ConfigItem_link *conf, int ipv4_only)
{
DNSReq *r;
@ -283,27 +282,6 @@ void unrealdns_cb_iptoname(void *arg, int status, int timeouts, struct hostent *
ares_gethostbyname(resolver_channel, he->h_name, ipv6 ? AF_INET6 : AF_INET, unrealdns_cb_nametoip_verify, newr);
}
/*
returns:
1 = good hostname
0 = bad hostname
*/
int verify_hostname(char *name)
{
char *p;
if (strlen(name) > HOSTLEN)
return 0;
/* No underscores or other illegal characters */
for (p = name; *p; p++)
if (!isalnum(*p) && !strchr(".-", *p))
return 0;
return 1;
}
void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct hostent *he)
{
DNSReq *r = (DNSReq *)arg;
@ -348,13 +326,16 @@ void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct ho
goto bad;
}
if (!verify_hostname(r->name))
if (!valid_host(r->name, 1))
{
/* Hostname is bad, don't cache and consider unresolved */
proceed_normal_client_handshake(client, NULL);
goto bad;
}
/* Get rid of stupid uppercase DNS names... */
strtolower(r->name);
/* Entry was found, verified, and can be added to cache */
unrealdns_addtocache(r->name, client->ip);
@ -372,7 +353,7 @@ void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct host
int n;
struct hostent *he2;
char ipbuf[HOSTLEN+1];
char *ip = NULL;
const char *ip = NULL;
if (!r->linkblock)
{
@ -393,8 +374,9 @@ void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct host
}
/* fatal error while resolving */
sendto_ops_and_log("Unable to resolve hostname '%s', when trying to connect to server %s.",
r->name, r->linkblock->servername);
unreal_log(ULOG_ERROR, "link", "LINK_ERROR_RESOLVING", NULL,
"Unable to resolve hostname $link_block.hostname, when trying to connect to server $link_block.",
log_data_link_block(r->linkblock));
r->linkblock->refcount--;
unrealdns_freeandremovereq(r);
return;
@ -405,8 +387,9 @@ void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct host
!(ip = inetntop(r->ipv6 ? AF_INET6 : AF_INET, he->h_addr_list[0], ipbuf, sizeof(ipbuf))))
{
/* Illegal response -- fatal */
sendto_ops_and_log("Unable to resolve hostname '%s', when trying to connect to server %s.",
r->name, r->linkblock->servername);
unreal_log(ULOG_ERROR, "link", "LINK_ERROR_RESOLVING", NULL,
"Unable to resolve hostname $link_block.hostname, when trying to connect to server $link_block.",
log_data_link_block(r->linkblock));
unrealdns_freeandremovereq(r);
return;
}
@ -417,22 +400,9 @@ void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct host
safe_strdup(r->linkblock->connect_ip, ip);
he2 = unreal_create_hostent(he->h_name, ip);
switch ((n = connect_server(r->linkblock, r->client, he2)))
{
case 0:
sendto_ops_and_log("Trying to activate link with server %s[%s]...", r->linkblock->servername, ip);
break;
case -1:
sendto_ops_and_log("Couldn't connect to server %s[%s].", r->linkblock->servername, ip);
break;
case -2:
/* Should not happen since he is not NULL */
sendto_ops_and_log("Hostname %s is unknown for server %s (!?).", r->linkblock->outgoing.hostname, r->linkblock->servername);
break;
default:
sendto_ops_and_log("Connection to server %s failed: %s", r->linkblock->servername, STRERROR(n));
}
/* Try to connect to the server */
connect_server(r->linkblock, r->client, he2);
unrealdns_freeandremovereq(r);
/* DONE */
}
@ -442,7 +412,7 @@ static uint64_t unrealdns_hash_ip(const char *ip)
return siphash(ip, siphashkey_dns_ip) % DNS_HASH_SIZE;
}
static void unrealdns_addtocache(char *name, char *ip)
static void unrealdns_addtocache(const char *name, const char *ip)
{
unsigned int hashv;
DNSCache *c;
@ -494,7 +464,7 @@ static void unrealdns_addtocache(char *name, char *ip)
/** Search the cache for a confirmed ip->name and name->ip match, by address.
* @returns The resolved hostname, or NULL if not found in cache.
*/
static char *unrealdns_findcache_ip(char *ip)
static const char *unrealdns_findcache_ip(const char *ip)
{
unsigned int hashv;
DNSCache *c;
@ -562,17 +532,11 @@ DNSCache *c, *next;
{
next = c->next;
if (c->expires < TStime())
{
#if 0
sendto_realops(client, "[Syzop/DNS] Expire: %s [%s] (%ld < %ld)",
c->name, c->ip, c->expires, TStime());
#endif
unrealdns_removecacherecord(c);
}
}
}
struct hostent *unreal_create_hostent(char *name, char *ip)
struct hostent *unreal_create_hostent(const char *name, const char *ip)
{
struct hostent *he;
@ -646,7 +610,7 @@ CMD_FUNC(cmd_dns)
{
DNSCache *c;
DNSReq *r;
char *param;
const char *param;
if (!ValidatePermissionsForPath("server:dns",client,NULL,NULL,NULL))
{
@ -673,8 +637,8 @@ CMD_FUNC(cmd_dns)
} else
if (*param == 'c') /* CLEAR CACHE */
{
sendto_realops("%s (%s@%s) cleared the DNS cache list (/QUOTE DNS c)",
client->name, client->user->username, client->user->realhost);
unreal_log(ULOG_INFO, "dns", "DNS_CACHE_CLEARED", client,
"DNS cache cleared by $client");
while (cache_list)
{
@ -702,7 +666,8 @@ CMD_FUNC(cmd_dns)
ares_get_servers(resolver_channel, &serverlist);
for (ns = serverlist; ns; ns = ns->next)
{
char ipbuf[128], *ip;
char ipbuf[128];
const char *ip;
i++;
ip = inetntop(ns->family, &ns->addr, ipbuf, sizeof(ipbuf));

View File

@ -24,16 +24,23 @@
*/
FDEntry fd_table[MAXCONNECTIONS + 1];
int fd_open(int fd, const char *desc)
/** Notify I/O engine that a file descriptor opened.
* @param fd The file descriptor
* @param desc Description for in the fd table
* @param close_method Tell what a subsequent call to fd_close() should do,
* eg close the socket, file or don't close anything.
* @returns The file descriptor 'fd' or -1 in case of fatal error.
*/
int fd_open(int fd, const char *desc, FDCloseMethod close_method)
{
FDEntry *fde;
if ((fd < 0) || (fd >= MAXCONNECTIONS))
{
sendto_realops("[BUG] trying to add fd #%d to fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
ircd_log(LOG_ERROR, "[BUG] trying to add fd #%d to fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
unreal_log(ULOG_ERROR, "io", "BUG_FD_OPEN_OUT_OF_RANGE", NULL,
"[BUG] trying to add fd $fd to fd table, but MAXCONNECTIONS is $maxconnections",
log_data_integer("fd", fd),
log_data_integer("maxconnections", MAXCONNECTIONS));
#ifdef DEBUGMODE
abort();
#endif
@ -46,6 +53,7 @@ int fd_open(int fd, const char *desc)
fde->fd = fd;
fde->is_open = 1;
fde->backend_flags = 0;
fde->close_method = close_method;
strlcpy(fde->desc, desc, FD_DESC_SZ);
return fde->fd;
@ -71,20 +79,28 @@ int fd_fileopen(const char *path, unsigned int flags)
snprintf(comment, sizeof comment, "File: %s", unreal_getfilename(pathbuf));
return fd_open(fd, comment);
return fd_open(fd, comment, FDCLOSE_FILE);
}
int fd_unmap(int fd)
/** Internal function to unmap and optionally close the fd.
*/
/** Remove file descriptor from our table and possibly close the fd.
* The fd is closed (or not) according to the method specified in fd_open().
* @param fd The file descriptor
* @returns 1 on success, 0 on failure
*/
int fd_close(int fd)
{
FDEntry *fde;
unsigned int befl;
FDCloseMethod close_method;
if ((fd < 0) || (fd >= MAXCONNECTIONS))
{
sendto_realops("[BUG] trying to close fd #%d in fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
ircd_log(LOG_ERROR, "[BUG] trying to close fd #%d in fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
unreal_log(ULOG_ERROR, "io", "BUG_FD_CLOSE_OUT_OF_RANGE", NULL,
"[BUG] trying to close fd $fd to fd table, but MAXCONNECTIONS is $maxconnections",
log_data_integer("fd", fd),
log_data_integer("maxconnections", MAXCONNECTIONS));
#ifdef DEBUGMODE
abort();
#endif
@ -94,10 +110,9 @@ int fd_unmap(int fd)
fde = &fd_table[fd];
if (!fde->is_open)
{
sendto_realops("[BUG] trying to close fd #%d in fd table, but this FD isn't reported open",
fd);
ircd_log(LOG_ERROR, "[BUG] trying to close fd #%d in fd table, but this FD isn't reported open",
fd);
unreal_log(ULOG_ERROR, "io", "BUG_FD_CLOSE_NOT_OPEN", NULL,
"[BUG] trying to close fd $fd to fd table, but FD is (already) closed",
log_data_integer("fd", fd));
#ifdef DEBUGMODE
abort();
#endif
@ -105,6 +120,7 @@ int fd_unmap(int fd)
}
befl = fde->backend_flags;
close_method = fde->close_method;
memset(fde, 0, sizeof(FDEntry));
fde->fd = fd;
@ -112,25 +128,29 @@ int fd_unmap(int fd)
/* only notify the backend if it is actively tracking the FD */
if (befl)
fd_refresh(fd);
/* Finally, close the file or socket if requested to do so */
switch (close_method)
{
case FDCLOSE_SOCKET:
CLOSE_SOCK(fd);
break;
case FDCLOSE_FILE:
close(fd);
break;
case FDCLOSE_NONE:
default:
break;
}
return 1;
}
void fd_close(int fd)
{
if (!fd_unmap(fd))
return;
CLOSE_SOCK(fd);
}
/* Deregister I/O notification for this file descriptor */
void fd_unnotify(int fd)
{
FDEntry *fde;
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "fd_unnotify(): fd=%d", fd);
#endif
FDEntry *fde;
if ((fd < 0) || (fd >= MAXCONNECTIONS))
return;
@ -150,7 +170,7 @@ int fd_socket(int family, int type, int protocol, const char *desc)
if (fd < 0)
return -1;
return fd_open(fd, desc);
return fd_open(fd, desc, FDCLOSE_SOCKET);
}
int fd_accept(int sockfd)
@ -162,7 +182,7 @@ int fd_accept(int sockfd)
if (fd < 0)
return -1;
return fd_open(fd, buf);
return fd_open(fd, buf, FDCLOSE_SOCKET);
}
void fd_desc(int fd, const char *desc)
@ -171,10 +191,10 @@ void fd_desc(int fd, const char *desc)
if ((fd < 0) || (fd >= MAXCONNECTIONS))
{
sendto_realops("[BUG] trying to modify fd #%d in fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
ircd_log(LOG_ERROR, "[BUG] trying to modify fd #%d in fd table, but MAXCONNECTIONS is %d",
fd, MAXCONNECTIONS);
unreal_log(ULOG_ERROR, "io", "BUG_FD_DESC_OUT_OF_RANGE", NULL,
"[BUG] trying to fd_desc fd $fd in fd table, but MAXCONNECTIONS is $maxconnections",
log_data_integer("fd", fd),
log_data_integer("maxconnections", MAXCONNECTIONS));
#ifdef DEBUGMODE
abort();
#endif
@ -184,10 +204,9 @@ void fd_desc(int fd, const char *desc)
fde = &fd_table[fd];
if (!fde->is_open)
{
sendto_realops("[BUG] trying to modify fd #%d in fd table, but this FD isn't reported open",
fd);
ircd_log(LOG_ERROR, "[BUG] trying to modify fd #%d in fd table, but this FD isn't reported open",
fd);
unreal_log(ULOG_ERROR, "io", "BUG_FD_DESC_NOT_OPEN", NULL,
"[BUG] trying to fd_desc fd $fd in fd table, but FD is (already) closed",
log_data_integer("fd", fd));
#ifdef DEBUGMODE
abort();
#endif

View File

@ -260,11 +260,9 @@ void siphash_generate_key(char *k)
static struct list_head clientTable[NICK_HASH_TABLE_SIZE];
static struct list_head idTable[NICK_HASH_TABLE_SIZE];
static Channel *channelTable[CHAN_HASH_TABLE_SIZE];
static Watch *watchTable[WATCH_HASH_TABLE_SIZE];
static char siphashkey_nick[SIPHASH_KEY_LENGTH];
static char siphashkey_chan[SIPHASH_KEY_LENGTH];
static char siphashkey_watch[SIPHASH_KEY_LENGTH];
static char siphashkey_whowas[SIPHASH_KEY_LENGTH];
static char siphashkey_throttling[SIPHASH_KEY_LENGTH];
@ -277,7 +275,6 @@ void init_hash(void)
siphash_generate_key(siphashkey_nick);
siphash_generate_key(siphashkey_chan);
siphash_generate_key(siphashkey_watch);
siphash_generate_key(siphashkey_whowas);
siphash_generate_key(siphashkey_throttling);
@ -288,7 +285,6 @@ void init_hash(void)
INIT_LIST_HEAD(&idTable[i]);
memset(channelTable, 0, sizeof(channelTable));
memset(watchTable, 0, sizeof(watchTable));
memset(ThrottlingHash, 0, sizeof(ThrottlingHash));
/* do not call init_throttling() here, as
@ -310,11 +306,6 @@ uint64_t hash_channel_name(const char *name)
return siphash_nocase(name, siphashkey_chan) % CHAN_HASH_TABLE_SIZE;
}
uint64_t hash_watch_nick_name(const char *name)
{
return siphash_nocase(name, siphashkey_watch) % WATCH_HASH_TABLE_SIZE;
}
uint64_t hash_whowas_name(const char *name)
{
return siphash_nocase(name, siphashkey_whowas) % WHOWAS_HASH_TABLE_SIZE;
@ -323,7 +314,7 @@ uint64_t hash_whowas_name(const char *name)
/*
* add_to_client_hash_table
*/
int add_to_client_hash_table(char *name, Client *client)
int add_to_client_hash_table(const char *name, Client *client)
{
unsigned int hashv;
/*
@ -349,7 +340,7 @@ int add_to_client_hash_table(char *name, Client *client)
/*
* add_to_client_hash_table
*/
int add_to_id_hash_table(char *name, Client *client)
int add_to_id_hash_table(const char *name, Client *client)
{
unsigned int hashv;
hashv = hash_client_name(name);
@ -360,7 +351,7 @@ int add_to_id_hash_table(char *name, Client *client)
/*
* add_to_channel_hash_table
*/
int add_to_channel_hash_table(char *name, Channel *channel)
int add_to_channel_hash_table(const char *name, Channel *channel)
{
unsigned int hashv;
@ -372,7 +363,7 @@ int add_to_channel_hash_table(char *name, Channel *channel)
/*
* del_from_client_hash_table
*/
int del_from_client_hash_table(char *name, Client *client)
int del_from_client_hash_table(const char *name, Client *client)
{
if (!list_empty(&client->client_hash))
list_del(&client->client_hash);
@ -382,7 +373,7 @@ int del_from_client_hash_table(char *name, Client *client)
return 0;
}
int del_from_id_hash_table(char *name, Client *client)
int del_from_id_hash_table(const char *name, Client *client)
{
if (!list_empty(&client->id_hash))
list_del(&client->id_hash);
@ -395,7 +386,7 @@ int del_from_id_hash_table(char *name, Client *client)
/*
* del_from_channel_hash_table
*/
void del_from_channel_hash_table(char *name, Channel *channel)
void del_from_channel_hash_table(const char *name, Channel *channel)
{
Channel *tmp, *prev = NULL;
unsigned int hashv;
@ -465,7 +456,7 @@ Client *hash_find_nickatserver(const char *str, Client *def)
if (serv)
*serv++ = '\0';
client = find_person(nick, NULL);
client = find_user(nick, NULL);
if (!client)
return NULL; /* client not found */
@ -509,14 +500,14 @@ Client *hash_find_server(const char *server, Client *def)
/** Find a client by name.
* This searches in the list of all types of clients, user/person, servers or an unregistered clients.
* If you know what type of client to search for, then use find_server() or find_person() instead!
* If you know what type of client to search for, then use find_server() or find_user() instead!
* @param name The name to search for (eg: "nick" or "irc.example.net")
* @param requester The client that is searching for this name
* @note If 'requester' is a server or NULL, then we also check
* the ID table, otherwise not.
* @returns If the client is found then the Client is returned, otherwise NULL.
*/
Client *find_client(char *name, Client *requester)
Client *find_client(const char *name, Client *requester)
{
if (requester == NULL || IsServer(requester))
{
@ -537,7 +528,7 @@ Client *find_client(char *name, Client *requester)
* the ID table, otherwise not.
* @returns If the server is found then the Client is returned, otherwise NULL.
*/
Client *find_server(char *name, Client *requester)
Client *find_server(const char *name, Client *requester)
{
if (name)
{
@ -550,14 +541,14 @@ Client *find_server(char *name, Client *requester)
return NULL;
}
/** Find a person (a user).
/** Find a user (a person)
* @param name The name to search for (eg: "nick" or "001ABCDEFG")
* @param requester The client that is searching for this name
* @note If 'requester' is a server or NULL, then we also check
* the ID table, otherwise not.
* @returns If the user is found then the Client is returned, otherwise NULL.
*/
Client *find_person(char *name, Client *requester) /* TODO: this should have been called find_user() to be consistent */
Client *find_user(const char *name, Client *requester)
{
Client *c2ptr;
@ -572,22 +563,20 @@ Client *find_person(char *name, Client *requester) /* TODO: this should have bee
/** Find a channel by name.
* @param name The channel name to search for
* @param default_result If the channel is not found, this value is returned.
* @returns If the channel exists then the Channel is returned, otherwise default_result is returned.
* @returns If the channel exists then the Channel is returned, otherwise NULL.
*/
Channel *find_channel(char *name, Channel *default_result)
Channel *find_channel(const char *name)
{
unsigned int hashv;
Channel *tmp;
Channel *channel;
hashv = hash_channel_name(name);
for (tmp = channelTable[hashv]; tmp; tmp = tmp->hnextch)
{
if (smycmp(name, tmp->chname) == 0)
return tmp;
}
return default_result;
for (channel = channelTable[hashv]; channel; channel = channel->hnextch)
if (smycmp(name, channel->name) == 0)
return channel;
return NULL;
}
/** @} */
@ -599,303 +588,6 @@ Channel *hash_get_chan_bucket(uint64_t hashv)
return channelTable[hashv];
}
void count_watch_memory(int *count, u_long *memory)
{
int i = WATCH_HASH_TABLE_SIZE;
Watch *anptr;
while (i--)
{
anptr = watchTable[i];
while (anptr)
{
(*count)++;
(*memory) += sizeof(Watch)+strlen(anptr->nick);
anptr = anptr->hnext;
}
}
}
/*
* add_to_watch_hash_table
*/
int add_to_watch_hash_table(char *nick, Client *client, int awaynotify)
{
unsigned int hashv;
Watch *anptr;
Link *lp;
/* Get the right bucket... */
hashv = hash_watch_nick_name(nick);
/* Find the right nick (header) in the bucket, or NULL... */
if ((anptr = (Watch *)watchTable[hashv]))
while (anptr && mycmp(anptr->nick, nick))
anptr = anptr->hnext;
/* If found NULL (no header for this nick), make one... */
if (!anptr) {
anptr = (Watch *)safe_alloc(sizeof(Watch)+strlen(nick));
anptr->lasttime = timeofday;
strcpy(anptr->nick, nick);
anptr->watch = NULL;
anptr->hnext = watchTable[hashv];
watchTable[hashv] = anptr;
}
/* Is this client already on the watch-list? */
if ((lp = anptr->watch))
while (lp && (lp->value.client != client))
lp = lp->next;
/* No it isn't, so add it in the bucket and client addint it */
if (!lp) {
lp = anptr->watch;
anptr->watch = make_link();
anptr->watch->value.client = client;
anptr->watch->flags = awaynotify;
anptr->watch->next = lp;
lp = make_link();
lp->next = client->local->watch;
lp->value.wptr = anptr;
lp->flags = awaynotify;
client->local->watch = lp;
client->local->watches++;
}
return 0;
}
/*
* hash_check_watch
*/
int hash_check_watch(Client *client, int reply)
{
unsigned int hashv;
Watch *anptr;
Link *lp;
int awaynotify = 0;
if ((reply == RPL_GONEAWAY) || (reply == RPL_NOTAWAY) || (reply == RPL_REAWAY))
awaynotify = 1;
/* Get us the right bucket */
hashv = hash_watch_nick_name(client->name);
/* Find the right header in this bucket */
if ((anptr = (Watch *)watchTable[hashv]))
while (anptr && mycmp(anptr->nick, client->name))
anptr = anptr->hnext;
if (!anptr)
return 0; /* This nick isn't on watch */
/* Update the time of last change to item */
anptr->lasttime = TStime();
/* Send notifies out to everybody on the list in header */
for (lp = anptr->watch; lp; lp = lp->next)
{
if (!awaynotify)
{
sendnumeric(lp->value.client, reply,
client->name,
(IsUser(client) ? client->user->username : "<N/A>"),
(IsUser(client) ?
(IsHidden(client) ? client->user->virthost : client->
user->realhost) : "<N/A>"), anptr->lasttime, client->info);
}
else
{
/* AWAY or UNAWAY */
if (!lp->flags)
continue; /* skip away/unaway notification for users not interested in them */
if (reply == RPL_NOTAWAY)
sendnumeric(lp->value.client, reply,
client->name,
(IsUser(client) ? client->user->username : "<N/A>"),
(IsUser(client) ?
(IsHidden(client) ? client->user->virthost : client->
user->realhost) : "<N/A>"), client->user->lastaway);
else /* RPL_GONEAWAY / RPL_REAWAY */
sendnumeric(lp->value.client, reply,
client->name,
(IsUser(client) ? client->user->username : "<N/A>"),
(IsUser(client) ?
(IsHidden(client) ? client->user->virthost : client->
user->realhost) : "<N/A>"), client->user->lastaway, client->user->away);
}
}
return 0;
}
/*
* hash_get_watch
*/
Watch *hash_get_watch(char *nick)
{
unsigned int hashv;
Watch *anptr;
hashv = hash_watch_nick_name(nick);
if ((anptr = (Watch *)watchTable[hashv]))
while (anptr && mycmp(anptr->nick, nick))
anptr = anptr->hnext;
return anptr;
}
/*
* del_from_watch_hash_table
*/
int del_from_watch_hash_table(char *nick, Client *client)
{
unsigned int hashv;
Watch *anptr, *nlast = NULL;
Link *lp, *last = NULL;
/* Get the bucket for this nick... */
hashv = hash_watch_nick_name(nick);
/* Find the right header, maintaining last-link pointer... */
if ((anptr = (Watch *)watchTable[hashv]))
while (anptr && mycmp(anptr->nick, nick)) {
nlast = anptr;
anptr = anptr->hnext;
}
if (!anptr)
return 0; /* No such watch */
/* Find this client from the list of notifies... with last-ptr. */
if ((lp = anptr->watch))
while (lp && (lp->value.client != client)) {
last = lp;
lp = lp->next;
}
if (!lp)
return 0; /* No such client to watch */
/* Fix the linked list under header, then remove the watch entry */
if (!last)
anptr->watch = lp->next;
else
last->next = lp->next;
free_link(lp);
/* Do the same regarding the links in client-record... */
last = NULL;
if ((lp = client->local->watch))
while (lp && (lp->value.wptr != anptr)) {
last = lp;
lp = lp->next;
}
/*
* Give error on the odd case... probobly not even neccessary
* No error checking in ircd is unneccessary ;) -Cabal95
*/
if (!lp)
sendto_ops("WATCH debug error: del_from_watch_hash_table "
"found a watch entry with no client "
"counterpoint processing nick %s on client %p!",
nick, client->user);
else {
if (!last) /* First one matched */
client->local->watch = lp->next;
else
last->next = lp->next;
free_link(lp);
}
/* In case this header is now empty of notices, remove it */
if (!anptr->watch) {
if (!nlast)
watchTable[hashv] = anptr->hnext;
else
nlast->hnext = anptr->hnext;
safe_free(anptr);
}
/* Update count of notifies on nick */
client->local->watches--;
return 0;
}
/*
* hash_del_watch_list
*/
int hash_del_watch_list(Client *client)
{
unsigned int hashv;
Watch *anptr;
Link *np, *lp, *last;
if (!(np = client->local->watch))
return 0; /* Nothing to do */
client->local->watch = NULL; /* Break the watch-list for client */
while (np) {
/* Find the watch-record from hash-table... */
anptr = np->value.wptr;
last = NULL;
for (lp = anptr->watch; lp && (lp->value.client != client);
lp = lp->next)
last = lp;
/* Not found, another "worst case" debug error */
if (!lp)
sendto_ops("WATCH Debug error: hash_del_watch_list "
"found a WATCH entry with no table "
"counterpoint processing client %s!",
client->name);
else {
/* Fix the watch-list and remove entry */
if (!last)
anptr->watch = lp->next;
else
last->next = lp->next;
free_link(lp);
/*
* If this leaves a header without notifies,
* remove it. Need to find the last-pointer!
*/
if (!anptr->watch) {
Watch *np2, *nl;
hashv = hash_watch_nick_name(anptr->nick);
nl = NULL;
np2 = watchTable[hashv];
while (np2 != anptr) {
nl = np2;
np2 = np2->hnext;
}
if (nl)
nl->hnext = anptr->hnext;
else
watchTable[hashv] = anptr->hnext;
safe_free(anptr);
}
}
lp = np; /* Save last pointer processed */
np = np->next; /* Jump to the next pointer */
free_link(lp); /* Free the previous */
}
client->local->watches = 0;
return 0;
}
/* Throttling - originally by Stskeeps */
/* Note that we call this set::anti-flood::connect-flood nowadays */
@ -925,15 +617,7 @@ void update_throttling_timer_settings(void)
EventMod(EventFind("throttling_check_expire"), &eInfo);
}
void init_throttling()
{
EventAdd(NULL, "throttling_check_expire", throttling_check_expire, NULL, 123456, 0);
/* Note: the every_ms value (123,456) will be adjusted on boot and rehash
* via the update_throttling_timer_settings() function.
*/
}
uint64_t hash_throttling(char *ip)
uint64_t hash_throttling(const char *ip)
{
return siphash(ip, siphashkey_throttling) % THROTTLING_HASH_TABLE_SIZE;
}

View File

@ -34,7 +34,6 @@ time_t timeofday = 0;
struct timeval timeofday_tv;
int tainted = 0;
LoopStruct loop;
MODVAR MemoryInfo StatsZ;
#ifndef _WIN32
uid_t irc_uid = 0;
gid_t irc_gid = 0;
@ -51,12 +50,8 @@ extern SERVICE_STATUS IRCDStatus;
MODVAR unsigned char conf_debuglevel = 0;
#ifdef USE_LIBCURL
extern void url_init(void);
#endif
void server_reboot(char *);
void restart(char *);
void server_reboot(const char *);
void restart(const char *);
static void open_debugfile(), setup_signals();
extern void init_glines(void);
extern void tkl_init(void);
@ -82,7 +77,7 @@ void s_die()
Client *client;
if (!IsService)
{
loop.ircd_terminating = 1;
loop.terminating = 1;
unload_all_modules();
list_for_each_entry(client, &lclient_list, lclient_node)
@ -97,7 +92,7 @@ void s_die()
ControlService(hService, SERVICE_CONTROL_STOP, &status);
}
#else
loop.ircd_terminating = 1;
loop.terminating = 1;
unload_all_modules();
unlink(conf_files ? conf_files->pid_file : IRCD_PIDFILE);
exit(0);
@ -128,7 +123,7 @@ static void s_reloadcert()
}
#endif // #ifndef _WIN32
void restart(char *mesg)
void restart(const char *mesg)
{
server_reboot(mesg);
}
@ -174,12 +169,13 @@ void ignore_this_signal()
#endif /* #ifndef _WIN32 */
void server_reboot(char *mesg)
void server_reboot(const char *mesg)
{
int i;
Client *client;
sendto_realops("Aieeeee!!! Restarting server... %s", mesg);
Debug((DEBUG_NOTICE, "Restarting server... %s", mesg));
unreal_log(ULOG_INFO, "main", "UNREALIRCD_RESTARTING", NULL,
"Restarting server: $reason",
log_data_string("reason", mesg));
list_for_each_entry(client, &lclient_list, lclient_node)
(void) send_queued(client);
@ -206,12 +202,6 @@ void server_reboot(char *mesg)
CleanUp();
WinExec(cmdLine, SW_SHOWDEFAULT);
}
#endif
#ifndef _WIN32
Debug((DEBUG_FATAL, "Couldn't restart server: %s", strerror(errno)));
#else
Debug((DEBUG_FATAL, "Couldn't restart server: %s",
strerror(GetLastError())));
#endif
unload_all_modules();
#ifdef _WIN32
@ -254,7 +244,7 @@ EVENT(garbage_collect)
int ii;
if (loop.do_garbage_collect == 1)
sendto_realops("Doing garbage collection ..");
unreal_log(ULOG_INFO, "main", "GARBAGE_COLLECT_STARTED", NULL, "Doing garbage collection...");
if (freelinks > HOW_MANY_FREELINKS_ALLOWED) {
ii = freelinks;
while (freelink && (freelinks > HOW_MANY_FREELINKS_ALLOWED)) {
@ -265,65 +255,20 @@ EVENT(garbage_collect)
}
if (loop.do_garbage_collect == 1) {
loop.do_garbage_collect = 0;
sendto_realops
("Cleaned up %i garbage blocks", (ii - freelinks));
unreal_log(ULOG_INFO, "main", "GARBAGE_COLLECT_STARTED", NULL, "Cleaned up $count garbage blocks",
(ii - freelinks));
}
}
if (loop.do_garbage_collect == 1)
loop.do_garbage_collect = 0;
}
/** Perform autoconnect to servers that are not linked yet. */
EVENT(try_connections)
{
ConfigItem_link *aconf;
ConfigItem_deny_link *deny;
Client *client;
int confrq;
ConfigItem_class *class;
for (aconf = conf_link; aconf; aconf = aconf->next)
{
/* We're only interested in autoconnect blocks that are valid. Also, we ignore temporary link blocks. */
if (!(aconf->outgoing.options & CONNECT_AUTO) || !aconf->outgoing.hostname || (aconf->flag.temporary == 1))
continue;
class = aconf->class;
/* Only do one connection attempt per <connfreq> seconds (for the same server) */
if ((aconf->hold > TStime()))
continue;
confrq = class->connfreq;
aconf->hold = TStime() + confrq;
client = find_client(aconf->servername, NULL);
if (client)
continue; /* Server already connected (or connecting) */
if (class->clients >= class->maxclients)
continue; /* Class is full */
/* Check connect rules to see if we're allowed to try the link */
for (deny = conf_deny_link; deny; deny = deny->next)
if (match_simple(deny->mask, aconf->servername) && crule_eval(deny->rule))
break;
if (!deny && connect_server(aconf, NULL, NULL) == 0)
sendto_ops_and_log("Trying to activate link with server %s[%s]...",
aconf->servername, aconf->outgoing.hostname);
}
}
/** Does this user match any TKL's? */
int match_tkls(Client *client)
{
ConfigItem_ban *bconf = NULL;
char banbuf[1024];
char killflag = 0;
/* Process dynamic *LINES */
if (find_tkline_match(client, 0))
return 1; /* user killed */
@ -334,35 +279,25 @@ int match_tkls(Client *client)
{
/* Check ban realname { } */
if (!ValidatePermissionsForPath("immune",client,NULL,NULL,NULL) && (bconf = find_ban(NULL, client->info, CONF_BAN_REALNAME)))
killflag++;
}
{
unreal_log(ULOG_INFO, "tkl", "BAN_REALNAME", client,
"Banned client $client.details due to realname ban: $reason",
bconf->reason ? bconf->reason : "no reason");
/* If user is meant to be killed, take action: */
if (killflag)
{
if (IsUser(client))
sendto_realops("Ban active for %s (%s)",
get_client_name(client, FALSE),
bconf->reason ? bconf->reason : "no reason");
if (IsServer(client))
sendto_realops("Ban active for server %s (%s)",
get_client_name(client, FALSE),
bconf->reason ? bconf->reason : "no reason");
if (bconf->reason) {
if (IsUser(client))
snprintf(banbuf, sizeof(banbuf), "User has been banned (%s)", bconf->reason);
else
snprintf(banbuf, sizeof(banbuf), "Banned (%s)", bconf->reason);
exit_client(client, NULL, banbuf);
} else {
if (IsUser(client))
exit_client(client, NULL, "User has been banned");
else
exit_client(client, NULL, "Banned");
if (bconf->reason) {
if (IsUser(client))
snprintf(banbuf, sizeof(banbuf), "User has been banned (%s)", bconf->reason);
else
snprintf(banbuf, sizeof(banbuf), "Banned (%s)", bconf->reason);
exit_client(client, NULL, banbuf);
} else {
if (IsUser(client))
exit_client(client, NULL, "User has been banned");
else
exit_client(client, NULL, "Banned");
}
return 1; /* stop processing, client is dead now */
}
return 1; /* stop processing this user, as (s)he is dead now. */
}
if (loop.do_bancheck_spamf_user && IsUser(client) && find_spamfilter_user(client, SPAMFLAG_NOWARN))
@ -385,14 +320,10 @@ EVENT(handshake_timeout)
list_for_each_entry_safe(client, next, &unknown_list, lclient_node)
{
if (client->local->firsttime && ((TStime() - client->local->firsttime) > iConf.handshake_timeout))
if (client->local->creationtime && ((TStime() - client->local->creationtime) > iConf.handshake_timeout))
{
if (client->serv && *client->serv->by)
{
/* If this is a handshake timeout to an outgoing server then notify ops & log it */
sendto_ops_and_log("Connection handshake timeout while trying to link to server '%s' (%s)",
client->name, client->ip?client->ip:"<unknown ip>");
}
if (client->server && *client->server->by)
continue; /* handled by server module */
exit_client(client, NULL, "Registration Timeout");
continue;
@ -407,37 +338,31 @@ void check_ping(Client *client)
int ping = 0;
ping = client->local->class ? client->local->class->pingfreq : iConf.handshake_timeout;
Debug((DEBUG_DEBUG, "c(%s)=%d p %d a %lld", client->name,
client->status, ping,
(long long)(TStime() - client->local->lasttime)));
/* If ping is less than or equal to the last time we received a command from them */
if (ping > (TStime() - client->local->lasttime))
if (ping > (TStime() - client->local->last_msg_received))
return; /* some recent command was executed */
if (
/* If we have sent a ping */
(IsPingSent(client)
/* And they had 2x ping frequency to respond */
&& ((TStime() - client->local->lasttime) >= (2 * ping)))
&& ((TStime() - client->local->last_msg_received) >= (2 * ping)))
||
/* Or isn't registered and time spent is larger than ping (CONNECTTIMEOUT).. */
(!IsRegistered(client) && (TStime() - client->local->since >= ping))
(!IsRegistered(client) && (TStime() - client->local->fake_lag >= ping))
)
{
if (IsServer(client) || IsConnecting(client) ||
IsHandshake(client) || IsTLSConnectHandshake(client))
{
sendto_umode_global(UMODE_OPER, "No response from %s, closing link",
get_client_name(client, FALSE));
ircd_log(LOG_ERROR, "No response from %s, closing link",
get_client_name(client, FALSE));
unreal_log(ULOG_ERROR, "link", "LINK_DISCONNECTED", client,
"Lost server link to $client [$client.ip]: No response (Ping timeout)",
client->server->conf ? log_data_link_block(client->server->conf) : NULL);
SetServerDisconnectLogged(client);
}
if (IsTLSAcceptHandshake(client))
Debug((DEBUG_DEBUG, "ssl accept handshake timeout: %s (%lld-%lld > %lld)", client->local->sockhost,
(long long)TStime(), (long long)client->local->since, (long long)ping));
ircsnprintf(scratch, sizeof(scratch), "Ping timeout: %lld seconds",
(long long) (TStime() - client->local->lasttime));
(long long) (TStime() - client->local->last_msg_received));
exit_client(client, NULL, scratch);
return;
}
@ -447,17 +372,19 @@ void check_ping(Client *client)
SetPingSent(client);
ClearPingWarning(client);
/* not nice but does the job */
client->local->lasttime = TStime() - ping;
client->local->last_msg_received = TStime() - ping;
sendto_one(client, NULL, "PING :%s", me.name);
}
else if (!IsPingWarning(client) && PINGWARNING > 0 &&
(IsServer(client) || IsHandshake(client) || IsConnecting(client) ||
IsTLSConnectHandshake(client)) &&
(TStime() - client->local->lasttime) >= (ping + PINGWARNING))
(TStime() - client->local->last_msg_received) >= (ping + PINGWARNING))
{
SetPingWarning(client);
sendto_realops("Warning, no response from %s for %d seconds",
get_client_name(client, FALSE), PINGWARNING);
unreal_log(ULOG_WARNING, "link", "LINK_UNRELIABLE", client,
"Warning, no response from $client for $time_delta seconds",
log_data_integer("time_delta", PINGWARNING),
client->server->conf ? log_data_link_block(client->server->conf) : NULL);
}
return;
@ -496,9 +423,6 @@ EVENT(check_deadsockets)
/* No need to notify opers here. It's already done when dead socket is set */
if (IsDeadSocket(client))
{
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "Closing deadsock: %d/%s", client->local->fd, client->name);
#endif
ClearDeadSocket(client); /* CPR. So we send the error. */
exit_client(client, NULL, client->local->error_str ? client->local->error_str : "Dead socket");
continue;
@ -510,9 +434,6 @@ EVENT(check_deadsockets)
/* No need to notify opers here. It's already done when dead socket is set */
if (IsDeadSocket(client))
{
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "Closing deadsock: %d/%s", client->local->fd, client->name);
#endif
ClearDeadSocket(client); /* CPR. So we send the error. */
exit_client(client, NULL, client->local->error_str ? client->local->error_str : "Dead socket");
continue;
@ -562,21 +483,6 @@ char chess[] = {
85, 110, 114, 101, 97, 108, 0
};
static void version_check_logerror(char *fmt, ...)
{
va_list va;
char buf[1024];
va_start(va, fmt);
vsnprintf(buf, sizeof(buf), fmt, va);
va_end(va);
#ifndef _WIN32
fprintf(stderr, "[!!!] %s\n", buf);
#else
win_log("[!!!] %s", buf);
#endif
}
extern void applymeblock(void);
extern MODVAR Event *events;
@ -595,41 +501,20 @@ void fix_timers(void)
list_for_each_entry(client, &lclient_list, lclient_node)
{
if (client->local->since > TStime())
{
Debug((DEBUG_DEBUG, "fix_timers(): %s: client->local->since %ld -> %ld",
client->name, client->local->since, TStime()));
client->local->since = TStime();
}
if (client->local->lasttime > TStime())
{
Debug((DEBUG_DEBUG, "fix_timers(): %s: client->local->lasttime %ld -> %ld",
client->name, client->local->lasttime, TStime()));
client->local->lasttime = TStime();
}
if (client->local->last > TStime())
{
Debug((DEBUG_DEBUG, "fix_timers(): %s: client->local->last %ld -> %ld",
client->name, client->local->last, TStime()));
client->local->last = TStime();
}
if (client->local->fake_lag > TStime())
client->local->fake_lag = TStime();
if (client->local->last_msg_received > TStime())
client->local->last_msg_received = TStime();
if (client->local->idle_since > TStime())
client->local->idle_since = TStime();
/* users */
if (MyUser(client))
{
if (client->local->nextnick > TStime())
{
Debug((DEBUG_DEBUG, "fix_timers(): %s: client->local->nextnick %ld -> %ld",
client->name, client->local->nextnick, TStime()));
client->local->nextnick = TStime();
}
if (client->local->next_nick_allowed > TStime())
client->local->next_nick_allowed = TStime();
if (client->local->nexttarget > TStime())
{
Debug((DEBUG_DEBUG, "fix_timers(): %s: client->local->nexttarget %ld -> %ld",
client->name, client->local->nexttarget, TStime()));
client->local->nexttarget = TStime();
}
}
}
@ -658,7 +543,6 @@ void fix_timers(void)
thr->since = TStime();
}
}
Debug((DEBUG_DEBUG, "fix_timers(): removed %d throttling item(s)", cnt));
/* Make sure autoconnect for servers still works (lnk->hold) */
for (lnk = conf_link; lnk; lnk = lnk->next)
@ -668,37 +552,34 @@ void fix_timers(void)
if (lnk->hold > TStime() + t)
{
lnk->hold = TStime() + (t / 2); /* compromise */
Debug((DEBUG_DEBUG, "fix_timers(): link '%s' hold-time adjusted to %ld", lnk->servername, lnk->hold));
}
}
}
#ifndef _WIN32
/* Generate 3 cloak keys and print to console */
static void generate_cloakkeys()
{
/* Generate 3 cloak keys */
#define GENERATE_CLOAKKEY_MINLEN 50
#define GENERATE_CLOAKKEY_MAXLEN 60 /* Length of cloak keys to generate. */
char keyBuf[GENERATE_CLOAKKEY_MAXLEN + 1];
#define GENERATE_CLOAKKEY_LEN 80 /* Length of cloak keys to generate. */
char keyBuf[GENERATE_CLOAKKEY_LEN + 1];
int keyNum;
int keyLen;
int charIndex;
short has_upper;
short has_lower;
short has_num;
fprintf(stderr, "Here are 3 random cloak keys:\n");
fprintf(stderr, "Here are 3 random cloak keys that you can copy-paste to your configuration file:\n\n");
fprintf(stderr, "set {\n\tcloak-keys {\n");
for (keyNum = 0; keyNum < 3; ++keyNum)
{
has_upper = 0;
has_lower = 0;
has_num = 0;
keyLen = (getrandom8() % (GENERATE_CLOAKKEY_MAXLEN - GENERATE_CLOAKKEY_MINLEN + 1)) + GENERATE_CLOAKKEY_MINLEN;
for (charIndex = 0; charIndex < keyLen; ++charIndex)
for (charIndex = 0; charIndex < sizeof(keyBuf)-1; ++charIndex)
{
switch (getrandom8() % 3)
{
@ -716,14 +597,15 @@ static void generate_cloakkeys()
break;
}
}
keyBuf[keyLen] = '\0';
keyBuf[sizeof(keyBuf)-1] = '\0';
if (has_upper && has_lower && has_num)
(void)fprintf(stderr, "%s\n", keyBuf);
fprintf(stderr, "\t\t\"%s\";\n", keyBuf);
else
/* Try again. For this reason, keyNum must be signed. */
keyNum--;
}
fprintf(stderr, "\t}\n}\n\n");
}
#endif
@ -743,38 +625,35 @@ void detect_timeshift_and_warn(void)
if (oldtimeofday == 0)
oldtimeofday = timeofday; /* pretend everything is ok the first time.. */
if (mytdiff(timeofday, oldtimeofday) < NEGATIVE_SHIFT_WARN) {
if (mytdiff(timeofday, oldtimeofday) < NEGATIVE_SHIFT_WARN)
{
/* tdiff = # of seconds of time set backwards (positive number! eg: 60) */
time_t tdiff = oldtimeofday - timeofday;
ircd_log(LOG_ERROR, "WARNING: Time running backwards! Clock set back ~%lld seconds (%lld -> %lld)",
(long long)tdiff, (long long)oldtimeofday, (long long)timeofday);
ircd_log(LOG_ERROR, "[TimeShift] Resetting a few timers to prevent IRCd freeze!");
sendto_realops("WARNING: Time running backwards! Clock set back ~%lld seconds (%lld -> %lld)",
(long long)tdiff, (long long)oldtimeofday, (long long)timeofday);
sendto_realops("Incorrect time for IRC servers is a serious problem. "
"Time being set backwards (system clock changed) is "
"even more serious and can cause clients to freeze, channels to be "
"taken over, and other issues.");
sendto_realops("Please be sure your clock is always synchronized before "
"the IRCd is started!");
sendto_realops("[TimeShift] Resetting a few timers to prevent IRCd freeze!");
unreal_log(ULOG_WARNING, "system", "SYSTEM_CLOCK_JUMP_BACKWARDS", NULL,
"System clock jumped back in time ~$time_delta seconds ($time_from -> $time_to)\n"
"Incorrect time for IRC servers is a serious problem. "
"Time being set backwards (system clock changed) is "
"even more serious and can cause clients to freeze, channels to be "
"taken over, and other issues.\n"
"Please be sure your clock is always synchronized before the IRCd is started!",
log_data_integer("time_delta", tdiff),
log_data_timestamp("time_from", oldtimeofday),
log_data_timestamp("time_to", timeofday));
fix_timers();
} else
if (mytdiff(timeofday, oldtimeofday) > POSITIVE_SHIFT_WARN) /* do not set too low or you get false positives */
{
/* tdiff = # of seconds of time set forward (eg: 60) */
time_t tdiff = timeofday - oldtimeofday;
ircd_log(LOG_ERROR, "WARNING: Time jumped ~%lld seconds ahead! (%lld -> %lld)",
(long long)tdiff, (long long)oldtimeofday, (long long)timeofday);
ircd_log(LOG_ERROR, "[TimeShift] Resetting some timers!");
sendto_realops("WARNING: Time jumped ~%lld seconds ahead! (%lld -> %lld)",
(long long)tdiff, (long long)oldtimeofday, (long long)timeofday);
sendto_realops("Incorrect time for IRC servers is a serious problem. "
"Time being adjusted (by changing the system clock) "
"more than a few seconds forward/backward can lead to serious issues.");
sendto_realops("Please be sure your clock is always synchronized before "
"the IRCd is started!");
sendto_realops("[TimeShift] Resetting some timers!");
unreal_log(ULOG_WARNING, "system", "SYSTEM_CLOCK_JUMP_FORWARDS", NULL,
"System clock jumped ~$time_delta seconds forward ($time_from -> $time_to)\n"
"Incorrect time for IRC servers is a serious problem. "
"Time being adjusted (by changing the system clock) "
"more than a few seconds forward/backward can lead to serious issues.\n"
"Please be sure your clock is always synchronized before the IRCd is started!",
log_data_integer("time_delta", tdiff),
log_data_timestamp("time_from", oldtimeofday),
log_data_timestamp("time_to", timeofday));
fix_timers();
}
@ -784,13 +663,11 @@ void detect_timeshift_and_warn(void)
lasthighwarn = timeofday;
if (timeofday - lasthighwarn > 300)
{
ircd_log(LOG_ERROR, "[TimeShift] The (IRCd) clock was set backwards. "
"Waiting for time to be OK again. This will be in %lld seconds",
(long long)(highesttimeofday - timeofday));
sendto_realops("[TimeShift] The (IRCd) clock was set backwards. Timers, nick- "
"and channel-timestamps are possibly incorrect. This message will "
"repeat itself until we catch up with the original time, which will be "
"in %lld seconds", (long long)(highesttimeofday - timeofday));
unreal_log(ULOG_WARNING, "system", "SYSTEM_CLOCK_JUMP_BACKWARDS_PREVIOUSLY", NULL,
"The system clock previously went backwards. Waiting for time to be OK again. This will be in $time_delta seconds.",
log_data_integer("time_delta", highesttimeofday - timeofday),
log_data_timestamp("time_from", highesttimeofday),
log_data_timestamp("time_to", timeofday));
lasthighwarn = timeofday;
}
} else {
@ -909,7 +786,6 @@ int InitUnrealIRCd(int argc, char *argv[])
#else
WSAStartup(wVersionRequested, &wsaData);
#endif
memset(&StatsZ, 0, sizeof(StatsZ));
setup_signals();
memset(&irccounts, '\0', sizeof(irccounts));
@ -918,10 +794,10 @@ int InitUnrealIRCd(int argc, char *argv[])
mp_pool_init();
dbuf_init();
initlists();
initlist_channels();
#ifdef USE_LIBCURL
early_init_tls();
url_init();
#endif
tkl_init();
umode_init();
extcmode_init();
@ -967,7 +843,7 @@ int InitUnrealIRCd(int argc, char *argv[])
#ifndef _WIN32
case 'P':{
short type;
char *result;
const char *result;
srandom(TStime());
type = Auth_FindType(NULL, p);
if (type == -1)
@ -1001,11 +877,10 @@ int InitUnrealIRCd(int argc, char *argv[])
exit(0);
}
#endif
#if 1
#if 0
case 'S':
//charsys_dump_table(p ? p : "*");
unrealdb_test();
exit(0);
charsys_dump_table(p ? p : "*");
//unrealdb_test();
#endif
#ifndef _WIN32
case 't':
@ -1065,14 +940,6 @@ int InitUnrealIRCd(int argc, char *argv[])
fprintf(stderr, "It is impossible to get here\n");
exit(0);
}
case 'U':
if (chdir(CONFDIR) < 0)
{
fprintf(stderr, "Unable to change to '%s' directory\n", CONFDIR);
exit(1);
}
update_conf();
exit(0);
case 'R':
report_crash();
exit(0);
@ -1142,7 +1009,8 @@ int InitUnrealIRCd(int argc, char *argv[])
#ifndef _WIN32
fprintf(stderr, "%s", unreallogo);
fprintf(stderr, " v%s\n\n", VERSIONONLY);
fprintf(stderr, "UnrealIRCd is brought to you by Bram Matthys (Syzop), Gottem and i\n\n");
fprintf(stderr, "UnrealIRCd is brought to you by Bram Matthys (Syzop),\n"
"Krzysztof Beresztant (k4be), Gottem and i\n\n");
fprintf(stderr, "Using the following libraries:\n");
fprintf(stderr, "* %s\n", SSLeay_version(SSLEAY_VERSION));
@ -1170,7 +1038,7 @@ int InitUnrealIRCd(int argc, char *argv[])
(void)chmod(CPATH, DEFAULT_PERMISSIONS);
#endif
init_dynconf();
early_init_ssl();
init_sys();
/*
* Add default class
*/
@ -1181,10 +1049,17 @@ int InitUnrealIRCd(int argc, char *argv[])
default_class->sendq = DEFAULT_RECVQ;
default_class->name = "default";
AddListItem(default_class, conf_class);
if (init_conf(configfile, 0) < 0)
{
if (config_read_start() < 0)
exit(-1);
while (!is_config_read_finished())
{
gettimeofday(&timeofday_tv, NULL);
timeofday = timeofday_tv.tv_sec;
url_socket_timeout(NULL);
fd_select(500);
}
if (config_test() < 0)
exit(-1);
booted = TRUE;
load_tunefile();
make_umodestr();
@ -1192,7 +1067,6 @@ int InitUnrealIRCd(int argc, char *argv[])
me.local->fd = -1;
SetMe(&me);
make_server(&me);
extcmodes_check_for_changes();
umodes_check_for_changes();
charsys_check_for_changes();
clicap_init();
@ -1202,37 +1076,30 @@ int InitUnrealIRCd(int argc, char *argv[])
exit(-4);
}
#ifndef _WIN32
fprintf(stderr, "Initializing TLS..\n");
#endif
if (!init_ssl())
if (!init_tls())
{
config_error("Failed to load SSL/TLS (see errors above). UnrealIRCd can not start.");
config_error("Failed to load TLS (see errors above). UnrealIRCd can not start.");
#ifdef _WIN32
win_error(); /* display error dialog box */
#endif
exit(9);
}
unreal_log(ULOG_INFO, "config", "CONFIG_PASSED", NULL, "Configuration test passed OK");
if (loop.config_test)
{
ircd_log(LOG_ERROR, "Configuration test passed OK");
fflush(stderr);
exit(0);
}
if (loop.boot_function)
loop.boot_function();
#ifndef _WIN32
fprintf(stderr, "Dynamic configuration initialized.. booting IRCd.\n");
#endif
open_debugfile();
me.local->port = 6667; /* pointless? */
init_sys();
applymeblock();
#ifdef HAVE_SYSLOG
openlog("ircd", LOG_PID | LOG_NDELAY, LOG_DAEMON);
#endif
run_configuration();
ircd_log(LOG_ERROR, "UnrealIRCd started.");
config_run();
unreal_log(ULOG_INFO, "main", "UNREALIRCD_START", NULL, "UnrealIRCd started.");
read_motd(conf_files->botmotd_file, &botmotd);
read_motd(conf_files->rules_file, &rules);
@ -1250,11 +1117,10 @@ int InitUnrealIRCd(int argc, char *argv[])
* This listener will never go away
*/
me_hash = find_or_add(me.name);
me.serv->up = me_hash;
timeofday = time(NULL);
me.local->lasttime = me.local->since = me.local->firsttime = me.serv->boottime = TStime();
me.serv->features.protocol = UnrealProtocol;
safe_strdup(me.serv->features.software, version);
me.local->last_msg_received = me.local->fake_lag = me.local->creationtime = me.server->boottime = TStime();
me.server->features.protocol = UnrealProtocol;
safe_strdup(me.server->features.software, version);
add_to_client_hash_table(me.name, &me);
add_to_id_hash_table(me.id, &me);
list_add(&me.client_node, &global_server_list);
@ -1277,18 +1143,16 @@ int InitUnrealIRCd(int argc, char *argv[])
/* Background process (child) continues below... */
close_std_descriptors();
fd_fork();
loop.ircd_forked = 1;
loop.forked = 1;
}
#endif
#ifdef _WIN32
loop.ircd_forked = 1;
loop.forked = 1;
#endif
fix_timers();
write_pidfile();
Debug((DEBUG_NOTICE, "Server ready..."));
init_throttling();
loop.ircd_booted = 1;
loop.booted = 1;
#if defined(HAVE_SETPROCTITLE)
setproctitle("%s", me.name);
#elif defined(HAVE_PSTAT)
@ -1346,7 +1210,7 @@ void SocketLoop(void *dummy)
*/
if (dorehash)
{
(void)rehash(&me, 1);
request_rehash(NULL);
dorehash = 0;
}
if (dorestart)
@ -1355,7 +1219,8 @@ void SocketLoop(void *dummy)
}
if (doreloadcert)
{
reinit_ssl(NULL);
unreal_log(ULOG_INFO, "config", "CONFIG_RELOAD_TLS", NULL, "Reloading all TLS related data (./unrealircd reloadtls)");
reinit_tls();
doreloadcert = 0;
}
}
@ -1408,9 +1273,6 @@ static void open_debugfile(void)
else
# endif
strlcpy(client->name, "FD2-Pipe", sizeof(client->name));
Debug((DEBUG_FATAL,
"Debug: File <%s> Level: %d at %s", client->name,
client->local->port, myctime(time(NULL))));
}
#endif
}

View File

@ -104,14 +104,14 @@ Client *make_client(Client *from, Client *servr)
/* Note: all fields are already NULL/0, no need to set here */
client->direction = from ? from : client; /* 'from' of local client is self! */
client->srvptr = servr;
client->uplink = servr;
client->status = CLIENT_STATUS_UNKNOWN;
INIT_LIST_HEAD(&client->client_node);
INIT_LIST_HEAD(&client->client_hash);
INIT_LIST_HEAD(&client->id_hash);
strcpy(client->ident, "unknown");
strlcpy(client->ident, "unknown", sizeof(client->ident));
if (!from)
{
/* Local client */
@ -123,9 +123,9 @@ Client *make_client(Client *from, Client *servr)
INIT_LIST_HEAD(&client->lclient_node);
INIT_LIST_HEAD(&client->special_node);
client->local->since = client->local->lasttime =
client->lastnick = client->local->firsttime =
client->local->last = TStime();
client->local->fake_lag = client->local->last_msg_received =
client->lastnick = client->local->creationtime =
client->local->idle_since = TStime();
client->local->class = NULL;
client->local->passwd = NULL;
client->local->sockhost[0] = '\0';
@ -197,7 +197,7 @@ User *make_user(Client *client)
#ifdef DEBUGMODE
users.inuse++;
#endif
strlcpy(user->svid, "0", sizeof(user->svid));
strlcpy(user->account, "0", sizeof(user->account));
if (client->ip)
{
/* initially set client->user->realhost to IP */
@ -213,7 +213,7 @@ User *make_user(Client *client)
Server *make_server(Client *client)
{
Server *serv = client->serv;
Server *serv = client->server;
if (!serv)
{
@ -223,8 +223,7 @@ Server *make_server(Client *client)
#endif
*serv->by = '\0';
serv->users = 0;
serv->up = NULL;
client->serv = serv;
client->server = serv;
}
if (strlen(client->id) > 3)
{
@ -234,7 +233,7 @@ Server *make_server(Client *client)
del_from_id_hash_table(client->id, client);
*client->id = '\0';
}
return client->serv;
return client->server;
}
/*
@ -260,6 +259,7 @@ void free_user(Client *client)
}
safe_free(client->user->virthost);
safe_free(client->user->operlogin);
safe_free(client->user->snomask);
mp_pool_release(client->user);
#ifdef DEBUGMODE
users.inuse--;
@ -297,8 +297,8 @@ void remove_client_from_list(Client *client)
VERIFY_OPERCOUNT(client, "rmvlist");
}
irccounts.clients--;
if (client->srvptr && client->srvptr->serv)
client->srvptr->serv->users--;
if (client->uplink && client->uplink->server)
client->uplink->server->users--;
}
if (IsUnknown(client) || IsConnecting(client) || IsHandshake(client)
|| IsTLSHandshake(client)
@ -313,16 +313,16 @@ void remove_client_from_list(Client *client)
if (client->user)
free_user(client);
if (client->serv)
if (client->server)
{
safe_free(client->serv->features.usermodes);
safe_free(client->serv->features.chanmodes[0]);
safe_free(client->serv->features.chanmodes[1]);
safe_free(client->serv->features.chanmodes[2]);
safe_free(client->serv->features.chanmodes[3]);
safe_free(client->serv->features.software);
safe_free(client->serv->features.nickchars);
safe_free(client->serv);
safe_free(client->server->features.usermodes);
safe_free(client->server->features.chanmodes[0]);
safe_free(client->server->features.chanmodes[1]);
safe_free(client->server->features.chanmodes[2]);
safe_free(client->server->features.chanmodes[3]);
safe_free(client->server->features.software);
safe_free(client->server->features.nickchars);
safe_free(client->server);
#ifdef DEBUGMODE
servs.inuse--;
#endif
@ -383,6 +383,16 @@ void free_link(Link *lp)
#endif
}
/** Returns the length (entry count) of a +beI list */
int link_list_length(Link *lp)
{
int count = 0;
for (; lp; lp = lp->next)
count++;
return count;
}
Ban *make_ban(void)
{
Ban *lp;
@ -491,7 +501,7 @@ void add_ListItemPrio(ListStructPrio *new, ListStructPrio **list, int priority)
/* NameList functions */
void _add_name_list(NameList **list, char *name)
void _add_name_list(NameList **list, const char *name)
{
NameList *e = safe_alloc(sizeof(NameList)+strlen(name));
strcpy(e->name, name); /* safe, allocated above */
@ -509,7 +519,7 @@ void _free_entire_name_list(NameList *n)
}
}
void _del_name_list(NameList **list, char *name)
void _del_name_list(NameList **list, const char *name)
{
NameList *e = find_name_list(*list, name);
if (e)
@ -523,7 +533,7 @@ void _del_name_list(NameList **list, char *name)
/** Find an entry in a NameList - case insensitive comparisson.
* @ingroup ListFunctions
*/
NameList *find_name_list(NameList *list, char *name)
NameList *find_name_list(NameList *list, const char *name)
{
NameList *e;
@ -540,7 +550,7 @@ NameList *find_name_list(NameList *list, char *name)
/** Find an entry in a NameList by running match_simple() on it.
* @ingroup ListFunctions
*/
NameList *find_name_list_match(NameList *list, char *name)
NameList *find_name_list_match(NameList *list, const char *name)
{
NameList *e;
@ -554,7 +564,7 @@ NameList *find_name_list_match(NameList *list, char *name)
return NULL;
}
void add_nvplist(NameValuePrioList **lst, int priority, char *name, char *value)
void add_nvplist(NameValuePrioList **lst, int priority, const char *name, const char *value)
{
va_list vl;
NameValuePrioList *e = safe_alloc(sizeof(NameValuePrioList));
@ -564,7 +574,7 @@ void add_nvplist(NameValuePrioList **lst, int priority, char *name, char *value)
AddListItemPrio(e, *lst, priority);
}
NameValuePrioList *find_nvplist(NameValuePrioList *list, char *name)
NameValuePrioList *find_nvplist(NameValuePrioList *list, const char *name)
{
NameValuePrioList *e;
@ -578,7 +588,7 @@ NameValuePrioList *find_nvplist(NameValuePrioList *list, char *name)
return NULL;
}
void add_fmt_nvplist(NameValuePrioList **lst, int priority, char *name, FORMAT_STRING(const char *format), ...)
void add_fmt_nvplist(NameValuePrioList **lst, int priority, const char *name, FORMAT_STRING(const char *format), ...)
{
char value[512];
va_list vl;
@ -603,3 +613,37 @@ void free_nvplist(NameValuePrioList *lst)
safe_free(e);
}
}
#define nv_find_by_name(stru, name) do_nv_find_by_name(stru, name, ARRAY_SIZEOF((stru)))
long do_nv_find_by_name(NameValue *table, const char *cmd, int numelements)
{
int start = 0;
int stop = numelements-1;
int mid;
while (start <= stop) {
mid = (start+stop)/2;
if (smycmp(cmd,table[mid].name) < 0) {
stop = mid-1;
}
else if (strcmp(cmd,table[mid].name) == 0) {
return table[mid].value;
}
else
start = mid+1;
}
return 0;
}
#define nv_find_by_value(stru, value) do_nv_find_by_value(stru, value, ARRAY_SIZEOF((stru)))
const char *do_nv_find_by_value(NameValue *table, long value, int numelements)
{
int i;
for (i=0; i < numelements; i++)
if (table[i].value == value)
return table[i].name;
return NULL;
}

1871
src/log.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ class AppModel : ChangeNotifierDelegate
{
var menuItem : NSStatusItem
static let logoName = "logo.png"
static let helpURL = "https://www.unrealircd.org/docs/UnrealIRCd_5_documentation"
static let helpURL = "https://www.unrealircd.org/docs/UnrealIRCd_6_documentation"
var daemonModel : DaemonModel
var configurationModel : ConfigurationModel
var windowController : NSWindowController?

View File

@ -384,7 +384,7 @@ void unreal_delete_match(Match *m)
safe_free(m);
}
Match *unreal_create_match(MatchType type, char *str, char **error)
Match *unreal_create_match(MatchType type, const char *str, char **error)
{
Match *m = safe_alloc(sizeof(Match));
static char errorbuf[512];
@ -438,7 +438,7 @@ Match *unreal_create_match(MatchType type, char *str, char **error)
* @returns 1 if matched, 0 if not.
* @note These (more logical) return values are opposite to the match_simple() function.
*/
int unreal_match(Match *m, char *str)
int unreal_match(Match *m, const char *str)
{
if (m->type == MATCH_SIMPLE)
{
@ -463,7 +463,7 @@ int unreal_match(Match *m, char *str)
return 0;
}
int unreal_match_method_strtoval(char *str)
int unreal_match_method_strtoval(const char *str)
{
if (!strcmp(str, "regex") || !strcmp(str, "pcre"))
return MATCH_PCRE_REGEX;
@ -489,10 +489,11 @@ char *unreal_match_method_valtostr(int val)
* Moved here from the censor channel and user mode module
* (previously was present in both modules, code duplication)
*/
int fast_badword_match(ConfigItem_badword *badword, char *line)
int fast_badword_match(ConfigItem_badword *badword, const char *line)
{
char *p;
const char *p;
int bwlen = strlen(badword->word);
if ((badword->type & BADW_TYPE_FAST_L) && (badword->type & BADW_TYPE_FAST_R))
return (our_strcasestr(line, badword->word) ? 1 : 0);
@ -523,21 +524,20 @@ next:
* buf is used for the result and max is sizeof(buf).
* Assumptions[!]: max > 0 AND max > strlen(line)+1
*/
int fast_badword_replace(ConfigItem_badword *badword, char *line, char *buf, int max)
int fast_badword_replace(ConfigItem_badword *badword, const char *line, char *buf, int max)
{
/* Some aliases ;P */
char *replacew = badword->replace ? badword->replace : REPLACEWORD;
char *pold = line, *pnew = buf; /* Pointers to old string and new string */
char *poldx = line;
const char *pold = line; /* pointer to the old string */
const char *poldx = line;
char *pnew = buf; /* pointer to the new string */
int replacen = -1; /* Only calculated if needed. w00t! saves us a few nanosecs? lol */
int searchn = -1;
char *startw, *endw;
const char *startw, *endw; /* start and end of the word */
char *c_eol = buf + max - 1; /* Cached end of (new) line */
int run = 1;
int cleaned = 0;
Debug((DEBUG_NOTICE, "replacing %s -> %s in '%s'", badword->word, replacew, line));
while(run) {
pold = our_strcasestr(pold, badword->word);
if (!pold)
@ -617,7 +617,7 @@ int fast_badword_replace(ConfigItem_badword *badword, char *line, char *buf, int
* the loadbadwords() function. It's primary use is to filter swearing
* in both private and public messages
*/
char *stripbadwords(char *str, ConfigItem_badword *start_bw, int *blocked)
const char *stripbadwords(const char *str, ConfigItem_badword *start_bw, int *blocked)
{
static char cleanstr[4096];
char buf[4096];
@ -692,14 +692,17 @@ char *stripbadwords(char *str, ConfigItem_badword *start_bw, int *blocked)
ret = pcre2_match(this_word->pcre2_expr, ptr, PCRE2_ZERO_TERMINATED, 0, 0, md, NULL); /* run the regex */
if (ret > 0)
{
ircd_log(LOG_ERROR, "pcre2_get_ovector_count: %d", pcre2_get_ovector_count(md));
dd = pcre2_get_ovector_pointer(md);
start = (int)dd[0];
end = (int)dd[1];
if ((start < 0) || (end < 0) || (start > strlen(ptr)) || (end > strlen(ptr)+1))
{
ircd_log(LOG_ERROR, "pcre2_match() returned an ovector with OOB start/end: %d/%d, str (%d): '%s'",
(int)start, (int)end, (int)strlen(ptr), ptr);
unreal_log(ULOG_FATAL, "main", "BUG_STRIPBADWORDS_PCRE2_MATCH_OOB", NULL,
"[BUG] pcre2_match() returned an ovector with OOB start/end: $start/$end, len $length: '$buf'",
log_data_integer("start", start),
log_data_integer("end", end),
log_data_integer("length", strlen(ptr)),
log_data_string("buf", ptr));
abort();
}
m = end - start;
@ -743,10 +746,10 @@ char *stripbadwords(char *str, ConfigItem_badword *start_bw, int *blocked)
* if check_broadness is 1, the function will attempt to determine
* if the given regex string is too broad (i.e. matches everything)
*/
char *badword_config_check_regex(char *str, int fastsupport, int check_broadness)
const char *badword_config_check_regex(const char *str, int fastsupport, int check_broadness)
{
int regex=0;
char *tmp;
const char *tmp;
static char errorbuf[512];
if (fastsupport)
@ -787,9 +790,9 @@ char *badword_config_check_regex(char *str, int fastsupport, int check_broadness
return NULL;
}
int badword_config_process(ConfigItem_badword *ca, char *str)
int badword_config_process(ConfigItem_badword *ca, const char *str)
{
char *tmp;
const char *tmp;
short regex = 0;
int ast_l = 0, ast_r = 0;

1077
src/misc.c

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ int mm_valid_module_name(char *name);
void free_managed_module(ManagedModule *m);
SSL_CTX *mm_init_ssl(void)
SSL_CTX *mm_init_tls(void)
{
SSL_CTX *ctx_client;
char buf1[512], buf2[512];
@ -101,8 +101,7 @@ int parse_url(const char *url, char **host, int *port, char **document)
if (!p)
return 0;
*hostbuf = '\0';
strlncat(hostbuf, url, sizeof(hostbuf), p - url);
strlncpy(hostbuf, url, sizeof(hostbuf), p - url);
strlcpy(documentbuf, p, sizeof(documentbuf));
@ -134,7 +133,7 @@ int mm_http_request(char *url, char *fname, int follow_redirects)
snprintf(hostandport, sizeof(hostandport), "%s:%d", host, port);
ctx_client = mm_init_ssl();
ctx_client = mm_init_tls();
if (!ctx_client)
{
fprintf(stderr, "ERROR: TLS initalization failure (I)\n");
@ -163,14 +162,14 @@ int mm_http_request(char *url, char *fname, int follow_redirects)
if (BIO_do_connect(socket) != 1)
{
fprintf(stderr, "ERROR: Could not connect to %s\n", hostandport);
config_report_ssl_error();
//config_report_ssl_error(); FIXME?
goto out2;
}
if (BIO_do_handshake(socket) != 1)
{
fprintf(stderr, "ERROR: Could not connect to %s (TLS handshake failed)\n", hostandport);
config_report_ssl_error();
//config_report_ssl_error(); FIXME?
goto out2;
}
@ -339,63 +338,64 @@ int parse_quoted_string(char *buf, char *dest, size_t destlen)
return 1;
}
#define CheckNull(x) if ((!(x)->ce_vardata) || (!(*((x)->ce_vardata)))) { config_error("%s:%i: missing parameter", m->name, (x)->ce_varlinenum); return 0; }
#undef CheckNull
#define CheckNull(x) if ((!(x)->value) || (!(*((x)->value)))) { config_error("%s:%i: missing parameter", m->name, (x)->line_number); return 0; }
/** Parse a module { } line from a module (not repo!!) */
int mm_module_file_config(ManagedModule *m, ConfigEntry *ce)
{
ConfigEntry *cep;
if (ce->ce_vardata)
if (ce->value)
{
config_error("%s:%d: module { } block should not have a name.",
m->name, ce->ce_varlinenum);
m->name, ce->line_number);
return 0;
}
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!strcmp(cep->ce_varname, "source") ||
!strcmp(cep->ce_varname, "version") ||
!strcmp(cep->ce_varname, "author") ||
!strcmp(cep->ce_varname, "sha256sum") ||
!strcmp(cep->ce_varname, "description")
if (!strcmp(cep->name, "source") ||
!strcmp(cep->name, "version") ||
!strcmp(cep->name, "author") ||
!strcmp(cep->name, "sha256sum") ||
!strcmp(cep->name, "description")
)
{
config_error("%s:%d: module::%s should not be in here (it only exists in repository entries)",
m->name, cep->ce_varlinenum, cep->ce_varname);
m->name, cep->line_number, cep->name);
return 0;
}
else if (!strcmp(cep->ce_varname, "troubleshooting"))
else if (!strcmp(cep->name, "troubleshooting"))
{
CheckNull(cep);
safe_strdup(m->troubleshooting, cep->ce_vardata);
safe_strdup(m->troubleshooting, cep->value);
}
else if (!strcmp(cep->ce_varname, "documentation"))
else if (!strcmp(cep->name, "documentation"))
{
CheckNull(cep);
safe_strdup(m->documentation, cep->ce_vardata);
safe_strdup(m->documentation, cep->value);
}
else if (!strcmp(cep->ce_varname, "min-unrealircd-version"))
else if (!strcmp(cep->name, "min-unrealircd-version"))
{
CheckNull(cep);
safe_strdup(m->min_unrealircd_version, cep->ce_vardata);
safe_strdup(m->min_unrealircd_version, cep->value);
}
else if (!strcmp(cep->ce_varname, "max-unrealircd-version"))
else if (!strcmp(cep->name, "max-unrealircd-version"))
{
CheckNull(cep);
safe_strdup(m->max_unrealircd_version, cep->ce_vardata);
safe_strdup(m->max_unrealircd_version, cep->value);
}
else if (!strcmp(cep->ce_varname, "post-install-text"))
else if (!strcmp(cep->name, "post-install-text"))
{
if (cep->ce_entries)
if (cep->items)
{
ConfigEntry *cepp;
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
addmultiline(&m->post_install_text, cepp->ce_varname);
for (cepp = cep->items; cepp; cepp = cepp->next)
addmultiline(&m->post_install_text, cepp->name);
} else {
CheckNull(cep);
addmultiline(&m->post_install_text, cep->ce_vardata);
addmultiline(&m->post_install_text, cep->value);
}
}
/* unknown items are silently ignored for future compatibility */
@ -403,19 +403,19 @@ int mm_module_file_config(ManagedModule *m, ConfigEntry *ce)
if (!m->documentation)
{
config_error("%s:%d: module::documentation missing", m->name, ce->ce_varlinenum);
config_error("%s:%d: module::documentation missing", m->name, ce->line_number);
return 0;
}
if (!m->troubleshooting)
{
config_error("%s:%d: module::troubleshooting missing", m->name, ce->ce_varlinenum);
config_error("%s:%d: module::troubleshooting missing", m->name, ce->line_number);
return 0;
}
if (!m->min_unrealircd_version)
{
config_error("%s:%d: module::min-unrealircd-version missing", m->name, ce->ce_varlinenum);
config_error("%s:%d: module::min-unrealircd-version missing", m->name, ce->line_number);
return 0;
}
@ -438,9 +438,9 @@ int mm_parse_module_file(ManagedModule *m, char *buf, unsigned int line_offset)
return 0; /* eg: parse errors */
/* Parse the module { } block (only one!) */
for (ce = cf->cf_entries; ce; ce = ce->ce_next)
for (ce = cf->items; ce; ce = ce->next)
{
if (!strcmp(ce->ce_varname, "module"))
if (!strcmp(ce->name, "module"))
{
int n = mm_module_file_config(m, ce);
config_free(cf);
@ -652,7 +652,8 @@ int mm_valid_module_name(char *name)
return 1;
}
#define CheckNull(x) if ((!(x)->ce_vardata) || (!(*((x)->ce_vardata)))) { config_error("%s:%i: missing parameter", repo_url, (x)->ce_varlinenum); goto fail_mm_repo_module_config; }
#undef CheckNull
#define CheckNull(x) if ((!(x)->value) || (!(*((x)->value)))) { config_error("%s:%i: missing parameter", repo_url, (x)->line_number); goto fail_mm_repo_module_config; }
/** Parse a module { } line from a repository */
ManagedModule *mm_repo_module_config(char *repo_url, ConfigEntry *ce)
@ -660,84 +661,84 @@ ManagedModule *mm_repo_module_config(char *repo_url, ConfigEntry *ce)
ConfigEntry *cep;
ManagedModule *m = safe_alloc(sizeof(ManagedModule));
if (!ce->ce_vardata)
if (!ce->value)
{
config_error("%s:%d: module { } with no name",
repo_url, ce->ce_varlinenum);
repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (strncmp(ce->ce_vardata, "third/", 6))
if (strncmp(ce->value, "third/", 6))
{
config_error("%s:%d: module { } name must start with: third/",
repo_url, ce->ce_varlinenum);
repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!mm_valid_module_name(ce->ce_vardata))
if (!mm_valid_module_name(ce->value))
{
config_error("%s:%d: module { } with illegal name: %s",
repo_url, ce->ce_varlinenum, ce->ce_vardata);
repo_url, ce->line_number, ce->value);
goto fail_mm_repo_module_config;
}
safe_strdup(m->name, ce->ce_vardata);
safe_strdup(m->name, ce->value);
safe_strdup(m->repo_url, repo_url);
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!strcmp(cep->ce_varname, "source"))
if (!strcmp(cep->name, "source"))
{
CheckNull(cep);
safe_strdup(m->source, cep->ce_vardata);
safe_strdup(m->source, cep->value);
}
else if (!strcmp(cep->ce_varname, "sha256sum"))
else if (!strcmp(cep->name, "sha256sum"))
{
CheckNull(cep);
safe_strdup(m->sha256sum, cep->ce_vardata);
safe_strdup(m->sha256sum, cep->value);
}
else if (!strcmp(cep->ce_varname, "version"))
else if (!strcmp(cep->name, "version"))
{
CheckNull(cep);
safe_strdup(m->version, cep->ce_vardata);
safe_strdup(m->version, cep->value);
}
else if (!strcmp(cep->ce_varname, "author"))
else if (!strcmp(cep->name, "author"))
{
CheckNull(cep);
safe_strdup(m->author, cep->ce_vardata);
safe_strdup(m->author, cep->value);
}
else if (!strcmp(cep->ce_varname, "troubleshooting"))
else if (!strcmp(cep->name, "troubleshooting"))
{
CheckNull(cep);
safe_strdup(m->troubleshooting, cep->ce_vardata);
safe_strdup(m->troubleshooting, cep->value);
}
else if (!strcmp(cep->ce_varname, "documentation"))
else if (!strcmp(cep->name, "documentation"))
{
CheckNull(cep);
safe_strdup(m->documentation, cep->ce_vardata);
safe_strdup(m->documentation, cep->value);
}
else if (!strcmp(cep->ce_varname, "min-unrealircd-version"))
else if (!strcmp(cep->name, "min-unrealircd-version"))
{
CheckNull(cep);
safe_strdup(m->min_unrealircd_version, cep->ce_vardata);
safe_strdup(m->min_unrealircd_version, cep->value);
}
else if (!strcmp(cep->ce_varname, "max-unrealircd-version"))
else if (!strcmp(cep->name, "max-unrealircd-version"))
{
CheckNull(cep);
safe_strdup(m->max_unrealircd_version, cep->ce_vardata);
safe_strdup(m->max_unrealircd_version, cep->value);
}
else if (!strcmp(cep->ce_varname, "description"))
else if (!strcmp(cep->name, "description"))
{
CheckNull(cep);
safe_strdup(m->description, cep->ce_vardata);
safe_strdup(m->description, cep->value);
}
else if (!strcmp(cep->ce_varname, "post-install-text"))
else if (!strcmp(cep->name, "post-install-text"))
{
if (cep->ce_entries)
if (cep->items)
{
ConfigEntry *cepp;
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
addmultiline(&m->post_install_text, cepp->ce_varname);
for (cepp = cep->items; cepp; cepp = cepp->next)
addmultiline(&m->post_install_text, cepp->name);
} else {
CheckNull(cep);
addmultiline(&m->post_install_text, cep->ce_vardata);
addmultiline(&m->post_install_text, cep->value);
}
}
/* unknown items are silently ignored for future compatibility */
@ -745,43 +746,43 @@ ManagedModule *mm_repo_module_config(char *repo_url, ConfigEntry *ce)
if (!m->source)
{
config_error("%s:%d: module::source missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::source missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!m->sha256sum)
{
config_error("%s:%d: module::sha256sum missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::sha256sum missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!m->version)
{
config_error("%s:%d: module::version missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::version missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!m->author)
{
config_error("%s:%d: module::author missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::author missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!m->documentation)
{
config_error("%s:%d: module::documentation missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::documentation missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!m->troubleshooting)
{
config_error("%s:%d: module::troubleshooting missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::troubleshooting missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
if (!m->min_unrealircd_version)
{
config_error("%s:%d: module::min-unrealircd-version missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::min-unrealircd-version missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
/* max_unrealircd_version is optional */
if (!m->description)
{
config_error("%s:%d: module::description missing", repo_url, ce->ce_varlinenum);
config_error("%s:%d: module::description missing", repo_url, ce->line_number);
goto fail_mm_repo_module_config;
}
/* post_install_text is optional */
@ -805,9 +806,9 @@ int mm_parse_repo_db(char *url, char *filename)
if (!cf)
return 0; /* eg: parse errors */
for (ce = cf->cf_entries; ce; ce = ce->ce_next)
for (ce = cf->items; ce; ce = ce->next)
{
if (!strcmp(ce->ce_varname, "module"))
if (!strcmp(ce->name, "module"))
{
m = mm_repo_module_config(url, ce);
if (!m)
@ -957,7 +958,7 @@ int mm_get_module_status(ManagedModule *m)
{
FILE *fd;
char fname[512];
char *our_sha256sum;
const char *our_sha256sum;
snprintf(fname, sizeof(fname), "%s/src/modules/%s.c", BUILDDIR, m->name);
if (!file_exists(fname))
@ -1142,7 +1143,7 @@ int mm_compile(ManagedModule *m, char *tmpfile, int test)
{
char newpath[512];
char cmd[512];
char *basename;
const char *basename;
char *p;
FILE *fd;
char buf[512];
@ -1213,15 +1214,15 @@ int mm_compile(ManagedModule *m, char *tmpfile, int test)
*/
void mm_install_module(ManagedModule *m)
{
char *basename = unreal_getfilename(m->source);
const char *basename = unreal_getfilename(m->source);
char *tmpfile;
char *sha256;
const char *sha256;
if (!basename)
basename = "mod.c";
tmpfile = unreal_mktemp(TMPDIR, basename);
printf("Downloading %s from %s...\n", m->name, m->source);
printf("ConfigResourceing %s from %s...\n", m->name, m->source);
if (!mm_http_request(m->source, tmpfile, 1))
{
fprintf(stderr, "Repository %s seems to list a module file that cannot be retrieved (%s).\n", m->repo_url, m->source);
@ -1535,7 +1536,7 @@ void print_md_block(FILE *fdo, ManagedModule *m)
void mm_generate_repository_usage(void)
{
fprintf(stderr, "Usage: ./unrealircd module generate-repository <url base path> <directory-with-modules> <name of output file>\n");
fprintf(stderr, "Usage: ./unrealircd module generate-repository <url base path> <directory-with-modules> <name of output file> [optional-minimum-version-filter]\n");
fprintf(stderr, "For example: ./unrealircd module generate-repository https://www.unrealircd.org/modules/ src/modules/third modules.lst\n");
}
@ -1547,6 +1548,7 @@ void mm_generate_repository(int argc, char *args[])
char *urlbasepath;
char *dirname;
char *outputfile;
char *minversion;
char modname[128];
char fullname[512];
ManagedModule *m;
@ -1555,6 +1557,8 @@ void mm_generate_repository(int argc, char *args[])
urlbasepath = args[1];
dirname = args[2];
outputfile = args[3];
minversion = args[4];
if (!urlbasepath || !dirname || !outputfile)
{
mm_generate_repository_usage();
@ -1587,6 +1591,7 @@ void mm_generate_repository(int argc, char *args[])
char *fname = dir->d_name;
if (filename_has_suffix(fname, ".c"))
{
int hide = 0;
snprintf(fullname, sizeof(fullname), "%s/%s", dirname, fname);
snprintf(modname, sizeof(modname), "third/%s", filename_strip_suffix(fname, ".c"));
printf("Processing: %s\n", modname);
@ -1599,7 +1604,12 @@ void mm_generate_repository(int argc, char *args[])
m->sha256sum = strdup(sha256sum_file(fullname));
m->source = safe_alloc(512);
snprintf(m->source, 512, "%s%s.c", urlbasepath, modname + 6);
print_md_block(fdo, m);
/* filter */
if (minversion && m->min_unrealircd_version && strncmp(minversion, m->min_unrealircd_version, strlen(minversion)))
hide = 1;
/* /filter */
if (!hide)
print_md_block(fdo, m);
free_managed_module(m);
m = NULL;
}
@ -1611,7 +1621,7 @@ void mm_generate_repository(int argc, char *args[])
void mm_parse_c_file(int argc, char *args[])
{
char *fullname = args[1];
char *basename;
const char *basename;
char modname[256];
ManagedModule *m;

View File

@ -52,7 +52,7 @@ Module *Module_make(ModuleHeader *header,
#ifdef UNDERSCORE
/* dlsym for OpenBSD */
void *obsd_dlsym(void *handle, char *symbol)
void *obsd_dlsym(void *handle, const char *symbol)
{
size_t buflen = strlen(symbol) + 2;
char *obsdsymbol = safe_alloc(buflen);
@ -69,7 +69,7 @@ void *obsd_dlsym(void *handle, char *symbol)
}
#endif
void deletetmp(char *path)
void deletetmp(const char *path)
{
#ifndef NOREMOVETMP
if (!loop.config_test)
@ -88,7 +88,7 @@ void DeleteTempModules(void)
{
config_error("Unable to open temp directory %s: %s, please create one with the appropriate permissions",
TMPDIR, strerror(errno));
if (!loop.ircd_booted)
if (!loop.booted)
exit(7);
return;
}
@ -131,7 +131,7 @@ void DeleteTempModules(void)
#endif
}
Module *Module_Find(char *name)
Module *Module_Find(const char *name)
{
Module *p;
@ -149,16 +149,16 @@ Module *Module_Find(char *name)
}
int parse_modsys_version(char *version)
int parse_modsys_version(const char *version)
{
if (!strcmp(version, "unrealircd-5"))
return 0x500000;
if (!strcmp(version, "unrealircd-6"))
return 0x600000;
return 0;
}
void make_compiler_string(char *buf, size_t buflen, unsigned int ver)
{
unsigned int maj, min, plevel;
unsigned int maj, min, plevel;
if (ver == 0)
{
@ -180,7 +180,7 @@ unsigned int maj, min, plevel;
* something like "/home/xyz/unrealircd/modules/third/la.so
* (and other tricks)
*/
char *Module_TransformPath(char *path_)
const char *Module_TransformPath(const char *path_)
{
static char path[1024];
@ -202,17 +202,18 @@ char *Module_TransformPath(char *path_)
}
/** This function is the inverse of Module_TransformPath() */
char *Module_GetRelPath(char *fullpath)
const char *Module_GetRelPath(const char *fullpath)
{
static char buf[512];
char prefix[512];
char *s = fullpath;
const char *without_prefix = fullpath;
char *s;
/* Strip the prefix */
snprintf(prefix, sizeof(prefix), "%s/", MODULESDIR);
if (!strncasecmp(fullpath, prefix, strlen(prefix)))
s += strlen(prefix);
strlcpy(buf, s, sizeof(buf));
without_prefix += strlen(prefix);
strlcpy(buf, without_prefix, sizeof(buf));
/* Strip the suffix */
s = strstr(buf, MODULE_SUFFIX);
@ -225,7 +226,7 @@ char *Module_GetRelPath(char *fullpath)
/** Validate a modules' ModuleHeader.
* @returns Error message is returned, or NULL if everything is OK.
*/
static char *validate_mod_header(char *relpath, ModuleHeader *mod_header)
static const char *validate_mod_header(const char *relpath, ModuleHeader *mod_header)
{
char *p;
static char buf[256];
@ -260,7 +261,7 @@ static char *validate_mod_header(char *relpath, ModuleHeader *mod_header)
return NULL; /* SUCCESS */
}
int module_already_in_testing(char *relpath)
int module_already_in_testing(const char *relpath)
{
Module *m;
for (m = Modules; m; m = m->next)
@ -277,7 +278,7 @@ int module_already_in_testing(char *relpath)
/*
* Returns an error if insucessful .. yes NULL is OK!
*/
char *Module_Create(char *path_)
const char *Module_Create(const char *path_)
{
#ifdef _WIN32
HMODULE Mod;
@ -291,15 +292,14 @@ char *Module_Create(char *path_)
char *Mod_Version;
unsigned int *compiler_version;
static char errorbuf[1024];
char *path, *relpath, *tmppath;
const char *path, *relpath, *tmppath;
ModuleHeader *mod_header = NULL;
int ret = 0;
char *reterr;
const char *reterr;
Module *mod = NULL, **Mod_Handle = NULL;
char *expectedmodversion = our_mod_version;
unsigned int expectedcompilerversion = our_compiler_version;
long modsys_ver = 0;
Debug((DEBUG_DEBUG, "Attempting to load module from %s", path_));
path = Module_TransformPath(path_);
@ -447,7 +447,7 @@ char *Module_Create(char *path_)
else
{
/* Return the error .. */
return ((char *)irc_dlerror());
return irc_dlerror();
}
}
@ -524,9 +524,6 @@ void FreeModObj(ModuleObject *obj, Module *m)
else if (obj->type == MOBJ_VERSIONFLAG) {
VersionflagDel(obj->object.versionflag, m);
}
else if (obj->type == MOBJ_SNOMASK) {
SnomaskDel(obj->object.snomask);
}
else if (obj->type == MOBJ_UMODE) {
UmodeDel(obj->object.umode);
}
@ -565,7 +562,9 @@ void FreeModObj(ModuleObject *obj, Module *m)
}
else
{
ircd_log(LOG_ERROR, "FreeModObj() called for unknown object");
unreal_log(ULOG_FATAL, "module", "FREEMODOBJ_UNKNOWN_TYPE", NULL,
"[BUG] FreeModObj() called for unknown object (type $type)",
log_data_integer("type", obj->type));
abort();
}
}
@ -655,8 +654,6 @@ int Module_free(Module *mod)
for (cp = mod->children; cp; cp = cp->next)
{
sendto_realops("Unloading child module %s",
cp->child->header->name);
Module_Unload(cp->child->header->name);
}
for (objs = mod->objects; objs; objs = next) {
@ -693,7 +690,7 @@ int Module_free(Module *mod)
* 1 Module unloaded
* 2 Module wishes delayed unloading, has placed event
*/
int Module_Unload(char *name)
int Module_Unload(const char *name)
{
Module *m;
int (*Mod_Unload)();
@ -734,11 +731,6 @@ void module_loadall(void)
iFP fp;
Module *mi, *next;
if (!loop.ircd_booted)
{
sendto_realops("Ehh, !loop.ircd_booted in module_loadall()");
return ;
}
/* Run through all modules and check for module load */
for (mi = Modules; mi; mi = next)
{
@ -799,12 +791,12 @@ CMD_FUNC(cmd_module)
all = 1;
if (MyUser(client) && !IsOper(client) && all)
client->local->since += 7; /* Lag them up. Big list. */
add_fake_lag(client, 7000); /* Lag them up. Big list. */
if ((parc > 2) && (hunt_server(client, recv_mtags, ":%s MODULE %s :%s", 2, parc, parv) != HUNTED_ISME))
if ((parc > 2) && (hunt_server(client, recv_mtags, "MODULE", 2, parc, parv) != HUNTED_ISME))
return;
if ((parc == 2) && (parv[1][0] != '-') && (hunt_server(client, recv_mtags, ":%s MODULE :%s", 1, parc, parv) != HUNTED_ISME))
if ((parc == 2) && (parv[1][0] != '-') && (hunt_server(client, recv_mtags, "MODULE", 1, parc, parv) != HUNTED_ISME))
return;
if (all)
@ -884,7 +876,7 @@ CMD_FUNC(cmd_module)
sendtxtnumeric(client, "Override: %s", tmp);
}
Hooktype *HooktypeFind(char *string) {
Hooktype *HooktypeFind(const char *string) {
Hooktype *hooktype;
for (hooktype = Hooktypes; hooktype->string ;hooktype++) {
if (!strcasecmp(hooktype->string, string))
@ -984,7 +976,7 @@ void VersionflagDel(Versionflag *vflag, Module *module)
}
}
Hook *HookAddMain(Module *module, int hooktype, int priority, int (*func)(), void (*vfunc)(), char *(*cfunc)())
Hook *HookAddMain(Module *module, int hooktype, int priority, int (*func)(), void (*vfunc)(), char *(*stringfunc)(), const char *(*conststringfunc)())
{
Hook *p;
@ -993,8 +985,10 @@ Hook *HookAddMain(Module *module, int hooktype, int priority, int (*func)(), voi
p->func.intfunc = func;
if (vfunc)
p->func.voidfunc = vfunc;
if (cfunc)
p->func.pcharfunc = cfunc;
if (stringfunc)
p->func.stringfunc = stringfunc;
if (conststringfunc)
p->func.conststringfunc = conststringfunc;
p->type = hooktype;
p->owner = module;
p->priority = priority;
@ -1036,17 +1030,40 @@ Hook *HookDel(Hook *hook)
return NULL;
}
Callback *CallbackAddMain(Module *module, int cbtype, int (*func)(), void (*vfunc)(), char *(*cfunc)())
static int num_callbacks(int cbtype)
{
Callback *e;
int cnt = 0;
for (e = Callbacks[cbtype]; e; e = e->next)
if (!e->willberemoved)
cnt++;
return cnt;
}
Callback *CallbackAddMain(Module *module, int cbtype, int (*func)(), void (*vfunc)(), void *(*pvfunc)(), char *(*stringfunc)(), const char *(*conststringfunc)())
{
Callback *p;
if (num_callbacks(cbtype) > 0)
{
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
p = safe_alloc(sizeof(Callback));
if (func)
p->func.intfunc = func;
if (vfunc)
p->func.voidfunc = vfunc;
if (cfunc)
p->func.pcharfunc = cfunc;
if (pvfunc)
p->func.pvoidfunc = pvfunc;
if (stringfunc)
p->func.stringfunc = stringfunc;
if (conststringfunc)
p->func.conststringfunc = conststringfunc;
p->type = cbtype;
p->owner = module;
AddListItem(p, Callbacks[cbtype]);
@ -1086,7 +1103,7 @@ Callback *CallbackDel(Callback *cb)
return NULL;
}
CommandOverride *CommandOverrideAddEx(Module *module, char *name, int priority, OverrideCmdFunc function)
CommandOverride *CommandOverrideAdd(Module *module, const char *name, int priority, OverrideCmdFunc function)
{
RealCommand *p;
CommandOverride *ovr;
@ -1108,7 +1125,7 @@ CommandOverride *CommandOverrideAddEx(Module *module, char *name, int priority,
}
ovr = safe_alloc(sizeof(CommandOverride));
ovr->func = function;
ovr->owner = module; /* TODO: module objects */
ovr->owner = module;
ovr->priority = priority;
if (module)
{
@ -1127,11 +1144,6 @@ CommandOverride *CommandOverrideAddEx(Module *module, char *name, int priority,
return ovr;
}
CommandOverride *CommandOverrideAdd(Module *module, char *name, OverrideCmdFunc function)
{
return CommandOverrideAddEx(module, name, 0, function);
}
void CommandOverrideDel(CommandOverride *cmd)
{
DelListItem(cmd, cmd->command->overriders);
@ -1157,7 +1169,7 @@ void CommandOverrideDel(CommandOverride *cmd)
safe_free(cmd);
}
void CallCommandOverride(CommandOverride *ovr, Client *client, MessageTag *mtags, int parc, char *parv[])
void CallCommandOverride(CommandOverride *ovr, Client *client, MessageTag *mtags, int parc, const char *parv[])
{
if (ovr->next)
ovr->next->func(ovr->next, client, mtags, parc, parv);
@ -1171,21 +1183,27 @@ EVENT(e_unload_module_delayed)
int i;
i = Module_Unload(name);
if (i == 1)
sendto_realops("Unloaded module %s", name);
{
unreal_log(ULOG_INFO, "module", "MODULE_UNLOADING_DELAYED", NULL,
"Unloading module $module_name (was delayed earlier)",
log_data_string("module_name", name));
}
safe_free(name);
extcmodes_check_for_changes();
umodes_check_for_changes();
return;
}
void unload_all_modules(void)
void unload_all_modules(void)
{
Module *m;
int (*Mod_Unload)();
for (m = Modules; m; m = m->next)
{
#ifdef DEBUGMODE
ircd_log(LOG_ERROR, "Unloading %s...", m->header->name);
unreal_log(ULOG_DEBUG, "module", "MODULE_UNLOADING", NULL,
"Unloading module $module_name",
log_data_string("module_name", m->header->name));
#endif
irc_dlsym(m->dll, "Mod_Unload", Mod_Unload);
if (Mod_Unload)
@ -1237,18 +1255,6 @@ const char *ModuleGetErrorStr(Module *module)
return module_error_str[module->errorcode];
}
static int num_callbacks(int cbtype)
{
Callback *e;
int cnt = 0;
for (e = Callbacks[cbtype]; e; e = e->next)
if (!e->willberemoved)
cnt++;
return cnt;
}
/** Ensure that all required callbacks are in place and meet
* all specified requirements
*/
@ -1262,11 +1268,21 @@ int i;
{
config_error("ERROR: Multiple callbacks loaded for type %d. "
"Make sure you only load 1 module of 1 type (eg: only 1 cloaking module)",
i); /* TODO: make more clear? */
i);
return -1;
}
}
if (!Callbacks[CALLBACKTYPE_CLOAK_KEY_CHECKSUM])
{
unreal_log(ULOG_ERROR, "config", "NO_CLOAKING_MODULE", NULL,
"No cloaking module loaded, you must load 1 of these modulese:\n"
"1) cloak_sha256 - if you are a new network starting with UnrealIRCd 6\n"
"2) cloak_md5 - the old one if migrating an existing network from UnrealIRCd 3.2/4/5\n"
"3) cloak_none - if you don't want to use cloaking at all\n"
"See also https://www.unrealircd.org/docs/FAQ#choose-a-cloaking-module");
return -1;
}
return 0;
}
@ -1311,7 +1327,7 @@ const char *our_dlerror(void)
* @note The name is checked against the module name,
* this can be a problem if two modules have the same name.
*/
int is_module_loaded(char *name)
int is_module_loaded(const char *name)
{
Module *mi;
for (mi = Modules; mi; mi = mi->next)
@ -1325,17 +1341,17 @@ int is_module_loaded(char *name)
return 0;
}
static char *mod_var_name(ModuleInfo *modinfo, char *varshortname)
static const char *mod_var_name(ModuleInfo *modinfo, const char *varshortname)
{
static char fullname[512];
snprintf(fullname, sizeof(fullname), "%s:%s", modinfo->handle->header->name, varshortname);
return fullname;
}
int LoadPersistentPointerX(ModuleInfo *modinfo, char *varshortname, void **var, void (*free_variable)(ModData *m))
int LoadPersistentPointerX(ModuleInfo *modinfo, const char *varshortname, void **var, void (*free_variable)(ModData *m))
{
ModDataInfo *m;
char *fullname = mod_var_name(modinfo, varshortname);
const char *fullname = mod_var_name(modinfo, varshortname);
m = findmoddata_byname(fullname, MODDATATYPE_LOCAL_VARIABLE);
if (m)
@ -1346,27 +1362,28 @@ int LoadPersistentPointerX(ModuleInfo *modinfo, char *varshortname, void **var,
ModDataInfo mreq;
memset(&mreq, 0, sizeof(mreq));
mreq.type = MODDATATYPE_LOCAL_VARIABLE;
mreq.name = fullname;
mreq.name = strdup(fullname);
mreq.free = free_variable;
m = ModDataAdd(modinfo->handle, mreq);
moddata_local_variable(m).ptr = NULL;
safe_free(mreq.name);
return 0;
}
}
void SavePersistentPointerX(ModuleInfo *modinfo, char *varshortname, void *var)
void SavePersistentPointerX(ModuleInfo *modinfo, const char *varshortname, void *var)
{
ModDataInfo *m;
char *fullname = mod_var_name(modinfo, varshortname);
const char *fullname = mod_var_name(modinfo, varshortname);
m = findmoddata_byname(fullname, MODDATATYPE_LOCAL_VARIABLE);
moddata_local_variable(m).ptr = var;
}
int LoadPersistentIntX(ModuleInfo *modinfo, char *varshortname, int *var)
int LoadPersistentIntX(ModuleInfo *modinfo, const char *varshortname, int *var)
{
ModDataInfo *m;
char *fullname = mod_var_name(modinfo, varshortname);
const char *fullname = mod_var_name(modinfo, varshortname);
m = findmoddata_byname(fullname, MODDATATYPE_LOCAL_VARIABLE);
if (m)
@ -1377,27 +1394,28 @@ int LoadPersistentIntX(ModuleInfo *modinfo, char *varshortname, int *var)
ModDataInfo mreq;
memset(&mreq, 0, sizeof(mreq));
mreq.type = MODDATATYPE_LOCAL_VARIABLE;
mreq.name = fullname;
mreq.name = strdup(fullname);
mreq.free = NULL;
m = ModDataAdd(modinfo->handle, mreq);
moddata_local_variable(m).i = 0;
safe_free(mreq.name);
return 0;
}
}
void SavePersistentIntX(ModuleInfo *modinfo, char *varshortname, int var)
void SavePersistentIntX(ModuleInfo *modinfo, const char *varshortname, int var)
{
ModDataInfo *m;
char *fullname = mod_var_name(modinfo, varshortname);
const char *fullname = mod_var_name(modinfo, varshortname);
m = findmoddata_byname(fullname, MODDATATYPE_LOCAL_VARIABLE);
moddata_local_variable(m).i = var;
}
int LoadPersistentLongX(ModuleInfo *modinfo, char *varshortname, long *var)
int LoadPersistentLongX(ModuleInfo *modinfo, const char *varshortname, long *var)
{
ModDataInfo *m;
char *fullname = mod_var_name(modinfo, varshortname);
const char *fullname = mod_var_name(modinfo, varshortname);
m = findmoddata_byname(fullname, MODDATATYPE_LOCAL_VARIABLE);
if (m)
@ -1408,18 +1426,19 @@ int LoadPersistentLongX(ModuleInfo *modinfo, char *varshortname, long *var)
ModDataInfo mreq;
memset(&mreq, 0, sizeof(mreq));
mreq.type = MODDATATYPE_LOCAL_VARIABLE;
mreq.name = fullname;
mreq.name = strdup(fullname);
mreq.free = NULL;
m = ModDataAdd(modinfo->handle, mreq);
moddata_local_variable(m).l = 0;
safe_free(mreq.name);
return 0;
}
}
void SavePersistentLongX(ModuleInfo *modinfo, char *varshortname, long var)
void SavePersistentLongX(ModuleInfo *modinfo, const char *varshortname, long var)
{
ModDataInfo *m;
char *fullname = mod_var_name(modinfo, varshortname);
const char *fullname = mod_var_name(modinfo, varshortname);
m = findmoddata_byname(fullname, MODDATATYPE_LOCAL_VARIABLE);
moddata_local_variable(m).l = var;

View File

@ -28,13 +28,14 @@ INCLUDES = ../include/channel.h \
../include/ircsprintf.h \
../include/license.h \
../include/modules.h ../include/modversion.h ../include/msg.h \
../include/numeric.h ../include/proto.h ../include/dns.h \
../include/numeric.h ../include/dns.h \
../include/resource.h ../include/setup.h \
../include/struct.h ../include/sys.h \
../include/types.h ../include/url.h \
../include/types.h \
../include/version.h ../include/whowas.h
R_MODULES= \
MODULES= \
cloak_md5.so cloak_sha256.so cloak_none.so \
sethost.so chghost.so chgident.so setname.so \
setident.so sdesc.so svsmode.so swhois.so\
svsmotd.so svsnline.so who_old.so whox.so mkpasswd.so \
@ -49,7 +50,7 @@ R_MODULES= \
invite.so list.so time.so svskill.so sjoin.so \
pass.so userhost.so ison.so silence.so knock.so \
umode2.so squit.so protoctl.so addomotd.so \
wallops.so admin.so globops.so locops.so \
admin.so globops.so locops.so \
trace.so netinfo.so links.so help.so rules.so \
close.so map.so eos.so server.so stats.so \
dccdeny.so whowas.so \
@ -71,604 +72,48 @@ R_MODULES= \
account-tag.so labeled-response.so link-security.so \
message-ids.so plaintext-policy.so server-time.so sts.so \
echo-message.so userip-tag.so userhost-tag.so \
bot-tag.so \
reply-tag.so typing-indicator.so \
bot-tag.so reply-tag.so json-log-tag.so \
typing-indicator.so \
ident_lookup.so history.so chathistory.so \
targetfloodprot.so clienttagdeny.so
targetfloodprot.so clienttagdeny.so watch-backend.so \
monitor.so slog.so tls_cipher.so operinfo.so \
unreal_server_compat.so \
extended-monitor.so geoip_csv.so \
geoip_base.so extjwt.so \
$(GEOIP_CLASSIC_OBJECTS) $(GEOIP_MAXMIND_OBJECTS)
MODULES=cloak.so $(R_MODULES)
MODULEFLAGS=@MODULEFLAGS@
RM=@RM@
.SUFFIXES:
.SUFFIXES: .c .h .so
all: build
build: $(MODULES)
cd chanmodes; $(MAKE) all
cd usermodes; $(MAKE) all
cd snomasks; $(MAKE) all
cd extbans; $(MAKE) all
cd third; $(MAKE) all
#############################################################################
# .so's section
#############################################################################
chgname.so: chgname.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o chgname.so chgname.c
kill.so: kill.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o kill.so kill.c
lag.so: lag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o lag.so lag.c
message.so: message.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o message.so message.c
oper.so: oper.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o oper.so oper.c
pingpong.so: pingpong.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o pingpong.so pingpong.c
quit.so: quit.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o quit.so quit.c
sendumode.so: sendumode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sendumode.so sendumode.c
sqline.so: sqline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sqline.so sqline.c
tsctl.so: tsctl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o tsctl.so tsctl.c
unsqline.so: unsqline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o unsqline.so unsqline.c
whois.so: whois.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o whois.so whois.c
sethost.so: sethost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sethost.so sethost.c
chghost.so: chghost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o chghost.so chghost.c
chgident.so: chgident.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o chgident.so chgident.c
setident.so: setident.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o setident.so setident.c
setname.so: setname.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o setname.so setname.c
sdesc.so: sdesc.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sdesc.so sdesc.c
svsmode.so: svsmode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsmode.so svsmode.c
swhois.so: swhois.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o swhois.so swhois.c
svsmotd.so: svsmotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsmotd.so svsmotd.c
svsnline.so: svsnline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsnline.so svsnline.c
who_old.so: who_old.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o who_old.so who_old.c
whox.so: whox.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o whox.so whox.c
mkpasswd.so: mkpasswd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o mkpasswd.so mkpasswd.c
away.so: away.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o away.so away.c
svsnoop.so: svsnoop.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsnoop.so svsnoop.c
svsnick.so: svsnick.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsnick.so svsnick.c
tkl.so: tkl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o tkl.so tkl.c
vhost.so: vhost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o vhost.so vhost.c
cycle.so: cycle.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o cycle.so cycle.c
svsjoin.so: svsjoin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsjoin.so svsjoin.c
svspart.so: svspart.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svspart.so svspart.c
svslusers.so: svslusers.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svslusers.so svslusers.c
svswatch.so: svswatch.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svswatch.so svswatch.c
svssilence.so: svssilence.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svssilence.so svssilence.c
sendsno.so: sendsno.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sendsno.so sendsno.c
svssno.so: svssno.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svssno.so svssno.c
sajoin.so: sajoin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sajoin.so sajoin.c
sapart.so: sapart.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sapart.so sapart.c
samode.so: samode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o samode.so samode.c
kick.so: kick.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o kick.so kick.c
topic.so: topic.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o topic.so topic.c
invite.so: invite.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o invite.so invite.c
list.so: list.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o list.so list.c
time.so: time.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o time.so time.c
svskill.so: svskill.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svskill.so svskill.c
sjoin.so: sjoin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sjoin.so sjoin.c
pass.so: pass.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o pass.so pass.c
userhost.so: userhost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o userhost.so userhost.c
ison.so: ison.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o ison.so ison.c
silence.so: silence.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o silence.so silence.c
knock.so: knock.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o knock.so knock.c
umode2.so: umode2.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o umode2.so umode2.c
squit.so: squit.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o squit.so squit.c
protoctl.so: protoctl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o protoctl.so protoctl.c
addmotd.so: addmotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o addmotd.so addmotd.c
addomotd.so: addomotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o addomotd.so addomotd.c
wallops.so: wallops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o wallops.so wallops.c
admin.so: admin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o admin.so admin.c
globops.so: globops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o globops.so globops.c
locops.so: locops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o locops.so locops.c
trace.so: trace.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o trace.so trace.c
netinfo.so: netinfo.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o netinfo.so netinfo.c
links.so: links.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o links.so links.c
help.so: help.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o help.so help.c
rules.so: rules.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o rules.so rules.c
close.so: close.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o close.so close.c
map.so: map.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o map.so map.c
eos.so: eos.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o eos.so eos.c
server.so: server.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o server.so server.c
stats.so: stats.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o stats.so stats.c
dccdeny.so: dccdeny.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o dccdeny.so dccdeny.c
whowas.so: whowas.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o whowas.so whowas.c
connect.so: connect.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o connect.so connect.c
dccallow.so: dccallow.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o dccallow.so dccallow.c
userip.so: userip.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o userip.so userip.c
nick.so: nick.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o nick.so nick.c
user.so: user.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o user.so user.c
mode.so: mode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o mode.so mode.c
watch.so: watch.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o watch.so watch.c
part.so: part.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o part.so part.c
join.so: join.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o join.so join.c
motd.so: motd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o motd.so motd.c
opermotd.so: opermotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o opermotd.so opermotd.c
botmotd.so: botmotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o botmotd.so botmotd.c
lusers.so: lusers.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o lusers.so lusers.c
names.so: names.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o names.so names.c
svsnolag.so: svsnolag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o svsnolag.so svsnolag.c
starttls.so: starttls.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o starttls.so starttls.c
webredir.so: webredir.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o webredir.so webredir.c
cap.so: cap.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o cap.so cap.c
sasl.so: sasl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sasl.so sasl.c
md.so: md.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o md.so md.c
certfp.so: certfp.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o certfp.so certfp.c
tls_antidos.so: tls_antidos.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o tls_antidos.so tls_antidos.c
webirc.so: webirc.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o webirc.so webirc.c
websocket.so: websocket.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o websocket.so websocket.c
blacklist.so: blacklist.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o blacklist.so blacklist.c
jointhrottle.so: jointhrottle.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o jointhrottle.so jointhrottle.c
antirandom.so: antirandom.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o antirandom.so antirandom.c
hideserver.so: hideserver.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o hideserver.so hideserver.c
jumpserver.so: jumpserver.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o jumpserver.so jumpserver.c
ircops.so: ircops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o ircops.so ircops.c
staff.so: staff.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o staff.so staff.c
nocodes.so: nocodes.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o nocodes.so nocodes.c
charsys.so: charsys.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o charsys.so charsys.c
antimixedutf8.so: antimixedutf8.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o antimixedutf8.so antimixedutf8.c
authprompt.so: authprompt.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o authprompt.so authprompt.c
sinfo.so: sinfo.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sinfo.so sinfo.c
reputation.so: reputation.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o reputation.so reputation.c
connthrottle.so: connthrottle.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o connthrottle.so connthrottle.c
history_backend_mem.so: history_backend_mem.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o history_backend_mem.so history_backend_mem.c
history_backend_null.so: history_backend_null.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o history_backend_null.so history_backend_null.c
tkldb.so: tkldb.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o tkldb.so tkldb.c
channeldb.so: channeldb.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o channeldb.so channeldb.c
restrict-commands.so: restrict-commands.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o restrict-commands.so restrict-commands.c
rmtkl.so: rmtkl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o rmtkl.so rmtkl.c
message-tags.so: message-tags.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o message-tags.so message-tags.c
batch.so: batch.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o batch.so batch.c
account-tag.so: account-tag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o account-tag.so account-tag.c
labeled-response.so: labeled-response.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o labeled-response.so labeled-response.c
link-security.so: link-security.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o link-security.so link-security.c
message-ids.so: message-ids.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o message-ids.so message-ids.c
plaintext-policy.so: plaintext-policy.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o plaintext-policy.so plaintext-policy.c
server-time.so: server-time.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o server-time.so server-time.c
sts.so: sts.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o sts.so sts.c
echo-message.so: echo-message.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o echo-message.so echo-message.c
userip-tag.so: userip-tag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o userip-tag.so userip-tag.c
userhost-tag.so: userhost-tag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o userhost-tag.so userhost-tag.c
bot-tag.so: bot-tag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o bot-tag.so bot-tag.c
reply-tag.so: reply-tag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o reply-tag.so reply-tag.c
typing-indicator.so: typing-indicator.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o typing-indicator.so typing-indicator.c
require-module.so: require-module.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o require-module.so require-module.c
account-notify.so: account-notify.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o account-notify.so account-notify.c
ident_lookup.so: ident_lookup.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o ident_lookup.so ident_lookup.c
history.so: history.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o history.so history.c
chathistory.so: chathistory.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o chathistory.so chathistory.c
targetfloodprot.so: targetfloodprot.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o targetfloodprot.so targetfloodprot.c
clienttagdeny.so: clienttagdeny.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o clienttagdeny.so clienttagdeny.c
#############################################################################
# capabilities
#############################################################################
#############################################################################
# and now the remaining modules...
#############################################################################
cloak.so: cloak.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o cloak.so cloak.c
clean:
$(RM) -f *.o *.so *~ core
cd chanmodes; $(MAKE) clean
cd usermodes; $(MAKE) clean
cd snomasks; $(MAKE) clean
cd extbans; $(MAKE) clean
cd third; $(MAKE) clean
# Generic *.so rule:
%.so: %.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o $@ $<
# geoip_classic requires extra library
geoip_classic.so: geoip_classic.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) $(GEOIP_CLASSIC_CFLAGS) -DDYNAMIC_LINKING \
-o geoip_classic.so geoip_classic.c @LDFLAGS_PRIVATELIBS@ $(GEOIP_CLASSIC_LIBS)
# geoip_maxmind requires another extra library
geoip_maxmind.so: geoip_maxmind.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) $(LIBMAXMINDDB_CFLAGS) -DDYNAMIC_LINKING \
-o geoip_maxmind.so geoip_maxmind.c @LDFLAGS_PRIVATELIBS@ $(LIBMAXMINDDB_LIBS)

View File

@ -28,7 +28,7 @@ ModuleHeader MOD_HEADER
"5.0", /* Version */
"account-notify CAP", /* Short description of module */
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
/* Variables */
@ -70,7 +70,7 @@ int account_notify_account_login(Client *client, MessageTag *recv_mtags)
CAP_ACCOUNT_NOTIFY, mtags,
":%s ACCOUNT %s",
client->name,
!isdigit(*client->user->svid) ? client->user->svid : "*");
IsLoggedIn(client) ? client->user->account : "*");
free_message_tags(mtags);
return 0;
}

View File

@ -28,14 +28,14 @@ ModuleHeader MOD_HEADER
"5.0",
"account-tag CAP",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
/* Variables */
long CAP_ACCOUNT_TAG = 0L;
int account_tag_mtag_is_ok(Client *client, char *name, char *value);
void mtag_add_account(Client *client, MessageTag *recv_mtags, MessageTag **mtag_list, char *signature);
int account_tag_mtag_is_ok(Client *client, const char *name, const char *value);
void mtag_add_account(Client *client, MessageTag *recv_mtags, MessageTag **mtag_list, const char *signature);
MOD_INIT()
{
@ -75,7 +75,7 @@ MOD_UNLOAD()
* syntax.
* We simply allow account-tag ONLY from servers and with any syntax.
*/
int account_tag_mtag_is_ok(Client *client, char *name, char *value)
int account_tag_mtag_is_ok(Client *client, const char *name, const char *value)
{
if (IsServer(client))
return 1;
@ -83,15 +83,15 @@ int account_tag_mtag_is_ok(Client *client, char *name, char *value)
return 0;
}
void mtag_add_account(Client *client, MessageTag *recv_mtags, MessageTag **mtag_list, char *signature)
void mtag_add_account(Client *client, MessageTag *recv_mtags, MessageTag **mtag_list, const char *signature)
{
MessageTag *m;
if (client && client->user && (*client->user->svid != '*') && !isdigit(*client->user->svid))
if (IsLoggedIn(client))
{
m = safe_alloc(sizeof(MessageTag));
safe_strdup(m->name, "account");
safe_strdup(m->value, client->user->svid);
safe_strdup(m->value, client->user->account);
AddListItem(m, *mtag_list);
}

View File

@ -32,7 +32,7 @@ ModuleHeader MOD_HEADER
"5.0",
"command /addmotd",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
MOD_INIT()
@ -60,7 +60,7 @@ MOD_UNLOAD()
CMD_FUNC(cmd_addmotd)
{
FILE *conf;
char *text;
const char *text;
text = parc > 1 ? parv[1] : NULL;

View File

@ -32,7 +32,7 @@ ModuleHeader MOD_HEADER
"5.0",
"command /addomotd",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
MOD_INIT()
@ -60,7 +60,7 @@ MOD_UNLOAD()
CMD_FUNC(cmd_addomotd)
{
FILE *conf;
char *text;
const char *text;
text = parc > 1 ? parv[1] : NULL;

View File

@ -32,7 +32,7 @@ ModuleHeader MOD_HEADER
"5.0",
"command /admin",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
MOD_INIT()
@ -61,7 +61,7 @@ CMD_FUNC(cmd_admin)
if (IsUser(client))
{
if (hunt_server(client, recv_mtags, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
if (hunt_server(client, recv_mtags, "ADMIN", 1, parc, parv) != HUNTED_ISME)
return;
}

View File

@ -48,7 +48,7 @@ ModuleHeader MOD_HEADER
"1.0",
"Mixed UTF8 character filter (look-alike character spam) - by Syzop",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
struct {
@ -99,22 +99,22 @@ int detect_script(const char *t)
else if ((t[0] == 0xd3) && (t[1] >= 0x80) && (t[1] <= 0xbf))
return SCRIPT_CYRILLIC;
if((t[0] == 0xe4) && (t[1] >= 0xb8) && (t[1] <= 0xbf))
if ((t[0] == 0xe4) && (t[1] >= 0xb8) && (t[1] <= 0xbf))
return SCRIPT_CJK;
else if ((t[0] >= 0xe5) && (t[0] <= 0xe9) && (t[1] >= 0x80) && (t[1] <= 0xbf))
return SCRIPT_CJK;
if((t[0] == 0xea) && (t[1] >= 0xb0) && (t[1] <= 0xbf))
if ((t[0] == 0xea) && (t[1] >= 0xb0) && (t[1] <= 0xbf))
return SCRIPT_HANGUL;
else if ((t[0] >= 0xeb) && (t[0] <= 0xec) && (t[1] >= 0x80) && (t[1] <= 0xbf))
return SCRIPT_HANGUL;
else if ((t[0] == 0xed) && (t[1] >= 0x80) && (t[1] <= 0x9f))
return SCRIPT_HANGUL;
if((t[0] == 0xe1) && (t[1] >= 0x90) && (t[1] <= 0x99))
if ((t[0] == 0xe1) && (t[1] >= 0x90) && (t[1] <= 0x99))
return SCRIPT_CANADIAN;
if((t[0] == 0xe0) && (t[1] >= 0xb0) && (t[1] <= 0xb1))
if ((t[0] == 0xe0) && (t[1] >= 0xb0) && (t[1] <= 0xb1))
return SCRIPT_TELUGU;
if ((t[0] >= 'a') && (t[0] <= 'z'))
@ -206,12 +206,9 @@ CMD_OVERRIDE_FUNC(override_msg)
score = lookalikespam_score(StripControlCodes(parv[2]));
if ((score >= cfg.score) && !find_tkl_exception(TKL_ANTIMIXEDUTF8, client))
{
if (cfg.ban_action == BAN_ACT_KILL)
{
sendto_realops("[antimixedutf8] Killed connection from %s (score %d)",
GetIP(client), score);
} /* no else here!! */
unreal_log(ULOG_INFO, "antimixedutf8", "ANTIMIXEDUTF8_HIT", client,
"[antimixedutf8] Client $client.details hit score $score -- taking action",
log_data_integer("score", score));
if ((cfg.ban_action == BAN_ACT_BLOCK) ||
((cfg.ban_action == BAN_ACT_SOFT_BLOCK) && !IsLoggedIn(client)))
{
@ -246,10 +243,10 @@ MOD_INIT()
MOD_LOAD()
{
if (!CommandOverrideAdd(modinfo->handle, "PRIVMSG", override_msg))
if (!CommandOverrideAdd(modinfo->handle, "PRIVMSG", 0, override_msg))
return MOD_FAILED;
if (!CommandOverrideAdd(modinfo->handle, "NOTICE", override_msg))
if (!CommandOverrideAdd(modinfo->handle, "NOTICE", 0, override_msg))
return MOD_FAILED;
return MOD_SUCCESS;
@ -286,45 +283,45 @@ int antimixedutf8_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *er
return 0;
/* We are only interrested in set::antimixedutf8... */
if (!ce || !ce->ce_varname || strcmp(ce->ce_varname, "antimixedutf8"))
if (!ce || !ce->name || strcmp(ce->name, "antimixedutf8"))
return 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!cep->ce_vardata)
if (!cep->value)
{
config_error("%s:%i: set::antimixedutf8::%s with no value",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
cep->file->filename, cep->line_number, cep->name);
errors++;
} else
if (!strcmp(cep->ce_varname, "score"))
if (!strcmp(cep->name, "score"))
{
int v = atoi(cep->ce_vardata);
int v = atoi(cep->value);
if ((v < 1) || (v > 99))
{
config_error("%s:%i: set::antimixedutf8::score: must be between 1 - 99 (got: %d)",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, v);
cep->file->filename, cep->line_number, v);
errors++;
}
} else
if (!strcmp(cep->ce_varname, "ban-action"))
if (!strcmp(cep->name, "ban-action"))
{
if (!banact_stringtoval(cep->ce_vardata))
if (!banact_stringtoval(cep->value))
{
config_error("%s:%i: set::antimixedutf8::ban-action: unknown action '%s'",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_vardata);
cep->file->filename, cep->line_number, cep->value);
errors++;
}
} else
if (!strcmp(cep->ce_varname, "ban-reason"))
if (!strcmp(cep->name, "ban-reason"))
{
} else
if (!strcmp(cep->ce_varname, "ban-time"))
if (!strcmp(cep->name, "ban-time"))
{
} else
{
config_error("%s:%i: unknown directive set::antimixedutf8::%s",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
cep->file->filename, cep->line_number, cep->name);
errors++;
}
}
@ -340,26 +337,26 @@ int antimixedutf8_config_run(ConfigFile *cf, ConfigEntry *ce, int type)
return 0;
/* We are only interrested in set::antimixedutf8... */
if (!ce || !ce->ce_varname || strcmp(ce->ce_varname, "antimixedutf8"))
if (!ce || !ce->name || strcmp(ce->name, "antimixedutf8"))
return 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!strcmp(cep->ce_varname, "score"))
if (!strcmp(cep->name, "score"))
{
cfg.score = atoi(cep->ce_vardata);
cfg.score = atoi(cep->value);
} else
if (!strcmp(cep->ce_varname, "ban-action"))
if (!strcmp(cep->name, "ban-action"))
{
cfg.ban_action = banact_stringtoval(cep->ce_vardata);
cfg.ban_action = banact_stringtoval(cep->value);
} else
if (!strcmp(cep->ce_varname, "ban-reason"))
if (!strcmp(cep->name, "ban-reason"))
{
safe_strdup(cfg.ban_reason, cep->ce_vardata);
safe_strdup(cfg.ban_reason, cep->value);
} else
if (!strcmp(cep->ce_varname, "ban-time"))
if (!strcmp(cep->name, "ban-time"))
{
cfg.ban_time = config_checkval(cep->ce_vardata, CFG_TIME);
cfg.ban_time = config_checkval(cep->value, CFG_TIME);
}
}
return 1;

View File

@ -22,24 +22,13 @@
#include "unrealircd.h"
/* You can change this '//#undef' into '#define' if you want to see quite
* a flood for every user that connects (and on-load if cfg.fullstatus_on_load).
* Obviously only recommended for testing, use with care!
*/
#undef DEBUGMODE
/** Change this 'undef' to 'define' to get performance information.
* This really only meant for debugging purposes.
*/
#undef TIMING
ModuleHeader MOD_HEADER
= {
"antirandom",
"1.4",
"Detect and ban users with random names",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
#ifndef MAX
@ -515,7 +504,6 @@ struct {
long ban_time;
int convert_to_lowercase;
int show_failedconnects;
int fullstatus_on_load;
ConfigItem_mask *except_hosts;
int except_webirc;
} cfg;
@ -553,19 +541,14 @@ MOD_INIT()
HookAdd(modinfo->handle, HOOKTYPE_CONFIGRUN, 0, antirandom_config_run);
/* Some default values: */
cfg.fullstatus_on_load = 1;
cfg.convert_to_lowercase = 1;
cfg.except_webirc = 1;
return MOD_SUCCESS;
}
void check_all_users(void);
MOD_LOAD()
{
if (cfg.fullstatus_on_load)
check_all_users();
return MOD_SUCCESS;
}
@ -592,67 +575,64 @@ int antirandom_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
return 0;
/* We are only interrested in set::antirandom... */
if (!ce || !ce->ce_varname || strcmp(ce->ce_varname, "antirandom"))
if (!ce || !ce->name || strcmp(ce->name, "antirandom"))
return 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!strcmp(cep->ce_varname, "except-hosts"))
if (!strcmp(cep->name, "except-hosts"))
{
} else
if (!strcmp(cep->ce_varname, "except-webirc"))
if (!strcmp(cep->name, "except-webirc"))
{
/* This should normally be UNDER the generic 'set::antirandom::%s with no value'
* stuff but I put it here because people may think it's a hostlist and then
* the error can be a tad confusing. -- Syzop
*/
if (!cep->ce_vardata)
if (!cep->value)
{
config_error("%s:%i: set::antirandom::except-webirc should be 'yes' or 'no'",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
cep->file->filename, cep->line_number);
errors++;
}
} else
if (!cep->ce_vardata)
if (!cep->value)
{
config_error("%s:%i: set::antirandom::%s with no value",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
cep->file->filename, cep->line_number, cep->name);
errors++;
} else
if (!strcmp(cep->ce_varname, "threshold"))
if (!strcmp(cep->name, "threshold"))
{
req.threshold = 1;
} else
if (!strcmp(cep->ce_varname, "ban-action"))
if (!strcmp(cep->name, "ban-action"))
{
if (!banact_stringtoval(cep->ce_vardata))
if (!banact_stringtoval(cep->value))
{
config_error("%s:%i: set::antirandom::ban-action: unknown action '%s'",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_vardata);
cep->file->filename, cep->line_number, cep->value);
errors++;
} else
req.ban_action = 1;
} else
if (!strcmp(cep->ce_varname, "ban-reason"))
if (!strcmp(cep->name, "ban-reason"))
{
req.ban_reason = 1;
} else
if (!strcmp(cep->ce_varname, "ban-time"))
if (!strcmp(cep->name, "ban-time"))
{
req.ban_time = 1;
} else
if (!strcmp(cep->ce_varname, "convert-to-lowercase"))
if (!strcmp(cep->name, "convert-to-lowercase"))
{
} else
if (!strcmp(cep->ce_varname, "fullstatus-on-load"))
{
} else
if (!strcmp(cep->ce_varname, "show-failedconnects"))
if (!strcmp(cep->name, "show-failedconnects"))
{
} else
{
config_error("%s:%i: unknown directive set::antirandom::%s",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
cep->file->filename, cep->line_number, cep->name);
errors++;
}
}
@ -668,47 +648,43 @@ int antirandom_config_run(ConfigFile *cf, ConfigEntry *ce, int type)
return 0;
/* We are only interrested in set::antirandom... */
if (!ce || !ce->ce_varname || strcmp(ce->ce_varname, "antirandom"))
if (!ce || !ce->name || strcmp(ce->name, "antirandom"))
return 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!strcmp(cep->ce_varname, "except-hosts"))
if (!strcmp(cep->name, "except-hosts"))
{
for (cep2 = cep->ce_entries; cep2; cep2 = cep2->ce_next)
for (cep2 = cep->items; cep2; cep2 = cep2->next)
unreal_add_masks(&cfg.except_hosts, cep2);
} else
if (!strcmp(cep->ce_varname, "except-webirc"))
if (!strcmp(cep->name, "except-webirc"))
{
cfg.except_webirc = config_checkval(cep->ce_vardata, CFG_YESNO);
cfg.except_webirc = config_checkval(cep->value, CFG_YESNO);
} else
if (!strcmp(cep->ce_varname, "threshold"))
if (!strcmp(cep->name, "threshold"))
{
cfg.threshold = atoi(cep->ce_vardata);
cfg.threshold = atoi(cep->value);
} else
if (!strcmp(cep->ce_varname, "ban-action"))
if (!strcmp(cep->name, "ban-action"))
{
cfg.ban_action = banact_stringtoval(cep->ce_vardata);
cfg.ban_action = banact_stringtoval(cep->value);
} else
if (!strcmp(cep->ce_varname, "ban-reason"))
if (!strcmp(cep->name, "ban-reason"))
{
safe_strdup(cfg.ban_reason, cep->ce_vardata);
safe_strdup(cfg.ban_reason, cep->value);
} else
if (!strcmp(cep->ce_varname, "ban-time"))
if (!strcmp(cep->name, "ban-time"))
{
cfg.ban_time = config_checkval(cep->ce_vardata, CFG_TIME);
cfg.ban_time = config_checkval(cep->value, CFG_TIME);
} else
if (!strcmp(cep->ce_varname, "convert-to-lowercase"))
if (!strcmp(cep->name, "convert-to-lowercase"))
{
cfg.convert_to_lowercase = config_checkval(cep->ce_vardata, CFG_YESNO);
cfg.convert_to_lowercase = config_checkval(cep->value, CFG_YESNO);
}
if (!strcmp(cep->ce_varname, "show-failedconnects"))
if (!strcmp(cep->name, "show-failedconnects"))
{
cfg.show_failedconnects = config_checkval(cep->ce_vardata, CFG_YESNO);
} else
if (!strcmp(cep->ce_varname, "fullstatus-on-load"))
{
cfg.fullstatus_on_load = config_checkval(cep->ce_vardata, CFG_YESNO);
cfg.show_failedconnects = config_checkval(cep->value, CFG_YESNO);
}
}
return 1;
@ -820,24 +796,15 @@ static int internal_getscore(char *str)
if (digits >= 5)
{
score += 5 + (digits - 5);
#ifdef DEBUGMODE
sendto_ops_and_log("score@'%s': MATCH for digits check", str);
#endif
score += digits;
}
if (vowels >= 4)
{
score += 4 + (vowels - 4);
#ifdef DEBUGMODE
sendto_ops_and_log("score@'%s': MATCH for vowels check", str);
#endif
score += vowels;
}
if (consonants >= 4)
{
score += 4 + (consonants - 4);
#ifdef DEBUGMODE
sendto_ops_and_log("score@'%s': MATCH for consonants check", str);
#endif
score += consonants;
}
for (t=triples; t; t=t->next)
@ -846,10 +813,6 @@ static int internal_getscore(char *str)
if ((t->two[0] == s[0]) && (t->two[1] == s[1]) && s[2] && strchr(t->rest, s[2]))
{
score++; /* OK */
#ifdef DEBUGMODE
sendto_ops_and_log("score@'%s': MATCH for '%s[%s]' %c/%c/%c", str, t->two, t->rest,
s[0], s[1], s[2]);
#endif
}
}
@ -868,11 +831,6 @@ static int get_spam_score(Client *client)
char *gecos = client->info;
char nbuf[NICKLEN+1], ubuf[USERLEN+1], rbuf[REALLEN+1];
int nscore, uscore, gscore, score;
#ifdef TIMING
struct timeval tv_alpha, tv_beta;
gettimeofday(&tv_alpha, NULL);
#endif
if (cfg.convert_to_lowercase)
{
@ -889,46 +847,9 @@ static int get_spam_score(Client *client)
gscore = internal_getscore(gecos);
score = nscore + uscore + gscore;
#ifdef TIMING
gettimeofday(&tv_beta, NULL);
ircd_log(LOG_ERROR, "AntiRandom Timing: %ld microseconds",
((tv_beta.tv_sec - tv_alpha.tv_sec) * 1000000) + (tv_beta.tv_usec - tv_alpha.tv_usec));
#endif
#ifdef DEBUGMODE
sendto_ops_and_log("got score: %d/%d/%d = %d",
nscore, uscore, gscore, score);
#endif
return score;
}
void check_all_users(void)
{
Client *client;
int matches=0, score;
list_for_each_entry(client, &lclient_list, lclient_node)
{
if (IsUser(client))
{
if (is_exempt(client))
continue;
score = get_spam_score(client);
if (score > cfg.threshold)
{
if (!matches)
sendto_realops("[antirandom] Full status report follows:");
sendto_realops("%d points: %s!%s@%s:%s",
score, client->name, client->user->username, client->user->realhost, client->info);
matches++;
}
}
}
if (matches)
sendto_realops("[antirandom] %d match%s", matches, matches == 1 ? "" : "es");
}
int antirandom_preconnect(Client *client)
{
int score;
@ -941,13 +862,17 @@ int antirandom_preconnect(Client *client)
{
if (cfg.ban_action == BAN_ACT_WARN)
{
sendto_ops_and_log("[antirandom] would have denied access to user with score %d: %s!%s@%s:%s",
score, client->name, client->user->username, client->user->realhost, client->info);
unreal_log(ULOG_INFO, "antirandom", "ANTIRANDOM_DENIED_USER", client,
"[antirandom] would have denied access to user with score $score: $client:$client.info",
log_data_integer("score", score));
return HOOK_CONTINUE;
}
if (cfg.show_failedconnects)
sendto_ops_and_log("[antirandom] denied access to user with score %d: %s!%s@%s:%s",
score, client->name, client->user->username, client->user->realhost, client->info);
{
unreal_log(ULOG_INFO, "antirandom", "ANTIRANDOM_DENIED_USER", client,
"[antirandom] denied access to user with score $score: $client:$client.info",
log_data_integer("score", score));
}
place_host_ban(client, cfg.ban_action, cfg.ban_reason, cfg.ban_time);
return HOOK_DENY;
}
@ -972,7 +897,7 @@ static int is_exempt(Client *client)
/* WEBIRC gateway and exempt? */
if (cfg.except_webirc)
{
char *val = moddata_client_get(client, "webirc");
const char *val = moddata_client_get(client, "webirc");
if (val && (atoi(val)>0))
return 1;
}

View File

@ -25,7 +25,7 @@ ModuleHeader MOD_HEADER
"1.0",
"SASL authentication for clients that don't support SASL",
"UnrealIRCd Team",
"unrealircd-5",
"unrealircd-6",
};
/** Configuration settings */
@ -33,6 +33,7 @@ struct {
int enabled;
MultiLine *message;
MultiLine *fail_message;
MultiLine *unconfirmed_message;
} cfg;
/** User struct */
@ -50,10 +51,9 @@ static void init_config(void);
static void config_postdefaults(void);
int authprompt_config_test(ConfigFile *, ConfigEntry *, int, int *);
int authprompt_config_run(ConfigFile *, ConfigEntry *, int);
int authprompt_require_sasl(Client *client, char *reason);
int authprompt_sasl_continuation(Client *client, char *buf);
int authprompt_sasl_continuation(Client *client, const char *buf);
int authprompt_sasl_result(Client *client, int success);
int authprompt_place_host_ban(Client *client, int action, char *reason, long duration);
int authprompt_place_host_ban(Client *client, int action, const char *reason, long duration);
int authprompt_find_tkline_match(Client *client, TKL *tk);
int authprompt_pre_connect(Client *client);
CMD_FUNC(cmd_auth);
@ -89,7 +89,6 @@ MOD_INIT()
init_config();
HookAdd(modinfo->handle, HOOKTYPE_CONFIGRUN, 0, authprompt_config_run);
HookAdd(modinfo->handle, HOOKTYPE_REQUIRE_SASL, 0, authprompt_require_sasl);
HookAdd(modinfo->handle, HOOKTYPE_SASL_CONTINUATION, 0, authprompt_sasl_continuation);
HookAdd(modinfo->handle, HOOKTYPE_SASL_RESULT, 0, authprompt_sasl_result);
HookAdd(modinfo->handle, HOOKTYPE_PLACE_HOST_BAN, 0, authprompt_place_host_ban);
@ -133,12 +132,18 @@ static void config_postdefaults(void)
{
addmultiline(&cfg.fail_message, "Authentication failed.");
}
if (!cfg.unconfirmed_message)
{
addmultiline(&cfg.unconfirmed_message, "You are trying to use an unconfirmed services account.");
addmultiline(&cfg.unconfirmed_message, "This services account can only be used after it has been activated/confirmed.");
}
}
static void free_config(void)
{
freemultiline(cfg.message);
freemultiline(cfg.fail_message);
freemultiline(cfg.unconfirmed_message);
memset(&cfg, 0, sizeof(cfg)); /* needed! */
}
@ -151,29 +156,32 @@ int authprompt_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
return 0;
/* We are only interrested in set::authentication-prompt... */
if (!ce || !ce->ce_varname || strcmp(ce->ce_varname, "authentication-prompt"))
if (!ce || !ce->name || strcmp(ce->name, "authentication-prompt"))
return 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!cep->ce_vardata)
if (!cep->value)
{
config_error("%s:%i: set::authentication-prompt::%s with no value",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
cep->file->filename, cep->line_number, cep->name);
errors++;
} else
if (!strcmp(cep->ce_varname, "enabled"))
if (!strcmp(cep->name, "enabled"))
{
} else
if (!strcmp(cep->ce_varname, "message"))
if (!strcmp(cep->name, "message"))
{
} else
if (!strcmp(cep->ce_varname, "fail-message"))
if (!strcmp(cep->name, "fail-message"))
{
} else
if (!strcmp(cep->name, "unconfirmed-message"))
{
} else
{
config_error("%s:%i: unknown directive set::authentication-prompt::%s",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_varname);
cep->file->filename, cep->line_number, cep->name);
errors++;
}
}
@ -189,22 +197,26 @@ int authprompt_config_run(ConfigFile *cf, ConfigEntry *ce, int type)
return 0;
/* We are only interrested in set::authentication-prompt... */
if (!ce || !ce->ce_varname || strcmp(ce->ce_varname, "authentication-prompt"))
if (!ce || !ce->name || strcmp(ce->name, "authentication-prompt"))
return 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
for (cep = ce->items; cep; cep = cep->next)
{
if (!strcmp(cep->ce_varname, "enabled"))
if (!strcmp(cep->name, "enabled"))
{
cfg.enabled = config_checkval(cep->ce_vardata, CFG_YESNO);
cfg.enabled = config_checkval(cep->value, CFG_YESNO);
} else
if (!strcmp(cep->ce_varname, "message"))
if (!strcmp(cep->name, "message"))
{
addmultiline(&cfg.message, cep->ce_vardata);
addmultiline(&cfg.message, cep->value);
} else
if (!strcmp(cep->ce_varname, "fail-message"))
if (!strcmp(cep->name, "fail-message"))
{
addmultiline(&cfg.fail_message, cep->ce_vardata);
addmultiline(&cfg.fail_message, cep->value);
} else
if (!strcmp(cep->name, "unconfirmed-message"))
{
addmultiline(&cfg.unconfirmed_message, cep->value);
}
}
return 1;
@ -257,7 +269,7 @@ char *make_authbuf(const char *username, const char *password)
int size;
size = strlen(username) + 1 + strlen(username) + 1 + strlen(password);
if (size >= sizeof(inbuf))
if (size >= sizeof(inbuf)-1)
return NULL; /* too long */
/* Because size limits are already checked above, we can cut some corners here: */
@ -281,7 +293,7 @@ void send_first_auth(Client *client)
{
Client *sasl_server;
char *addr = BadPtr(client->ip) ? "0" : client->ip;
char *certfp = moddata_client_get(client, "certfp");
const char *certfp = moddata_client_get(client, "certfp");
sasl_server = find_client(SASL_SERVER, NULL);
if (!sasl_server)
{
@ -365,25 +377,8 @@ void authprompt_send_auth_required_message(Client *client)
sendnotice_multiline(client, cfg.message);
}
int authprompt_require_sasl(Client *client, char *reason)
{
/* If the client did SASL then we (authprompt) will not kick in */
if (HasCapability(client, "sasl"))
return 0;
authprompt_tag_as_auth_required(client);
/* Display the require authentication::reason */
if (reason && strcmp(reason, "-") && strcmp(reason, "*"))
sendnotice(client, "%s", reason);
authprompt_send_auth_required_message(client);
return 1;
}
/* Called upon "place a host ban on this user" (eg: spamfilter, blacklist, ..) */
int authprompt_place_host_ban(Client *client, int action, char *reason, long duration)
int authprompt_place_host_ban(Client *client, int action, const char *reason, long duration)
{
/* If it's a soft-xx action and the user is not logged in
* and the user is not yet online, then we will handle this user.
@ -437,7 +432,7 @@ int authprompt_pre_connect(Client *client)
return HOOK_CONTINUE; /* no action taken, proceed normally */
}
int authprompt_sasl_continuation(Client *client, char *buf)
int authprompt_sasl_continuation(Client *client, const char *buf)
{
/* If it's not for us (eg: user is doing real SASL) then return 0. */
if (!SEUSER(client) || !SEUSER(client)->authmsg)
@ -468,10 +463,16 @@ int authprompt_sasl_result(Client *client, int success)
return 1;
}
if (client->user && !IsLoggedIn(client))
{
sendnotice_multiline(client, cfg.unconfirmed_message);
return 1;
}
/* Authentication was a success */
if (*client->name && client->user && *client->user->username && IsNotSpoof(client))
{
register_user(client, client->name, client->user->username, NULL, NULL, NULL);
register_user(client);
/* User MAY be killed now. But since we 'return 1' below, it's safe */
}

Some files were not shown because too many files have changed in this diff Show More