Browse Source

Merge branch 'unrealircd:unreal60_dev' into piss60

pull/45/head
angryce 6 months ago committed by GitHub
parent
commit
6f926b722f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      Config
  2. 1
      Makefile.in
  3. 46
      Makefile.windows
  4. 65
      configure
  5. 19
      configure.ac
  6. 2
      doc/Config.header
  7. 79
      doc/RELEASE-NOTES.md
  8. 5
      doc/conf/help/help.conf
  9. 2
      doc/conf/help/help.es.conf
  10. 2
      doc/conf/help/help.nl.conf
  11. 2
      doc/conf/help/help.pl.conf
  12. 750
      doc/conf/help/help.ru.conf
  13. 2
      doc/conf/help/help.tr.conf
  14. 4
      extras/build-tests/windows/build.bat
  15. BIN
      extras/c-ares.tar.gz
  16. 2
      extras/curlinstall
  17. 2
      extras/doxygen/Doxyfile
  18. BIN
      extras/pcre2.tar.gz
  19. 43
      include/h.h
  20. 5
      include/numeric.h
  21. 3
      include/setup.h.in
  22. 14
      include/struct.h
  23. 1
      include/sys.h
  24. 3
      include/windows/setup.h
  25. 18
      src/Makefile.in
  26. 31
      src/api-command.c
  27. 18
      src/api-event.c
  28. 317
      src/conf.c
  29. 1
      src/dbuf.c
  30. 340
      src/ircd.c
  31. 31
      src/ircd_vars.c
  32. 2
      src/list.c
  33. 24
      src/log.c
  34. 173
      src/misc.c
  35. 14
      src/modules/channeldb.c
  36. 12
      src/modules/geoip_base.c
  37. 70
      src/modules/hideserver.c
  38. 69
      src/modules/map.c
  39. 29
      src/modules/mode.c
  40. 15
      src/modules/stats.c
  41. 36
      src/modules/whox.c
  42. 12
      src/parse.c
  43. 199
      src/proc_io_client.c
  44. 140
      src/proc_io_server.c
  45. 5
      src/send.c
  46. 153
      src/socket.c
  47. 14
      src/tls.c
  48. 245
      src/unrealircdctl.c
  49. 1
      src/user.c
  50. 2
      src/version.c.SH
  51. 8
      src/windows/gui.c
  52. 9
      src/windows/service.c
  53. 3
      src/windows/unrealinst.iss
  54. 10
      src/windows/unrealircdctl.exe.manifest
  55. 60
      unrealircd.in

10
Config

@ -72,6 +72,7 @@ fi
ARG="$ARG--with-bindir=$BINDIR "
ARG="$ARG--with-datadir=$DATADIR "
ARG="$ARG--with-pidfile=$DATADIR/unrealircd.pid "
ARG="$ARG--with-controlfile=$DATADIR/unrealircd.ctl "
ARG="$ARG--with-confdir=$CONFDIR "
ARG="$ARG--with-modulesdir=$MODULESDIR "
ARG="$ARG--with-logdir=$LOGDIR "
@ -701,11 +702,12 @@ 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 "Possible build options:"
echo " classic: This is the DEFAULT geoip engine. It should work on all systems"
echo " and receives automatic updates."
echo "libmaxminddb: This uses the libmaxminddb library. If you want to use this, then"
echo " you need to install the libmaxminddb library on your system first"
echo " none: Don't built with any geoip feature"
echo " none: Don't build with any geoip library (geoip-csv is still built)"
echo "Choose one of: classic, libmaxminddb, none"
echo $n "[$TEST] -> $c"
read cc

1
Makefile.in

@ -179,6 +179,7 @@ depend:
install: all
$(INSTALL) -m 0700 -d $(DESTDIR)@BINDIR@
$(INSTALL) -m 0700 src/ircd $(DESTDIR)@BINDIR@/unrealircd
$(INSTALL) -m 0700 src/unrealircdctl $(DESTDIR)@BINDIR@/unrealircdctl
$(INSTALL) -m 0700 extras/unrealircd-upgrade-script $(DESTDIR)@BINDIR@/unrealircd-upgrade-script
$(INSTALL) -m 0700 -d $(DESTDIR)@DOCDIR@
$(INSTALL) -m 0600 doc/Authors doc/coding-guidelines doc/tao.of.irc doc/KEYS doc/RELEASE-NOTES.md $(DESTDIR)@DOCDIR@

46
Makefile.windows

