←︎ unrealircd :: eec3fa0


1
commit eec3fa048615fda07497ea59fb4c83df9282f2f0
2
Author: acidvegas <acid.vegas@acid.vegas>
3
Date:   Mon Apr 20 15:12:33 2020 -0400
4
5
    updated to 5.0.4
6
---
7
 Config                                             | 140 ++++++------
8
 autoconf/m4/unreal.m4                              |  20 ++
9
 configure                                          | 247 +++++++++++++--------
10
 configure.ac                                       |  26 ++-
11
 doc/Config.header                                  |   3 +-
12
 doc/RELEASE-NOTES.md                               |  45 +++-
13
 doc/conf/except.conf                               |   1 +
14
 doc/conf/ircd.motd                                 |  11 +-
15
 doc/conf/unrealircd.remote.conf                    | 185 ---------------
16
 extras/doxygen/Doxyfile                            |   2 +-
17
 .../cipherscan_profiles/openssl-102-ubuntu16.txt   |  27 +++
18
 extras/tls.cnf                                     |   2 +-
19
 include/dynconf.h                                  |   7 +-
20
 include/h.h                                        |   5 +
21
 include/modules.h                                  |   3 +-
22
 include/setup.h.in                                 |   3 +
23
 include/windows/setup.h                            |   4 +-
24
 src/api-event.c                                    |  90 +++++---
25
 src/api-usermode.c                                 |  20 +-
26
 src/conf.c                                         |  94 ++++++--
27
 src/dns.c                                          |   2 +-
28
 src/ircd.c                                         |   7 +-
29
 src/modules/channeldb.c                            |  12 +-
30
 src/modules/connect.c                              |   2 +-
31
 src/modules/ident_lookup.c                         |  16 +-
32
 src/modules/join.c                                 |   2 +-
33
 src/modules/nick.c                                 |   4 +-
34
 src/modules/oper.c                                 |   4 +-
35
 src/modules/sajoin.c                               |  21 +-
36
 src/modules/sapart.c                               |  16 ++
37
 src/modules/server.c                               |   1 +
38
 src/modules/svsmode.c                              |   7 +
39
 src/modules/tkl.c                                  |  18 +-
40
 src/modules/whois.c                                |   8 +-
41
 src/modules/whox.c                                 |  87 ++++++--
42
 src/random.c                                       |   6 +-
43
 src/serv.c                                         |  40 +++-
44
 src/socket.c                                       |   7 +-
45
 src/tls.c                                          |  35 ++-
46
 src/user.c                                         |  26 +++
47
 src/version.c.SH                                   |   2 +-
48
 src/windows/UnrealIRCd.exe.manifest                |   2 +-
49
 src/windows/unrealinst.iss                         |   2 +-
50
 unrealircd.in                                      |   7 +-
51
 44 files changed, 748 insertions(+), 521 deletions(-)
52
53
diff --git a/Config b/Config
54
index 28ccb7f..7ddfe86 100755
55
--- a/Config
56
+++ b/Config
57
@@ -255,25 +255,19 @@ fi
58
 
59
 
60
 #parse arguments
61
-NOCACHE=""
62
 IMPORTEDSETTINGS=""
63
 NOINTRO=""
64
 QUICK=""
65
-CLEAN=""
66
 ADVANCED=""