@ -165,8 +165,7 @@ CFLAGS=$(DBGCFLAG) $(STDOPTIONS) /FS /MP1 /c /Fosrc/
CFLAGSST=$(DBGCFLAGST) $(STDOPTIONS) /FS /MP1 /c /Fosrc/
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib ws2_32.lib advapi32.lib \
dbghelp.lib oldnames.lib comctl32.lib comdlg32.lib $(STDLIBS) \
/def:UnrealIRCd.def /implib:UnrealIRCd.lib \
/nologo $(DBGLFLAG) /out:UnrealIRCd.exe
/nologo $(DBGLFLAG)
MODCFLAGS=$(MODDBGCFLAG) $(STDOPTIONS) /D DYNAMIC_LINKING /D MODULE_COMPILE
MODLFLAGS=/link /def:src/modules/module.def UnrealIRCd.lib ws2_32.lib $(STDLIBS)
@ -174,10 +173,10 @@ INCLUDES=./include/struct.h ./include/config.h ./include/sys.h \
./include/common.h ./include/version.h ./include/h.h ./include/numeric.h \
./include/msg.h ./include/setup.h ./include/dynconf.h
EXP_OBJ_FILES=src/channel.obj src/send.obj src/socket.obj \
src/conf.obj src/conf_preprocessor.obj \
EXP_OBJ_FILES=src/ircd_vars.obj src/channel.obj src/send.obj src/socket.obj \
src/conf.obj src/proc_io_server.obj src/conf_preprocessor.obj \
src/fdlist.obj src/dbuf.obj \
src/hash.obj src/parse.obj src/ircd.obj \
src/hash.obj src/parse.obj \
src/whowas.obj \
src/misc.obj src/match.obj src/crule.obj \
src/debug.obj src/support.obj src/list.obj \
@ -194,7 +193,7 @@ EXP_OBJ_FILES=src/channel.obj src/send.obj src/socket.obj \
src/utf8.obj src/log.obj $(CURLOBJ)
OBJ_FILES=$(EXP_OBJ_FILES) src/gui.obj src/service.obj src/windebug.obj src/rtf.obj \
src/editor.obj src/win.obj
src/editor.obj src/win.obj src/ircd.obj src/proc_io_client.obj
DLL_FILES=\
src/modules/account-notify.dll \
@ -411,7 +410,7 @@ DLL_FILES=\
src/modules/whox.dll
ALL: CONF UNREALSVC.EXE UnrealIRCd.exe MODULES
ALL: CONF unrealircdctl.exe UNREALSVC.EXE UnrealIRCd.exe MODULES
CLEAN:
-@del /Q /S *.dll *.exe *.obj *.pdb *.res *.lib *.exp *.ilk src\version.c >NUL
@ -424,21 +423,27 @@ CONF:
$(CC) src/windows/config.c
-@config.exe
UnrealIRCd.exe: $(OBJ_FILES) src/windows/win.res
$(LINK) $(LFLAGS) $(OBJ_FILES) src/windows/win.res /MAP
UnrealIRCd.exe: $(OBJ_FILES) src/ircd.obj src/windows/win.res
$(LINK) $(LFLAGS) /out:UnrealIRCd.exe /def:UnrealIRCd.def /implib:UnrealIRCd.lib $(OBJ_FILES) src/windows/win.res /MAP
-@erase src\windows\win.res
$(MT) -manifest src\windows\UnrealIRCd.exe.manifest -outputresource:UnrealIRCd.exe;1
!IFNDEF DEBUGEXTRA
@echo Standard version built
!ELSE
@echo Extra-Debug version built ...
!ENDIF
unrealircdctl.exe: $(OBJ_FILES) src/unrealircdctl.obj src/proc_io_client.obj
$(LINK) $(LFLAGS) /SUBSYSTEM:CONSOLE /out:unrealircdctl.exe $(OBJ_FILES) src/unrealircdctl.obj
$(MT) -manifest src\windows\unrealircdctl.exe.manifest -outputresource:unrealircdctl.exe;1
# alternative option -- FIXME: REMOVE / CHOOSE
#unrealircdctl.exe: $(OBJ_FILES) src/unrealircdctl.obj src/proc_io_client.obj src/windows/unrealircdctl.res
# $(LINK) $(LFLAGS) /out:unrealircdctl.exe $(OBJ_FILES) src/unrealircdctl.obj src/windows/unrealircdctl.res
#Source files
src/version.obj: src/version.c
$(CC) $(CFLAGS) src/version.c
src/ircd_vars.obj: src/ircd_vars.c $(INCLUDES)
$(CC) $(CFLAGS) src/ircd_vars.c
src/parse.obj: src/parse.c $(INCLUDES)
$(CC) $(CFLAGS) src/parse.c
@ -485,6 +490,12 @@ src/dns.obj: src/dns.c $(INCLUDES)
src/conf.obj: src/conf.c $(INCLUDES)
$(CC) $(CFLAGS) src/conf.c
src/proc_io_server.obj: src/proc_io_server.c $(INCLUDES)
$(CC) $(CFLAGS) src/proc_io_server.c
src/proc_io_client.obj: src/proc_io_client.c $(INCLUDES)
$(CC) $(CFLAGS) src/proc_io_client.c
src/conf_preprocessor.obj: src/conf_preprocessor.c $(INCLUDES)
$(CC) $(CFLAGS) src/conf_preprocessor.c
@ -540,6 +551,9 @@ src/win.obj: src/windows/win.c $(INCLUDES)
src/unrealsvc.obj: src/windows/unrealsvc.c $(INCLUDES)
$(CC) $(CFLAGSST) src/windows/unrealsvc.c
src/unrealircdctl.obj: src/unrealircdctl.c $(INCLUDES)
$(CC) $(CFLAGS) src/unrealircdctl.c
src/modules.obj: src/modules.c $(INCLUDES)
$(CC) $(CFLAGS) src/modules.c
@ -623,6 +637,10 @@ src/windows/unrealsvc.res: src/windows/unrealsvc.rc
$(RC) /l 0x409 /fosrc/windows/unrealsvc.res /i ./include /i ./src \
/d NDEBUG src/windows/unrealsvc.rc
src/windows/unrealircdctl.res: src/windows/unrealircdctl.rc
$(RC) /l 0x409 /fosrc/windows/unrealircdctl.res /i ./include /i ./src \
/d NDEBUG src/windows/unrealircdctl.rc
################# Modules #################
CUSTOMMODULE: src/modules/third/$(MODULEFILE).c

65
configure vendored

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for unrealircd 6.0.2-git.
# Generated by GNU Autoconf 2.69 for unrealircd 6.0.2-rc1.
#
# Report bugs to <https://bugs.unrealircd.org/>.
#
@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='unrealircd'
PACKAGE_TARNAME='unrealircd'
PACKAGE_VERSION='6.0.2-git'
PACKAGE_STRING='unrealircd 6.0.2-git'
PACKAGE_VERSION='6.0.2-rc1'
PACKAGE_STRING='unrealircd 6.0.2-rc1'
PACKAGE_BUGREPORT='https://bugs.unrealircd.org/'
PACKAGE_URL='https://unrealircd.org/'
@ -659,6 +659,7 @@ PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
LDFLAGS_PRIVATELIBS
CONTROLFILE
PIDFILE
DOCDIR
PERMDATADIR
@ -752,6 +753,7 @@ with_tmpdir
with_datadir
with_docdir
with_pidfile
with_controlfile
with_privatelibdir
with_maxconnections
with_no_operoverride
@ -1345,7 +1347,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 6.0.2-git to adapt to many kinds of systems.
\`configure' configures unrealircd 6.0.2-rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1411,7 +1413,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of unrealircd 6.0.2-git:";;
short | recursive ) echo "Configuration of unrealircd 6.0.2-rc1:";;
esac
cat <<\_ACEOF
@ -1460,6 +1462,7 @@ Optional Packages:
--with-datadir=path Specify the directory where permanent data is stored
--with-docdir=path Specify the directory where documentation is stored
--with-pidfile=path Specify the path of the pid file
--with-controlfile=path Specify the path of the control socket
--with-privatelibdir=path
Specify the directory where private libraries are
stored. Disable when building a package for a distro
@ -1586,7 +1589,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
unrealircd configure 6.0.2-git
unrealircd configure 6.0.2-rc1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1955,7 +1958,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 6.0.2-git, which was
It was created by unrealircd $as_me 6.0.2-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2373,7 +2376,7 @@ _ACEOF
# The version suffix such as a beta marker or release candidate
# marker. (e.g.: -rcX for unrealircd-3.2.9-rcX). This macro is a
# string instead of an integer because it contains arbitrary data.
UNREAL_VERSION_SUFFIX="-git"
UNREAL_VERSION_SUFFIX="-rc1"
cat >>confdefs.h <<_ACEOF
#define UNREAL_VERSION_SUFFIX "$UNREAL_VERSION_SUFFIX"
@ -6548,6 +6551,25 @@ fi
# Check whether --with-controlfile was given.
if test "${with_controlfile+set}" = set; then :
withval=$with_controlfile;
cat >>confdefs.h <<_ACEOF
#define CONTROLFILE "$withval"
_ACEOF
CONTROLFILE="$withval"
else
cat >>confdefs.h <<_ACEOF
#define CONTROLFILE "$HOME/unrealircd/data/unrealircd.ctl"
_ACEOF
CONTROLFILE="$HOME/unrealircd/data/unrealircd.ctl"
fi
# Check whether --with-privatelibdir was given.
if test "${with_privatelibdir+set}" = set; then :
withval=$with_privatelibdir;
@ -6589,6 +6611,7 @@ fi
# Check whether --with-maxconnections was given.
if test "${with_maxconnections+set}" = set; then :
withval=$with_maxconnections; ac_fd=$withval
@ -7369,12 +7392,12 @@ if test -n "$PCRE2_CFLAGS"; then
pkg_cv_PCRE2_CFLAGS="$PCRE2_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.00\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.00") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.34\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.34") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_PCRE2_CFLAGS=`$PKG_CONFIG --cflags "libpcre2-8 >= 10.00" 2>/dev/null`
pkg_cv_PCRE2_CFLAGS=`$PKG_CONFIG --cflags "libpcre2-8 >= 10.34" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -7386,12 +7409,12 @@ if test -n "$PCRE2_LIBS"; then
pkg_cv_PCRE2_LIBS="$PCRE2_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.00\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.00") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre2-8 >= 10.34\""; } >&5
($PKG_CONFIG --exists --print-errors "libpcre2-8 >= 10.34") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_PCRE2_LIBS=`$PKG_CONFIG --libs "libpcre2-8 >= 10.00" 2>/dev/null`
pkg_cv_PCRE2_LIBS=`$PKG_CONFIG --libs "libpcre2-8 >= 10.34" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -7412,9 +7435,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
PCRE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre2-8 >= 10.00" 2>&1`
PCRE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre2-8 >= 10.34" 2>&1`
else
PCRE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre2-8 >= 10.00" 2>&1`
PCRE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre2-8 >= 10.34" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$PCRE2_PKG_ERRORS" >&5
@ -7438,7 +7461,7 @@ fi
if test "$has_system_pcre2" = "no"; then :
pcre2_version="10.36"
pcre2_version="10.39"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: extracting PCRE2 regex library" >&5
$as_echo "extracting PCRE2 regex library" >&6; }
cur_dir=`pwd`
@ -7455,7 +7478,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring PCRE2 regex library" >&5
$as_echo "configuring PCRE2 regex library" >&6; }
cd pcre2-$pcre2_version
./configure --enable-jit --enable-shared --disable-unicode --prefix=$cur_dir/extras/pcre2 --libdir=$PRIVATELIBDIR || exit 1
./configure --enable-jit --enable-shared --prefix=$cur_dir/extras/pcre2 --libdir=$PRIVATELIBDIR || exit 1
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: compiling PCRE2 regex library" >&5
$as_echo "compiling PCRE2 regex library" >&6; }
$ac_cv_prog_MAKER || exit 1
@ -7798,7 +7821,7 @@ fi
if test "$has_system_cares" = "no"; then :
cares_version="1.17.2"
cares_version="1.18.1"
{ $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`
@ -9391,7 +9414,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 6.0.2-git, which was
This file was extended by unrealircd $as_me 6.0.2-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -9454,7 +9477,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 6.0.2-git
unrealircd config.status 6.0.2-rc1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

19
configure.ac

@ -7,7 +7,7 @@ dnl src/windows/unrealinst.iss
dnl doc/Config.header
dnl src/version.c.SH
AC_INIT([unrealircd], [6.0.2-git], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
AC_INIT([unrealircd], [6.0.2-rc1], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
AC_CONFIG_SRCDIR([src/ircd.c])
AC_CONFIG_HEADER([include/setup.h])
AC_CONFIG_AUX_DIR([autoconf])
@ -40,7 +40,7 @@ AC_DEFINE_UNQUOTED([UNREAL_VERSION_MINOR], [$UNREAL_VERSION_MINOR], [Minor versi
# The version suffix such as a beta marker or release candidate
# marker. (e.g.: -rcX for unrealircd-3.2.9-rcX). This macro is a
# string instead of an integer because it contains arbitrary data.
UNREAL_VERSION_SUFFIX=["-git"]
UNREAL_VERSION_SUFFIX=["-rc1"]
AC_DEFINE_UNQUOTED([UNREAL_VERSION_SUFFIX], ["$UNREAL_VERSION_SUFFIX"], [Version suffix such as a beta marker or release candidate marker. (e.g.: -rcX for unrealircd-3.2.9-rcX)])
AC_PATH_PROG(RM,rm)
@ -484,6 +484,12 @@ AC_ARG_WITH(pidfile, [AS_HELP_STRING([--with-pidfile=path],[Specify the path of
[AC_DEFINE_UNQUOTED([PIDFILE], ["$HOME/unrealircd/data/unrealircd.pid"], [Define the path of the pid file])
PIDFILE="$HOME/unrealircd/data/unrealircd.pid"])
AC_ARG_WITH(controlfile, [AS_HELP_STRING([--with-controlfile=path],[Specify the path of the control socket])],
[AC_DEFINE_UNQUOTED([CONTROLFILE], ["$withval"], [Define the path of the control socket])
CONTROLFILE="$withval"],
[AC_DEFINE_UNQUOTED([CONTROLFILE], ["$HOME/unrealircd/data/unrealircd.ctl"], [Define the path of the control socket])
CONTROLFILE="$HOME/unrealircd/data/unrealircd.ctl"])
dnl Ensure that this “feature” can be disabled as it makes it harder to package unrealircd.
dnl Users have always been able to specify “./configure LDFLAGS=-Wl,-rpath,/path/to/blah”—binki
AC_ARG_WITH(privatelibdir, [AS_HELP_STRING([--with-privatelibdir=path],[Specify the directory where private libraries are stored. Disable when building a package for a distro])],
@ -514,6 +520,7 @@ dnl well, Because DATADIR conflicts with the Windows SDK header files.. amazing.
AC_SUBST(PERMDATADIR)
AC_SUBST(DOCDIR)
AC_SUBST(PIDFILE)
AC_SUBST(CONTROLFILE)
AC_SUBST(LDFLAGS_PRIVATELIBS)
AC_ARG_WITH(maxconnections, [AS_HELP_STRING([--with-maxconnections=size], [Specify the max file descriptors to use])],
@ -571,12 +578,12 @@ export PATH_SEPARATOR
dnl Use system pcre2 when available, unless --without-system-pcre2.
has_system_pcre2="no"
AS_IF([test "x$with_system_pcre2" = "xyes"],[
PKG_CHECK_MODULES([PCRE2], libpcre2-8 >= 10.00,[has_system_pcre2=yes
PKG_CHECK_MODULES([PCRE2], libpcre2-8 >= 10.34,[has_system_pcre2=yes
AS_IF([test "x$PRIVATELIBDIR" != "x"], [rm -f "$PRIVATELIBDIR/"libpcre2*])],[has_system_pcre2=no])])
AS_IF([test "$has_system_pcre2" = "no"], [
dnl REMEMBER TO CHANGE WITH A NEW PCRE2 RELEASE!
pcre2_version="10.36"
pcre2_version="10.39"
AC_MSG_RESULT(extracting PCRE2 regex library)
cur_dir=`pwd`
cd extras
@ -593,7 +600,7 @@ else
fi
AC_MSG_RESULT(configuring PCRE2 regex library)
cd pcre2-$pcre2_version
./configure --enable-jit --enable-shared --disable-unicode --prefix=$cur_dir/extras/pcre2 --libdir=$PRIVATELIBDIR || exit 1
./configure --enable-jit --enable-shared --prefix=$cur_dir/extras/pcre2 --libdir=$PRIVATELIBDIR || exit 1
AC_MSG_RESULT(compiling PCRE2 regex library)
$ac_cv_prog_MAKER || exit 1
AC_MSG_RESULT(installing PCRE2 regex library)
@ -717,7 +724,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.2"
cares_version="1.18.1"
AC_MSG_RESULT(extracting c-ares resolver library)
cur_dir=`pwd`
cd extras

2
doc/Config.header

@ -7,7 +7,7 @@
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for UnrealIRCd 6.0.2-git
for UnrealIRCd 6.0.2-rc1
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.

79
doc/RELEASE-NOTES.md

@ -1,22 +1,83 @@
UnrealIRCd 6.0.2-git
=================
*THIS IS WORK IN PROGRESS*
UnrealIRCd 6.0.2-rc1
=====================
This is the release candidate for UnrealIRCd 6.0.2. You can help us by
testing this release and reporting any issues at https://bugs.unrealircd.org/.
You are looking at the git version of UnrealIRCd, bleeding edge.
If you are already running UnrealIRCd 6 then read below on the fixes
and nice new features in 6.0.2. Otherwise, jump straight to the
[summary about UnrealIRCd 6](#Summary) to learn more about UnrealIRCd 6.
Fixes:
* Windows: fix crash with IPv6 clients (local or remote) due to GeoIP lookup
* Fix infinite hang on "Loading IRCd configuration" if DNS is not working.
For example if the 1st DNS server in `/etc/resolv.conf` is down or refusing
requests.
* Some `MODE` server-to-server commands were missing a timestamp at the end,
even though this is mandatory for modes coming from a server.
* The [channeldb](https://www.unrealircd.org/docs/Set_block#set::channeldb)
module now converts letter extbans to named extbans (eg `~a` to `~account`).
Previously it did not, which caused letter extbans to appear in the banlist.
Later on, when linking servers, this would cause duplicate entries to appear
as well, with both the old and new format. The extbans were still effective
though, so this is mostly a visual +b/+e/+I list issue.
Enhancements:
* Support for [logging to a channel](https://www.unrealircd.org/docs/Log_block#Logging_to_a_channel).
Similar to snomasks but then for channels.
* Command line interface changes:
* The [CLI tool](https://www.unrealircd.org/docs/Command_Line_Interface) now
communicates to the running UnrealIRCd process via a UNIX socket to
send commands and retrieve output.
* The command `./unrealircd rehash` will now show the rehash output,
including warnings and errors, and return a proper exit code.
* The same for `./unrealircd reloadtls`
* New command `./unrealircd status` to show if UnrealIRCd is running, the
version, channel and user count, ..
* The command `./unrealircd genlinkblock` is now
[documented](https://www.unrealircd.org/docs/Linking_servers_(genlinkblock))
and is referred to from the
[Linking servers tutorial](https://www.unrealircd.org/docs/Tutorial:_Linking_servers).
* On Windows in the `C:\Program Files\UnrealIRCd 6\bin` directory there is
now an `unrealircdctl.exe` that can be used to do similar things to what
you can do on *NIX. Supported operations are: `rehash`, `reloadtls`,
`mkpasswd`, `gencloak` and `spkifp`.
* New option [set::server-notice-show-event](https://www.unrealircd.org/docs/Set_block#set::server-notice-show-event)
which can be set to `no` to hide the event information (eg `connect.LOCAL_CLIENT_CONNECT`)
in server notices. This can be overriden per-oper in the
in server notices. This can be overridden per-oper in the
[Oper block](https://www.unrealircd.org/docs/Oper_block) via oper::server-notice-show-event.
* Support for IRC over UNIX sockets (on the same machine), if you specify a
file in the [listen block](https://www.unrealircd.org/docs/Listen_block)
instead of an ip/port. This probably won't be used much, but the option is
there. Users will show up with a host of `localhost` and IP `127.0.0.1` to
keep things simple.
* The `MAP` command now shows percentages of users
* Add `WHO` option to search clients by time connected (eg. `WHO <300 t` to
search for less than 300 seconds)
* Rate limiting of `MODE nick -x` and `-t` via new `vhost-flood` option in
[set::anti-flood block](https://www.unrealircd.org/docs/Anti-flood_settings).
Changes:
* Update Russian `help.ru.conf`.
Developers and protocol:
* People packaging UnrealIRCd (eg. to an .rpm/.deb):
* Be sure to pass the new `--with-controlfile` configure option
* There is now an `unrealircdctl` tool that the `unrealircd` shell script
uses, it is expected to be in `bindir`.
* `SVSMODE #chan -b nick` will now correctly remove extbans that prevent `nick`
from joining. This fixes a bug where it would remove too much (for `~time`)
or not remove extbans (most other extbans, eg `~account`).
`SVSMODE #chan -b` has also been fixed accordingly (remove all bans
preventing joins).
Note that all these commands do not remove bans that do not affect joins,
such as `~quiet` or `~text`.
* For module coders: setting the `EXTBOPT_CHSVSMODE` flag in `extban.options`
is no longer useful, the flag is ignored. We now decide based on
`BANCHK_JOIN` being in `extban.is_banned_events` if the ban should be
removed or not upon SVS(2)MODE -b.
UnrealIRCd 6.0.1.1
-------------------
If you are already running UnrealIRCd 6 then read below on the
changes between 6.0.0 and 6.0.1(.1). Otherwise, jump straight to the
[summary about UnrealIRCd 6](#Summary) to learn more about UnrealIRCd 6.
Fixes:
* In 6.0.1.1: extended bans were not properly synced between U5 and U6.
@ -103,6 +164,8 @@ Enhancements
* Colors are enabled by default in snomask server notices, these can be disabled via
[set::server-notice-colors](https://www.unrealircd.org/docs/Set_block#set::server-notice-colors)
and also in [oper::server-notice-colors](https://www.unrealircd.org/docs/Oper_block)
* Support for [logging to a channel](https://www.unrealircd.org/docs/Log_block#Logging_to_a_channel).
Similar to snomasks but then for channels. *Requires UnrealIRCd 6.0.2 or later*
* Almost all channel modes are modularized
* Only the three list modes (+b/+e/+I) are still in the core
* The five [level modes](https://www.unrealircd.org/docs/Channel_Modes#Access_levels)

5
doc/conf/help/help.conf

@ -316,7 +316,7 @@ help Chmodef {
" c CTCP +C m, M";
" j Join +i R";
" k Knock +K";
" m Messages +m M, d";
" m Messages +m M";
" n Nickchange +N";
" t Text kick b, d";
" r Repeat kick d, b";
@ -378,6 +378,7 @@ help Who {
" i: IP address [*]";
" s: server name [*]";
" r: real name (gecos)";
" t: connect time (mask is >seconds or <seconds) [*]";
" a: account name (services account)";
" m: user modes (the mask contains for example +z or -z) [*]";
" R: sets output to show real hostnames [*]";
@ -418,6 +419,8 @@ help Who {
" all users on SSL/TLS. (IRCOp only command)";
" WHO -z m - Show all insecure users, without umode z.";
" (IRCOp only command)";
" WHO <300 t - Show all users that are connected for";
" less than 300 seconds (IRCOp only command)";
" Examples of WHOX requests using output modifiers:";
" WHO #test %acfhnru - Show all users in the channel #test and show";
" various fields, among which 'a' (services";

2
doc/conf/help/help.es.conf

@ -313,7 +313,7 @@ help Chmodef {
" c CTCP +C m, M";
" j Join +i R";
" k Knock +K";
" m Messages +m M, d";
" m Messages +m M";
" n Nickchange +N";
" t Text kick b, d";
" r Repeat kick d, b";

2
doc/conf/help/help.nl.conf

@ -290,7 +290,7 @@ help Chmodef {
" c CTCP +C m, M";
"Join +i R";
"k Klop + K";
" m Berichten +m M, d";
" m Berichten +m M";
" n Nickchange +N";
" t Tekstschop b, d";
" r Herhaal kick d, b";

2
doc/conf/help/help.pl.conf

@ -340,7 +340,7 @@ help Chmodef {
" c CTCP +C m, M";
" j Wejście na kanał (JOIN) +i R";
" k Pukanie (KNOCK) +K";
" m Wiadomości +m M, d";
" m Wiadomości +m M";
" n Zmiany nicków +N";
" t Tekst kick b, d";
" r Powtórzenia kick d, b";

750
doc/conf/help/help.ru.conf

File diff suppressed because it is too large Load Diff

2
doc/conf/help/help.tr.conf

@ -292,7 +292,7 @@ help Chmodef {
" c CTCP +C m, M";
" j Join +i R";
" k Knock +K";
" m Messages +m M, d";
" m Messages +m M";
" n Nickchange +N";
" t Text kick b, d";
" r Repeat kick d, b";

4
extras/build-tests/windows/build.bat

@ -36,11 +36,11 @@ rem Now the actual build
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
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe unrealircdctl.exe
rem - It will fail due to missing symbolfile, which we create here..
nmake -f makefile.windows SYMBOLFILE
rem - Then we finalize building UnrealIRCd.exe: should be no error
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe
call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat UNREALSVC.EXE UnrealIRCd.exe unrealircdctl.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

BIN
extras/c-ares.tar.gz

Binary file not shown.

2
extras/curlinstall

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

2
extras/doxygen/Doxyfile

@ -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 = 6.0.2-git
PROJECT_NUMBER = 6.0.2-rc1
# 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/pcre2.tar.gz

Binary file not shown.

43
include/h.h

@ -28,6 +28,34 @@
#include "setup.h"
#include "fdlist.h"
extern int dorehash, dorestart, doreloadcert;
#ifndef _WIN32
extern char **myargv;
#else
extern LPCSTR cmdLine;
#endif
/* Externals */
extern MODVAR char *buildid;
extern MODVAR char backupbuf[8192];
extern EVENT(unrealdns_removeoldrecords);
extern EVENT(unrealdb_expire_secret_cache);
extern void init_glines(void);
extern void tkl_init(void);
extern void process_clients(void);
extern void unrealdb_test(void);
extern void ignore_this_signal();
extern void s_rehash();
extern void s_reloadcert();
extern void s_restart();
extern void s_die();
#ifndef _WIN32
// nix specific
extern char unreallogo[];
#else
// windows specific
extern SERVICE_STATUS_HANDLE IRCDStatusHandle;
extern SERVICE_STATUS IRCDStatus;
#endif
extern MODVAR char *extraflags;
extern MODVAR int tainted;
extern MODVAR Member *freemember;
@ -153,6 +181,7 @@ extern MODVAR struct list_head lclient_list;
extern MODVAR struct list_head server_list;
extern MODVAR struct list_head oper_list;
extern MODVAR struct list_head unknown_list;
extern MODVAR struct list_head control_list;
extern MODVAR struct list_head global_server_list;
extern MODVAR struct list_head dead_list;
extern RealCommand *find_command(const char *cmd, int flags);
@ -663,7 +692,6 @@ extern int spamfilter_getconftargets(const char *s);
extern void remove_all_snomasks(Client *client);
extern void remove_oper_modes(Client *client);
extern char *spamfilter_inttostring_long(int v);
extern MODVAR char backupbuf[];
extern int is_invited(Client *client, Channel *channel);
extern void channel_modes(Client *client, char *mbuf, char *pbuf, size_t mbuf_size, size_t pbuf_size, Channel *channel, int hide_local_modes);
extern int op_can_override(const char *acl, Client *client,Channel *channel,void* extra);
@ -920,6 +948,10 @@ extern int unreal_bind(int fd, const char *ip, int port, SocketType socket_type)
extern int unreal_connect(int fd, const char *ip, int port, int ipv6);
extern int is_valid_ip(const char *str);
extern int ipv6_capable(void);
extern int unix_sockets_capable(void);
#ifdef _WIN32
extern void init_winsock(void);
#endif
extern MODVAR Client *remote_rehash_client;
extern MODVAR int debugfd;
extern void convert_to_absolute_path(char **path, const char *reldir);
@ -930,7 +962,7 @@ extern Cmode_t get_extmode_bitbychar(char m);
extern long find_user_mode(char mode);
extern void start_listeners(void);
extern void buildvarstring(const char *inbuf, char *outbuf, size_t len, const char *name[], const char *value[]);
extern void reinit_tls(void);
extern int reinit_tls(void);
extern CMD_FUNC(cmd_error);
extern CMD_FUNC(cmd_dns);
extern CMD_FUNC(cmd_info);
@ -1136,6 +1168,8 @@ extern void flood_limit_exceeded_log(Client *client, const char *floodname);
/* logging */
extern int config_test_log(ConfigFile *conf, ConfigEntry *ce);
extern int config_run_log(ConfigFile *conf, ConfigEntry *ce);
extern const char *log_level_terminal_color(LogLevel loglevel);
#define TERMINAL_COLOR_RESET "\033[0m"
extern LogType log_type_stringtoval(const char *str);
extern const char *log_type_valtostring(LogType v);
#ifdef DEBUGMODE
@ -1209,3 +1243,8 @@ extern void make_umodestr(void);
extern void initwhowas(void);
extern void uid_init(void);
extern const char *uid_get(void);
/* proc i/o */
extern void add_proc_io_server(void);
extern void procio_post_rehash(int failure);
/* end of proc i/o */
extern int minimum_msec_since_last_run(struct timeval *tv_old, long minimum);

5
include/numeric.h

@ -37,6 +37,8 @@
#define RPL_REDIR 10
#define RPL_MAPUSERS 18
#define RPL_REMOTEISUPPORT 105
/*
@ -349,10 +351,11 @@
#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_MAP /* 006 */ ":%s%s %s | Users: %*ld (%*.2f%%)%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_MAPUSERS /* 018 */ ":%d server%s and %d user%s, average %.2f users per server"
#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"

3
include/setup.h.in

@ -12,6 +12,9 @@
/* Define the location of the configuration files */
#undef CONFDIR
/* Define the path of the control socket */
#undef CONTROLFILE
/* Define the location of permanent data files */
#undef DATADIR

14
include/struct.h

@ -323,6 +323,7 @@ typedef enum LogDestination { LOG_DEST_SNOMASK=0, LOG_DEST_OPER=1, LOG_DEST_REMO
* @{
*/
typedef enum ClientStatus {
CLIENT_STATUS_CONTROL = -8, /**< Client is on the control channel */
CLIENT_STATUS_LOG = -7, /**< Client is a log file */
CLIENT_STATUS_TLS_STARTTLS_HANDSHAKE = -8, /**< Client is doing a STARTTLS handshake */
CLIENT_STATUS_CONNECTING = -6, /**< Client is an outgoing connect */
@ -345,6 +346,7 @@ typedef enum ClientStatus {
/** Client is not fully registered yet. May become a user or a server, we don't know yet. */
#define IsUnknown(x) (((x)->status == CLIENT_STATUS_UNKNOWN) || ((x)->status == CLIENT_STATUS_TLS_STARTTLS_HANDSHAKE))
#define IsServer(x) ((x)->status == CLIENT_STATUS_SERVER) /**< Is a server that has completed the connection handshake */
#define IsControl(x) ((x)->status == CLIENT_STATUS_CONTROL) /**< Is on the control channel (not on IRC) */
#define IsLog(x) ((x)->status == CLIENT_STATUS_LOG) /**< Is a log file, not a user or server */
#define IsStartTLSHandshake(x) ((x)->status == CLIENT_STATUS_TLS_STARTTLS_HANDSHAKE) /**< Currently doing a STARTTLS handshake */
#define IsTLSAcceptHandshake(x) ((x)->status == CLIENT_STATUS_TLS_ACCEPT_HANDSHAKE) /**< Currently doing a TLS handshake - incoming */
@ -361,6 +363,8 @@ typedef enum ClientStatus {
#define SetServer(x) ((x)->status = CLIENT_STATUS_SERVER)
#define SetUser(x) ((x)->status = CLIENT_STATUS_USER)
#define SetLog(x) ((x)->status = CLIENT_STATUS_LOG)
#define SetControl(x) ((x)->status = CLIENT_STATUS_CONTROL)
#define SetUser(x) ((x)->status = CLIENT_STATUS_USER)
/** @} */
@ -372,6 +376,7 @@ typedef enum ClientStatus {
#define CLIENT_FLAG_DEAD 0x00000002 /**< Client is dead: already quit/exited and removed from all lists -- Remaining part will soon be freed in main loop */
#define CLIENT_FLAG_DEADSOCKET 0x00000004 /**< Local socket is dead but otherwise the client still exists fully -- Will soon exit in main loop */
#define CLIENT_FLAG_KILLED 0x00000008 /**< Prevents "QUIT" from being sent for this */
#define CLIENT_FLAG_MONITOR_REHASH 0x00000010 /**< Client is monitoring rehash output */
#define CLIENT_FLAG_OUTGOING 0x00000020 /**< Outgoing connection (do not touch cptr->listener->clients) */
#define CLIENT_FLAG_CLOSING 0x00000040 /**< Set when closing to suppress errors */
#define CLIENT_FLAG_LISTEN 0x00000080 /**< Used to mark clients which we listen() on */
@ -470,6 +475,7 @@ typedef enum ClientStatus {
#define IsEAuth(x) ((x)->flags & CLIENT_FLAG_EAUTH)
#define IsIdentSuccess(x) ((x)->flags & CLIENT_FLAG_IDENTSUCCESS)
#define IsKilled(x) ((x)->flags & CLIENT_FLAG_KILLED)
#define IsMonitorRehash(x) ((x)->flags & CLIENT_FLAG_MONITOR_REHASH)
#define IsListening(x) ((x)->flags & CLIENT_FLAG_LISTEN)
#define IsLocalhost(x) ((x)->flags & CLIENT_FLAG_LOCALHOST)
#define IsMap(x) ((x)->flags & CLIENT_FLAG_MAP)
@ -501,6 +507,7 @@ typedef enum ClientStatus {
#define SetEAuth(x) do { (x)->flags |= CLIENT_FLAG_EAUTH; } while(0)
#define SetIdentSuccess(x) do { (x)->flags |= CLIENT_FLAG_IDENTSUCCESS; } while(0)
#define SetKilled(x) do { (x)->flags |= CLIENT_FLAG_KILLED; } while(0)
#define SetMonitorRehash(x) do { (x)->flags |= CLIENT_FLAG_MONITOR_REHASH; } while(0)
#define SetListening(x) do { (x)->flags |= CLIENT_FLAG_LISTEN; } while(0)
#define SetLocalhost(x) do { (x)->flags |= CLIENT_FLAG_LOCALHOST; } while(0)
#define SetMap(x) do { (x)->flags |= CLIENT_FLAG_MAP; } while(0)
@ -530,6 +537,7 @@ typedef enum ClientStatus {
#define ClearEAuth(x) do { (x)->flags &= ~CLIENT_FLAG_EAUTH; } while(0)
#define ClearIdentSuccess(x) do { (x)->flags &= ~CLIENT_FLAG_IDENTSUCCESS; } while(0)
#define ClearKilled(x) do { (x)->flags &= ~CLIENT_FLAG_KILLED; } while(0)
#define ClearMonitorRehash(x) do { (x)->flags &= ~CLIENT_FLAG_MONITOR_REHASH; } while(0)
#define ClearListening(x) do { (x)->flags &= ~CLIENT_FLAG_LISTEN; } while(0)
#define ClearLocalhost(x) do { (x)->flags &= ~CLIENT_FLAG_LOCALHOST; } while(0)
#define ClearMap(x) do { (x)->flags &= ~CLIENT_FLAG_MAP; } while(0)
@ -784,11 +792,11 @@ struct LoopStruct {
unsigned do_bancheck : 1; /* perform *line bancheck? */
unsigned do_bancheck_spamf_user : 1; /* perform 'user' spamfilter bancheck */
unsigned do_bancheck_spamf_away : 1; /* perform 'away' spamfilter bancheck */
unsigned rehashing : 1;
unsigned terminating : 1;
unsigned config_load_failed : 1;
unsigned rehash_download_busy : 1; /* don't return "all downloads complete", needed for race condition */
unsigned tainted : 1;
int rehashing;
Client *rehash_save_client;
void (*boot_function)();
};
@ -856,6 +864,8 @@ struct SWhois {
#define CMD_VIRUS 0x0080
/** Command requires IRCOp privileges */
#define CMD_OPER 0x0200
/** Command is for control channel only (unrealircd.ctl socket) */
#define CMD_CONTROL 0x0400
/** Command function - used by all command handlers.
* This is used in the code like <pre>CMD_FUNC(cmd_yourcmd)</pre> as a function definition.
@ -1217,6 +1227,7 @@ extern void unload_all_unused_moddata(void);
#define LISTENER_TLS 0x000010
#define LISTENER_BOUND 0x000020
#define LISTENER_DEFER_ACCEPT 0x000040
#define LISTENER_CONTROL 0x000080 /**< Control channel */
#define IsServersOnlyListener(x) ((x) && ((x)->options & LISTENER_SERVERSONLY))
@ -1245,6 +1256,7 @@ typedef enum FloodOption {
FLD_KNOCK = 4, /**< knock-flood */
FLD_CONVERSATIONS = 5, /**< max-concurrent-conversations */
FLD_LAG_PENALTY = 6, /**< lag-penalty / lag-penalty-bytes */
FLD_VHOST = 7, /**< vhost-flood */
} FloodOption;
#define MAXFLOODOPTIONS 10

1
include/sys.h

@ -63,6 +63,7 @@
#else
#include <winsock2.h>
#include <ws2tcpip.h>
#include <afunix.h>
#endif
#ifndef _WIN32

3
include/windows/setup.h

@ -33,6 +33,7 @@
#define CACHEDIR "cache"
#define TMPDIR "tmp"
#define PIDFILE PERMDATADIR"/unrealircd.pid"
#define CONTROLFILE PERMDATADIR"/unrealircd.ctl"
#define NO_U_TYPES
#define NEED_U_INT32_T
#define strcasecmp _stricmp
@ -65,6 +66,6 @@
/* Version suffix such as a beta marker or release candidate marker. (e.g.:
-rcX for unrealircd-3.2.9-rcX) */
#define UNREAL_VERSION_SUFFIX "-git"
#define UNREAL_VERSION_SUFFIX "-rc1"
#endif

18
src/Makefile.in

@ -21,10 +21,10 @@
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 \
OBJS=ircd_vars.o dns.o auth.o channel.o crule.o dbuf.o \
fdlist.o hash.o ircsprintf.o list.o \
match.o modules.o parse.o mempool.o operclass.o \
conf_preprocessor.o conf.o debug.o dispatch.o \
conf_preprocessor.o conf.o proc_io_server.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 \
@ -62,22 +62,22 @@ all: build
build:
# Force build of 'ircd', before we start building any modules:
$(MAKE) ircd
$(MAKE) ircd unrealircdctl
$(MAKE) mods
custommodule:
+cd modules/third; $(MAKE) MODULEFILE=$(MODULEFILE) 'EXLIBS=$(EXLIBS)' custommodule
ircd: $(OBJS)
$(CC) $(CFLAGS) $(BINCFLAGS) $(CRYPTOLIB) -o ircd $(OBJS) $(LDFLAGS) $(BINLDFLAGS) $(IRCDLIBS) $(CRYPTOLIB)
ircd: $(OBJS) ircd.o
$(CC) $(CFLAGS) $(BINCFLAGS) $(CRYPTOLIB) -o ircd ircd.o $(OBJS) $(LDFLAGS) $(BINLDFLAGS) $(IRCDLIBS) $(CRYPTOLIB)
unrealircdctl: $(OBJS) unrealircdctl.o proc_io_client.o
$(CC) $(CFLAGS) $(BINCFLAGS) $(CRYPTOLIB) -o unrealircdctl unrealircdctl.o proc_io_client.o $(OBJS) $(LDFLAGS) $(BINLDFLAGS) $(IRCDLIBS) $(CRYPTOLIB)
mods:
@if [ ! -r include ] ; then \
ln -s ../include include; \
fi
@if [ ! -r modules ] ; then \
echo "You havent done cvs update -P -d"; \
fi
+cd modules; $(MAKE) all
version.c: version.c.SH

31
src/api-command.c

@ -89,7 +89,7 @@ static Command *CommandAddInternal(Module *module, const char *cmd, CmdFunc func
Command *command = NULL;
RealCommand *c;
if (find_command_simple(cmd))
if ((c = find_command(cmd, flags)) && (c->flags == flags))
{
if (module)
module->errorcode = MODERR_EXISTS;
@ -253,15 +253,26 @@ static RealCommand *add_Command_backend(const char *cmd)
RealCommand *find_command(const char *cmd, int flags)
{
RealCommand *p;
for (p = CommandHash[toupper(*cmd)]; p; p = p->next) {
if ((flags & CMD_UNREGISTERED) && !(p->flags & CMD_UNREGISTERED))
continue;
if ((flags & CMD_SHUN) && !(p->flags & CMD_SHUN))
continue;
if ((flags & CMD_VIRUS) && !(p->flags & CMD_VIRUS))
continue;
if ((flags & CMD_ALIAS) && !(p->flags & CMD_ALIAS))
continue;
for (p = CommandHash[toupper(*cmd)]; p; p = p->next)
{
if (flags & CMD_CONTROL)
{
if (!(p->flags & CMD_CONTROL))
continue;
} else
{
if ((flags & CMD_UNREGISTERED) && !(p->flags & CMD_UNREGISTERED))
continue;
if ((flags & CMD_SHUN) && !(p->flags & CMD_SHUN))
continue;
if ((flags & CMD_VIRUS) && !(p->flags & CMD_VIRUS))
continue;
if ((flags & CMD_ALIAS) && !(p->flags & CMD_ALIAS))
continue;
if (p->flags & CMD_CONTROL)
continue; /* important to also filter it this way ;) */
}
if (!strcasecmp(p->cmd, cmd))
return p;
}

18
src/api-event.c

@ -27,9 +27,6 @@ ID_Copyright("(C) Carsten Munk 2001");
MODVAR Event *events = NULL;
extern EVENT(unrealdns_removeoldrecords);
extern EVENT(unrealdb_expire_secret_cache);
/** Add an event, a function that will run at regular intervals.
* @param module Module that this event belongs to
* @param name Name of the event
@ -211,18 +208,3 @@ void DoEvents(void)
CleanupEvents();
}
void SetupEvents(void)
{
/* Start events */
EventAdd(NULL, "tunefile", save_tunefile, NULL, 300*1000, 0);
EventAdd(NULL, "garbage", garbage_collect, NULL, GARBAGE_COLLECT_EVERY*1000, 0);
EventAdd(NULL, "loop", loop_event, NULL, 1000, 0);
EventAdd(NULL, "unrealdns_removeoldrecords", unrealdns_removeoldrecords, NULL, 15000, 0);
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, "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);
}

317
src/conf.c

@ -199,8 +199,8 @@ void free_tls_options(TLSOptions *tlsoptions);
* Config parser (IRCd)
*/
int config_read_file(const char *filename, const char *display_name);
void config_rehash();
int config_run_blocks();
void config_rehash(void);
int config_run_blocks(void);
int config_test_blocks();
/*
@ -464,10 +464,15 @@ int config_parse_flood_generic(const char *str, Configuration *conf, char *block
long config_checkval(const char *orig, unsigned short flags)
{
char *value = raw_strdup(orig);
char *value;
char *text;
long ret = 0;
/* Handle empty strings early, since we use +1 later in the code etc. */
if (BadPtr(orig))
return 0;
value = raw_strdup(orig);
if (flags == CFG_YESNO) {
for (text = value; *text; text++) {
if (!isalnum(*text))
@ -1586,7 +1591,7 @@ ConfigCommand *config_binary_search(const char *cmd) {
return NULL;
}
void free_iConf(Configuration *i)
void free_iConf(Configuration *i)
{
FloodSettings *f, *f_next;
@ -1695,6 +1700,7 @@ void config_setdefaultsettings(Configuration *i)
/* - known-users */
config_parse_flood_generic("3:60", i, "known-users", FLD_NICK); /* NICK flood protection: max 3 per 60s */
config_parse_flood_generic("3:90", i, "known-users", FLD_JOIN); /* JOIN flood protection: max 3 per 90s */
config_parse_flood_generic("3:90", i, "known-users", FLD_VHOST); /* MODE -x flood protection: max 3 per 90s */
config_parse_flood_generic("4:120", i, "known-users", FLD_AWAY); /* AWAY flood protection: max 4 per 120s */
config_parse_flood_generic("4:60", i, "known-users", FLD_INVITE); /* INVITE flood protection: max 4 per 60s */
config_parse_flood_generic("4:120", i, "known-users", FLD_KNOCK); /* KNOCK protection: max 4 per 120s */
@ -1703,6 +1709,7 @@ void config_setdefaultsettings(Configuration *i)
/* - unknown-users */
config_parse_flood_generic("2:60", i, "unknown-users", FLD_NICK); /* NICK flood protection: max 2 per 60s */
config_parse_flood_generic("2:90", i, "unknown-users", FLD_JOIN); /* JOIN flood protection: max 2 per 90s */
config_parse_flood_generic("2:90", i, "unknown-users", FLD_VHOST); /* MODE -x flood protection: max 2 per 90s */
config_parse_flood_generic("4:120", i, "unknown-users", FLD_AWAY); /* AWAY flood protection: max 4 per 120s */
config_parse_flood_generic("2:60", i, "unknown-users", FLD_INVITE); /* INVITE flood protection: max 2 per 60s */
config_parse_flood_generic("2:120", i, "unknown-users", FLD_KNOCK); /* KNOCK protection: max 2 per 120s */
@ -2412,7 +2419,8 @@ void config_rehash()
}
for (listen_ptr = conf_listen; listen_ptr; listen_ptr = listen_ptr->next)
{
listen_ptr->flag.temporary = 1;
if (!(listen_ptr->options & LISTENER_CONTROL))
listen_ptr->flag.temporary = 1;
}
for (tld_ptr = conf_tld; tld_ptr; tld_ptr = (ConfigItem_tld *) next)
{
@ -2643,152 +2651,87 @@ void config_switchover(void)
log_blocks_switchover();
}
int config_run_blocks()
/** Priority of config blocks during CONFIG_TEST stage */
static const char *config_test_priority_blocks[] =
{
"me",
"secret",
"log", /* "log" needs to be before "set" in CONFIG_TEST */
"set",
"class",
};
/** Priority of config blocks during CONFIG_RUN stage */
static const char *config_run_priority_blocks[] =
{
"me",
"secret",
"set",
"log", /* "log" needs to be after "set" in CONFIG_RUN */
"class",
};
int config_test_blocks()
{
ConfigEntry *ce;
ConfigFile *cfptr;
ConfigCommand *cc;
int errors = 0;
int i;
Hook *h;
ConfigItem_allow *allow;
/* Stage 1: set block first */
for (cfptr = conf; cfptr; cfptr = cfptr->next)
{
if (config_verbose > 1)
config_status("Running %s", cfptr->filename);
for (ce = cfptr->items; ce; ce = ce->next)
{
if (!strcmp(ce->name, "set"))
{
if (_conf_set(cfptr, ce) < 0)
errors++;
}
}
}
invalid_snomasks_encountered = 0;
/* Stage 2: now class blocks */
for (cfptr = conf; cfptr; cfptr = cfptr->next)
/* Stage 1: first the priority blocks, in the order as specified
* in config_test_priority_blocks[]
*/
for (i=0; i < ARRAY_SIZEOF(config_test_priority_blocks); i++)
{
if (config_verbose > 1)
config_status("Running %s", cfptr->filename);
for (ce = cfptr->items; ce; ce = ce->next)
const char *config_block = config_test_priority_blocks[i];
cc = config_binary_search(config_block);
if (!cc)
abort(); /* internal fuckup */
for (cfptr = conf; cfptr; cfptr = cfptr->next)
{
if (!strcmp(ce->name, "class"))
if (config_verbose > 1)
config_status("Running %s", cfptr->filename);
for (ce = cfptr->items; ce; ce = ce->next)
{
if (_conf_class(cfptr, ce) < 0)
errors++;
if (!strcmp(ce->name, config_block))
{
int n = cc->testfunc(cfptr, ce);
errors += n;
if (!strcmp(config_block, "secret") && (n == 0))
{
/* Yeah special case: secret { } blocks we run
* immediately here.
*/
_conf_secret(cfptr, ce);
}
}
}
}
}
/* Stage 3: now all the rest */
/* Stage 2: now all the other config blocks */
for (cfptr = conf; cfptr; cfptr = cfptr->next)
{
if (config_verbose > 1)
config_status("Running %s", cfptr->filename);
for (ce = cfptr->items; ce; ce = ce->next)
{
/* These are already processed above (set, class)
* or via config_test_blocks()