67
 while [ $# -ge 1 ] ; do
68
 	if [ $1 = "--help" ] ; then
69
 		echo "Config utility for UnrealIRCd"
70
 		echo "-----------------------------"
71
 		echo "Syntax: ./Config [options]"
72
-		echo "-nocache     Ignore settings saved in config.settings"
73
 		echo "-nointro     Skip intro (release notes, etc)"
74
 		echo "-quick       Skip questions, go straight to configure"
75
 		echo "-advanced    Include additional advanced questions"
76
-		echo "-clean       Clean ./configure cache"
77
 		exit 0
78
-	elif [ $1 = "-nocache" ] ; then
79
-		NOCACHE="1"
80
 	elif [ $1 = "-nointro" ] ; then
81
 		NOINTRO="1"
82
 	elif [ $1 = "-quick" -o $1 = "-q" ] ; then
83
@@ -285,8 +279,6 @@ while [ $# -ge 1 ] ; do
84
 		RUN_CONFIGURE
85
 		cd "$UNREALCWD"
86
 		exit 0
87
-	elif [ $1 = "-clean" -o $1 = "-C" ] ; then
88
-		CLEAN="1"
89
 	elif [ $1 = "-advanced" ] ; then
90
 		PREADVANCED="1"
91
 	fi
92
@@ -299,10 +291,6 @@ elif [ "$ADVANCED" = "1" ]; then
93
 	ADVANCED=""
94
 fi
95
 
96
-if [ -n "$CLEAN" ] ; then
97
-	rm -f config.cache
98
-fi
99
-
100
 if [ "`id -u`" = "0" ]; then
101
 	echo "ERROR: You cannot build or run UnrealIRCd as root"
102
 	echo ""
103
@@ -324,79 +312,77 @@ clear
104
 echo "We will now ask you a number of questions. You can just press ENTER to accept the defaults!"
105
 echo ""
106
 
107
-if [ -z "$NOCACHE" ] ; then
108
-	# This needs to be updated each release so auto-upgrading works for settings, modules, etc!!:
109
-	UNREALRELEASES="unrealircd-5.0.2 unrealircd-5.0.1 unrealircd-5.0.0 unrealircd-5.0.0-rc2 unrealircd-5.0.0-rc1"
110
-	if [ -f "config.settings" ]; then
111
-		. ./config.settings
112
-	else
113
-		# Try to load a previous config.settings
114
-		for x in $UNREALRELEASES
115
-		do
116
-			if [ -f ../$x/config.settings ]; then
117
-				IMPORTEDSETTINGS="../$x"
118
-				break
119
-			fi
120
-		done
121
-		echo "If you have previously installed UnrealIRCd on this shell then you can specify a"
122
-		echo "directory here so I can import the build settings and third party modules"
123
-		echo "to make your life a little easier."
124
-		if [ ! -z "$IMPORTEDSETTINGS" ]; then
125
-			echo "Found previous installation in: $IMPORTEDSETTINGS."
126
-			echo "You can enter a different path or type 'none' if you don't want to use it."
127
-			echo "Just press Enter to accept the default settings."
128
-		else
129
-			echo "If you install UnrealIRCd for the first time on this shell, then just hit Enter";
130
+# This needs to be updated each release so auto-upgrading works for settings, modules, etc!!:
131
+UNREALRELEASES="unrealircd-5.0.3.1 unrealircd-5.0.3 unrealircd-5.0.2 unrealircd-5.0.1 unrealircd-5.0.0 unrealircd-5.0.0-rc2 unrealircd-5.0.0-rc1"
132
+if [ -f "config.settings" ]; then
133
+	. ./config.settings
134
+else
135
+	# Try to load a previous config.settings
136
+	for x in $UNREALRELEASES
137
+	do
138
+		if [ -f ../$x/config.settings ]; then
139
+			IMPORTEDSETTINGS="../$x"
140
+			break
141
 		fi
142
+	done
143
+	echo "If you have previously installed UnrealIRCd on this shell then you can specify a"
144
+	echo "directory here so I can import the build settings and third party modules"
145
+	echo "to make your life a little easier."
146
+	if [ ! -z "$IMPORTEDSETTINGS" ]; then
147
+		echo "Found previous installation in: $IMPORTEDSETTINGS."
148
+		echo "You can enter a different path or type 'none' if you don't want to use it."
149
+		echo "Just press Enter to accept the default settings."
150
+	else
151
+		echo "If you install UnrealIRCd for the first time on this shell, then just hit Enter";
152
+	fi
153
 
154
-		TEST="$IMPORTEDSETTINGS"
155
-		echo $n "[$TEST] -> $c"
156
-		read cc
157
-		if [ -z "$cc" ]; then
158
-			IMPORTEDSETTINGS="$TEST"
159
-		else
160
-			IMPORTEDSETTINGS="$cc"
161
+	TEST="$IMPORTEDSETTINGS"
162
+	echo $n "[$TEST] -> $c"
163
+	read cc
164
+	if [ -z "$cc" ]; then
165
+		IMPORTEDSETTINGS="$TEST"
166
+	else
167
+		IMPORTEDSETTINGS="$cc"
168
+	fi
169
+	if [ "$IMPORTEDSETTINGS" = "none" ]; then
170
+		IMPORTEDSETTINGS=""
171
+	fi
172
+	if [ "$IMPORTEDSETTINGS" != "" ]; then
173
+		if [ -d $IMPORTEDSETTINGS/conf ]; then
174
+			echo "ERROR: Directory $IMPORTEDSETTINGS is an INSTALLATION directory (eg /home/irc/unrealircd)."
175
+			echo "This question was about a SOURCE directory (eg /home/irc/unrealircd-5.0.0)."
176
+			exit
177
 		fi
178
-		if [ "$IMPORTEDSETTINGS" = "none" ]; then
179
-			IMPORTEDSETTINGS=""
180
+		if [ ! -f $IMPORTEDSETTINGS/config.settings ]; then
181
+			echo "Directory $IMPORTEDSETTINGS does not exist or does not contain a config.settings file"
182
+			exit
183
 		fi
184
-		if [ "$IMPORTEDSETTINGS" != "" ]; then
185
-			if [ -d $IMPORTEDSETTINGS/conf ]; then
186
-				echo "ERROR: Directory $IMPORTEDSETTINGS is an INSTALLATION directory (eg /home/irc/unrealircd)."
187
-				echo "This question was about a SOURCE directory (eg /home/irc/unrealircd-5.0.0)."
188
-				exit
189
-			fi
190
-			if [ ! -f $IMPORTEDSETTINGS/config.settings ]; then
191
-				echo "Directory $IMPORTEDSETTINGS does not exist or does not contain a config.settings file"
192
-				exit
193
-			fi
194
-			COPYMODULES="1"
195
-			if grep -q TOPICNICKISNUH $IMPORTEDSETTINGS/config.settings; then
196
-				echo "Directory $IMPORTEDSETTINGS seems to be UnrealIRCd 4.x (or older)."
197
-				echo "I will copy the settings but not any 3rd party modules, as they are incompatible with 5.x."
198
-				COPYMODULES="0"
199
-			fi
200
-			# Actually load the settings
201
-			. $IMPORTEDSETTINGS/config.settings
202
-			if [ "$COPYMODULES" = "1" ]; then
203
-				# Copy over 3rd party modules (also deals with 0 file cases, hence the silly looking code)
204
-				for f in $IMPORTEDSETTINGS/src/modules/third/*.c
205
-				do
206
-					[ -e "$f" ] && cp $f src/modules/third/
207
-				done
208
-			fi
209
+		COPYMODULES="1"
210
+		if grep -q TOPICNICKISNUH $IMPORTEDSETTINGS/config.settings; then
211
+			echo "Directory $IMPORTEDSETTINGS seems to be UnrealIRCd 4.x (or older)."
212
+			echo "I will copy the settings but not any 3rd party modules, as they are incompatible with 5.x."
213
+			COPYMODULES="0"
214
 		fi
215
-	fi
216
-	# If we just imported settings and the curl dir is set to
217
-	# something like /home/xxx/unrealircd-5.x.y/extras/curl/
218
-	# (what we call 'local-curl') then remove this setting as
219
-	# it would refer to the old UnrealIRCd installation.
220
-	if [ ! -z "$IMPORTEDSETTINGS" ]; then
221
-		if echo "$CURLDIR"|grep -qi unrealircd; then
222
-			CURLDIR=""
223
+		# Actually load the settings
224
+		. $IMPORTEDSETTINGS/config.settings
225
+		if [ "$COPYMODULES" = "1" ]; then
226
+			# Copy over 3rd party modules (also deals with 0 file cases, hence the silly looking code)
227
+			for f in $IMPORTEDSETTINGS/src/modules/third/*.c
228
+			do
229
+				[ -e "$f" ] && cp $f src/modules/third/
230
+			done
231
 		fi
232
 	fi
233
 fi
234
+# If we just imported settings and the curl dir is set to
235
+# something like /home/xxx/unrealircd-5.x.y/extras/curl/
236
+# (what we call 'local-curl') then remove this setting as
237
+# it would refer to the old UnrealIRCd installation.
238
+if [ ! -z "$IMPORTEDSETTINGS" ]; then
239
+	if echo "$CURLDIR"|grep -qi unrealircd; then
240
+		CURLDIR=""
241
+	fi
242
+fi
243
 
244
 TEST="$BASEPATH"
245
 echo ""
246
diff --git a/autoconf/m4/unreal.m4 b/autoconf/m4/unreal.m4
247
index a77b095..ec2c85d 100644
248
--- a/autoconf/m4/unreal.m4
249
+++ b/autoconf/m4/unreal.m4
250
@@ -252,3 +252,23 @@ else
251
 	AC_MSG_RESULT([no])
252
 fi
253
 ])
254
+
255
+AC_DEFUN([CHECK_SSL_CTX_SET_SECURITY_LEVEL],
256
+[
257
+AC_MSG_CHECKING([for SSL_CTX_set_security_level in SSL library])
258
+AC_LANG_PUSH(C)
259
+SAVE_LIBS="$LIBS"
260
+LIBS="$LIBS $CRYPTOLIB"
261
+AC_TRY_LINK([#include <openssl/ssl.h>],
262
+	[SSL_CTX *ctx = NULL; SSL_CTX_set_security_level(ctx, 1);],
263
+	has_function=1,
264
+	has_function=0)
265
+LIBS="$SAVE_LIBS"
266
+AC_LANG_POP(C)
267
+if test $has_function = 1; then
268
+	AC_MSG_RESULT([yes])
269
+	AC_DEFINE([HAS_SSL_CTX_SET_SECURITY_LEVEL], [], [Define if ssl library has SSL_CTX_set_security_level])
270
+else
271
+	AC_MSG_RESULT([no])
272
+fi
273
+])
274
diff --git a/configure b/configure
275
index 125017a..4936473 100755
276
--- a/configure
277
+++ b/configure
278
@@ -1,6 +1,6 @@
279
 #! /bin/sh
280
 # Guess values for system-dependent variables and create Makefiles.
281
-# Generated by GNU Autoconf 2.69 for unrealircd 5.0.3.1.
282
+# Generated by GNU Autoconf 2.69 for unrealircd 5.0.4.
283
 #
284
 # Report bugs to <https://bugs.unrealircd.org/>.
285
 #
286
@@ -580,8 +580,8 @@ MAKEFLAGS=
287
 # Identity of this package.
288
 PACKAGE_NAME='unrealircd'
289
 PACKAGE_TARNAME='unrealircd'
290
-PACKAGE_VERSION='5.0.3.1'
291
-PACKAGE_STRING='unrealircd 5.0.3.1'
292
+PACKAGE_VERSION='5.0.4'
293
+PACKAGE_STRING='unrealircd 5.0.4'
294
 PACKAGE_BUGREPORT='https://bugs.unrealircd.org/'
295
 PACKAGE_URL='https://unrealircd.org/'
296
 
297
@@ -670,6 +670,8 @@ HARDEN_BINLDFLAGS
298
 HARDEN_BINCFLAGS
299
 HARDEN_LDFLAGS
300
 HARDEN_CFLAGS
301
+GMAKE
302
+MAKER
303
 OBJEXT
304
 EXEEXT
305
 ac_ct_CC
306
@@ -679,8 +681,6 @@ CFLAGS
307
 CC
308
 PKGCONFIG
309
 GUNZIP
310
-GMAKE
311
-MAKER
312
 INSTALL
313
 OPENSSLPATH
314
 TOUCH
315
@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
316
   # Omit some internal or obsolete options to make the list less imposing.
317
   # This message is too long to be a string in the A/UX 3.1 sh.
318
   cat <<_ACEOF
319
-\`configure' configures unrealircd 5.0.3.1 to adapt to many kinds of systems.
320
+\`configure' configures unrealircd 5.0.4 to adapt to many kinds of systems.
321
 
322
 Usage: $0 [OPTION]... [VAR=VALUE]...
323
 
324
@@ -1391,7 +1391,7 @@ fi
325
 
326
 if test -n "$ac_init_help"; then
327
   case $ac_init_help in
328
-     short | recursive ) echo "Configuration of unrealircd 5.0.3.1:";;
329
+     short | recursive ) echo "Configuration of unrealircd 5.0.4:";;
330
    esac
331
   cat <<\_ACEOF
332
 
333
@@ -1544,7 +1544,7 @@ fi
334
 test -n "$ac_init_help" && exit $ac_status
335
 if $ac_init_version; then
336
   cat <<\_ACEOF
337
-unrealircd configure 5.0.3.1
338
+unrealircd configure 5.0.4
339
 generated by GNU Autoconf 2.69
340
 
341
 Copyright (C) 2012 Free Software Foundation, Inc.
342
@@ -1913,7 +1913,7 @@ cat >config.log <<_ACEOF
343
 This file contains any messages produced by compilers while
344
 running configure, to aid debugging if configure makes a mistake.
345
 
346
-It was created by unrealircd $as_me 5.0.3.1, which was
347
+It was created by unrealircd $as_me 5.0.4, which was
348
 generated by GNU Autoconf 2.69.  Invocation command line was
349
 
350
   $ $0 $@
351
@@ -2321,7 +2321,7 @@ _ACEOF
352
 
353
 
354
 # Minor version number (e.g.: Z in X.Y.Z)
355
-UNREAL_VERSION_MINOR="3"
356
+UNREAL_VERSION_MINOR="4"
357
 
358
 cat >>confdefs.h <<_ACEOF
359
 #define UNREAL_VERSION_MINOR $UNREAL_VERSION_MINOR
360
@@ -2331,7 +2331,7 @@ _ACEOF
361
 # The version suffix such as a beta marker or release candidate
362
 # marker. (e.g.: -rcX for unrealircd-3.2.9-rcX). This macro is a
363
 # string instead of an integer because it contains arbitrary data.
364
-UNREAL_VERSION_SUFFIX=".1"
365
+UNREAL_VERSION_SUFFIX=""
366
 
367
 cat >>confdefs.h <<_ACEOF
368
 #define UNREAL_VERSION_SUFFIX "$UNREAL_VERSION_SUFFIX"
369
@@ -2551,91 +2551,6 @@ $as_echo "no" >&6; }
370
 fi
371
 
372
 
373
-# Extract the first word of "gmake", so it can be a program name with args.
374
-set dummy gmake; ac_word=$2
375
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
376
-$as_echo_n "checking for $ac_word... " >&6; }
377
-if ${ac_cv_prog_MAKER+:} false; then :
378
-  $as_echo_n "(cached) " >&6
379
-else
380
-  if test -n "$MAKER"; then
381
-  ac_cv_prog_MAKER="$MAKER" # Let the user override the test.
382
-else
383
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
384
-for as_dir in $PATH
385
-do
386
-  IFS=$as_save_IFS
387
-  test -z "$as_dir" && as_dir=.
388
-    for ac_exec_ext in '' $ac_executable_extensions; do
389
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
390
-    ac_cv_prog_MAKER="gmake"
391
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
392
-    break 2
393
-  fi
394
-done
395
-  done
396
-IFS=$as_save_IFS
397
-
398
-  test -z "$ac_cv_prog_MAKER" && ac_cv_prog_MAKER="make"
399
-fi
400
-fi
401
-MAKER=$ac_cv_prog_MAKER
402
-if test -n "$MAKER"; then
403
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKER" >&5
404
-$as_echo "$MAKER" >&6; }
405
-else
406
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
407
-$as_echo "no" >&6; }
408
-fi
409
-
410
-
411
-# Extract the first word of "gmake", so it can be a program name with args.
412
-set dummy gmake; ac_word=$2
413
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
414
-$as_echo_n "checking for $ac_word... " >&6; }
415
-if ${ac_cv_path_GMAKE+:} false; then :
416
-  $as_echo_n "(cached) " >&6
417
-else
418
-  case $GMAKE in
419
-  [\\/]* | ?:[\\/]*)
420
-  ac_cv_path_GMAKE="$GMAKE" # Let the user override the test with a path.
421
-  ;;
422
-  *)
423
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
424
-for as_dir in $PATH
425
-do
426
-  IFS=$as_save_IFS
427
-  test -z "$as_dir" && as_dir=.
428
-    for ac_exec_ext in '' $ac_executable_extensions; do
429
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
430
-    ac_cv_path_GMAKE="$as_dir/$ac_word$ac_exec_ext"
431
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
432
-    break 2
433
-  fi
434
-done
435
-  done
436
-IFS=$as_save_IFS
437
-
438
-  ;;
439
-esac
440
-fi
441
-GMAKE=$ac_cv_path_GMAKE
442
-if test -n "$GMAKE"; then
443
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMAKE" >&5
444
-$as_echo "$GMAKE" >&6; }
445
-else
446
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
447
-$as_echo "no" >&6; }
448
-fi
449
-
450
-
451
-
452
-if $MAKER --version | grep -q "GNU Make"; then :
453
-  GNUMAKE="0"
454
-else
455
-  as_fn_error $? "It seems your system does not have gmake installed. Please install gmake." "$LINENO" 5
456
-fi
457
-
458
 # Extract the first word of "gunzip", so it can be a program name with args.
459
 set dummy gunzip; ac_word=$2
460
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
461
@@ -3687,6 +3602,90 @@ if test "$ac_cv_prog_cc_c99" = "no"; then :
462
   as_fn_error $? "No C99 compiler was found. Please install gcc or clang and other build tools. Eg, on Debian/Ubuntu you probably want to run the following as root: apt-get install build-essential " "$LINENO" 5
463
 fi
464
 
465
+# Extract the first word of "gmake", so it can be a program name with args.
466
+set dummy gmake; ac_word=$2
467
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
468
+$as_echo_n "checking for $ac_word... " >&6; }
469
+if ${ac_cv_prog_MAKER+:} false; then :
470
+  $as_echo_n "(cached) " >&6
471
+else
472
+  if test -n "$MAKER"; then
473
+  ac_cv_prog_MAKER="$MAKER" # Let the user override the test.
474
+else
475
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
476
+for as_dir in $PATH
477
+do
478
+  IFS=$as_save_IFS
479
+  test -z "$as_dir" && as_dir=.
480
+    for ac_exec_ext in '' $ac_executable_extensions; do
481
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
482
+    ac_cv_prog_MAKER="gmake"
483
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
484
+    break 2
485
+  fi
486
+done
487
+  done
488
+IFS=$as_save_IFS
489
+
490
+  test -z "$ac_cv_prog_MAKER" && ac_cv_prog_MAKER="make"
491
+fi
492
+fi
493
+MAKER=$ac_cv_prog_MAKER
494
+if test -n "$MAKER"; then
495
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKER" >&5
496
+$as_echo "$MAKER" >&6; }
497
+else
498
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
499
+$as_echo "no" >&6; }
500
+fi
501
+
502
+
503
+# Extract the first word of "gmake", so it can be a program name with args.
504
+set dummy gmake; ac_word=$2
505
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
506
+$as_echo_n "checking for $ac_word... " >&6; }
507
+if ${ac_cv_path_GMAKE+:} false; then :
508
+  $as_echo_n "(cached) " >&6
509
+else
510
+  case $GMAKE in
511
+  [\\/]* | ?:[\\/]*)
512
+  ac_cv_path_GMAKE="$GMAKE" # Let the user override the test with a path.
513
+  ;;
514
+  *)
515
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
516
+for as_dir in $PATH
517
+do
518
+  IFS=$as_save_IFS
519
+  test -z "$as_dir" && as_dir=.
520
+    for ac_exec_ext in '' $ac_executable_extensions; do
521
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
522
+    ac_cv_path_GMAKE="$as_dir/$ac_word$ac_exec_ext"
523
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
524
+    break 2
525
+  fi
526
+done
527
+  done
528
+IFS=$as_save_IFS
529
+
530
+  ;;
531
+esac
532
+fi
533
+GMAKE=$ac_cv_path_GMAKE
534
+if test -n "$GMAKE"; then
535
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMAKE" >&5
536
+$as_echo "$GMAKE" >&6; }
537
+else
538
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
539
+$as_echo "no" >&6; }
540
+fi
541
+
542
+
543
+if $MAKER --version | grep -q "GNU Make"; then :
544
+  GNUMAKE="0"
545
+else
546
+  as_fn_error $? "It seems your system does not have make/gmake installed. If you are on Linux then install make, otherwise install gmake." "$LINENO" 5
547
+fi
548
+
549
 
550
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -ldescrypt" >&5
551
 $as_echo_n "checking for crypt in -ldescrypt... " >&6; }
552
@@ -6384,6 +6383,53 @@ else
553
 $as_echo "no" >&6; }
554
 fi
555
 
556
+
557
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_set_security_level in SSL library" >&5
558
+$as_echo_n "checking for SSL_CTX_set_security_level in SSL library... " >&6; }
559
+ac_ext=c
560
+ac_cpp='$CPP $CPPFLAGS'
561
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
562
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
563
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
564
+
565
+SAVE_LIBS="$LIBS"
566
+LIBS="$LIBS $CRYPTOLIB"
567
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
568
+/* end confdefs.h.  */
569
+#include <openssl/ssl.h>
570
+int
571
+main ()
572
+{
573
+SSL_CTX *ctx = NULL; SSL_CTX_set_security_level(ctx, 1);
574
+  ;
575
+  return 0;
576
+}
577
+_ACEOF
578
+if ac_fn_c_try_link "$LINENO"; then :
579
+  has_function=1
580
+else
581
+  has_function=0
582
+fi
583
+rm -f core conftest.err conftest.$ac_objext \
584
+    conftest$ac_exeext conftest.$ac_ext
585
+LIBS="$SAVE_LIBS"
586
+ac_ext=c
587
+ac_cpp='$CPP $CPPFLAGS'
588
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
589
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
590
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
591
+
592
+if test $has_function = 1; then
593
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
594
+$as_echo "yes" >&6; }
595
+
596
+$as_echo "#define HAS_SSL_CTX_SET_SECURITY_LEVEL /**/" >>confdefs.h
597
+
598
+else
599
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
600
+$as_echo "no" >&6; }
601
+fi
602
+
603
 # Check whether --enable-dynamic-linking was given.
604
 if test "${enable_dynamic_linking+set}" = set; then :
605
   enableval=$enable_dynamic_linking; enable_dynamic_linking=$enableval
606
@@ -6948,6 +6994,11 @@ $as_echo "installing Argon2 library" >&6; }
607
 $ac_cv_prog_MAKER install PREFIX=$cur_dir/extras/argon2 || exit 1
608
 # We need to manually copy the libs to PRIVATELIBDIR because
609
 # there is no way to tell make install in libargon2 to do so.
610
+# BUT FIRST, delete the old library so it becomes an unlink+create
611
+# operation rather than overwriting the existing file which would
612
+# lead to a crash of the currently running IRCd.
613
+rm -f "$PRIVATELIBDIR/"libargon2*
614
+# Now copy the new library files:
615
 cp -av $cur_dir/extras/argon2/lib/* $PRIVATELIBDIR/
616
 ARGON2_CFLAGS="-I$cur_dir/extras/argon2/include"
617
 
618
@@ -8249,7 +8300,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
619
 # report actual input values of CONFIG_FILES etc. instead of their
620
 # values after options handling.
621
 ac_log="
622
-This file was extended by unrealircd $as_me 5.0.3.1, which was
623
+This file was extended by unrealircd $as_me 5.0.4, which was
624
 generated by GNU Autoconf 2.69.  Invocation command line was
625
 
626
   CONFIG_FILES    = $CONFIG_FILES
627
@@ -8312,7 +8363,7 @@ _ACEOF
628
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
629
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
630
 ac_cs_version="\\
631
-unrealircd config.status 5.0.3.1
632
+unrealircd config.status 5.0.4
633
 configured by $0, generated by GNU Autoconf 2.69,
634
   with options \\"\$ac_cs_config\\"
635
 
636
diff --git a/configure.ac b/configure.ac
637
index 983b6dd..92720c8 100644
638
--- a/configure.ac
639
+++ b/configure.ac
640
@@ -7,7 +7,7 @@ dnl src/windows/unrealinst.iss
641
 dnl doc/Config.header
642
 dnl src/version.c.SH
643
 
644
-AC_INIT([unrealircd], [5.0.3.1], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
645
+AC_INIT([unrealircd], [5.0.4], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
646
 AC_CONFIG_SRCDIR([src/ircd.c])
647
 AC_CONFIG_HEADER([include/setup.h])
648
 AC_CONFIG_AUX_DIR([autoconf])
649
@@ -34,13 +34,13 @@ UNREAL_VERSION_MAJOR=["0"]
650
 AC_DEFINE_UNQUOTED([UNREAL_VERSION_MAJOR], [$UNREAL_VERSION_MAJOR], [Major version number (e.g.: Y for X.Y.Z)])
651
 
652
 # Minor version number (e.g.: Z in X.Y.Z)
653
-UNREAL_VERSION_MINOR=["3"]
654
+UNREAL_VERSION_MINOR=["4"]
655
 AC_DEFINE_UNQUOTED([UNREAL_VERSION_MINOR], [$UNREAL_VERSION_MINOR], [Minor version number (e.g.: Z for X.Y.Z)])
656
 
657
 # The version suffix such as a beta marker or release candidate
658
 # marker. (e.g.: -rcX for unrealircd-3.2.9-rcX). This macro is a
659
 # string instead of an integer because it contains arbitrary data.
660
-UNREAL_VERSION_SUFFIX=[".1"]
661
+UNREAL_VERSION_SUFFIX=[""]
662
 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)])
663
 
664
 AC_PATH_PROG(RM,rm)
665
@@ -60,13 +60,6 @@ exit 1
666
 ])
667
 
668
 AC_PATH_PROG(INSTALL,install)
669
-AC_CHECK_PROG(MAKER, gmake, gmake, make)
670
-AC_PATH_PROG(GMAKE,gmake)
671
-
672
-AS_IF([$MAKER --version | grep -q "GNU Make"],
673
-        [GNUMAKE="0"],
674
-        [AC_MSG_ERROR([It seems your system does not have gmake installed. Please install gmake.])])
675
-
676
 AC_PATH_PROG(GUNZIP, gunzip)
677
 AC_PATH_PROG(PKGCONFIG, pkg-config)
678
 
679
@@ -75,6 +68,13 @@ AC_PROG_CC_C99
680
 AS_IF([test "$ac_cv_prog_cc_c99" = "no"],
681
 	[AC_MSG_ERROR([No C99 compiler was found. Please install gcc or clang and other build tools. Eg, on Debian/Ubuntu you probably want to run the following as root: apt-get install build-essential ])])
682
 
683
+dnl Check for make moved down, so the above compiler check takes precedence.
684
+AC_CHECK_PROG(MAKER, gmake, gmake, make)
685
+AC_PATH_PROG(GMAKE,gmake)
686
+AS_IF([$MAKER --version | grep -q "GNU Make"],
687
+        [GNUMAKE="0"],
688
+        [AC_MSG_ERROR([It seems your system does not have make/gmake installed. If you are on Linux then install make, otherwise install gmake.])])
689
+
690
 dnl Checks for libraries.
691
 AC_CHECK_LIB(descrypt, crypt,
692
 	[AC_DEFINE([HAVE_CRYPT], [], [Define if you have crypt])
693
@@ -497,6 +497,7 @@ AC_ARG_WITH(system-cares, [AS_HELP_STRING([--without-system-cares], [Use bundled
694
 CHECK_SSL
695
 CHECK_SSL_CTX_SET1_CURVES_LIST
696
 CHECK_SSL_CTX_SET_MIN_PROTO_VERSION
697
+CHECK_SSL_CTX_SET_SECURITY_LEVEL
698
 AC_ARG_ENABLE(dynamic-linking, [AS_HELP_STRING([--disable-dynamic-linking], [Make the IRCd statically link with shared objects rather than dynamically (noone knows if disabling dynamic linking actually does anything or not)])],
699
 	[enable_dynamic_linking=$enableval], [enable_dynamic_linking="yes"])
700
 AS_IF([test $enable_dynamic_linking = "yes"],
701
@@ -603,6 +604,11 @@ AC_MSG_RESULT(installing Argon2 library)
702
 $ac_cv_prog_MAKER install PREFIX=$cur_dir/extras/argon2 || exit 1
703
 # We need to manually copy the libs to PRIVATELIBDIR because
704
 # there is no way to tell make install in libargon2 to do so.
705
+# BUT FIRST, delete the old library so it becomes an unlink+create
706
+# operation rather than overwriting the existing file which would
707
+# lead to a crash of the currently running IRCd.
708
+rm -f "$PRIVATELIBDIR/"libargon2*
709
+# Now copy the new library files:
710
 cp -av $cur_dir/extras/argon2/lib/* $PRIVATELIBDIR/
711
 ARGON2_CFLAGS="-I$cur_dir/extras/argon2/include"
712
 AC_SUBST(ARGON2_CFLAGS)
713
diff --git a/doc/Config.header b/doc/Config.header
714
index caeeb18..dcddc86 100644
715
--- a/doc/Config.header
716
+++ b/doc/Config.header
717
@@ -7,11 +7,10 @@
718
  \___/|_| |_|_|  \___|\__,_|_|\___/\_| \_| \____/\__,_|
719
 
720
                                Configuration Program
721
-                                for UnrealIRCd 5.0.3.1
722
+                                for UnrealIRCd 5.0.4
723
                                     
724
 This program will help you to compile your IRC server, and ask you
725
 questions regarding the compile-time settings of it during the process. 
726
-regarding the setup of it, during the process.
727
 
728
 A short installation guide is available online at:
729
 https://www.unrealircd.org/docs/Installing_from_source
730
diff --git a/doc/RELEASE-NOTES.md b/doc/RELEASE-NOTES.md
731
index b7625dc..d030e13 100644
732
--- a/doc/RELEASE-NOTES.md
733
+++ b/doc/RELEASE-NOTES.md
734
@@ -1,5 +1,46 @@
735
-UnrealIRCd 5.0.3.1 Release Notes
736
-=================================
737
+UnrealIRCd 5.0.4 Release Notes
738
+===============================
739
+
740
+This new 5.0.4 version fixes quite a number of bugs. It contains only two small feature improvements.
741
+
742
+Fixes:
743
+* When placing a SHUN on an online user it was not always effective.
744
+* Channeldb was not properly restoring all channel modes, such as +P.
745
+* When upgrading UnrealIRCd it could sometimes crash the currently
746
+  running IRC server (rare), or trigger a crash report on
747
+  ```./unrealircd restart``` (quite common).
748
+* UnrealIRCd was giving up too easily on ident lookups.
749
+* Crash when unloading a module with moddata.
750
+* Crash if an authenticated server sends wrong information (rare).
751
+* Removing a TEMPSHUN did not work if the user was on another server.
752
+* SAJOIN to 0 (part all channels) resulted in a desync when used on remote users.
753
+* Forced nick change from services was not showing up if the user
754
+  was not in any channels.
755
+
756
+Enhancements:
757
+* New option [set::hide-idle-time::policy](https://www.unrealircd.org/docs/Set_block#set%3A%3Ahide-idle-time)
758
+  by which you can change usermode +I (hide idle time in WHOIS) from
759
+  oper-only to settable by users. More options will follow in a future
760
+  release.
761
+* In WHOIS you can now see if a user is currently (temp)shunned.
762
+  This only works for locally connected users for technical reasons,
763
+  so use ```/WHOIS Nick Nick``` to see it for remote users.
764
+
765
+Changes:
766
+* The oper notices and logging with regards to server linking have changed
767
+  a little. They are more consistent and log more now.
768
+* When an IRCOp tries to oper up from an insecure connection we will now
769
+  mention the https://www.unrealircd.org/docs/FAQ#oper-requires-tls page.
770
+  This message is customizable through
771
+  [set::plaintext-policy::oper-message](https://www.unrealircd.org/docs/Set_block#set::plaintext-policy).
772
+* The French HELPOP text was updated.
773
+
774
+Upgrading from UnrealIRCd 4?
775
+-----------------------------
776
+
777
+Are you upgrading from UnrealIRCd 4.x to UnrealIRCd 5?
778
+Then check out the *UnrealIRCd 5* release notes [further down](#unrealircd-5). At the
779
+very least, check out [Upgrading from 4.x](https://www.unrealircd.org/docs/Upgrading_from_4.x).
780
 
781
 UnrealIRCd 5.0.3.1
782
 -------------------
783
diff --git a/doc/conf/except.conf b/doc/conf/except.conf
784
index 14a9be5..562fbd5 100644
785
--- a/doc/conf/except.conf
786
+++ b/doc/conf/except.conf
787
@@ -33,3 +33,4 @@ except ban { mask *@2600:3c03::f03c:91ff:fe96:c1fa; } # bot.search.mibbit.com
788
 
789
 # Netsplit
790
 except ban { mask *@85.25.137.63; } # eagle.netsplit.de
791
+except ban { mask *@85.25.10.40;  } # anaconda.netsplit.de
792
diff --git a/doc/conf/ircd.motd b/doc/conf/ircd.motd
793
index 1113ad7..7fc0ae0 100644
794
--- a/doc/conf/ircd.motd
795
+++ b/doc/conf/ircd.motd
796
@@ -36,12 +36,9 @@
797
      0,0  0║ ╚0,0     0║ 0,0       0╗   0,0  0║   ╚0,0     0╔╝
798
      0╚═╝  ╚════╝ ╚══════╝   ╚═╝    ╚════╝
799
 
800
+4─────────┤ 0THE WILD WILD WEST OF IRC4├─────────
801
 
802
+14• 7Do not disrupt the orderly operation of the network
803
+14• 7No distribution of child pornography
804
 
805
-4──────────────────┤ 0RULES 4├───────────────────
806
-
807
-14• 7Do not disrupt or compromise our security. 
808
-14• 7No malicious abuse of network services.
809
-14• 7No distribution of child pornography.
810
-
811
-4──────────────────────────────────────────────
812
+8,4         E N T E R   T H E   V O I D          
813
diff --git a/doc/conf/unrealircd.remote.conf b/doc/conf/unrealircd.remote.conf
814
deleted file mode 100644
815
index e745785..0000000
816
--- a/doc/conf/unrealircd.remote.conf
817
+++ /dev/null
818
@@ -1,185 +0,0 @@
819
-admin { ""; }
820
-
821
-alias botserv { type services; }
822
-alias bs { target botserv; type services; }
823
-alias chanserv { type services; }
824
-alias cs { target chanserv; type services; }
825
-alias hostserv { type services; }
826
-alias hs { target hostserv; type services; }
827
-alias nickserv { type services; }
828
-alias ns { target nickserv; type services; }
829
-alias operserv { type services; }
830
-alias os { target operserv; type services; }
831
-
832
-class clients { pingfreq 120; maxclients 100; sendq 1M; options { nofakelag; } }
833
-class servers { pingfreq 120; maxclients  10; sendq 1M; connfreq 30;           }
834
-
835
-allow { ip *; class clients; maxperip 2; }
836
-
837
-listen { ip *; port 6667;      options { clientsonly;      } }
838
-listen { ip *; port 6697;      options { clientsonly; tls; } }
839
-listen { ip *; port REDACTED;  options { serversonly; tls; } }
840
-
841
-link irc.supernets.org {
842
-	incoming { mask REDACTED; }
843
-	outgoing {
844
-		bind-ip *;
845
-		hostname REDACTED;
846
-		port REDACTED;
847
-		options { tls; autoconnect; }
848
-	}
849
-	password "REDACTED" { spkifp; }
850
-	class servers;
851
-}
852
-
853
-log "errors.log" { flags { errors; } maxsize 10K; }
854
-
855
-tld { mask *@*; motd remote.motd; rules remote.motd; options { remote; } }
856
-
857
-ulines { services.supernets.org; }
858
-
859
-blacklist dronebl {
860
-	dns {
861
-		name dnsbl.dronebl.org;
862
-		type record;
863
-		reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
864
-	}
865
-	action gzline;
866
-	ban-time 1d;
867
-	reason "8,4   E N T E R   T H E   V O I D   ";
868
-}
869
-
870
-blacklist efnetrbl {
871
-	dns {
872
-		name rbl.efnetrbl.org;
873
-		type record;
874
-		reply { 1; 4; 5; }
875
-	}
876
-	action gzline;
877
-	ban-time 1d;
878
-	reason "8,4   E N T E R   T H E   V O I D   ";
879
-}
880
-
881
-blacklist torbl {
882
-	dns {
883
-		name torexit.dan.me.uk;
884
-		type record;
885
-		reply { 100; }
886
-	}
887
-	action gzline;
888
-	ban-time 1d;
889
-	reason "8,4   E N T E R   T H E   V O I D   ";
890
-}
891
-
892
-webirc { mask 107.161.19.53;  password "REDACTED"; } # KiwiIRC
893
-webirc { mask 107.161.19.109; password "REDACTED"; }
894
-webirc { mask 107.161.31.4;   password "REDACTED"; }
895
-
896
-webirc { mask 207.192.75.252; password "REDACTED"; } # Mibbit
897
-webirc { mask 64.62.228.82;   password "REDACTED"; }
898
-webirc { mask 78.129.202.38;  password "REDACTED"; }
899
-webirc { mask 109.169.29.95 ; password "REDACTED"; }
900
-
901
-set {
902
-	kline-address "banned@supernets.org";
903
-	gline-address "banned@supernets.org";
904
-	modes-on-connect "+ipTx";
905
-	modes-on-oper "+HIq";
906
-	snomask-on-oper "+bcFfkGsSo";
907
-	modes-on-join "+ns";
908
-	level-on-join "op";
909
-	restrict-channelmodes "CnLpPs";
910
-	restrict-commands {
911
-		invite          { connect-delay 3600; exempt-identified yes; }
912
-		list            { connect-delay 120;  exempt-identified yes; }
913
-		private-message { connect-delay 300;  exempt-identified yes; }
914
-		private-notice  { connect-delay 3600; exempt-identified yes; }
915
-	}
916
-	auto-join "#superbowl";
917
-	oper-auto-join "#help";
918
-	static-quit "EMO-QUIT";
919
-	static-part "EMO-PART";
920
-	who-limit 100;
921
-	nick-length 20;
922
-	maxchannelsperuser 10;
923
-	channel-command-prefix "`!@$.";
924
-	options { hide-ulines; flat-map; identd-check; }
925
-	network-name "SuperNETs";
926
-	default-server "irc.supernets.org";
927
-	services-server "services.supernets.org";
928
-	sasl-server "services.supernets.org";
929
-	help-channel "#help";
930
-	cloak-method ip;
931
-	cloak-keys {
932
-		"REDACTED";
933
-		"REDACTED";
934
-		"REDACTED";
935
-	}
936
-	hiddenhost-prefix "SUPER";
937
-	plaintext-policy {
938
-		user warn;
939
-		oper deny;
940
-		server deny;
941
-		user-message "4WARNING: You are not using a secure connection with SSL/TLS";
942
-		oper-message "Network operators must connect using SSL/TLS";
943
-	}
944
-	outdated-tls-policy {
945
-		user warn;
946
-		oper deny;
947
-		server deny;
948
-		user-message "4WARNING: You are using an outdated SSL/TLS protocol or cipher";
949
-		oper-message "Network operators must connect using an up-to-date SSL/TLS protocol or cipher";
950
-	}
951
-	anti-flood {
952
-		away-flood 3:300;
953
-		connect-flood 3:300;
954
-		invite-flood 3:300;
955
-		join-flood 3:300;
956
-		knock-flood 3:300;
957
-		max-concurrent-conversations { users 5; new-user-every 60s; }
958
-		nick-flood 3:300;
959
-		unknown-flood-amount 2048;
960
-		unknown-flood-bantime 1h;
961
-	}
962
-	default-bantime 1d;
963
-	spamfilter {
964
-		ban-time 1d;
965
-		ban-reason "8,4   E N T E R   T H E   V O I D   ";
966
-		except "#anythinggoes";
967
-	}
968
-	max-targets-per-command { kick 1; part 1; privmsg 1; }
969
-	hide-ban-reason yes;
970
-	reject-message {
971
-		gline                "8,4   E N T E R   T H E   V O I D   ";
972
-		kline                "8,4   E N T E R   T H E   V O I D   ";
973
-		password-mismatch    "8,4   E N T E R   T H E   V O I D   ";
974
-		server-full          "8,4   E N T E R   T H E   V O I D   ";
975
-		too-many-connections "8,4   E N T E R   T H E   V O I D   ";
976
-		unauthorized         "8,4   E N T E R   T H E   V O I D   ";
977
-	}
978
-	antimixedutf8 {
979
-		score 10;
980
-		ban-action block;
981
-		ban-reason "8,4   E N T E R   T H E   V O I D   ";
982
-		ban-time 1h;
983
-	}
984
-	connthrottle {
985
-		known-users   { minimum-reputation-score 24; sasl-bypass yes;       }
986
-		new-users     { local-throttle 20:60;        global-throttle 30:60; }
987
-		disabled-when { reputation-gathering 1w;     start-delay 3m;        }
988
-	}
989
-	history {
990
-		channel {
991
-			playback-on-join        { lines 100; time 1d; }
992
-			max-storage-per-channel { lines 100; time 1d; }
993
-		}
994
-	}
995
-	manual-ban-target ip;
996
-}
997
-
998
-hideserver {
999
-	disable-map yes;