Explorar o código

Merge branch 'master' into 39-dynamic-roles

* master: (31 commits)
  Fallback to ISON if the server falsely claims to support MONITOR.
  Use proper bdlib 9ee3b7d84, accidentally modified in recent merges
  No need for compat here after removing calloc/realloc overrides
  Remove unneeded my_calloc/my_realloc
  Remove compatibility for POSIX.1 2001 and C90 functions.
  Remove unused isascii(3) support
  Fix ban/exempt/invite masking not working with 10-char idents.
  Tell Travis sudo is needed
  Support forward compat for FreeBSD's procctl PROC_TRACE_CTL
  Simplify DEBUG ifdef handling
  Optimize ptrace detection on FreeBSD 10
  Use FreeBSD 10's procctl(PROC_TRACE_CTL) to disable core dumps and tracing.
  Rebuild with latest autoconf
  Libc++ r249800 breaks labs(3).  Revert to working revisions for now.
  Attempt to use PR_SET_PTRACER even if not defined at build-time to fix foward-compat.
  Use Linux's prctl(PR_SET_DUMPABLE) to disable core dumps and ptrace(2).
  irc.shaw.ca was just a CNAME to eversible, remove it.
  Fix +take to work
  Note that it was Linux binary compat that was fixed on FreeBSD
  irc.eversible.com is shutting down permanently.
  ...
Bryan Drewery %!s(int64=10) %!d(string=hai) anos
pai
achega
4fe078572c
Modificáronse 70 ficheiros con 1913 adicións e 3612 borrados
  1. 5 2
      .travis.yml
  2. 5 5
      build/autotools/configure.ac
  3. 44 86
      configure
  4. 0 1544
      doc/UPDATES
  5. 1527 0
      doc/UPDATES.md
  6. 2 15
      doc/settings.txt
  7. 0 5
      src/Makefile.in
  8. 7 7
      src/adns.cc
  9. 4 5
      src/base64.cc
  10. 3 3
      src/binary.cc
  11. 3 3
      src/binds.cc
  12. 1 1
      src/botmsg.cc
  13. 9 5
      src/botnet.cc
  14. 0 3
      src/chan.h
  15. 8 14
      src/chanprog.cc
  16. 5 0
      src/chanprog.h
  17. 24 24
      src/cmds.cc
  18. 0 6
      src/compat/compat.h
  19. 1 1
      src/compat/dn_expand.c
  20. 0 1230
      src/compat/gnu_strftime.c
  21. 0 181
      src/compat/inet_ntop.c
  22. 0 29
      src/compat/inet_ntop.h
  23. 0 17
      src/compat/memcpy.c
  24. 0 27
      src/compat/memcpy.h
  25. 0 16
      src/compat/memset.c
  26. 0 32
      src/compat/memset.h
  27. 2 34
      src/compat/memutil.c
  28. 0 9
      src/compat/memutil.h
  29. 0 32
      src/compat/strcasecmp.c
  30. 0 33
      src/compat/strcasecmp.h
  31. 0 16
      src/compat/strftime.c
  32. 0 29
      src/compat/strftime.h
  33. 7 7
      src/conf.cc
  34. 11 32
      src/config.h.in
  35. 2 2
      src/crypt.cc
  36. 4 4
      src/crypto/aes_util.cc
  37. 4 4
      src/crypto/bf_util.cc
  38. 1 1
      src/crypto/dh_util.cc
  39. 6 6
      src/dcc.cc
  40. 7 7
      src/dccutil.cc
  41. 2 2
      src/egg_timer.cc
  42. 1 1
      src/enclink.cc
  43. 1 1
      src/flags.cc
  44. 1 1
      src/garble.cc
  45. 1 1
      src/main.cc
  46. 4 0
      src/match.cc
  47. 12 6
      src/misc.cc
  48. 0 4
      src/misc_file.cc
  49. 7 7
      src/mod/channels.mod/chanmisc.cc
  50. 1 1
      src/mod/channels.mod/channels.cc
  51. 2 2
      src/mod/channels.mod/userchan.cc
  52. 2 2
      src/mod/compress.mod/compress.cc
  53. 3 3
      src/mod/console.mod/console.cc
  54. 8 9
      src/mod/irc.mod/chan.cc
  55. 7 7
      src/mod/irc.mod/cmdsirc.cc
  56. 7 7
      src/mod/irc.mod/irc.cc
  57. 9 9
      src/mod/irc.mod/mode.cc
  58. 5 5
      src/mod/server.mod/server.cc
  59. 19 1
      src/mod/server.mod/servmsg.cc
  60. 8 8
      src/mod/share.mod/share.cc
  61. 3 3
      src/mod/transfer.mod/transfer.cc
  62. 2 2
      src/net.cc
  63. 9 9
      src/set.cc
  64. 83 17
      src/shell.cc
  65. 1 1
      src/socket.cc
  66. 9 9
      src/userent.cc
  67. 2 2
      src/userrec.cc
  68. 2 0
      src/userrec.h
  69. 10 10
      src/users.cc
  70. 0 5
      src/users.h

+ 5 - 2
.travis.yml

@@ -12,8 +12,8 @@ before_install:
   - if [ "$CXX" = "g++" ]; then sudo apt-get install gcc-4.8 g++-4.8; fi
   - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
   - if [ "$CXX" = "clang++" ]; then sudo apt-get install clang-3.4; fi
-  - if [ "$CXX" = "clang++" ]; then svn co --quiet http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi; fi
-  - if [ "$CXX" = "clang++" ]; then svn co --quiet http://llvm.org/svn/llvm-project/libcxx/trunk libcxx; fi
+  - if [ "$CXX" = "clang++" ]; then svn co --quiet --trust-server-cert --non-interactive https://llvm.org/svn/llvm-project/libcxxabi/trunk@r249649 libcxxabi; fi
+  - if [ "$CXX" = "clang++" ]; then svn co --quiet --trust-server-cert --non-interactive https://llvm.org/svn/llvm-project/libcxx/trunk@r249595 libcxx; fi
   - if [ "$CXX" = "clang++" ]; then (cd libcxx/lib && env CXX="clang++ -I ../../libcxxabi/include" sh buildit); fi
   - if [ "$CXX" = "clang++" ]; then sudo cp libcxx/lib/libc++.so.1.0 /usr/lib/; fi
   - if [ "$CXX" = "clang++" ]; then sudo mkdir /usr/include/c++/v1; fi
@@ -35,3 +35,6 @@ script:
 
 # Skip install
 install: true
+
+# State we need old build infrastructure for now
+sudo: required

+ 5 - 5
build/autotools/configure.ac

@@ -94,7 +94,8 @@ AC_HEADER_STAT
 #checkpoint
 AC_CACHE_SAVE 
 AC_CHECK_HEADERS([stdarg.h arpa/inet.h fcntl.h limits.h locale.h netdb.h netinet/in.h])
-AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h sys/ptrace.h paths.h sys/prctl.h])
+AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h])
+AC_CHECK_HEADERS([sys/ptrace.h paths.h sys/prctl.h sys/procctl.h])
 
 #checkpoint
 AC_CACHE_SAVE
@@ -207,15 +208,14 @@ AC_FUNC_MMAP
 AC_FUNC_REALLOC
 AC_FUNC_STAT
 EGG_FUNC_TIMESPEC
-AC_FUNC_STRFTIME
 
 #checkpoint
 AC_CACHE_SAVE
-AC_CHECK_FUNCS([clock fsync getrusage isascii getpassphrase posix_madvise madvise])
-AC_CHECK_FUNCS([memcpy memmem memset random rename snprintf srandom gettime])
+AC_CHECK_FUNCS([getrusage getpassphrase posix_madvise madvise])
+AC_CHECK_FUNCS([memmem random snprintf srandom gettime])
 #checkpoint
 AC_CACHE_SAVE
-AC_CHECK_FUNCS([strcasecmp strncasecmp vsnprintf inet_ntop])
+AC_CHECK_FUNCS([vsnprintf prctl procctl])
 
 #autoscan suggested this....
 #These are recommended by autoscan, but no code supports it currently

+ 44 - 86
configure

@@ -5756,7 +5756,20 @@ fi
 
 done
 
-for ac_header in sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h sys/ptrace.h paths.h sys/prctl.h
+for ac_header in sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>build/confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/ptrace.h paths.h sys/prctl.h sys/procctl.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -7263,18 +7276,18 @@ else
 /* end build/confdefs.h.  */
 
   /* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
+	 implementations with broken preprocessors.  Perhaps this can
+	 be revisited in 2012.  In the meantime, code should not expect
+	 #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
+		     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
+		     ? 1 : -1)];
       int i = 63;
 int
 main ()
@@ -7283,9 +7296,9 @@ main ()
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));
+	      | (llmax / ll) | (llmax % ll)
+	      | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+	      | (ullmax / ull) | (ullmax % ull));
   ;
   return 0;
 }
@@ -7317,33 +7330,33 @@ if ${ac_cv_type_long_long_int+:} false; then :
 else
   ac_cv_type_long_long_int=yes
       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
-        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
-        if test $ac_cv_type_long_long_int = yes; then
-                                        if test "$cross_compiling" = yes; then :
+	ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+	if test $ac_cv_type_long_long_int = yes; then
+	  	  	  	  if test "$cross_compiling" = yes; then :
   :
 else
   cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end build/confdefs.h.  */
 #include <limits.h>
-                 #ifndef LLONG_MAX
-                 # define HALF \
-                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-                 # define LLONG_MAX (HALF - 1 + HALF)
-                 #endif
+		 #ifndef LLONG_MAX
+		 # define HALF \
+			  (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+		 # define LLONG_MAX (HALF - 1 + HALF)
+		 #endif
 int
 main ()
 {
 long long int n = 1;
-                 int i;
-                 for (i = 0; ; i++)
-                   {
-                     long long int m = n << i;
-                     if (m >> i != n)
-                       return 1;
-                     if (LLONG_MAX / 2 < m)
-                       break;
-                   }
-                 return 0;
+		 int i;
+		 for (i = 0; ; i++)
+		   {
+		     long long int m = n << i;
+		     if (m >> i != n)
+		       return 1;
+		     if (LLONG_MAX / 2 < m)
+		       break;
+		   }
+		 return 0;
   ;
   return 0;
 }
@@ -7357,7 +7370,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-        fi
+	fi
       fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
@@ -8671,61 +8684,6 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-for ac_func in strftime
-do :
-  ac_fn_cxx_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = xyes; then :
-  cat >>build/confdefs.h <<_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-else
-  # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if ${ac_cv_lib_intl_strftime+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end build/confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strftime ();
-int
-main ()
-{
-return strftime ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_intl_strftime=yes
-else
-  ac_cv_lib_intl_strftime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = xyes; then :
-  $as_echo "#define HAVE_STRFTIME 1" >>build/confdefs.h
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
 
 #checkpoint
 cat >confcache <<\_ACEOF
@@ -8813,7 +8771,7 @@ $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
-for ac_func in clock fsync getrusage isascii getpassphrase posix_madvise madvise
+for ac_func in getrusage getpassphrase posix_madvise madvise
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -8825,7 +8783,7 @@ _ACEOF
 fi
 done
 
-for ac_func in memcpy memmem memset random rename snprintf srandom gettime
+for ac_func in memmem random snprintf srandom gettime
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -8923,7 +8881,7 @@ $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
-for ac_func in strcasecmp strncasecmp vsnprintf inet_ntop
+for ac_func in vsnprintf prctl procctl
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"

+ 0 - 1544
doc/UPDATES

@@ -1,1544 +0,0 @@
-* Wraith now automatically assigns roles to bots for channels, no longer
-  requiring manually assigning them with flags +flry for flood, limit,
-  resolve, auto-voice, auto-op. These roles are decentralized and per-chan
-  such that net-splits and botnet-splits and multiple groups in 1 chan
-  will properly assign roles out to bots to not cause overlap. Only leaf
-  bots know which bots have which roles. (#39)
-* Add cmd_roles (leaf only) to display roles for a channel. (#39)
-
-master
-  * Require C++11 compiler support (G++ 4.7+, clang32+)
-
-maint
-  * Disable demo TCL support by default to prevent confusion during build.
-  * Avoid apparmor ptrace(2) warnings on Ubuntu
-  * Allow 'set trace ignore' again. Undoes a change from 2005.
-  * Fix ptrace detection on Linux
-  * Fix broken startup with GCC from ports on FreeBSD.
-  * Fix simulated terminal mode (-nt) defaulting to all console flags.
-  * Fix simulated terminal mode (-nt) not having color supported.
-  * Fix race between DCC and terminal output which could result in
-    bolds being backwards (#86).
-  * Fix TCL warnings during build if TCL is not being used.
-  * Rework the build to parallelize better and rebuild some things less often.
-  * GCC: Always link libstdc++ statically. This avoids distributing
-    a binary that would rely on having a specific compiler version installed
-    and avoids issues when updating the local compiler. This also fixes
-    building a binary with GCC on FreeBSD and using it on a clang-only system.
-  * Fix conversion of command passes from ancient 1.3 format.
-
-1.4.5
-  * Remove ahbl as it now positively identifies all hosts as abusive
-    http://www.ahbl.org/content/last-notice-wildcarding-services-jan-1st
-
-1.4.4
-  * Read in /etc/hosts on startup
-  * Fix 'bl %group cmd' giving incorrect message when group/bots not found.
-  * Fix cmd_slowjoin eating the first channel option (This fixes groups support)
-  * Fix help for 'topic' to show optional channel argument
-  * Fix cmd_hublevel not properly requiring a hublevel argument
-  * Fix build with clang (FreeBSD 10)
-  * Fix startup crash when some shared library symbols were missing
-  * Fix build on systems without working libssp
-  * Fix build detecting invalid openssl installations (ones with only static libs)
-  * Give hint on bot when disconnected from hub for reason
-  * Fix cmd_netnick formatting issue with offline bots
-  * Fix crash when built with clang (FreeBSD)
-  * Binary now uses libelf internally for handling conf data.
-  * Bot responses are now clear and nice. Recompile with your own list if you want
-    in doc/responses.txt
-  * Remove channel limit when limitraise is disabled (#77)
-  * 'fork-interval' removed.
-  * Build with -fstack-protector by default
-  * Remove 60 process limit
-
-1.4.3
-  * Default 'set promisc' to ignore since it's usually a false positive
-    and doesn't matter much.
-  * Bots linking in must now have a matching host on their user to succeed linking.
-    This was always requiring a valid host, but was not restricted to that bot.
-  * Fix leaf bots being able to initiate userfile transfer to hubs
-  * Protect binary updates so that only hubs can offer/send them
-  * Fix backwards compatibility with older 1.2/1.3 bots
-  * Fix vulnerability in linking
-
-1.4.2 - http://wraith.botpack.net/milestone/1.4.2
-  * Prevent crashing on startup if openssl can not be loaded
-  * Rename option -c to -m for 'manual' edit, and redirect -c to -C
-  * Show a nicer compile error when BUILDTS unable to be determined / gmake is not used.
-  * Show 'Do!' in 'chaninfo' for 'Voice-moderate' to be consistent with other flags.
-  * Fix CALLERID not respecting ignores (#63)
-  * When using msg OP, check for and allow '#chan PASS' as well as 'PASS #chan'
-  * Warn when using 'chattr +a' as some users may expect it to be auto-op (#58)
-  * Really fix CAPS/COLOR flood detection not obeying x|x flags
-  * Support TCL 8.6 in the beta libtcl support (no scripting support yet)
-  * Fix hub startup not respecting changed HUB lines in config
-  * Fix './wraith -V' not showing the updated HUB info
-
-1.4.1 - http://wraith.botpack.net/milestone/1.4.1
-  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
-  * Remove 'chanset +meankicks'. You can customize your kicks in doc/responses.txt and recompile.
-  * Don't allow running as root
-  * Don't allow more than 5 bots per binary.
-  * Fix CAPS/COLOR flood detection not obeying x|x flags
-  * Fix OPs engaging the mass flood protection
-  * Fix +bitch not working under some conditions
-  * Fix "+d virus" causing bots to enforce deop anyone who ops someone who opped a +d user
-  * Fix compiling without TCL support (#50)
-  * Reading in pack.cfg will now do some sanity checks
-  * Add better explanation when rejecting botlink due to not being +o (#51)
-
-1.4.0 - http://wraith.botpack.net/milestone/1.4.0
-  * Updated server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
-  * Change +bitch reaction to use normal queue for deopping opper/opped clients
-  * Fix +take clearing -fastop (fixes #371)
-  * Added botbitch to mmode (fixes #139)
-  * Added SSL support
-    This includes new set options: 'servers-ssl', 'servers6-ssl', 'server-port-ssl', 'server-use-ssl'
-  * libcrypto (openssl) is now loaded at startup and is required.
-  * Added TCL support. This is *only* a .tcl command currently, no scripts are loadable yet.
-  * Fix blowfish not working correctly on 64bit
-  * Suicide will now remove all bots related to the binary being removed (fixes #435)
-  * FiSH message support added.
-    * FiSH support for DH1080 key-exchange. 'keyx' command added to start from bot, and responds to key-exchanges.
-    * Auto FiSH key-exchange when accepting users via callerid (controllable with set 'fish-auto-keyx')
-    * Automatic re-key exchange after every message to avoid replay attacks (controllable with set 'fish-paranoid')
-    * Set FiSH key via cmd_setkey and 'chanset fish-key'
-    * Bot expires key exchange if there's no response in 7 seconds.
-    * Bot expires key-exchanged keys after 60 minutes.
-  * When 'mdop' protection is on, re-op all previously opped clients automatically.
-  * When 'mop' protection is on, deop all previously regular clients automatically.
-  * Add './wraith -V' which will display the packconfig that the bot is using.
-  * Add cmd_newhub for adding a new hub. All bots will add this to their config.
-  * Hubs can now be overridden inside the botconfig (-C)
-  * Optimize userfile writing by doing it asynchronously
-  * Groups support added. See: http://wraith.botpack.net/wiki/Groups
-    * Add [bot]set var 'groups' to configure what groups bots are in
-    * Add chanset 'groups' to take a list of groups that should join. 'chanset #chan groups { main backup }'
-    * Added group support to 'botcmd': 'botcmd [*|&|?] %group cmd'
-    * 'botjoin' and 'botpart' have been removed. Just use .+chan, .chanset, .botset to control groups.
-    * Add command 'groups' to list all groups and which bots are in them.
-    * Command 'channels' now accepts a '%group' param to show which channels a group are in.
-    * Add '%group' support to 'bots' command.
-  * Improve output of 'bots' command by displaying and sorting nodename
-  * Minus chrec if .chattr set no flags
-  * Added 'chanset +floodban' to ban clients that violate 'flood-chan' and 'flood-ctcp'
-  * Bots now auto-reop other bots that get deopped
-  * Bots now ask for ops quicker if another bot is opped
-  * Bots now request/join +ilk channels much quicker
-  * Add 'chanset revenge' which will react/kick/ban/remove users who kick/ban/deop bots.
-  * Fix flood kicking not properly tracking multiple clients at once (#43)
-  * Add chanset 'flood-bytes' to count how many bytes:second a user sends before getting kicked for flood. (#42)
-  * Bot will now lockdown channel (+im) if banlist becomes full (#37)
-  * Bot will now lockdown channel (+im) if a drone flood is detected (#37)
-    * Add chansets 'flood-mchan', 'flood-mbytes', 'flood-mctcp' to control reactions to mass floods (#37)
-  * Remove unneeded chanset 'nomassjoin'
-  * Add chanset 'caps-limit' to handle % of message that can be in caps before kick (#8)
-  * Add chanset 'color-limit' to handle how many color codes are allowed in a message before kick (#8)
-  * Add chanset 'closed-exempt' which will allow exempting non-users (who are opped or voice) from being kicked. (fixes #171)
-  * Tweak limit range checking such that bot will set limit less often
-  * Bots now again respect devoices made by other bots and will not revoice those users.
-  * Add chanset 'voice-moderate' which will auto set +m in '+voice' channel and devoice flooding clients instead of kick. (#48)
-  * Bots now will enforce devoices made by ops (user +o) and allow any op (user +o) to revoice to disable that enforcement.
-    This used to use +m to enforce/allowed revoicing.
-  * Bots will now remember a client's flood/devoice settings if they cycle (#49)
-
-1.3.4 - http://wraith.botpack.net/milestone/1.3.4
-  * Fix various compile warnings with newer GCC
-  * Fix bot getting confused when changing to long nicks
-  * Fix case where nick would rotate to NICK1 when already on NICK2 and NICK was unavailable
-  * Documentation cleanups
-  * Fixed 'request' kick msg with cmd_kick
-  * Enforce cmd_invite syntax
-  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
-
-1.3.3 - http://wraith.botpack.net/milestone/1.3.3
-  * Fix --disable-ipv6 compiling
-  * Update cmd_mop to support console channel (so it works via Auth commands better)
-  * Add an extra 2 second delay before releasing nick to aide in syncing and time to type /nick
-  * When a nick is released, start regaining as soon as it is witnessed to have been taken again
-  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
-  * cmd_mns_user now accepts multiple users (fixes #77)
-  * Permanent owners can no longer be removed via cmd_mns_user
-  * Fix various places incorrectly truncating passwords at 15 characters
-  * Fix BSDmakefile not being included in distribution package
-
-1.3.2 - http://wraith.botpack.net/milestone/1.3.2
-  * Misc bug fixes
-  * 'make' on BSD will now redirect to gmake.
-  * Fix partyline cmds for |m and |o users who do not have console set correctly. (.adduser)
-  * Allow simulated terminal (HQ) user to access owners (ie, .chpass owner)
-  * Fix 'mop' causing a mass deop when -bitch
-  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
-  * Don't kick friendly bots that are desynced: op them.
-  * Wraith is now linked dynamically. This should improve binary compat.
-    Compile on the oldest OS you want to support, and ensure newer ones have
-    all necessary compat libraries.
-
-1.3.1 - http://wraith.botpack.net/milestone/1.3.1
-  * Fix crash related to slowpart
-  * Fixed parsing errors in .chanset
-  * Only global +n can use .chanset * now
-  * cmd_die no longer puts user's nick into the quit msg.
-  * Update rbl list, 'set -yes rbl-servers -' to get new list.
-  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
-  * Fix default compile so it doesn't use a ton of processes.
-  * Fix bot getting killed on OpenBSD 4.7 on startup
-  * Ignore 'pflog' interfaces in promisc
-  * Fix buffer overflow in DCC
-  * Fix problems with changing IP
-  * Fix bot going zombie if it jumps during a restart
-  * Fix auth IRC lookups getting the wrong cached idx
-  * Fix cmd_relay so it does not use IPv6 if not supported.
-  * Fix bot linking so it does not use IPv6 if not supported.
-
-1.3 - http://wraith.botpack.net/milestone/1.3
-* Binary / shell / startup changes
-  * Binary error messages are no longer obscure numbers or fake segfaults. (Compile with OBSCURE_ERRORS to re-enable)
-  * Binary pass prompt has been changed to not be an obscure 'bash$' prompt anymore.
-  * Removed pscloak feature, it was too malicious, pointless and stupid.
-  * Fix problem of upgrading with uninitialized binaries causing corruption (will kick in on future upgrades)
-  * Optimized how some shell operations are executed.
-  * Uname checking (and associated emails) have been removed.
-  * Email functionality has been removed.
-  * Fix crash on OpenBSD due to mmap(2) bug.
-  * Removed gethostbyname() dependency. This fixes Linux binary compatibility issues / crashes on startup.
-* Cookie op changes
-  * Cookie op algorithm changed again, they can no longer be easily reused (fixes #402) Thank you mulder.
-  * Cookies no longer fail if the opping bot changes nick after queueing the mode.
-  * Cookie time window increased, false-positives from lag/netsplits should be completely eliminated now.
-  * Auto disable cookies on ircu(undernet) and Unreal servers as they do not support unbanning nonexistant bans.
-* DNS changes
-  * More DNS errors are now handled which fixes some misc DNS issues.
-  * DNS now works on servers which tend to only return partial results (fixes #424)
-  * Lower DNS lookup timeout from 40 seconds to 10 seconds.
-  * Use random query ids for DNS lookups.
-  * Remove cox.net nameservers from backup list.
-  * Add Google DNS servers as backups: 8.8.8.8, 8.8.4.4 (http://code.google.com/speed/public-dns/)
-  * If a .resolv.conf exists, only use the nameservers listed in it.
-  * Fix problem of bots never reconnecting to hub after being up for long periods. (Was a DNS issue)
-  * Bot no longer connects to IRC over IPv6 if it was specifically given an IPv4 IP.
-* Botlink
-  * Bots now link to the first bot in their binary (the localhub) over a UNIX domain socket. Only the localhub connects to the main hubs.
-  * Bots must have a matching host to be able to link now.
-  * Telnet/DCC now checks both forward/reverse to ensure they match. (fixes #19)
-  * Fix botlink problems when hub and leaf nicks are long.
-  * Only use oident for server connects, not for bot linking.
-* Compiling changes
-  * Prefer g++ 4.4.1 when compiling.
-  * No longer bundling Openssl code; It is now required to be installed to compile.
-  * build.sh cleanups.
-  * Now including bdlib.
-  * Enable SSP for debug binary/testing.
-* PackConfig changes
-  * PackConfig can now be securely read over STDIN. Use ./wraith -Q, then paste it in.
-  * Binary will no longer generate SALTS if missing from the PackConfig. This was causing too much confusion.
-  * SHELLHASH renamed to BINARYPASS (SHELLHASH is still supported)
-  * BINARYPASS and Owner passwords in the PackConfig can now be salted-sha1. '+' + RAND(5) + '$' + SHA1(RAND(5) + 'password')
-  * BINARYPASS may no longer be an MD5 Hash.
-* Userfile / sharing changes
-  * Userfile transfer is now made over botlink (no extra ports needed) (works behind NAT/firewall)
-  * New userfile pass algorithm (salted-sha1)
-  * New userfile cmdpass algorithm (salted-sha1)
-  * New userfile storage format.
-  * Raise Handle length up to 32 characters.
-* cmd_set fixes
-  * Sanitize cmd_set input locally as well as remotely (fixes #273)
-  * Ensure that some set variables are only 1 word long.
-  * Fix cmd_botset not setting default/global value on leaf bots when clearing a var (fixes #389)
-* Misc fixes
-  * All existing compile errors fixed.
-  * Cleanup +r implementation a bit to lookup users more often than only on join. (fixes #127)
-  * Bot now properly reacts to IP bans if it is +r.
-  * If a user does not have a console setting, they will be given default settings on login.
-  * Fix a case where the temporary file was not cleaned up when exiting config editor (-C) (fixes #428)
-  * Fix cmd_slowpart issues.
-  * Fix cmd_pls_chan causing bots to reset a channels settings when it already existed.
-  * Fix password length discrepencies / off-by-1 problems in cmd_chpass and cmd_nopass (fixes #436)
-  * Fix botcmd to make sure that results are delivered only to the requester (fixes #208)
-  * Fix issues with server-port not being updated to the current server list (fixes #176)
-  * Fix aliases not properly indicating bad command on leaf bots (fixes #297)
-  * Fix (+|-)(ban|exempt|invite) commands to properly handle if the channel is given first so that a #chan!*@* ban is not created.
-  * Fix chanint 'flood-exempt' not exempting ops when set to 'voice'.
-  * Fix segfault with /KNOCK on csircd.
-  * Fix restart causing bot to change nick (this was a regression in jupenick)
-  * Fix cmd_slowjoin not working on backup bots correctly.
-  * Fix a crash from long hubnicks.
-  * Fix +botbitch being very slow and inefficient
-  * Better +bitch/+botbitch/+closed handling when in floodless mode.
-  * Bot now attempts to join a channel immediately on invite.
-  * Fix bot not setting 'chanmode' channel modes when getting opped.
-  * Fix bot forgetting server uptime on restart
-  * Fix '+user user' with no hostmask adding the hostmask '*!*@' to the user.
-  * Fix case where bot would not get the +e and +I lists when getting opped.
-  * If a bot devoices a user in a +voice channel, the +y bot will no longer enforce this.
-  * Fix cmd_botjoin not properly setting up addedby/addedts for the channel.
-  * Fix bots never timing out when connecting to servers sometimes.
-  * Bot no longer tries opening an identd socket unless it's root or running on cygwin.
-  * Fix crash when setting a bot +B
-  * Fix crash and lockup in cmd_bottree
-* Misc changes
-  * Cleanup DCC/Telnet listening so bot only listens on IPV6 if it was specifically given an IPV6 IP.
-  * CTCP bot CHAT will no longer work if the bot does not have an IPV4 IP set.
-  * Add cmd 'release', 'netrelease' and msg-release for releasing a bot's jupenick on a 7 second timer.
-  * Add MONITOR support. This speeds up NICK grabbing. (fixes #320)
-  * Add set 'deaf' to run bot in DEAF mode on supporting IRCDs. This prevents channel conversations coming to the bot. On by default.
-  * Add set 'callerid' to run bot in CALLERID mode (+g). +c bots will automatically accept messages from known users. (fixes #45)
-  * Rename set 'flood-g' to 'flood-callerid', which only takes effect if the server supports CALLERID.
-  * Relays are now encrypted between bots. Username is sent automatically. Just enter in pass now.
-  * Added pseudo-channel 'default' which can be modified with 'chanset' and 'chaninfo'.
-    This is used to modify what the default channel options will be for new channels.
-  * Removed 'set chanset' as it has been replaced by 'chanset default'
-  * Add new channel setting 'ban-type' which support mIRC style ban types (adapted from recent eggdrop patch)
-  * EFnet server list updates (To update yours: .set -YES servers - | .set -YES servers6 -)
-  * Default alias updates (To update yours: .set -YES alias - ) 'cq' added as an alias to 'clearqueue play' to stop .play
-  * EFnet's CSIRCD servers have been removed as they have proven to be highly incompatible with Ratbox features. (irc.nac.net/irc.efnet.no)
-  * Give localhubs credit for adding their child bots in 'whois'.
-  * Ident lookup timeout is now 5 seconds (will speed up linking / partyline connecting)
-  * Cleanup all string parsing to trim excess whitespaces (fixes #268)
-  * Cleanup cmd_botcmd restrictions/sanity checks.
-  * RBL Checking: Add 'chanset +rbl' which uses list of servers from 'set rbl-servers'. Only +r bots will enforce this.
-  * Removed 'chanset +knock' and replaced with 'chanset knock (Op|Voice|User)', see 'help chaninfo'.
-  * Default log timestamp now includes seconds.
-  * Hubs no longer include their own timestamp over botnet.
-  * Floodbots (+f) and Resolvbots (+r) are now listed in cmd_userlist
-  * Floodbots (+f) will automatically unDEAF themselves to they can monitor the channel for floods (namely flood-chan).
-    Note that this is done about 10 seconds after adding +f to a bot. Removing +f will set DEAF again.
-  * This auto DEAF/UNDEAF works if you auth with the bot and it supports channel cmds
-  * Added SHA256 support (cmd_sha256, Auth cmd: sha256)
-  * Add cmd_encrypt_fish and cmd_decrypt_fish which uses eggdrop's blowfish (same as FiSH)
-  * Add cmd_hash which returns the MD5, SHA1 and SHA256 of the given string.
-  * Credits/cmd_about updates.
-  * Add chanset '+/-voicebitch' for a +bitch style enforcement over voices. (fixes #381)
-  * Add chanset '+/-protect' which will set +botbitch and mass deop if any takeover is detected.
-  * Add chanset 'protect-backup' which will optionally set +backup in the event of a takeover with +protect.
-  * Channel settings 'mop' and 'mdop' now react to non-users.
-  * set 'fight-threshold' now requires +protect and is a trigger for +protect. See 'help chanset' for +protect info.
-  * Bots no longer cycle channels when restarting/upgrading. (This will take effect AFTER upgrading to 1.3) (fixes #187)
-  * Speedup irc server queue by bursting more often and fully. Thanks VXP.
-  * Add set 'msgrate' to define how often to dequeue to the server, if non-ratbox.
-  * Add set 'msgburst' to define how many commands to burst to server per msgrate.
-  * On hybrid/ratbox servers, burst some commands on connect
-  * On ratbox type servers, use an optimized queue for better throughput on the queue.
-  * Add cmd_play for playing files to irc. (ASCII art gallery exhibition)
-  * Utilize CPRIVMSG/CNOTICE if available.
-  * Chain WHO requests to try avoiding Max SendQ
-  * More Auth channel commands are now available. Auth up and run +help to see them all. (fixes #2)
-  * Add debug buffer output on crash - please give to bryan if it ever comes up.
-  * Remove hardcoded -bot alias and move to 'set alias'. Also add a '+bot' alias to 'newleaf'
-
-1.2.16.1
-* Fix linux compile errors
-
-1.2.16 - http://wraith.botpack.net/milestone/1.2.16
-* Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)
-* Fix channels added by cmd_slowjoin not having the user who added them associated with the channel.
-* Removed BDHASH as it wasn't even used.
-* SHELLHASH now supports SHA1 hashes.
-* Fix segfault from receiving truncated DNS replies.
-* Remove 'set mean-kicks' and change to 'chanset +meankicks' (default on, does not upgrade from old .set, must unset after upgrade if wanted)
-* Don't check last/promisc unless linked.
-* Speed up botnet parsing / set lookups /cmd_help a bit
-* Fix some various issues with initial setups and new PackConfig format
-* Greatly sped up binary startup - lower resource usage for cron checks, etc.
-* checkchannels now displays server. (fixes #420)
-* Added 'jupenick'. Jupenick is preferred over 'nick' but only 'nick' will be rotated with altchars. Ie, nick_, nick-, etc. (fixes #421)
-* Added 'link_cleartext' which allows disabling of cleartext bot linking (needed for upgrades)
-* Fixed bug where salts were not written to binary when first generating them
-* Fixed countless buffer overflows. (fixes #226)
-* Fixed a rare segfault on userfile transfer timeouts
-* Fixed bots getting confused about their hub/uplink after userfile transfer fails (fixes #61)
-* Fixed cmd_handle not properly bounds checking max handlen. (fixes #305)
-* Bans are now only retrieved from server after being opped. (addresses #406)
-* Update efnet server list and add new alias 'bs' for botset. (To get new defaults: 'set -YES servers -' and 'set -YES alias -')
-* Fix /ctcp FINGER leaking shell username when using oidentd
-* Fix ISON not working on some ircds.
-* Fix a socket leak from timed out userfile transfers.
-* Fixed bot dying off when it can't create a temporary file. (fixes #412)
-* Show connection time in cmd_(net|bot)server now.
-* Fix a segfault in the settings handling code. (Could create very random looking segfaults)
-* Disable bot +f as all it did was cause a segfault. The flood code is unfinished. (fixes #429)
-* Fix cmd_slowjoin not counting bots correctly. (fixes #431)
-* Added telnet 'tcl expect' script in scripts/telnet.exp. Can be used for easier hub management over telnet from shell.
-* Fix 'cmd_rehash' problems on hubs.
-* Fix 'HQ' user getting wiped in -t mode resulting in a crash. (fixes #298)
-* Fix bots linking to the wrong hub not giving a good reason why they failed in the log. (fixes #369)
-* Fix segfault on some ircds after restart due to them not giving 005 information on VERSION. (fixes #378)
-
-1.2.15.1
-* Fix leaf bots not updating behind other hubs (fixes #419)
-
-1.2.15 - http://wraith.botpack.net/milestone/1.2.15
-* Fix a possible segfault when binaries compiled wrong
-* Fix a segfault in op cookies during a desync
-* Remove cmd_netmsg and restrict cmd_msg so it cannot be used from botcmd.
-* Fixed '+user' so that hostmasks are sanity checked. Ie, (test@test.com is added as *!test@test.com)
-* Add links to FAQ/new site in cmd_help/cmd_about
-* Cleanup some ctcp responses
-* Add more ctcp version responses (mirc scripts), and some others, such as irssi/xchat/snak/cgi::irc
-* Add more 'responses' (ie, kicks reasons)
-* Added new chanset flag '+knock' which will make +y bots auto invite USERS. (No flag restrictions currently)
-* Bots now check their own hostmask before opping or requesting assistance to join a channel
-* Fix bans not being removed from channels when removed from bot. (fixes #352)
-* Dont show portmin/portmax/pscloak/autouname/datadir/autocron in binary config unless they are not set to the default
-* Fix possible situation where an error while saving userfile is not reported (fixes #287)
-* Fix a bug where some nets did not save userfile correctly
-* Fix a case where 'botcmd ?' would loop forever when a hub had a 1 character handle
-* Change default realname to mimic bitchx
-* Make the 'detect login' use less shell resources
-* Fix bot hosts/users being cached internally as wrong, even when a new host is added
-* Fix segfault in cmd_mmode (fixes #399)
-* Fix segfault from receiving from non-recursive dns servers. (fixes #401)
-* Fix some cases where the bot would pointlessly do WHO on users instead of on the channel to resolve a desync.
-* Fix the bot not starting up when it is not allowed to run ptrace() (FreeBSD: security.bsd.unprivileged_proc_debug=0)
-* Misc help cleanups
-* Show kline reasons on connect to servers. (fixes #400)
-* Fix case where binpath/datadir were not updated correctly when homedir changed. (fixes #169)
-* For security purposes the following commands are now hub-only: botnick, botserver, botversion, botmsg, netnick, netserver, netversion
-* Added cmd_nick to display leaf's current nick
-* Change default ip/host/ip6 to a * in the binary config
-* Silently fix user mistake of giving hostname in ip field in binary config
-* Fix datadir being expanded to full path (fixes #405)
-* Bots can now be started as ./binary bot.conf instead of ./binary bot. (Disable autocron and manually crontab it to start like this)
-* Fix a very rare segfault when closing the identd socket (fixes #410)
-
-1.2.14 - http://wraith.botpack.net/milestone/1.2.14
-* Fix another bug in shell functions. (fixes #321)
-* Fix some bugs with bot flags. (fixes #334 and #337 and #344)
-* Remove the notes system and related commands. (fixes #275)
-* Fix ./binary -C not signalling the correct process under some situations. (actually fixes #315)
-* Fix bots being removed from binary not being killed. (fixes #338)
-* Fix typo in help for 'set' (fixes #342)
-* Fix typo in help for 'botset' in regards to wildcards. (fixes #365)
-* Fix cmd_swhois stripping multiple channel modes. (fixes #348)
-* Fix processing/killing/signalling of possible new localhub when editing binary.
-* The socket file generated for restarting is now encrypted.
-* Delay 'op-requests'.time seconds before re-requesting op on opeless channels.
-* Fix some issues with case with pid files, nicks, conf loading. (This will break some bots upgrading to 1.2.14)
-* Fix bot not reconnecting with new ip/host when -HUPd. (fixes #340)
-* All bots are now rehashed after editing binary - nick casing, ip changes are taken into effect.
-* Bots now use the shell username instead of botnick when ident does not work.
-* Localhubs now auto add *!~username@... hosts instead of *!~nick@... hosts for their leafs.
-* Make bot chmod() itself when accessing its binary.
-* Fix bots sharing wrong channel keys over botnet.
-* Cmd_swhois now displays a list of only 'public' channels as well.
-* Fix cmd_mns_user being ran on self-bot. (fixes #350)
-* Fix cmd_checkchannels not taking slowjoin into account.
-* Fix cmd_swhois returning results after a server jump.
-* Fix bots not connecting to their uplink.
-* Add ghost-inspired feature: backup bots. Bots marked +B will only join channels marked +backup.
-* Fixed cmd_nohelp (for viewing undocumented cmds - mainly debugging cmds)
-* cmd_adduser sends a PRIVMSG now instead of a NOTICE
-* Rewrote op-cookies to be fix a security hole. (They also react to '.set hijack' now)
-* Fixed +voice flaw where users in channels that were +voice AND +private would only be voiced with |v. (fixes #54)
-* Added cmd_clearhosts
-* Added 'whois restrictions' to more cmds.
-* Add channel flags 'nomassjoin' and 'flood-mjoin' to set +im on a timer during join floods (drones)
-* Add BOT flag +f for handling cpu intensive floods (none supported yet)
-* Add chanset 'flood-exempt' to exempt ops/voices from flood controls (see 'help chaninfo')
-* Add chanset 'flood-lock-time' to control how long to keep the channel locked during drone floods.
-* chanset flood-join now also counts PARTs as flooding.
-* Fix segfault in cmd_channel during splits.
-* Remove chanflag 'protectops' and 'idle-kick'
-* Fix bot not checking +e/+I modes when opped sometimes.
-* Fix chanset flag 'userbans' not being saved correctly. (may cause warnings on upgrade)
-* Fix authing on non-chathubs (fixes #356)
-* Fix segfault with cmd_set and adding to empty lists.
-* Cleaned up some bugs in the 'getin' system.
-* Add '$n' expansion into realname. (fixes #361)
-* Reformat CTCP logging. (fixes #358)
-* Cleanup cmd_userlist to list hubs/leafs/backups (fixes #363)
-* Bots will now cycle nicks on servers which claim their nick is invalid. (fixes #311)
-* Limit bots no longer set limit when 'chanmode -l' is set. (fixes #294)
-* Fixed +closed from interfering with 'chanmode -pi'. (fixes #294)
-* Fix misc bugs with cmd_mop. (fixes #313 and #392)
-* Bad uname EMAILS now include the localhub's nick. (fixes #354)
-* -host now accepts partial host masks, ie, '-host user@host'.
-* Rewrote cmd_mdop into cmd_mmode. See 'help mmode' on a leaf bot.
-* Fixed bots having problems with kick/bans on undernet.
-* Added oidentd support. set 'oidentd' on makes bot spoof as BOTNICK.
-* Made 'ident-botnick' variable to decide to send username vs botnick for non-ident.
-* Default servers/servers6/alias list updated ('set -YES var -' to use it)
-* Fix MODE parsing bug
-* Bot no longer requires (or uses) '-B' to spawn bots. (now: ./binary <botnick>)
-* Fixed +take opping the wrong clients due to desync (+take now sets +bitch)
-* Fix cmd/dcc prefix leaking to -p users (when chat is off) (fixes #376)
-* Fix checking for flood on hosts which are already ignored. (fixes #343)
-* Added OSVER entry for bots in .whois
-* Userfile transfers now use a random filename instead of .share.botnick.users.timestamp
-* Fix ambiguous warning when a bot tries linking after being added with +user (fixes #383)
-* Add set 'irc-autoaway' to be able to disable autoaway feature. (addresses #380)
-* Fix an automatic hostmask bug (fixes #339)
-* Bots no longer die when receiving a corrupt userfile under some conditions
-* Delay for auto-op/voice (+O, +v) and +voice can now be set with 'chanset auto-delay' (default 5 seconds)
-* Update system now uses revisions instead of build timestamp
-* Linux 2.2, Linux 2.4, and FreeBSD 4 are no longer supported.
-
-1.2.13 - http://wraith.botpack.net/milestone/1.2.13
-* Fix cmd_chanset accepting invalid flags
-* Fix Auth system not tracking nick changes correctly. (fixes #318)
-* Fix set not allowing defaults under the lower limit. (addresses #315)
-* For ./binary -C prefer environment variable EDITOR over VISUAL.
-* Fix ./binary -C not signalling the correct process under some situations. (fixes #315)
-* Fix security hole in all shell cmds. (fixes #321)
-* Make ./binary -E default to displaying every error. (fixes #322)
-* Fix a possible memory leak with DNS. (fixes #296)
-* cmd_[bot]set now accepts wildcards (*) for listing variables. (not for setting)
-* Added set var 'usermode' for IRC usermode to set on connect/rehash.
-* Added cmd_umode (+m) to manually set bots' usermodes at will.
-* Fix botnicks becoming lower case after being opped.
-* Minor documentation change for cmd_newleaf. (fixes #291)
-* Fix cmd_chattr accepting invalid flags. (fixes #293)
-* See 'help whois' as some flags are now user, bot, chan, global only.
-* Fix cmd_console not working for +private channels correctly (fixes #325)
-* -user on a bot now works on linked bots. (fixes #200)
-* Fix cmd_link being used to link to non-hubs. (fixes #329)
-* Fix cmd_mns_chan not sharing console changes. (fixes #328)
-* Fix many instances of hub nicks leaking to leaf bots. (fixes #326)
-* Fix bot not checking if it can access datadir on startup. (fixes #330)
-
-1.2.12 - http://wraith.botpack.net/milestone/1.2.12
-* Clearing a variable via 'set var -' now resets that variable to default settings. (implements #111)
-* Fix bug introduced from fixing #274
-* Fixed overflow with cmd_set (fixes #289)
-* cmd_set now sanitizes input with ranges/limits. (fixes #289)
-* cmd_set now accepts 'true', 'on', 'false' and 'off' for boolean variables.
-* Added somewhat advanced password scoring to replace current password restrictions. (#56)
-* Added build os/architechture to output for ./binary -v
-* Added ARCH entry for bots in .whois
-* Added a new error code (22) which displays if attempting to run binary before using -C.
-* cmd_swhois is now -|- and hides all restricted information, channels; see 'help swhois'.
-* cmd_mop no longer defaults to console channel if no channel is specified. (fixes #302)
-* Fix cmds: bot[jump|server|version|msg] not running locally correctly. (fixes #304)
-* Fix cmd_chinfo to use the standard 'whois restrictions' (fixes #303)
-* Fix ',' character being allowed with 'set list' functions. (fixes #308)
-* Make 'set list' check to see if an item exists or not before add/remove. (fixes #307)
-* Fix problems with alias rewriting. (fixes #306)
-* Fix bots trying to boot virtual user created via cmd_botcmd.
-
-1.2.11 - http://wraith.botpack.net/milestone/1.2.11
-* Fixed typo in help for .set/.conf/.channel
-* Fixed a bug in cmd_chattr with |m users. (fixes #267)
-* Suicide now removes userfile backups, most pid files, and crontab entries. (Fixes #125)
-* Fixed removed bots not being automatically unlinked from botnet. (fixes #254)
-* Aliases may no longer reference other aliases (only checked when used) (fixes #244)
-* Fixed cmd_checkchannels so that results are not shown in log, but to user only. (fixes #217)
-* Disabled watcher feature.
-* Fixed problems with symlinked binaries. (fixes #240)
-* Fixed CIDR masks not being checked on JOIN. (also fixes some other cases of CIDR matching) (fixes #270)
-* Fixed a segfault from removing bots. (fixes #271)
-* Fix /MSG invite not showing proper cmd for usage. (Fixes #278)
-* Fix cmdpass processing on ambiguous cmds. (fixes #279)
-* Fix ban/invite/exempt removal flaw. (fixes #280)
-* Clean and speedup ban/exempt/invite processing. (addresses #277)
-* Fix processing of localhubs when binary is editted. (fixes #274)
-* Fix some minor bugs with cmd_conf. (fixes #284)
-* Made requested changes to cmd_dump to help clear up confusion. (fixes #269)
-* Fix improper notice when doing .set <var> -- (this actually shouldn't say 'not set') (fixes #272)
-* cmd_bans/exempts/invites [global] now displays a list of bans for ALL channels. (fixes #276)
-* Fix a segfault with ctcp-cloak. (fairly random) (fixes #285)
-* Fixed cmd_botset not making a bot grab a different capitalization of a nick. (fixes #283)
-* Hub nicks no longer show on leaf bots for partyline chat.
-* Hub bots can no longer be whois'd or match'd from leaf bots.
-* Disabled the process list checking.
-
-1.2.10 - http://wraith.botpack.net/milestone/1.2.10
-* Removed old references to '+/-manop' and '+/-nomop' for chaninfo in help file.
-* Fixed auth cmds not working in privmsg. (fixes #228)
-* Fixed a major security hole in cmdpass checking.
-* cmd_chhandle can no longer be used on bots. (fixes #224)
-* Revised help listing for 'auth-chan' in 'help set'. (fixes #229)
-* Fixed an invalid socket warning with failed relay. (fixes #216)
-* Fixed a potential dns socket leak. (might fix #230)
-* Fixed leaf bots sending color to hub bots still. (fixes #161)
-* Fixed cmd_trace to use 2 decimal places in display for seconds. (fixes #207)
-* Fixed cmd_trace not displaying hops correctly.
-* Expand symbolic links when searching for tempdirs. (fixes #210)
-* Fixed a segfault in cmd_rehash and revised help listing for it. (fixes #242)
-* Fixed cmd_set not saving the userfile when needed. (fixes #245)
-* Fixed cmd_set list removal bugs. (fixes #246)
-* Fixed chanmode -i conflicting with closed-invite 1. (fixes #249)
-* Fixed yet another .relay bug (YARB) (fixes #250)
-* cmd_checkchannels now states if a bot is not online. (fixes #239)
-* Added mIRC 6.17 version reply
-* Fixed empty version replies. (fixes #236)
-* Fixed a sharing segfault with an empty userfile. (fixes #243)
-* Hubs will now boot removed users/bots upon userfile reload. (addresses #243)
-* Fix typo in help file for 'botpart' (fixes #259)
-* Now supressing "port taken" error on hub startup.
-* Removed stop-nethack and associated flags. (fixes #219)
-* +bitch is now properly enforced on a netsplit return. (fixes #219)
-* Fixed a timer bug which could cause prolonged looping.
-* Removed some stale (backup) dns servers. (fixes #263)
-* Bot handles are now restricted to 9 characters. (fixes #253)
-* Fixed hubs not preserving uptime when restarted.
-* Fixed hub flaw in cmd_uptime.
-* Fixed auth cmd: help.
-
-1.2.9 - http://tracker.shatow.net/milestone/1.2.9
-* Fixed cmd_[un]stick not properly using numbers for channel masks. (#160)
-* Fixed binary spawning/updating to escape needed chars for shell. (#158)
-* Fixed a flaw in binary checksums.
-* Removed references to the old 'greet' features of eggdrop from help.
-* Removed/fixed references to the old 'config' to the new 'set' in help.
-* Fixed references to 'set manop/mop' to point to chanset instead.
-* Fixed tempdir checking to attempt to 'mkdir ~/.ssh/' for '~/.ssh/...' tempdir.
-* Fixed bot link getting colors. (fixes #161)
-* Fixed +r bots resolving users by resolved ip before host.
-* Fixed 2 socket leaks in the dns/socket code. (#167)
-* Fixed cmd_[bot]set showing an invalid example for using '-YES'
-* Fixed a mem leak on bot unlinks.
-* Fixed an error with msg-* displaying as msg* in 'help set'. (seinfeld)
-* Setting 'manop-warn' was only being used for 'OP #chan' not 'OP' alone.
-* Fixed channel notices not being parsed.
-* Took out all punish/revenge code, it's been disabled since 1.2.7 anyway.
-* Fixed bots giving up on joining juped channels (may be due to split) (#168)
-* Fixed cmdpass list getting desynced during userfile transfer. (#143)
-* Removed old compatability code for converting CONFIG->SET during userfile loading.
-* Fixed "un-allocated socket" errors when a relay fails.
-* Fixed var 'server-port' not being used correctly. (Now lists/saves/loads before servers)
-* Fixed a typo in msg_pass.
-* Failed relay no longer says failed link.
-* Fixed a socket protocol error.
-* Fixed a small error in help file for 'whom'.
-* Removed some legacy code from failed relays that attempts to connect to port+1, port+2, port+3... (might fix #177)
-* Fixed an invalid killsock error in sharing.
-* Fixed chanset 'flood-*' not working correctly. (#69)
-* Fixed cmd_rehash killing hubs. And revised help for 'rehash'. (#186)
-* Fixed a bug in the listen code, which caused a segfault in /ctcp chat (a few other places too) (#189)
-* Fixed botcmd using wrong user on remote bot after doing su'ing to another user. (#190)
-* Fixed botcmd -> su/quit causing remote bots to close random socket.
-* Fixed another cmd_whom bug which showed remote users from .botcmd. (#9)
-* Fixed returning from 'su' not returning user to correct channel. (ie, partyline)
-* Fixed cmds showing failed cmdpass. (#188)
-* The respository is now stored in subversion; binaries now hold a revision number.
-* cmd_botcmd <?> now displays which bot is chosen in the log. (#192)
-* There is now a 'datadir' option in the binary config. The tempdir is still automatically found. (#162)
-* The datadir defaults to './.../' replacing the old '~/.ssh/.../'
-* Fixed ACTION ctcp log msg to be more standard. (fixes #138)
-* Added set var 'notify-time' to change the interval for regaining nick. (fixes #182)
-* Fixed segfault caused by CHANFIX/server modes. (fixes #25)
-* Modified a kick to be less offensive (fixes #175)
-* Fixed bots not enforcing bans when exempts were removed. (fixes #193)
-* Updated CREDITS/cmd_about
-* Fixed some startup segfaults resulting from bugs in glibc.
-* Fixed bot going floodless when it wasn't granted it.
-* Fixed bots requesting op in chans they don't have access to. (fixes #196)
-* Fixed a startup segfault. (fixes #195)
-* Unsetting auth-prefix disables authing/cmds.
-* Fixed segfault in cmd_slowpart (#191)
-* Fixed a memory leak in the cookie checking functions.
-* Fixed some segfaults with tempfiles
-* Update binaries can now be stored in bins/ within the hub's binary directory.
-* If a tempdir suddenly becomes unavailable, a new one is now immediately sought out.
-
-1.2.8
-* Fixed [bot]* cmds depending on case of botnicks.
-* Fixed hubs attempting to generate a ctcp version reply after 'cloak-script' was set.
-* Fixed some similar problems with servers/servers6/nick
-* Fixed a memleak in var_set_mem()
-* Now specifying what was removed from a list with set -listvar and set +listvar.
-* Fixed hub forgetting it's uplink.
-* Fixed hubs not correctly installing/checking crontab on startup. (#156)
-* Fixed hub segfaults (on Linux) with bot links. (#155)
-* Removing an ignore by number now displays which ignore was removed. (#126)
-* Added hub cmd 'checkchannels' which displays in loglevel misc (+o) which chans leaf bots aren't on. (#149)
-* Fixed 'chanset chanmode { -p }' conflicting with 'closed-private 1' (closed-private now sets to 0 if -p) (#14)
-
-1.2.7
-* Forgot 'log_bad = 0;' to fix the '!' showing up for aliases.
-* When a user is removed and is on partyline, they are now booted. (#142)
-* Booting a su'd user now returns the user to their original connection. (Problem when removing +i)
-* (eggdrop1.6) Fixed bot not requesting topic after reseting channel.
-* Fixed hubs not updating NODENAME/OS/USERNAME, which broke updating on new nets.
-* Added var 'auth-chan' which allows disabling auth cmds in all channels.
-* Fixed being able to 'chsecpass' a bot.
-* Fixed cmd_chsecpass to use whois_access() (#120)
-* Added code to eat zombie processes minutely (shouldn't interfere with anything)
-* Fixed ignores not being used. (#147) (Breaks a fix to not display msgs after added to ignore for floods)
-* Fixed improper hub recognition in binary config parser. (#148)
-* Help for 'botcmd' was off/outdated
-* Fixed cmd_[un]stick not using "ban" by default for mask type. (#145)
-* Fixed default binary name always becoming "wraith" instead of original binary name.
-* Cleaned up trace detection code.
-* Fixed hang on running binary on some FreeBSD systems.
-* Fixed bots not correctly recognizing changes in botset to empty vars after restart/update. (#150)
-* Disabled chanset flags '+/-revenge' and '+/-revengebot' as they are 100% incompatable/untouched egg code.
-* Fixed an issue with cmd_pls_host not adding all hosts given, and 'hostmask already there' now displays WHICH host. (#153)
-* Fixed binary data parsing to strip trailing spaces for entries.
-* Removed support for encrypted link for bots older than 1.2.4
-* Implemented a hack to fix a bug with link encryptions.
-
-1.2.6
-* (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)
-  -This actually CAUSED cpu-spins after segfaults.
-* Disabled debug contexts as they were useless.
-* Fixed many channel cmds blocking access due to +botbitch. (#141)
-* Now using g++3.3[.6] as g++3.4 was causing spontaneous SEGFAULTS(see cpu-spin bug) on FreeBSD.
-* Fixed aliases not properly using cmdpass given. (#140)
-* Changed display for when a user uses an alias over partyline. (#116)
-* Related to above change, invalid cmds are logged in a different order now for users.
-* Fixed cloak-script not updating correctly.
-* Some fixes to slowjoin/slowpart were mixed up, fixed.
-
-1.2.5
-* Fixed a segfault/cpu-spin with mode parsing. (#25)
-* Fixed a segfault/cpu-spin during WHO parsing, although, it could have occurred at any time. (#110)
-* Possibly fixed a random segfault/cpu-spin after linking/connecting to irc.
-* Fixed spaces being stripped in .botcmd reply.
-* Changed order of 'rehashed config data from binary' notice to appear before any bot/userfile changes.
-* 'localhub's now check minutely if their bots need added or hosts added to userlist.
-* Fixed bot username casing causing bad cookies. (disable cookies for upgrade)
-* Fixed binary config stating there was no change with -C under certain conditions.
-* Fixed binary config not decrypting data on rare occasions.
-* Fixed bots set +k being able to request ops.
-* Fixed bots asking for ops/invite when set to +d or +k.
-* Fixed delay of requesting op spamming logs with delay msgs.
-* Added a 5 second delay on requesting/checking ops when no bots are available to ask.
-* Fixed 16 bytes after packdata being cleared in memory, causing random memory corruption.
-* Fixed localhub attempting to spawn itself during binary rehash and cmd_conf
-* Fixed another fatal bug with cmd_conf, this should fix it for good.
-* Added var 'manop-warn' to allow disabling the new manop NOTICE warnings when msg opping.
-* Added irc.ptptech.com/efnet.port80.se to default servers/servers6, added irc.pte.hu, irc.efnet.fr to servers.
-* Fixed an issue with bot respdoning to TCM CTCP VERSIONS too slowly at times on connect. (#128)
-* Added syslog style repeated log detection for all logging.
-* Fixed cmd_net[ps|last] not working. (#130, #131)
-* Added note at end of display for cmd_match to try using cmd_matchbot
-* Fixed 'reset*' being blocked with 'botcmd *'
-* Added code to prevent cmd_botcmd from being chained over botnet.
-* Prevent use of cmd_botcmd for cmds: cmd_me, cmd_away, cmd_back
-* Fixed security flaw with 'auth-obscure', and improved: auth-obscure now gives a hash regardless of 'dccauth'.
-* Fixed the whois_access() function to not allow non-perm owners to see/access perm-owners.
-* cmd_chpass now uses the whois_access() function. (#122)
-* Updated CREDITS/cmd_about (#119)
-* Fixed wrong notice on partyline when a user with no access attempts to telnet in.
-* Added binary config botline output to cmd_newleaf. (#135)
-* Fixed cmd_chattr saving userfile when no changes were made. (#123)
-* Fixed cmd_chattr displaying flags for higher users, therefore bypassing 'whois' restrictions. (#123)
-* Added examples on how to use cmd_set in the helpfile. (#118)
-* Added confirmation for using 'set' on list variables without using the list functions. (#118)
-* Fixed bots auto-opping passwordless users on JOIN, to match cmd_mop.
-* Fixed typo for 'help nopass'
-* Added CIDR/mask matching support for all user hosts, ie, '.+host user *!jerry@1.2.0.0/16' will match 'bob!jerry@1.2.3.4'
-* Balanced out mdop/mop kicks to not make entire net flood off.
-* Added flag '+r' which will make a bot resolve all hosts it sees to match against userlist. (You should only set this per-chan) (#127)
-* Removed cmd line param '-s'; Tracing bot on startup will always make the bot die right away.
-* Trace detection cannot be set to 'ignore', lowest setting is now: 'die'
-* Fixed cmd_slowjoin (#129)
-* Automatic host adding by localhubs now sanity checks if the hosts will conflict with other bots/users. (#137)
-* Fixed cmd_chanset not displaying ALL invalid channel flags, although, there are still *many* errors like with with the chanset code. (#136)
-* Perm owners may no longer change their handle via cmd_handle or cmd_chhandle. (#107)
-  (A user may change to a perm-owner handle though in a situation where the list changes in binary)
-* Disabled ability to cmd_chpass a bot. (#42)
-* Fixed hubs sharing out channels that were 'slowparted'. (#93)
-* Fixed m|o being able to chattr a user for a +private channel. (#98)
-
-1.2.4
-* Fixed cmd_botset not displaying botnick.
-* cmd_adduser now sends a NOTICE to the person being added with their initial password.
-* Fixed cmd_conf not working at all.
-* When msging bot for op, a NOTICE is sent to user if the channel is set to no manop.
-* Fixed 'chanset *' not working.
-* Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
-* cmd_nopass when given any argument will give random passes to users with no password. (#114)
-* Fixed a small cosmetic error with displaying bot info in whois.
-* Fixed CPU lockup for bots which did not have NODENAME/USERNAME/SYSNAME entries filled out.
-* Slightly changed/added a comment in -C for uname.
-* Default binary name is now what you name it, or "wraith" if left in "wraith.OS-ver" format.
-* Increased buffer size in binary config for binname/binpath/homedir
-* Removed '+/-manop' from 'chanset' var and added to ignore list for chanset.
-* Fixed a segfault with 'set +' (#117)
-* List functions now only work on variables marked as list variables.
-* Changed binary data encryption to not be viewable under 'strings'.
-* Fixed/Finished some cmd_set bugs/cosmetics.
-  -Now 'set +VAR' and 'set -VAR' will work for adding/removing to lists. ('set +/- VAR' still works)
-
-1.2.3
-
------ ADDITIONS/IMPROVEMENTS -----
-
-* HUB/LEAF binaries have been combined into 1 binary named 'wraith'
-* Rewrote config/botconfig from scratch as [bot]set with list support. See 'help set'.
-* Added dcc alias support, see 'help set' (only perm owner may set aliases as loops are easy and fatal)
-  -Added aliases: bl, bc. See 'set list alias' for more info.
-* Added cmdline option '-r <botname>' for restarting/starting specified bot.
-* chanset -bitch/-private/-botbitch/+botbitch/+closed/+private will now trigger bots to recheck channel (op/deop/kick people)
-* Added channel flag +|-botbitch, when set only bots will be allowed to be opped, users are auto-deopped.
-* Added cmd_version (does same as .botversion)
-* Added some debug logging for failed bind() listen() and getsockname()
-* Users can no longer whois PERM OWNERS unless they are themselves one.
-* cmd_find now takes an optional username instead of a nick!user@host to search for.
-* Some changes to ./binary -C:
-  -Default binpath is now the directory the binary is first ran in
-  -Running the bot with -C will automatically update uid/uname/homedir/username
-  -Added cmd line param '-c' to avoid auto updating uid/uname/homedir/username
-  -The binary is only rewritten now if CHANGES are made in the editor.
-* cmd_conf changes:
-  -Added 'enable' and 'disable' for bots
-  -'remove', 'rem', 'delete' are now also recognized for 'del'
-  -Fixed the binary not correctly being rewritten/saved
-  -Bots are now correctly killed/spawned 
-  -'del' now also removes the bot from the userlist
-* Things done after using cmd_conf / editing config with -C:
-   -New bots are spawned and added (if linked)
-   -Changed (NEW) ip/host for bots are added to the botnet (if linked)
-   -Removed bots are killed and removed from the userlist (if linked)
-* Added match option for cmd_botcmd: '&' will match on all localhubs (first bot in config) (#28)
-* Added some debug logging when a telnet connection is ignored.
-* Added some missing logging for msg_pass (#34)
-* Added log msg (+w) for when a msg is received when umode +g. (#44)
-* Added ability to +chan/chanset flood-* x:n (#69)
-* Added entry to help for ban-time in chanset: ban-time requires +dynamicbans
-* Added new feature (soft_restart) which restarts/updates bots while keeping them on IRC and preserving uptime/pid
-* Added cmd_rehash to reload binary data (conf/bots) (this is done auto after -C anyway)
-* Added cmd_suicide. (#80)
-* Added a note for users who are 'SU'd in cmd_whom for +a|. (LOCAL WHOM ONLY) (#64)
-* Added channel name to bad cookie/manop commenting (#97)
-* Added var 'auth-obscure': Don't halt on dcc w/dccauth if the pass is wrong; halt at hash (right or wrong). (#100)
-* Added var 'autoaway': How long in seconds until an idle user is set away on dcc auto. (Def: 1800, 30min)
-* Added rate vars 'flood-msg' and 'flood-ctcp' to control how quickly a bot ignores on flood.
-* Added rate var 'flood-g' which will set +g for 60 seconds after this many msgs:sec has been detected. (#74)
-* Added bool var 'mean-kicks' which enables offensive/mean kick msgs.
-* Added chanint 'voice-non-ident' which can be used to not voice non-idented clients with +voice.
-* Optimized WHO parsing more to alieviate some cpu usage in large chans
-* Binary writing is now a bit faster as the hash is calculated on the fly now.
-* Rewrote how logs are shared over botnet, now uses much less bw and resources. (#31)
-  -[will break logging during update]
-* Tempdir is now chosen from a list as follows: (hub) ./tmp/ (leaf) ~/.ssh/..., /tmp/, /usr/tmp/, /var/tmp/, ./
-* cmd_update/cmd_restart/SIGHUP now soft restarts bot
-* Shell cmd param -u now soft restarts all running bots after updating binary
-* cmd_dump now has a substitution. '$n' is replaced with the bot's current IRC nick.
-* Changed password encryption, should auto convert, might need to reset all though. (#75)
-* Adding hosts with missing nick/ident will now prefix the host with '*!' and '*!*' respectively.
-
------ FIXES -----
-
-* Fixed binary getting an excess of 1-15 bytes during write. 
-* If a binary is already initialized when updating, the pack data will not be overwritten.
-* Fixed chanset (manop/mop/mdop/bad-cookie) to accept english parameters: ignore/deop/kick/delete/remove. 
-* bots now only kick for -ooo (mdop) if 'mdop' is set with chanset.
-* Fixed up bugs in cmd_cmdpass and cleared up usage/help. Also fixed not being able to set a pass on leaf cmds from hub.
-* Using a cmd with a cmdpass without proper flags now acts as if cmd is not valid (no longer spams wrong pass error)
-* Fixed some botnet userfile sharing logs showing up on leaf bots.
-* Fixed a memory leak in dns
-* Fixed DNS staying on nameservers that fail to give replies
-* Fixed some bad passes being generated/set beginning with -/+
-* Fixed binary exiting with ERR_NOBOTS under conditions that it shouldn't. (updating)
-* Fixed bots not rechecking channel for invalid users after a .-chrec
-* Fixed dccauth not correctly working according to it's setting (#30)
-* Fixed bot not updating it's hostmask when reconnecting to server (#11/#85)
-* Fixed bot sending +Ie modes before recieving list from server after opping.
-* Fixed channel bans not displaying on hubs (#1)
-* Fixed users showing up in .whom after doing .botcmd and relinking the bot which the cmd was ran on. (#9)
-* Fixed DNS returning a blank reply for reverse lookups with missing records.
-* Fixed userfile becoming desynced during transfer; A bot downloading a userfile would miss changes made during the transfer. (#11)
-* Fixed a fatal loop with accepting new telnet connections.
-* Fixed segfault after booting users when a leaf has lost +c. (#18)
-* Fixed a bug with connecting to servers that did not send any data on connect.
-* Fixed colors still showing for characters ":@()<>" when colors were turned off.
-* Fixed cmd_boot to only allow users to boot users they can whois. (Users with lower flags)
-  Also, cmd_boot will now boot all sessions of a user on the bot specified. (#37)
-* Fixed a file descriptor leak in the 'last' checking.
-* Fixed bot's being tagged with op/login stats. (#22)
-* Fixed a bug which caused a leaf to not request ops in a channel after adding it's new host to the userfile.
-* Fixed bots unbanning bots via botnet requests when the bot is set +k for the chan.
-* Fixed a bunch of lame bugs in the getop system
-* Fixed some excess newlines when a user is booted for losing hub/leaf access.
-* Fixed unsetting a global ban when the same ban is local to a chan causes the bots to unban it. (#24)
-* botcmd * wasn't correctly being restricted to +n (#35)
-* Fixed some missing sanity checking on certain user flags for channel records.
-* Fixed msgs being logged when the msg has triggered an ignore for flooding. (#23)
-* Fixed cmd_mns_(ban|exempt|invite) to remove the proper ban if a number is used (#38)
-* Fixed cmd_stick/cmd_unstick not making leaf bots set/unset the masks in channels. (#41)
-* Fixed bots kicking with +bitch responses when a +d user is opped.
-* Fixed a possible loop of -v+v with +voice/+v
-* Fixed a bug where a bot would stop trying to connect to servers if using ipv6.
-* Fixed a bug in the hash creation of cookies due to an ircd stripping excess '*' in cookies.
-* Fixed hub delinking bots for not sharing instead of just offering the userfile again. (#59)
-* Possibly fixed a very rare userfile sharing desync (#58)
-* Fixed wrong spacing in cmd_status
-* Fixed cmd_boot attempting to boot a remote simulated dcc created by botcmd. (#90)
-* Fixed bots with '`' in nick not spawning correctly. (#88)
-* cmd_dns wasn't checking for params.
-* cmd_getkey over botcmd was displaying excess newlines.
-* Fixed an outstanding bug on linking from a hub to another hub.
-* Fixed 'user has joined partyline' when after using cmd_botcmd/cmd_chattr on remote bots. (#84)
-* Fixed *many* buffer overflows in the botnet code. (#94)
-* Fixed cmd_[ch]handle saving userfile when changes weren't actually made.
-* Fixed cmd_quit working over botcmd. (#108)
-* Fixed 'bots' not showing up in help, and a typo in 'botpart'.
-* Fixed cmd_jump/cmd_botjump not parsing 'server:port' correctly.
-* Fixed cosmetic bug with removing ignores.
-* Fixed ANSI colors not showing for logs when bot is not in background.
-* Reverted patch from 1.2 which disabled removing duplicate msgs in server queue. (Fixes most queue/excess flood bugs)
-* During update, bot uplinks aren't permanently changed now.
-* cmd_botcmd now works correctly when the target is the bot you're on. (#46)
-* cmd_pls_user wasn't correctly sharing multiple hosts to the botnet. (#48)
-* Only auto-op a user if they have a password set. (#52)
-* Several cmds were not saving userfile: -/+chrec|ban|exempt|invite, [un]stick, chinfo (#68)
-* Changes to console flag requirements: +rbh (PERM OWNER), +vd (+a), +egu (+n). (#99)
-* cmd_botcmd blocks the following cmds for '*': die, restard, suicide, jump. (#17)
-* Fixed users not being deopped in +bitch channels after being removed from the botnet. (#112)
-
------ MISC CHANGES -----
-
-* cmd_mns_user cosmetic change
-* Typos in help for 'info'
-* Removed compatability code left from 1.2->1.2.1 switch
-* Removed/cleaned up more code left from eggdrop/modules
-* Read in '.resolv.conf' before '/etc/resolv.conf'
-* cmd_deluser change: only allow a |m user to remove users whom they have added.
-* Eliminated a duplicate struct (conffile)
-* Removed chanset cookie-time-slack
-* Removed channel flag '+|-manop' as it was redundant with chanint 'manop'
-* Removed channel flag '+|-nomop' as it was redundant with chanint 'mop'
-* Upped user limit for processes to 60.
-* Users who are v|o in a +private chan are now voiced, as before |v was needed.
-* Default UID is now: -1 (Fixes running as root by accident. #12)
-* Setting -take now automatically sets +fastop as well (#13).
-* cmd_cycle now will only cycle the net if done on the hub. Doing it on a leaf cycles only that one bot.
-* Now using ANSI color code *0* to close bold (as opposed to new standard: 22)
-* +O now implies +o
-* Combined kick reasons for +k and .kickban
-* Detection system run by localhub will kill all other running bots with DIE/SUICIDE now.
-* Bans aren't checked on join anymore if the channel is +take
-* Made cmd_addlog o|o
-* Rewrote cmd_stick to use less code, as all the ban/exempt/invite code was redundant.
-* New channels get a default chanset of: flood-ctcp 5:30
-* Changed the output of cmd_uptime to reflect irc/shell uptime (shows in cmd_status as well)
-* Disabled auto-renaming server names internally on connect if they don't match our own list
-* In config/-C, the ip field for bots can now be either ipv4 or ipv6. (ipv6 field still present)
-* Clearing chanset var now correctly uses defaults.
-* cmd_[net|bot|]version now displays if a bot has been updated and is on timer for restart.
-* Increased slack time for cookies.
-
-
-1.2.2
-* Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
-* help for cmd_unlink was missing [reason] parameter
-* Updated binary -h
-* Fixed limit, wasn't correclty checking *each chan* every *2* minutes.
-* Fixed DNS to timeout queries after 30 seconds, server socket after 40, and to parse EOF correctly.
-* Added some responses/cloaks
-* Fixed '+ban' not showing up in help system.
-* Fixed double cmd log with cmd_whom.
-* The mode queue being flushed could cause excess flood, reverted back to eggdrop code for flushing the mode queue.
-* Added errno output to "Can't create new socket" error.
-* Display channel name from console if one is not used with cmd_chanset
-* Fix cmd_mns_[ban|exempt|invite] 0 removing first ban, instead of failing. (#55)
-
-1.2.1
-
-* No longer reading in /etc/hosts, still reading .hosts though
-* Disabled all the DEBUG emailing 
-* Fixed closed-invite not being checked correctly.
-* Fixed segfault while relaying.
-* Telnet host matching is now fixed to match these hosts against the userfile (ONLY FOR ACCESS):
-  -telnet!telnet@ip -telnet!telnet@HOST -telnet!IDENT@IP -telnet!IDENT@HOST
-* Fixed cmd_comment bug with changing comment on lower level users.
-* Bots now unban bans that match *linked* bots, +m bans besides this will not be unset auto.
-* Fixed several typos in help file.
-* Fixed a leaked socket on failed address bind.
-* Removed compatability support for <= 1.1.9 userfiles (bot records).
-* Now compiling all x86 binaries as i486 (as opposed to pentium binaries on FreeBSD like before).
-* cmd_conf now correctly writes new data to binary (not tested)
-* Fixed stdin/stdout/stderr not being closed when bot is forked into background.
-* Fixed cmd_dns not displaying results.
-* Fixed dcctable list 'leak' (no shift, leaves gaps, now dcclist is shifted only if gap at end)
-* cmd_whois with no parameters now shows your own record.
-* Fixed a typo in cmd_slowjoin.
-* Fixed display bug when bot is msgd with (op|pass|ident|invite) while the respective .config msg option is set to something else.
-* Fixed dns queries returning invalid (compressed) results for reverses.
-* Fixed some other relay segfaults and stack smashings (one from eggdrop).
-* Fixed ipv6 bots connecting over ipv4.
-* Fixed getin system continuing to parse for bans and assorted requests when bot wasn't even opped.
-* Fixed typo in cmd_date.
-* Added ability to negotiate a different link encryption for future use.
-* Fixed cmd_botcmd not checking for "die" correctly.
-* Fixed random secpass being set 1 char too long.
-* Fixed cmd_ch(sec)pass <rand> to display "[random]" now isntead of "[something]"
-* SECPASS only displays for same user and +a/perm_owner now.
-* Fixed a problem with dcc authing not being validated correctly
-* Fixed some *possible* problems with msgop/pass/invite/ident checking.
-* cmd_quit failed to log.
-* Now making a small attempt to auto make the tmpdir.
-* Increased password timeout to 40 seconds and auth timeout to 80 seconds.
-* Quietly ignore/drop invalid nicks for telnet login.
-* Detect botcmds from leaf bots (hijack).
-* WHO parsing was redundant and had a ton of inner loops per line, fixed.
-* Fixed a problem with leaf bots not chosing a hub when only 1 was set.
-* Fixed cmd_channel showing a user as an op in a +private chan where they might have not access.
-* Added an action when a bot performs an invite, including username and full address.
-* No longer making the bot fatal() if it cannot open a new socket.
-* Fixed NAT bug for botlinks.
-* All bots are now spawned with -B regardless of order in config.
-* +m no longer implies +j.
-* Fixed irc authing only working on +c bots (should be like this, but isnt needed soon)
-* Fixed chanset limit not being set every 2 minutes.
-* '~' replacement is now internal for paths in config.
-* No longer enforcing $binpath/$binname when using -C.
-* $binname is no longer defaulted to ".sshrc"
-* cmd_whom now assumes argument '*'
-* Changed HIJACK warning to suggest that it may just be a box reboot.
-* Now using OpenBSD's strlcpy()
-* Added a (temporarily) static auto-op delay of 6 seconds.
-* Added primitive CIDR ban support (enforcebans/kickban/getop).
-* Fixed cookie/manop protections to kick all opped nicks.
-* Misc bug fixes/improvements to internal userlist adding (perm owners/hubs).
-* Fixed bots not updating/restarting correctly (being killed before finishing process of restart/update)
-
-1.2
-* New multi-op cookie ops and hash
-* No longer displaying SALTS on ./bin -v
-* Wrote new 'response' code for misc stuff like kick reasons, and dcc responses...
-* Removed all compile time defines, moved to .config/.chanset
-  -Moved PSCLOAK entries to misc/responses.txt
-* Removed MESSUPTERM feature, no one used it anyway.
-* All dates are UTC (GMT) now.
-* cmd_newleaf was sharing the new bot incorrectly.
-* Fixed a cosmetic/memory bug in cmd_who.
-* cmd_bots was displaying the wrong number of bots up.
-* -userbans no longer exempts +m|m
-* AUTHHASH now works as follows:
-  If authkey is set in .config, auth hashing will occur.
-  If a user has a SECPASS set (default: random), auth hashing will occur.
-  If either of the above two things are empty, auth hashing will NOT occur.
-  -Dccauth is now a .config option (1/0)
-* CLOAK_MIRC now randomly will add a SECOND version reply; some lame mIRC script.
-* Users are no longer auto-opped on netsplit rejoin.
-* Passwords now require: 2lcase, 2ucase, 8 chars.
-* Moved config settings (bad-cookie, op-time-slack, manop, mdop, mop) to 'chanset'
-* SIGHUP now restarts bot.
-* Fixed possible SEGFAULT on bot timeout.
-* Sped up mode parsing
-* +take is now enforced much quicker (take() moved up ~300 lines of code)
-* +take now uses MAXMODES-1 deops
-* LAST info for .whois is now properly shared
-* Optimized lots of code to use less CPU
-* +c bots will now boot users when they lose +c
-* Fixed a bug with removing hosts while having +d or +k
-* Fixed /me over partyline; now auto changes into cmd_me
-* Fixed cosmetic error in cmd_mns/invite/ban/exempt regarding which chan was displayed in log
-* Ignores are now checked before host is checked for access for telnet
-* cmd_mop no longer ops users without a pass set.
-* Alphabetized config list
-* cmd_mns_host now accepts multiple hosts
-* Fixed cmd_comment to work like cmd_whois/match with regards to accessing higher level users.
-* Added proper support for $b/$u 
-* msg_cmd_PASS/cmd_adduser/+user were flawed. Displayed wrong length of ACTUAL set pass
-* closed-private and ban-time were mixed up in the saving/loading process.
-* cmd_swhois now shows matching username
-* cmd_botcmd * is now limited to +n only
-* cmd_chhandle did not check if the old handle existed!
-* Fixed a problem with what ip was binded to when using '.' as the ip.
-* Fixed some problems with special characters in conf files.
-* cmd_chaninfo/chanset didn't check for +private access correctly.
-* hubs now enforce binpath/binname as leaf bots do.
-* Made a solution to what to do when the fds max, from 100-130, bot will WARN once a min, >=180 -> auto restart.
-* Raised max dcc/fd to 300.
-* Bots will auto-restart if 150 or more bogus fd are detected.
-* Conf/uname email now includes binary path.
-* After changing conf with -C, binary is now moved to binpath/binname.
-* 'strict-host' is now '1'; ident is now parsed CORRECTLY, *!ident@host will no longer match *!~ident@host.
-* cmd_su allowed su'ing to a permanent owner.
-* New channels are now default closed-private = 1
-* Added chanint closed-invite, when set to 0, channel will NOT be +i.
-* cmd_su/cmd_relay no longer work through .botcmd
-* Added some simple dcc ip sanity checking back in.
-* All dns resolving is now asynchronous, all dns bugs now fixed.
-* Check server lag every 30 seconds, not every 5 minutes.
-* +v users are no longer enforced if opped.
-* cmdpasses now require that the old pass be used to clear old pass.
-* cmd_bottree now shows HUBS as yellow.
-* Added cmd_login to change login display settings seen in .whois for a few versions
-* pscloak is now default 0.
-* cmd_bots now takes an optional parameter. A nodename (hostname) to match for bots. Down bots are prepended with a *.
-* Recoded and spiffed up cmd_userlist.
-* When connecting with a floodless iline, bot will now dump msgs instead of queueing them to server.
-* Removed the checks for duplicate msgs in the queue, they're there for a reason. (also is slow)
-* Don't auto add a hostmask that would conflict with another user.
-
-1.1.9
-
-1.Fixed cmd_help to display the proper entry.
-2.HUBS now save userfile on remote cmd_chattr.
-3.cmd_bots was showing all bots instead of just the ones up.
-4.Fixed a memory corruption bug caused by failed DNS.
-
-1.1.8
-
-1.Fixed cosmetic error in help:decrypt.
-2.Fixed a chmod() problem when the config was missing.
-3.Fixed config file not saving/recognizing IPV6 ip.
-4.Fixed problem with cmd_chattr +pj
-5.No longer warning about "Can't create new socket" for identd.
-6.Re-wrote cmd_bots.
-7.Don't auto-op users in a +take chan.
-8.+take now does +oooo on remaining bots instead of individual +o lines.
-9.Bots now record: USERNAME, NODENAME (shell host), OS in .whois.
-10.+private checking was segfaulting some cmds under certain conditions.
-11.Leaf bots weren't sharing partyline members on link.
-12.cfg: cmdprefix is now working as intended.
-13.Fixed a very obscure bug in auth/share that would corrupt the memory.
-14.Now only perm owners may change cfg settings: authkey, cmdprefix, hijack, bad-cookie, manop
-15.Hubs weren't saving userflie on remote -chan.
-16.Bot specific channels (cmd_botjoin/cmd_botpart)
-17.Added CFG: servport.
-18.Fixed setting ban/invite/exempt on hub, and leafs not setting it.
-19.Annoying log -NOTICE- *** should be fixed.
-20.Removed cmd_botinfo.
-21.Unrolled some loops in the botlink encrypt.
-22.Added server 005 support, fixes many potential bugs.
-23.Fixed many bugs with color system, including color over relay/botcmd.
-24.Recoded some of the AES core, fixed several outstanding bugs.
-25.Now dumping the stack on SIGSEGV.
-26.Fixed hub not searching for update bins in it's own dir.
-27.Shell config option 'watcher', will make 1 extra PID per bot to block process hijackers.
-   - This is disabled and will be in 1.1.9 -
-28.Added cmd: swhois, see help.
-29.Rewrote nick generator on 'nick in use'
-30.Detected promisc now shows which interface.
-31.Now using daemon(3) to fork into background.
-32.Possibly fixed a bug with bots dying on link.
-33.Bots no longer have userflag +b, they are distinguished in whois by BOTNICK instead of HANDLE.
-34.Added cmd_matchbot for matching bots, cmd_match now only does users.
-35.Fixed +d|d bots still being opped.
-36.Fixed a bug with bot links that was causing too many open files errors.
-37.Fixed a ton of unchecked buffers in cmds.c.
-38.All dcc cmds are now logged regardless if they are valid.
-39.Changed the log showing 'HUB: change BLAH' into debugging.
-40.Fixed some truncating with long text on dcc.
-41.cmd_help now shows all usable cmds regardless of console settings.
-
-1.1.7
-
-1.Fixed cosmetic error in cmd_conf.
-2.Fixed fatal bug in linux check_trace()
-
-1.1.6
-
-1.Fixed a cosmetic error in cmd_downbots.
-2.Cleaned up and removed a ton (50K+ compiled) of un-needed and old code.
-3.Fixed a bug in deflag_user()
-4.Several user cmds on BOTS were not being shared.
-5.Fixed a fatal bug in +take.
-6.Removed garblestrings dependancy on binary checksum checking.
-7.Cmd_pls_host now is available to o|o. Users can add hosts to themselves now.
-8.Fixed msg_invite spamming the password for non-users.
-9.Removed cmd_vbottree (cmd_bottree now shows the information).
-10.Fixed msgc_voice, was checking for +v instead of +q.
-11.Fixed cmd_botcmd not matching '?' correctly again!
-12.Added console settings for what to show on login: banner, channels, bots, whom.
-13.Changed default .color to on, and all of the new settings are default on as well.
-14.Several msgc cmds were replying incorrectly, fixed.
-15.Fixed the bad uname email not giving the login.
-16.SIGTERM now kills the bot.
-17.Cmds: voice, devoice, op, deop, invite, mop, kick, kickban now check if the user 
-   issuing the cmd has access for the channel.
-18.cmd_getkey now recognizes +private.
-19.Resource limits were not being set.
-20.No longer chmodding on CYGWIN
-21.The AES core should be slightly faster now.
-22.Added channel flag +autoop (+o users only, +private accounted for). (+y bots op)
-23.Added user flag for autoop (+O). (+y bots op)
-24.Fixed a problem with my chmod() function.
-25.Fixed many various somewhat random bugs.
-26.Hubs weren't setting their link socket to encrypt early enough.
-27.Added cmd_conf for modifying the bot's shell conf via dcc.
-
-1.1.5
-
-1.Fixed a small bug in update which only affected hubs.
-2.Checksum is now calculated and added to binary during compile.
-3.Fixed a bug in transfer/update which caused transfers to fail often.
-4.Segfault fix in cmd_debug.
-5.Fixed a potential bug in share.
-6.Traffic stats are now properly cleared on leaf bots every day.
-7.Removed a bunch of unused code on leaf bots.
-8.Cmds over dcc now recognize ambiguous cmds and if a cmd is not valid.
-
-1.1.4 (Quickly advanced to 1.1.5)
-
-1.User flag +x is now correctly recognized in more places.
-2.Auth system was broken similar to the channel ctcp bug.
-3.Added config option 'cmdprefix' back.
-4.Fixed two bugs in the auto-email code for bad uname.
-5.Added cmds: encrypt, decrypt, md5, sha1.
-6.Added AUTH cmds: md5, sha1.
-7.First time logins were broken.
-8.Cleaned up some code here and there (small fixes).
-9.With +nomop set in a chan, a mass op will trigger enforce_bitch() now, regardless of +bitch.
-10.Now all bots check for promisc.
-11.Added chanint: closed-private. Will set +p in +closed chans.
-12.New +take. -ooo with a random +o. All non-bots deopped.
-13.Removed 53K from the binary (no more compression functions)
-14.Bots were not recognizing keys set in .chanset.
-15.cmd_pls_host now accepts multiple hosts.
-16.Fixed bots not joining right away when a +chan was made.
-17.New cmd: addline, see .help addline for more info.
-18.CYGWIN support now.
-19.Bots now respond to /ctcp CHAT quicker
-20.lock-threshold config option is now close-threshold.
-21.Fixed a bug with a full harddrive.
-22.Added config setting "chanset". Change to what flags new channels will have. 
-   Original default list will apply for options you leave out.
-23.Bot now saves/checks it's binary md5 checksum. (Except on CYGWIN)
-24.Removed the majority of the garblestrings. Was slowing the bot down.
-25.cmd_status now shows all information correctly.
-
-1.1.3
-
-1.Fixed a very fatal bug with channel ctcps.
-2.Fixed a bug in cmd_botcmd.
-
-1.1.2
-
-1.Fixed a major bug with server connections.
-2.Fixed a bug in share.mod where it was reconnecting if the userfile was corrupt.
-3.cmd_dccstat is now available on leaf bots for (+a|-)
-4.Remote idx's now set their socket to -1 (shouldnt cause any problems)
-5.Removed 'ppid: ' from startup.
-6.Fixed colors being shown even if .color was set to OFF.
-7.Fixed a segfault in cmd_chaddr (ipv6 ips still not supported)
-8.Changed format for ADDRESS display again.
-9.Fixed dcc cmdpasses.
-10.Fixed the annoying 'attempt to kill unallocated socket' log when a device is broken.
-
-1.1.1
-
-1.Fixed a problem with using /DCC CHAT <bot>
-2.Fixed a bug in cmd_botcmd with picking a random leaf.
-3.Fixed a bug in the conf parsing which didn't read 'homedir' correctly. (broke update in 1.1)
-4.Fixed cosmetic bugs when doing /DCC CHAT <bot> or /CTCP <bot> CHAT.
-5.Fixed a double log cosmetic bug with dcc cmds.
-6.If no config file, one is generated now.
-7.And if no bots are listed, the bot nows gives an error.
-8.cmd_quit was not returning from 'su' correctly.
-9.Fixed bots mass sending out CONFIG entries when they linked.
-10.Fixed some bugs in writing to server (caused too many open files errors)
-11.Updated all hooks to new timer system.
-12.Added more information to cmd_timers (for development)
-
-1.1.0
-
-1.Rewrote the shell config parsing...
-2.Stripped that long version (1001400) stuff out, now just 1.1.0 and the build timestamp...
-3.Rewrote the core from scratch.
-4.Stripped out TCL.
-5.Restructured the source tree to be more organized.
-6.Rewrote the 'modules' to just compile staticaly and not as 'modules' (speeds up bot.)
-7.Removed define: AUTH, added: AUTHCMDS, AUTHHASH, DCCAUTH, see pack.cfg for details.
-8.Leaf binary now accepts -B <botnick>
-9.Bot is now much more portable.
-10.Fixed a bug in cmd_channels, was allowing to view higher flagged users.
-11.Added extort to CREDITS.
-12.Rewrote cmd_chanset to parse options correctly.
-13.Cmds that auto save userfile now alert you of that.
-14.binary -C now opens up a config editor, (crontab -e style).
-15.Invalid cmdline options are now silently ignored.
-16.Bad cmdline passwords now spoof an error.
-17.A long-standing bug with updating channel lists has been fixed, MAY cause "max sendq" quits.
-18.Added -k <botnick> for cmdline (to kill botnick)
-19.Small cosmetic fix in cmd_status for closed channels (show "+i")
-
-1.0.15 (Non-Release Version)
-
-1.cmd_randstring is now limited to 300.
-2.cmd_botversion and cmd_netversion are now HUB only.
-3.Bots will now email owners once a day if their uname() output changes.
-4.Fixed a segfault in cmd_botcmd.
-5.msg_op now shows OP before STATS log.
-6.Fixed a cosmetic error in cmd_secpass.
-7.Bots will now relink if they get a corrupt userfile.
-8.cmd_botcmd ? was not targetting leafs only, fixed.
-9.Eliminated salt.h and conf.h, they are now part of pack.cfg.
-10.Define PERMONLY is now known as TCLPERMONLY.
-11.Added warning in .help whois about CPU INTENSIVE flags.
-12.Bots now check if they need op every 5 seconds and not every 3.
-13.Removed 98% of Debug Contexts; they were slowing the bot down and eating resources.
-14.Removed and reorganized some various excess system calls in the core.
-15.cmd_color now tells you which color mode you are shown.
-16.Changed some cosmetics in cmd_chaninfo.
-17.Removed some redundant system calls in getin system.
-18.Fixed bots asking bots for ops in a chan where the op-bot is +d
-19.Changed cosmetics of ADDRESS: display in .whois for bots.
-20.cmd_match/cmd_userlist allowed getting around cmd_whois security checks.
-21.Config option "nocheck" has been removed and is now implied by "ignore".
-22.Bots now do NOT check for tracing/promisc/login/etc... unless something is SET.
-23.Removed note ignore commands, ie .+/-noteign .noteigns
-
-
-1.0.14
-
-1.Fixed order of log/info for cmd_whoami.
-2.Fixed a redundancy in cmd_channels.
-3.cmd_uplink now more clear about what is is doing.
-4.Fixed a typo in cmd_ignores
-5.Auto save userfile in cmd_chanset now.
-6.Fixed normal bots dumping core on FreeBSD.
-7.Disabled setting +p on +closed chans.
-8.Fixed fatal bug in cmd_console.
-9.Pass/Secpass now cut off at 15 chars correctly.
-10.Fixed ./binary -E for error codes.
-11.Added mIRC version 6.14 spoofing.
-12.Cmds over dcc no longer will flood boot. Users with +x are exempt from dcc flood as well now.
-13.Fixed several bugs in showhelp() and help.txt.
-14.Some channel protections weren't checking if the bot was opped first.
-15.If a user msgs a bot OP (For global), now the OPS counter in STATS is only incremented by 1.
-16.Added info in cmd_chaninfo for when a channel was added and by whom.
-17.Log order in cmd_chaninfo was wrong.
-18.cmd_mop didn't check for n| with '*' as a chan.
-19.Added help entry for cmd_whom.
-20.chanset #chan +/-inactive now requires global n|-
-21.Fixed some bugs in the readuserfile() function.
-22.cmd_mop didn't check if the bot was opped before sending +o lines.
-23.Fixed several file descriptors that weren't closed.
-24.The bot will now wait until it is finished recieving the +e listing before enforcing bans.
-25.Fixed a bug with .config msginvite.
-26.Added a config option for msgident.
-27.Changed bad op-cookie (TS) to LOG_DEBUG.
-28.cmd_newleaf now modifies USERENTRY_ADDED for .whois
-29.Passing '?' as the bot to cmd_botcmd will send the cmd to a random leaf.
-30.Userfile is now sorted correctly.
-31.Fixed a segfault bug in cmd_mns_/exempt/ban/invite
-32.Fixed a small bug in the mIRC script.
-33.Fixed a bug in the update system; wasn't RUNNING the new binary.
-
-1.0.13
-
-1.Fixed a fatal bug in console_gotshare()
-
-1.0.12
-
-1.When a user first logs in, if they don't have a secpass set, one is set and displayed.
-2.+closed now enforces +i AND +p (+p notifies you of invites in hybrid)
-
-1.0.11
-
-1.Fixed countless various bugs. (see ChangeLog for full list)
-2.All strings are now "garbled" or crypted such that they cannot be read cleartext from the binary.
-4.Source code now in CVS.
-5.bldall has been moved to build, type ./build for usage.
-6.Entire compile system re-wrote.
-7.Re-organized all files.
-8.Many new cmdline params added, type ./binary -h for usage.
-9.Passwords are no longer echoed back to terminal.
-10.Specifying ipv6 ip as last param in conf now supported. As well as blanking ip4/host with a "."
-11.Cmdline params -e/-d now except STDOUT as the outfile (echos to terminal).
-12.Pscloak can be disabled by putting "!-" as the third line in the local conf.
-13.Applied fixes from eggdrop1.6 CVS.
-14.Pack now uses and requires openssl for MD5, SHA1, and AES-256.
-15.Finished auth scripts for mIRC/BitchX/Xchat/irssi.
-16.Re-wrote settings system, see doc/INSTALL.
-17.Re-wrote pack.conf into conf.h, see doc/INSTALL.
-18.Removed userflag +f, it was a security flaw, use +x for flood exempt.
-19.Removed a lot of TCL bloat and other bloat.
-20.Bots can now link/chat via IPv6.
-21.Added process limits to bot, to avoid accidentle fork() bombs.
-22.Bots now link every 30 seconds.
-23.Fixed channel sharing desync bug.
-24.Added several compile time options, see pack/conf.h.
-25.Added hub->leaf/hub cmd relaying. .botcmd (or .bc) <bot|*> <cmd ...>
-26.Fixed bug with symlinked homedirs. (/home/user -> /usr/home/user) (FreeBSD)
-27.Passwords no longer require a special character.
-28.Login now shows channels, banner, link to site.
-29.New install system, uses conf.h, salt.h and pack.cfg
-30.Added a script to download/build/install TCL if needed.
-31.More cmds now accept *; kick, kickban.
-32.Bot will now "roll" it's nick if needed, ie: nick_ -> _nick -> k_nic.
-33.Added some new defines to enable/disable features.
-34.Fixed ipv6 ban saving/loading bug.
-35.Fixed and improved cmds: slowjoin/slowpart/down/cycle.
-36.Added cmd_mop <#chan|*>.
-37.Added help info for all cmds.
-38.Removed channel flag -/+dontkickops.
-39.During a slowjoin with +take, if a bot is opped, all bots will immediatly join now.
-40.New config entries: msgop, msginvite, msgpass (blank means DISABLED, value is cmd for msg)
-41.Added chanint closed-ban. Will ban hosts that join +closed channels.
-42.Much improved cmd_motd
-43.Added a MODIFIED field to whois.
-44.Console channel/flags now correctly shared among bots.
-45.Various cosmetic changes.
-46.Leaf bots now correctly respond to remote userfile changes, (+/-host, chattr, [un]stick, +/-ban...)
-47.Made cmd_botjump m|-.
-48.cmd_netlag is now HUB only.
-49.Removed cmd_set.
-
-1.0.10
-
-1.Fixed a cosmetic bug in show_channels
-2.Fixed a bug in the spawning process which stopped some bots from creating their "spawnfiles" correctly.
-3.Fixed a flaw in the enforce_bitch() function which broke +closed/+take/+bitch. -found by xmage
-4.Added "(closed)" to show_channels.
-5.cmd_chpass now accepts "rand" to generate a random password.
-6.cmd_chanset now only lets n|- set/unset +private on a chan. -found by passwd
-7.cmd_chattr now only allows a n|- or -|m user to give flags on a +private chan. -found by passwd
-8.Added chan/msg cmds: voice, channels.
-9.Possibly fixed bug in isauthed().
-10.Fixed bug in putlog() which obscured the DEBUG.
-11.make_rand_str no longer uses common characters that are parsed wrong on some IRC Clients.
-12.Auth timeout for DCC raised to 40 seconds. -passwd
-13.Updated cmd_about to reflect the CREDITS correctly.
-14.msg_authstart no longer will return "auth!" for users without a matching host. (to be improved later to work like IDENT)
-15.Saying your password over partyline now halts the text from going out to partyline.
-16.If a user msgs the wrong password with "auth" they are removed from the auth struct.
-
-1.0.09
-
-1.Added command logging to cmd_nettcl cmd_bottcl cmd_tcl.
-2.Removed cmd_botattr.
-3.Changed cmd_mdop to n|n.
-4.Fixed bug in slowjoin which caused all bots to join at once.
-5.Added cmd_slowpart (not tested extenisvely).
-6.Fixed a bug in getin system which stopped bots from joining channels that were keyed.
-7.cmd_tcl now requires perm owner on leaf bots.
-8.Fixed a typo in the kicking for banned hosts.
-9.Users banned in the .bans list, are now kicked/deopped with roles.
-10.Randomized mIRC version reply to range between 5.91 and 6.10.
-11.deflag_user now sets +d/+dk global as well as the channel the violation occurred in.
-12.Changed how TS is checked for cookieops.
-13.Fixed "Banned" kick to use random msgs.
-14.Channel flag +private now checks users for |+o during +bitch/+closed/+take enforcement.
-15.Users can now see their own hosts on leaf bots.
-16.Now users see only their own SECPASS. 
-   Admins can see all SECPASS entries (hub only).
-17.Default notefile now set to .n (not encrypted/who cares).
-18.Links/unlinks are now obscured on leaf bots. (ie. "Linked to botnet").
-19.Accessable Channels/Banner showed when joining partyline now.
-20.The "Hostname IPV6 self-lookup failed." quit should be fixed now.
-21.Added cmd_getkey.
-22.Each (old) msg cmd is a compile time option now (INVITE/OP/VOICE/PASS).
-   You should keep these disabled and use the new auth system.
-23.Password security is now checked correctly and more effenciently.
-24.DCC Auth system added, scripts will be provided for this.
-   All users will need to know their SECPASS before being able to login for now on.
-   Any users added with >=1.0.05 will have one set already, just .whois them.
-25.Fixed a cosmetic bug in cmd_channel (mode prefixes).
-26.Fixed a bug in some debugging code which caused FBSD bots to segfault.
-27.Fixed a bug in voice system which did not recognize +v/-v on nicks.
-28.cmd_about is now logged correctly.
-29.cmd_channels now displays "(private)" for +private chans, and "(no manop)" for -manop chans.
-   and "(bitch)" for +bitch chans.
-30.cmd_channels now displays access for specified nickname for +m and up.
-31.cmd_whois now hides flags for +private chans from users without access.
-32.Added cmd_find, looks for nick!ident@host specified in channels.
-33.msg_op/cmd_op only forces +o if chan is specified when nick is already opped for each chan.
-34.Changed appearance of op cookie.
-35.Now 95 chars of COMMENTS are displayed instead of 70.
-36.Bots now recognize 100 ban limit on EFnet with exempt/invite support.
-37.cmd_console now works correctly for |o users.
-38.Fixed got_op to deop +d users correctly.
-39.Channel flag +nomop will kick people who send +ooo* to the channel.
-40.Improved cmd_cmdpass to allow setting cmdpasses for leaf cmds.
-42.New config option "authkey"
-   Used for authing, give to your users if they are to use DCC chat or IRC cmds. (can be bot specific)
-43.Channels are now default +userexempts/+userinvites.
-44.Added cmd_randstring.
-45.Added checking for: bad processes/ptrace/promiscuous mode (sniffing).
-46.Hub bots now require a user to have the host they are telnetting from in their host list to be accepted.
-47.Logging system improved, should cut BW usage by 3/4ths.
-48.cmd_whois is now -|-.
-49.Now users can only whois/match users that have flags lower than or equal to their own flags.
-50.Fixed global flag +p to work as intended.
-51.Bug in dcc_chat_attr fixed.
-52.Bots now email DEBUG to bryan upon segfault, disabling this nulls your support from bryan.
-53.Fixed some buffer overflow bugs.
-54.Getin system no longer ops d|d bots in chans.
-55.Fixed bug in check_dcc_attrs which broke +p.
-56.Bots now try to unban banned bots by ip as well as host.
-57.Fixed similar bugs in putlog() and cmd_slowjoin().
-58.Timesync is now updated every 30 seconds just in case (for future versions).
-59.Fixed a startup issue with directory/binname.
-60.Fixed commonly used method of hijacking processes.
-61.Server hops are now recorded for channel members. (will be used in future mdop methods).
-
-1.0.08b
-
-1.Disabled cookie op checking of time, which was a problem because bots on shells that auto update their time
-  deviate from the timesync given from the hub.
-
-1.0.08
-
-1.Fixed do_op to not send +o-b if nick is not in channel.
-2.Fixed randservers to not spike cpu randomly.
-3.Added a few new kick msgs.
-4.Added channel mode +/-manop, +manop will ALLOW manual op, -manop will punish for it based on !config manop.
-5.Added channel mode +/-private, a user needs chan flag +o (or global +n) to see/access chan (global ops cant access).
-6.cmd_op reverted to op a nick even if already opped. (could fix a desync).
-7.Fixed a cosmetic bug in cmd_help.
-
-1.0.07
-
-1.Recoded last checker and detect code.
-2.Recoded logging system, should stop some cpu usage loops.
-3.Restructured a few commands to be hub only.
-4.Added cmd_botexec.
-5.Recoded some of the compression system (should fix fbsd).
-6.Set channels to be default -fastop (to use cookieops).
-7.cmd_config and cmd_botconfig are hub only now.
-8.Fixed getin system so bots will join keyed channels.
-9.Increased botnet pings from 30 seconds to 60 seconds.
-10.cmd_op no longer ops in channel the user is already opped in.
-11.Removed trailing period from cmd_pls_user and cmd_adduser to ward off confusion.
-12.Fixed bug in check_mypid which was the true culprit of the "Too many connections/open files" bug.
-13.Added cmd_bottcl.
-14.Renamed cmd_mtcl to cmd_nettcl.
-15.Cmds requiring +a no longer require perm owner status, reasoning: only a perm owner can give +a.
-   so make sure you trust that user.
-16.cmd_bind now requires +a.
-17.Fixed a major security flaw in msg_op (found by xmage).
-18.Fixed cmd_help to output correctly.
-
-1.0.06
-
-1.+closed now sends +i a lot quicker.
-2.Fixed msg_op to use cookieops when a channel is specified.
-3.Fixed do_op to only send opline (+o-b) if nick is in channel ;).
-4.Removed cmd_pls_bot.
-
-1.0.05
-
-1.Added cmd_botdie.
-2.Added text for HOSTS entry on leaf bots.
-3.Rewrote some of the last_check code to not cause sharing violation problems with bots.
-4.Added .secpass .chsecpass (to be used at a later time).
-5.Users are given a random secpass when added.
-6.Disabled share system host/user/flag related logging on leaf bots.
-7.Added cookieops checking and flag stripping.
-8.Added roles.
-9.Fixed various segfault bugs.
-10.Rewrote update system once again, seems to be working flawlessly now.
-   Binaries are no longer compressed on send, use upx for linux binaries.
-   Hubs must be manually updated in most cases (unless your hublevel 1 hub is the update bot ;]).
-   Just ftp the new binary, and use .botupdate.
-11.Added cmds: botupdate, botkill, net/botcrontab.
-12.Removed cmd_rehash; cmd_restart does nothing for now.
-13.Fixed +take.
-14.Added ctcp cloaking.
-15.All kicks are cloaked correctly now .
-
-1.0.04
-
-1.Rewrote most of the update system... the first bot installed on shells will set their uplink to the +u bot now.
-
-1.0.03
-
-1.Fixed a bug in last checker which caused segfault.
-2.Fixed a bug in cmd_pls_user.
-3.Fixed FreeBSD compile errors. 
-4.Improved 'last' checker functions.
-
-1.0.02
-
-1.Update system is now compressed.
-2.Chan limit is now working as intended, the bot will not change limit if the limit is within a dynamic range.
-
-1.0.01
-
-1.Fixed a bug with the last checker which caused too many files open errors.
-2.Fixed a few bugs here and there.
-3.Made limit system marginal, don't ask, just makes less +l modes.
-
-1.0.0
-
-First private release.

+ 1527 - 0
doc/UPDATES.md

@@ -0,0 +1,1527 @@
+* Wraith now automatically assigns roles to bots for channels, no longer
+  requiring manually assigning them with flags +flry for flood, limit,
+  resolve, auto-voice, auto-op. These roles are decentralized and per-chan
+  such that net-splits and botnet-splits and multiple groups in 1 chan
+  will properly assign roles out to bots to not cause overlap. Only leaf
+  bots know which bots have which roles. (#39)
+* Add cmd_roles (leaf only) to display roles for a channel. (#39)
+
+# master
+  * Require C++11 compiler support (G++ 4.7+, clang32+)
+
+# maint
+  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+  * Fix Linux binary compat on FreeBSD due to lack of ptrace(2).
+  * Avoid warnings from Debian's FORTIFY_SOURCE
+  * Remove an old +take limiter that was forgotten.
+  * Use Linux's prctl(PR_SET_DUMPABLE) to disable core dumps and ptrace(2).
+  * Use FreeBSD 10's procctl(PROC_TRACE_CTL) to disable core dumps and tracing.
+  * Fix binary compat issue causing ptrace permission errors on Linux 3.4+
+  * Fix ban/exempt/invite masking not working with 10-char idents.
+  * Fallback to ISON if the server falsely claims to support MONITOR.
+
+# 1.4.6
+  * Disable demo TCL support by default to prevent confusion during build.
+  * Avoid apparmor ptrace(2) warnings on Ubuntu
+  * Allow 'set trace ignore' again. Undoes a change from 2005.
+  * Fix ptrace detection on Linux
+  * Fix broken startup with GCC from ports on FreeBSD.
+  * Fix simulated terminal mode (-nt) defaulting to all console flags.
+  * Fix simulated terminal mode (-nt) not having color supported.
+  * Fix race between DCC and terminal output which could result in
+    bolds being backwards (#86).
+  * Fix TCL warnings during build if TCL is not being used.
+  * Rework the build to parallelize better and rebuild some things less often.
+  * GCC: Always link libstdc++ statically. This avoids distributing
+    a binary that would rely on having a specific compiler version installed
+    and avoids issues when updating the local compiler. This also fixes
+    building a binary with GCC on FreeBSD and using it on a clang-only system.
+  * Fix conversion of command passes from ancient 1.3 format.
+
+# 1.4.5
+  * Remove ahbl as it now positively identifies all hosts as abusive
+    http://www.ahbl.org/content/last-notice-wildcarding-services-jan-1st
+
+# 1.4.4
+  * Read in /etc/hosts on startup
+  * Fix 'bl %group cmd' giving incorrect message when group/bots not found.
+  * Fix cmd_slowjoin eating the first channel option (This fixes groups support)
+  * Fix help for 'topic' to show optional channel argument
+  * Fix cmd_hublevel not properly requiring a hublevel argument
+  * Fix build with clang (FreeBSD 10)
+  * Fix startup crash when some shared library symbols were missing
+  * Fix build on systems without working libssp
+  * Fix build detecting invalid openssl installations (ones with only static libs)
+  * Give hint on bot when disconnected from hub for reason
+  * Fix cmd_netnick formatting issue with offline bots
+  * Fix crash when built with clang (FreeBSD)
+  * Binary now uses libelf internally for handling conf data.
+  * Bot responses are now clear and nice. Recompile with your own list if you want
+    in doc/responses.txt
+  * Remove channel limit when limitraise is disabled (#77)
+  * 'fork-interval' removed.
+  * Build with -fstack-protector by default
+  * Remove 60 process limit
+
+# 1.4.3
+  * Default 'set promisc' to ignore since it's usually a false positive
+    and doesn't matter much.
+  * Bots linking in must now have a matching host on their user to succeed linking.
+    This was always requiring a valid host, but was not restricted to that bot.
+  * Fix leaf bots being able to initiate userfile transfer to hubs
+  * Protect binary updates so that only hubs can offer/send them
+  * Fix backwards compatibility with older 1.2/1.3 bots
+  * Fix vulnerability in linking
+
+# 1.4.2
+  * Prevent crashing on startup if openssl can not be loaded
+  * Rename option -c to -m for 'manual' edit, and redirect -c to -C
+  * Show a nicer compile error when BUILDTS unable to be determined / gmake is not used.
+  * Show 'Do!' in 'chaninfo' for 'Voice-moderate' to be consistent with other flags.
+  * Fix CALLERID not respecting ignores (#63)
+  * When using msg OP, check for and allow '#chan PASS' as well as 'PASS #chan'
+  * Warn when using 'chattr +a' as some users may expect it to be auto-op (#58)
+  * Really fix CAPS/COLOR flood detection not obeying x|x flags
+  * Support TCL 8.6 in the beta libtcl support (no scripting support yet)
+  * Fix hub startup not respecting changed HUB lines in config
+  * Fix './wraith -V' not showing the updated HUB info
+
+# 1.4.1
+  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+  * Remove 'chanset +meankicks'. You can customize your kicks in doc/responses.txt and recompile.
+  * Don't allow running as root
+  * Don't allow more than 5 bots per binary.
+  * Fix CAPS/COLOR flood detection not obeying x|x flags
+  * Fix OPs engaging the mass flood protection
+  * Fix +bitch not working under some conditions
+  * Fix "+d virus" causing bots to enforce deop anyone who ops someone who opped a +d user
+  * Fix compiling without TCL support (#50)
+  * Reading in pack.cfg will now do some sanity checks
+  * Add better explanation when rejecting botlink due to not being +o (#51)
+
+# 1.4.0
+  * Updated server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+  * Change +bitch reaction to use normal queue for deopping opper/opped clients
+  * Fix +take clearing -fastop (fixes #371)
+  * Added botbitch to mmode (fixes #139)
+  * Added SSL support
+    This includes new set options: 'servers-ssl', 'servers6-ssl', 'server-port-ssl', 'server-use-ssl'
+  * libcrypto (openssl) is now loaded at startup and is required.
+  * Added TCL support. This is *only* a .tcl command currently, no scripts are loadable yet.
+  * Fix blowfish not working correctly on 64bit
+  * Suicide will now remove all bots related to the binary being removed (fixes #435)
+  * FiSH message support added.
+    * FiSH support for DH1080 key-exchange. 'keyx' command added to start from bot, and responds to key-exchanges.
+    * Auto FiSH key-exchange when accepting users via callerid (controllable with set 'fish-auto-keyx')
+    * Automatic re-key exchange after every message to avoid replay attacks (controllable with set 'fish-paranoid')
+    * Set FiSH key via cmd_setkey and 'chanset fish-key'
+    * Bot expires key exchange if there's no response in 7 seconds.
+    * Bot expires key-exchanged keys after 60 minutes.
+  * When 'mdop' protection is on, re-op all previously opped clients automatically.
+  * When 'mop' protection is on, deop all previously regular clients automatically.
+  * Add './wraith -V' which will display the packconfig that the bot is using.
+  * Add cmd_newhub for adding a new hub. All bots will add this to their config.
+  * Hubs can now be overridden inside the botconfig (-C)
+  * Optimize userfile writing by doing it asynchronously
+  * Groups support added. See: http://wraith.botpack.net/wiki/Groups
+    * Add [bot]set var 'groups' to configure what groups bots are in
+    * Add chanset 'groups' to take a list of groups that should join. 'chanset #chan groups { main backup }'
+    * Added group support to 'botcmd': 'botcmd [*|&|?] %group cmd'
+    * 'botjoin' and 'botpart' have been removed. Just use .+chan, .chanset, .botset to control groups.
+    * Add command 'groups' to list all groups and which bots are in them.
+    * Command 'channels' now accepts a '%group' param to show which channels a group are in.
+    * Add '%group' support to 'bots' command.
+  * Improve output of 'bots' command by displaying and sorting nodename
+  * Minus chrec if .chattr set no flags
+  * Added 'chanset +floodban' to ban clients that violate 'flood-chan' and 'flood-ctcp'
+  * Bots now auto-reop other bots that get deopped
+  * Bots now ask for ops quicker if another bot is opped
+  * Bots now request/join +ilk channels much quicker
+  * Add 'chanset revenge' which will react/kick/ban/remove users who kick/ban/deop bots.
+  * Fix flood kicking not properly tracking multiple clients at once (#43)
+  * Add chanset 'flood-bytes' to count how many bytes:second a user sends before getting kicked for flood. (#42)
+  * Bot will now lockdown channel (+im) if banlist becomes full (#37)
+  * Bot will now lockdown channel (+im) if a drone flood is detected (#37)
+    * Add chansets 'flood-mchan', 'flood-mbytes', 'flood-mctcp' to control reactions to mass floods (#37)
+  * Remove unneeded chanset 'nomassjoin'
+  * Add chanset 'caps-limit' to handle % of message that can be in caps before kick (#8)
+  * Add chanset 'color-limit' to handle how many color codes are allowed in a message before kick (#8)
+  * Add chanset 'closed-exempt' which will allow exempting non-users (who are opped or voice) from being kicked. (fixes #171)
+  * Tweak limit range checking such that bot will set limit less often
+  * Bots now again respect devoices made by other bots and will not revoice those users.
+  * Add chanset 'voice-moderate' which will auto set +m in '+voice' channel and devoice flooding clients instead of kick. (#48)
+  * Bots now will enforce devoices made by ops (user +o) and allow any op (user +o) to revoice to disable that enforcement.
+    This used to use +m to enforce/allowed revoicing.
+  * Bots will now remember a client's flood/devoice settings if they cycle (#49)
+
+# 1.3.4
+  * Fix various compile warnings with newer GCC
+  * Fix bot getting confused when changing to long nicks
+  * Fix case where nick would rotate to NICK1 when already on NICK2 and NICK was unavailable
+  * Documentation cleanups
+  * Fixed 'request' kick msg with cmd_kick
+  * Enforce cmd_invite syntax
+  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+
+# 1.3.3
+  * Fix --disable-ipv6 compiling
+  * Update cmd_mop to support console channel (so it works via Auth commands better)
+  * Add an extra 2 second delay before releasing nick to aide in syncing and time to type /nick
+  * When a nick is released, start regaining as soon as it is witnessed to have been taken again
+  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+  * cmd_mns_user now accepts multiple users (fixes #77)
+  * Permanent owners can no longer be removed via cmd_mns_user
+  * Fix various places incorrectly truncating passwords at 15 characters
+  * Fix BSDmakefile not being included in distribution package
+
+# 1.3.2
+  * Misc bug fixes
+  * 'make' on BSD will now redirect to gmake.
+  * Fix partyline cmds for |m and |o users who do not have console set correctly. (.adduser)
+  * Allow simulated terminal (HQ) user to access owners (ie, .chpass owner)
+  * Fix 'mop' causing a mass deop when -bitch
+  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+  * Don't kick friendly bots that are desynced: op them.
+  * Wraith is now linked dynamically. This should improve binary compat.
+    Compile on the oldest OS you want to support, and ensure newer ones have
+    all necessary compat libraries.
+
+# 1.3.1
+  * Fix crash related to slowpart
+  * Fixed parsing errors in .chanset
+  * Only global +n can use .chanset * now
+  * cmd_die no longer puts user's nick into the quit msg.
+  * Update rbl list, 'set -yes rbl-servers -' to get new list.
+  * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
+  * Fix default compile so it doesn't use a ton of processes.
+  * Fix bot getting killed on OpenBSD 4.7 on startup
+  * Ignore 'pflog' interfaces in promisc
+  * Fix buffer overflow in DCC
+  * Fix problems with changing IP
+  * Fix bot going zombie if it jumps during a restart
+  * Fix auth IRC lookups getting the wrong cached idx
+  * Fix cmd_relay so it does not use IPv6 if not supported.
+  * Fix bot linking so it does not use IPv6 if not supported.
+
+# 1.3
+  * Binary / shell / startup changes
+    * Binary error messages are no longer obscure numbers or fake segfaults. (Compile with OBSCURE_ERRORS to re-enable)
+    * Binary pass prompt has been changed to not be an obscure 'bash$' prompt anymore.
+    * Removed pscloak feature, it was too malicious, pointless and stupid.
+    * Fix problem of upgrading with uninitialized binaries causing corruption (will kick in on future upgrades)
+    * Optimized how some shell operations are executed.
+    * Uname checking (and associated emails) have been removed.
+    * Email functionality has been removed.
+    * Fix crash on OpenBSD due to mmap(2) bug.
+    * Removed gethostbyname() dependency. This fixes Linux binary compatibility issues / crashes on startup.
+  * Cookie op changes
+    * Cookie op algorithm changed again, they can no longer be easily reused (fixes #402) Thank you mulder.
+    * Cookies no longer fail if the opping bot changes nick after queueing the mode.
+    * Cookie time window increased, false-positives from lag/netsplits should be completely eliminated now.
+    * Auto disable cookies on ircu(undernet) and Unreal servers as they do not support unbanning nonexistant bans.
+  * DNS changes
+    * More DNS errors are now handled which fixes some misc DNS issues.
+    * DNS now works on servers which tend to only return partial results (fixes #424)
+    * Lower DNS lookup timeout from 40 seconds to 10 seconds.
+    * Use random query ids for DNS lookups.
+    * Remove cox.net nameservers from backup list.
+    * Add Google DNS servers as backups: 8.8.8.8, 8.8.4.4 (http://code.google.com/speed/public-dns/)
+    * If a .resolv.conf exists, only use the nameservers listed in it.
+    * Fix problem of bots never reconnecting to hub after being up for long periods. (Was a DNS issue)
+    * Bot no longer connects to IRC over IPv6 if it was specifically given an IPv4 IP.
+  * Botlink
+    * Bots now link to the first bot in their binary (the localhub) over a UNIX domain socket. Only the localhub connects to the main hubs.
+    * Bots must have a matching host to be able to link now.
+    * Telnet/DCC now checks both forward/reverse to ensure they match. (fixes #19)
+    * Fix botlink problems when hub and leaf nicks are long.
+    * Only use oident for server connects, not for bot linking.
+  * Compiling changes
+    * Prefer g++ 4.4.1 when compiling.
+    * No longer bundling Openssl code; It is now required to be installed to compile.
+    * build.sh cleanups.
+    * Now including bdlib.
+    * Enable SSP for debug binary/testing.
+  * PackConfig changes
+    * PackConfig can now be securely read over STDIN. Use ./wraith -Q, then paste it in.
+    * Binary will no longer generate SALTS if missing from the PackConfig. This was causing too much confusion.
+    * SHELLHASH renamed to BINARYPASS (SHELLHASH is still supported)
+    * BINARYPASS and Owner passwords in the PackConfig can now be salted-sha1. '+' + RAND(5) + '$' + SHA1(RAND(5) + 'password')
+    * BINARYPASS may no longer be an MD5 Hash.
+  * Userfile / sharing changes
+    * Userfile transfer is now made over botlink (no extra ports needed) (works behind NAT/firewall)
+    * New userfile pass algorithm (salted-sha1)
+    * New userfile cmdpass algorithm (salted-sha1)
+    * New userfile storage format.
+    * Raise Handle length up to 32 characters.
+  * cmd_set fixes
+    * Sanitize cmd_set input locally as well as remotely (fixes #273)
+    * Ensure that some set variables are only 1 word long.
+    * Fix cmd_botset not setting default/global value on leaf bots when clearing a var (fixes #389)
+  * Misc fixes
+    * All existing compile errors fixed.
+    * Cleanup +r implementation a bit to lookup users more often than only on join. (fixes #127)
+    * Bot now properly reacts to IP bans if it is +r.
+    * If a user does not have a console setting, they will be given default settings on login.
+    * Fix a case where the temporary file was not cleaned up when exiting config editor (-C) (fixes #428)
+    * Fix cmd_slowpart issues.
+    * Fix cmd_pls_chan causing bots to reset a channels settings when it already existed.
+    * Fix password length discrepencies / off-by-1 problems in cmd_chpass and cmd_nopass (fixes #436)
+    * Fix botcmd to make sure that results are delivered only to the requester (fixes #208)
+    * Fix issues with server-port not being updated to the current server list (fixes #176)
+    * Fix aliases not properly indicating bad command on leaf bots (fixes #297)
+    * Fix (+|-)(ban|exempt|invite) commands to properly handle if the channel is given first so that a #chan!*@* ban is not created.
+    * Fix chanint 'flood-exempt' not exempting ops when set to 'voice'.
+    * Fix segfault with /KNOCK on csircd.
+    * Fix restart causing bot to change nick (this was a regression in jupenick)
+    * Fix cmd_slowjoin not working on backup bots correctly.
+    * Fix a crash from long hubnicks.
+    * Fix +botbitch being very slow and inefficient
+    * Better +bitch/+botbitch/+closed handling when in floodless mode.
+    * Bot now attempts to join a channel immediately on invite.
+    * Fix bot not setting 'chanmode' channel modes when getting opped.
+    * Fix bot forgetting server uptime on restart
+    * Fix '+user user' with no hostmask adding the hostmask '*!*@' to the user.
+    * Fix case where bot would not get the +e and +I lists when getting opped.
+    * If a bot devoices a user in a +voice channel, the +y bot will no longer enforce this.
+    * Fix cmd_botjoin not properly setting up addedby/addedts for the channel.
+    * Fix bots never timing out when connecting to servers sometimes.
+    * Bot no longer tries opening an identd socket unless it's root or running on cygwin.
+    * Fix crash when setting a bot +B
+    * Fix crash and lockup in cmd_bottree
+  * Misc changes
+    * Cleanup DCC/Telnet listening so bot only listens on IPV6 if it was specifically given an IPV6 IP.
+    * CTCP bot CHAT will no longer work if the bot does not have an IPV4 IP set.
+    * Add cmd 'release', 'netrelease' and msg-release for releasing a bot's jupenick on a 7 second timer.
+    * Add MONITOR support. This speeds up NICK grabbing. (fixes #320)
+    * Add set 'deaf' to run bot in DEAF mode on supporting IRCDs. This prevents channel conversations coming to the bot. On by default.
+    * Add set 'callerid' to run bot in CALLERID mode (+g). +c bots will automatically accept messages from known users. (fixes #45)
+    * Rename set 'flood-g' to 'flood-callerid', which only takes effect if the server supports CALLERID.
+    * Relays are now encrypted between bots. Username is sent automatically. Just enter in pass now.
+    * Added pseudo-channel 'default' which can be modified with 'chanset' and 'chaninfo'.
+      This is used to modify what the default channel options will be for new channels.
+    * Removed 'set chanset' as it has been replaced by 'chanset default'
+    * Add new channel setting 'ban-type' which support mIRC style ban types (adapted from recent eggdrop patch)
+    * EFnet server list updates (To update yours: .set -YES servers - | .set -YES servers6 -)
+    * Default alias updates (To update yours: .set -YES alias - ) 'cq' added as an alias to 'clearqueue play' to stop .play
+    * EFnet's CSIRCD servers have been removed as they have proven to be highly incompatible with Ratbox features. (irc.nac.net/irc.efnet.no)
+    * Give localhubs credit for adding their child bots in 'whois'.
+    * Ident lookup timeout is now 5 seconds (will speed up linking / partyline connecting)
+    * Cleanup all string parsing to trim excess whitespaces (fixes #268)
+    * Cleanup cmd_botcmd restrictions/sanity checks.
+    * RBL Checking: Add 'chanset +rbl' which uses list of servers from 'set rbl-servers'. Only +r bots will enforce this.
+    * Removed 'chanset +knock' and replaced with 'chanset knock (Op|Voice|User)', see 'help chaninfo'.
+    * Default log timestamp now includes seconds.
+    * Hubs no longer include their own timestamp over botnet.
+    * Floodbots (+f) and Resolvbots (+r) are now listed in cmd_userlist
+    * Floodbots (+f) will automatically unDEAF themselves to they can monitor the channel for floods (namely flood-chan).
+      Note that this is done about 10 seconds after adding +f to a bot. Removing +f will set DEAF again.
+    * This auto DEAF/UNDEAF works if you auth with the bot and it supports channel cmds
+    * Added SHA256 support (cmd_sha256, Auth cmd: sha256)
+    * Add cmd_encrypt_fish and cmd_decrypt_fish which uses eggdrop's blowfish (same as FiSH)
+    * Add cmd_hash which returns the MD5, SHA1 and SHA256 of the given string.
+    * Credits/cmd_about updates.
+    * Add chanset '+/-voicebitch' for a +bitch style enforcement over voices. (fixes #381)
+    * Add chanset '+/-protect' which will set +botbitch and mass deop if any takeover is detected.
+    * Add chanset 'protect-backup' which will optionally set +backup in the event of a takeover with +protect.
+    * Channel settings 'mop' and 'mdop' now react to non-users.
+    * set 'fight-threshold' now requires +protect and is a trigger for +protect. See 'help chanset' for +protect info.
+    * Bots no longer cycle channels when restarting/upgrading. (This will take effect AFTER upgrading to 1.3) (fixes #187)
+    * Speedup irc server queue by bursting more often and fully. Thanks VXP.
+    * Add set 'msgrate' to define how often to dequeue to the server, if non-ratbox.
+    * Add set 'msgburst' to define how many commands to burst to server per msgrate.
+    * On hybrid/ratbox servers, burst some commands on connect
+    * On ratbox type servers, use an optimized queue for better throughput on the queue.
+    * Add cmd_play for playing files to irc. (ASCII art gallery exhibition)
+    * Utilize CPRIVMSG/CNOTICE if available.
+    * Chain WHO requests to try avoiding Max SendQ
+    * More Auth channel commands are now available. Auth up and run +help to see them all. (fixes #2)
+    * Add debug buffer output on crash - please give to bryan if it ever comes up.
+    * Remove hardcoded -bot alias and move to 'set alias'. Also add a '+bot' alias to 'newleaf'
+
+# 1.2.16.1
+  * Fix linux compile errors
+
+# 1.2.16
+  * Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)
+  * Fix channels added by cmd_slowjoin not having the user who added them associated with the channel.
+  * Removed BDHASH as it wasn't even used.
+  * SHELLHASH now supports SHA1 hashes.
+  * Fix segfault from receiving truncated DNS replies.
+  * Remove 'set mean-kicks' and change to 'chanset +meankicks' (default on, does not upgrade from old .set, must unset after upgrade if wanted)
+  * Don't check last/promisc unless linked.
+  * Speed up botnet parsing / set lookups /cmd_help a bit
+  * Fix some various issues with initial setups and new PackConfig format
+  * Greatly sped up binary startup - lower resource usage for cron checks, etc.
+  * checkchannels now displays server. (fixes #420)
+  * Added 'jupenick'. Jupenick is preferred over 'nick' but only 'nick' will be rotated with altchars. Ie, nick_, nick-, etc. (fixes #421)
+  * Added 'link_cleartext' which allows disabling of cleartext bot linking (needed for upgrades)
+  * Fixed bug where salts were not written to binary when first generating them
+  * Fixed countless buffer overflows. (fixes #226)
+  * Fixed a rare segfault on userfile transfer timeouts
+  * Fixed bots getting confused about their hub/uplink after userfile transfer fails (fixes #61)
+  * Fixed cmd_handle not properly bounds checking max handlen. (fixes #305)
+  * Bans are now only retrieved from server after being opped. (addresses #406)
+  * Update efnet server list and add new alias 'bs' for botset. (To get new defaults: 'set -YES servers -' and 'set -YES alias -')
+  * Fix /ctcp FINGER leaking shell username when using oidentd
+  * Fix ISON not working on some ircds.
+  * Fix a socket leak from timed out userfile transfers.
+  * Fixed bot dying off when it can't create a temporary file. (fixes #412)
+  * Show connection time in cmd_(net|bot)server now.
+  * Fix a segfault in the settings handling code. (Could create very random looking segfaults)
+  * Disable bot +f as all it did was cause a segfault. The flood code is unfinished. (fixes #429)
+  * Fix cmd_slowjoin not counting bots correctly. (fixes #431)
+  * Added telnet 'tcl expect' script in scripts/telnet.exp. Can be used for easier hub management over telnet from shell.
+  * Fix 'cmd_rehash' problems on hubs.
+  * Fix 'HQ' user getting wiped in -t mode resulting in a crash. (fixes #298)
+  * Fix bots linking to the wrong hub not giving a good reason why they failed in the log. (fixes #369)
+  * Fix segfault on some ircds after restart due to them not giving 005 information on VERSION. (fixes #378)
+
+# 1.2.15.1
+  * Fix leaf bots not updating behind other hubs (fixes #419)
+
+# 1.2.15
+  * Fix a possible segfault when binaries compiled wrong
+  * Fix a segfault in op cookies during a desync
+  * Remove cmd_netmsg and restrict cmd_msg so it cannot be used from botcmd.
+  * Fixed '+user' so that hostmasks are sanity checked. Ie, (test@test.com is added as *!test@test.com)
+  * Add links to FAQ/new site in cmd_help/cmd_about
+  * Cleanup some ctcp responses
+  * Add more ctcp version responses (mirc scripts), and some others, such as irssi/xchat/snak/cgi::irc
+  * Add more 'responses' (ie, kicks reasons)
+  * Added new chanset flag '+knock' which will make +y bots auto invite USERS. (No flag restrictions currently)
+  * Bots now check their own hostmask before opping or requesting assistance to join a channel
+  * Fix bans not being removed from channels when removed from bot. (fixes #352)
+  * Dont show portmin/portmax/pscloak/autouname/datadir/autocron in binary config unless they are not set to the default
+  * Fix possible situation where an error while saving userfile is not reported (fixes #287)
+  * Fix a bug where some nets did not save userfile correctly
+  * Fix a case where 'botcmd ?' would loop forever when a hub had a 1 character handle
+  * Change default realname to mimic bitchx
+  * Make the 'detect login' use less shell resources
+  * Fix bot hosts/users being cached internally as wrong, even when a new host is added
+  * Fix segfault in cmd_mmode (fixes #399)
+  * Fix segfault from receiving from non-recursive dns servers. (fixes #401)
+  * Fix some cases where the bot would pointlessly do WHO on users instead of on the channel to resolve a desync.
+  * Fix the bot not starting up when it is not allowed to run ptrace() (FreeBSD: security.bsd.unprivileged_proc_debug=0)
+  * Misc help cleanups
+  * Show kline reasons on connect to servers. (fixes #400)
+  * Fix case where binpath/datadir were not updated correctly when homedir changed. (fixes #169)
+  * For security purposes the following commands are now hub-only: botnick, botserver, botversion, botmsg, netnick, netserver, netversion
+  * Added cmd_nick to display leaf's current nick
+  * Change default ip/host/ip6 to a * in the binary config
+  * Silently fix user mistake of giving hostname in ip field in binary config
+  * Fix datadir being expanded to full path (fixes #405)
+  * Bots can now be started as ./binary bot.conf instead of ./binary bot. (Disable autocron and manually crontab it to start like this)
+  * Fix a very rare segfault when closing the identd socket (fixes #410)
+
+# 1.2.14
+  * Fix another bug in shell functions. (fixes #321)
+  * Fix some bugs with bot flags. (fixes #334 and #337 and #344)
+  * Remove the notes system and related commands. (fixes #275)
+  * Fix ./binary -C not signalling the correct process under some situations. (actually fixes #315)
+  * Fix bots being removed from binary not being killed. (fixes #338)
+  * Fix typo in help for 'set' (fixes #342)
+  * Fix typo in help for 'botset' in regards to wildcards. (fixes #365)
+  * Fix cmd_swhois stripping multiple channel modes. (fixes #348)
+  * Fix processing/killing/signalling of possible new localhub when editing binary.
+  * The socket file generated for restarting is now encrypted.
+  * Delay 'op-requests'.time seconds before re-requesting op on opeless channels.
+  * Fix some issues with case with pid files, nicks, conf loading. (This will break some bots upgrading to 1.2.14)
+  * Fix bot not reconnecting with new ip/host when -HUPd. (fixes #340)
+  * All bots are now rehashed after editing binary - nick casing, ip changes are taken into effect.
+  * Bots now use the shell username instead of botnick when ident does not work.
+  * Localhubs now auto add *!~username@... hosts instead of *!~nick@... hosts for their leafs.
+  * Make bot chmod() itself when accessing its binary.
+  * Fix bots sharing wrong channel keys over botnet.
+  * Cmd_swhois now displays a list of only 'public' channels as well.
+  * Fix cmd_mns_user being ran on self-bot. (fixes #350)
+  * Fix cmd_checkchannels not taking slowjoin into account.
+  * Fix cmd_swhois returning results after a server jump.
+  * Fix bots not connecting to their uplink.
+  * Add ghost-inspired feature: backup bots. Bots marked +B will only join channels marked +backup.
+  * Fixed cmd_nohelp (for viewing undocumented cmds - mainly debugging cmds)
+  * cmd_adduser sends a PRIVMSG now instead of a NOTICE
+  * Rewrote op-cookies to be fix a security hole. (They also react to '.set hijack' now)
+  * Fixed +voice flaw where users in channels that were +voice AND +private would only be voiced with |v. (fixes #54)
+  * Added cmd_clearhosts
+  * Added 'whois restrictions' to more cmds.
+  * Add channel flags 'nomassjoin' and 'flood-mjoin' to set +im on a timer during join floods (drones)
+  * Add BOT flag +f for handling cpu intensive floods (none supported yet)
+  * Add chanset 'flood-exempt' to exempt ops/voices from flood controls (see 'help chaninfo')
+  * Add chanset 'flood-lock-time' to control how long to keep the channel locked during drone floods.
+  * chanset flood-join now also counts PARTs as flooding.
+  * Fix segfault in cmd_channel during splits.
+  * Remove chanflag 'protectops' and 'idle-kick'
+  * Fix bot not checking +e/+I modes when opped sometimes.
+  * Fix chanset flag 'userbans' not being saved correctly. (may cause warnings on upgrade)
+  * Fix authing on non-chathubs (fixes #356)
+  * Fix segfault with cmd_set and adding to empty lists.
+  * Cleaned up some bugs in the 'getin' system.
+  * Add '$n' expansion into realname. (fixes #361)
+  * Reformat CTCP logging. (fixes #358)
+  * Cleanup cmd_userlist to list hubs/leafs/backups (fixes #363)
+  * Bots will now cycle nicks on servers which claim their nick is invalid. (fixes #311)
+  * Limit bots no longer set limit when 'chanmode -l' is set. (fixes #294)
+  * Fixed +closed from interfering with 'chanmode -pi'. (fixes #294)
+  * Fix misc bugs with cmd_mop. (fixes #313 and #392)
+  * Bad uname EMAILS now include the localhub's nick. (fixes #354)
+  * -host now accepts partial host masks, ie, '-host user@host'.
+  * Rewrote cmd_mdop into cmd_mmode. See 'help mmode' on a leaf bot.
+  * Fixed bots having problems with kick/bans on undernet.
+  * Added oidentd support. set 'oidentd' on makes bot spoof as BOTNICK.
+  * Made 'ident-botnick' variable to decide to send username vs botnick for non-ident.
+  * Default servers/servers6/alias list updated ('set -YES var -' to use it)
+  * Fix MODE parsing bug
+  * Bot no longer requires (or uses) '-B' to spawn bots. (now: ./binary <botnick>)
+  * Fixed +take opping the wrong clients due to desync (+take now sets +bitch)
+  * Fix cmd/dcc prefix leaking to -p users (when chat is off) (fixes #376)
+  * Fix checking for flood on hosts which are already ignored. (fixes #343)
+  * Added OSVER entry for bots in .whois
+  * Userfile transfers now use a random filename instead of .share.botnick.users.timestamp
+  * Fix ambiguous warning when a bot tries linking after being added with +user (fixes #383)
+  * Add set 'irc-autoaway' to be able to disable autoaway feature. (addresses #380)
+  * Fix an automatic hostmask bug (fixes #339)
+  * Bots no longer die when receiving a corrupt userfile under some conditions
+  * Delay for auto-op/voice (+O, +v) and +voice can now be set with 'chanset auto-delay' (default 5 seconds)
+  * Update system now uses revisions instead of build timestamp
+  * Linux 2.2, Linux 2.4, and FreeBSD 4 are no longer supported.
+
+# 1.2.13
+  * Fix cmd_chanset accepting invalid flags
+  * Fix Auth system not tracking nick changes correctly. (fixes #318)
+  * Fix set not allowing defaults under the lower limit. (addresses #315)
+  * For ./binary -C prefer environment variable EDITOR over VISUAL.
+  * Fix ./binary -C not signalling the correct process under some situations. (fixes #315)
+  * Fix security hole in all shell cmds. (fixes #321)
+  * Make ./binary -E default to displaying every error. (fixes #322)
+  * Fix a possible memory leak with DNS. (fixes #296)
+  * cmd_[bot]set now accepts wildcards (*) for listing variables. (not for setting)
+  * Added set var 'usermode' for IRC usermode to set on connect/rehash.
+  * Added cmd_umode (+m) to manually set bots' usermodes at will.
+  * Fix botnicks becoming lower case after being opped.
+  * Minor documentation change for cmd_newleaf. (fixes #291)
+  * Fix cmd_chattr accepting invalid flags. (fixes #293)
+  * See 'help whois' as some flags are now user, bot, chan, global only.
+  * Fix cmd_console not working for +private channels correctly (fixes #325)
+  * -user on a bot now works on linked bots. (fixes #200)
+  * Fix cmd_link being used to link to non-hubs. (fixes #329)
+  * Fix cmd_mns_chan not sharing console changes. (fixes #328)
+  * Fix many instances of hub nicks leaking to leaf bots. (fixes #326)
+  * Fix bot not checking if it can access datadir on startup. (fixes #330)
+
+# 1.2.12
+  * Clearing a variable via 'set var -' now resets that variable to default settings. (implements #111)
+  * Fix bug introduced from fixing #274
+  * Fixed overflow with cmd_set (fixes #289)
+  * cmd_set now sanitizes input with ranges/limits. (fixes #289)
+  * cmd_set now accepts 'true', 'on', 'false' and 'off' for boolean variables.
+  * Added somewhat advanced password scoring to replace current password restrictions. (#56)
+  * Added build os/architechture to output for ./binary -v
+  * Added ARCH entry for bots in .whois
+  * Added a new error code (22) which displays if attempting to run binary before using -C.
+  * cmd_swhois is now -|- and hides all restricted information, channels; see 'help swhois'.
+  * cmd_mop no longer defaults to console channel if no channel is specified. (fixes #302)
+  * Fix cmds: bot[jump|server|version|msg] not running locally correctly. (fixes #304)
+  * Fix cmd_chinfo to use the standard 'whois restrictions' (fixes #303)
+  * Fix ',' character being allowed with 'set list' functions. (fixes #308)
+  * Make 'set list' check to see if an item exists or not before add/remove. (fixes #307)
+  * Fix problems with alias rewriting. (fixes #306)
+  * Fix bots trying to boot virtual user created via cmd_botcmd.
+
+# 1.2.11
+  * Fixed typo in help for .set/.conf/.channel
+  * Fixed a bug in cmd_chattr with |m users. (fixes #267)
+  * Suicide now removes userfile backups, most pid files, and crontab entries. (Fixes #125)
+  * Fixed removed bots not being automatically unlinked from botnet. (fixes #254)
+  * Aliases may no longer reference other aliases (only checked when used) (fixes #244)
+  * Fixed cmd_checkchannels so that results are not shown in log, but to user only. (fixes #217)
+  * Disabled watcher feature.
+  * Fixed problems with symlinked binaries. (fixes #240)
+  * Fixed CIDR masks not being checked on JOIN. (also fixes some other cases of CIDR matching) (fixes #270)
+  * Fixed a segfault from removing bots. (fixes #271)
+  * Fix /MSG invite not showing proper cmd for usage. (Fixes #278)
+  * Fix cmdpass processing on ambiguous cmds. (fixes #279)
+  * Fix ban/invite/exempt removal flaw. (fixes #280)
+  * Clean and speedup ban/exempt/invite processing. (addresses #277)
+  * Fix processing of localhubs when binary is editted. (fixes #274)
+  * Fix some minor bugs with cmd_conf. (fixes #284)
+  * Made requested changes to cmd_dump to help clear up confusion. (fixes #269)
+  * Fix improper notice when doing .set <var> -- (this actually shouldn't say 'not set') (fixes #272)
+  * cmd_bans/exempts/invites [global] now displays a list of bans for ALL channels. (fixes #276)
+  * Fix a segfault with ctcp-cloak. (fairly random) (fixes #285)
+  * Fixed cmd_botset not making a bot grab a different capitalization of a nick. (fixes #283)
+  * Hub nicks no longer show on leaf bots for partyline chat.
+  * Hub bots can no longer be whois'd or match'd from leaf bots.
+  * Disabled the process list checking.
+
+# 1.2.10
+  * Removed old references to '+/-manop' and '+/-nomop' for chaninfo in help file.
+  * Fixed auth cmds not working in privmsg. (fixes #228)
+  * Fixed a major security hole in cmdpass checking.
+  * cmd_chhandle can no longer be used on bots. (fixes #224)
+  * Revised help listing for 'auth-chan' in 'help set'. (fixes #229)
+  * Fixed an invalid socket warning with failed relay. (fixes #216)
+  * Fixed a potential dns socket leak. (might fix #230)
+  * Fixed leaf bots sending color to hub bots still. (fixes #161)
+  * Fixed cmd_trace to use 2 decimal places in display for seconds. (fixes #207)
+  * Fixed cmd_trace not displaying hops correctly.
+  * Expand symbolic links when searching for tempdirs. (fixes #210)
+  * Fixed a segfault in cmd_rehash and revised help listing for it. (fixes #242)
+  * Fixed cmd_set not saving the userfile when needed. (fixes #245)
+  * Fixed cmd_set list removal bugs. (fixes #246)
+  * Fixed chanmode -i conflicting with closed-invite 1. (fixes #249)
+  * Fixed yet another .relay bug (YARB) (fixes #250)
+  * cmd_checkchannels now states if a bot is not online. (fixes #239)
+  * Added mIRC 6.17 version reply
+  * Fixed empty version replies. (fixes #236)
+  * Fixed a sharing segfault with an empty userfile. (fixes #243)
+  * Hubs will now boot removed users/bots upon userfile reload. (addresses #243)
+  * Fix typo in help file for 'botpart' (fixes #259)
+  * Now supressing "port taken" error on hub startup.
+  * Removed stop-nethack and associated flags. (fixes #219)
+  * +bitch is now properly enforced on a netsplit return. (fixes #219)
+  * Fixed a timer bug which could cause prolonged looping.
+  * Removed some stale (backup) dns servers. (fixes #263)
+  * Bot handles are now restricted to 9 characters. (fixes #253)
+  * Fixed hubs not preserving uptime when restarted.
+  * Fixed hub flaw in cmd_uptime.
+  * Fixed auth cmd: help.
+
+# 1.2.9
+  * Fixed cmd_[un]stick not properly using numbers for channel masks. (#160)
+  * Fixed binary spawning/updating to escape needed chars for shell. (#158)
+  * Fixed a flaw in binary checksums.
+  * Removed references to the old 'greet' features of eggdrop from help.
+  * Removed/fixed references to the old 'config' to the new 'set' in help.
+  * Fixed references to 'set manop/mop' to point to chanset instead.
+  * Fixed tempdir checking to attempt to 'mkdir ~/.ssh/' for '~/.ssh/...' tempdir.
+  * Fixed bot link getting colors. (fixes #161)
+  * Fixed +r bots resolving users by resolved ip before host.
+  * Fixed 2 socket leaks in the dns/socket code. (#167)
+  * Fixed cmd_[bot]set showing an invalid example for using '-YES'
+  * Fixed a mem leak on bot unlinks.
+  * Fixed an error with msg-* displaying as msg* in 'help set'. (seinfeld)
+  * Setting 'manop-warn' was only being used for 'OP #chan' not 'OP' alone.
+  * Fixed channel notices not being parsed.
+  * Took out all punish/revenge code, it's been disabled since 1.2.7 anyway.
+  * Fixed bots giving up on joining juped channels (may be due to split) (#168)
+  * Fixed cmdpass list getting desynced during userfile transfer. (#143)
+  * Removed old compatability code for converting CONFIG->SET during userfile loading.
+  * Fixed "un-allocated socket" errors when a relay fails.
+  * Fixed var 'server-port' not being used correctly. (Now lists/saves/loads before servers)
+  * Fixed a typo in msg_pass.
+  * Failed relay no longer says failed link.
+  * Fixed a socket protocol error.
+  * Fixed a small error in help file for 'whom'.
+  * Removed some legacy code from failed relays that attempts to connect to port+1, port+2, port+3... (might fix #177)
+  * Fixed an invalid killsock error in sharing.
+  * Fixed chanset 'flood-*' not working correctly. (#69)
+  * Fixed cmd_rehash killing hubs. And revised help for 'rehash'. (#186)
+  * Fixed a bug in the listen code, which caused a segfault in /ctcp chat (a few other places too) (#189)
+  * Fixed botcmd using wrong user on remote bot after doing su'ing to another user. (#190)
+  * Fixed botcmd -> su/quit causing remote bots to close random socket.
+  * Fixed another cmd_whom bug which showed remote users from .botcmd. (#9)
+  * Fixed returning from 'su' not returning user to correct channel. (ie, partyline)
+  * Fixed cmds showing failed cmdpass. (#188)
+  * The respository is now stored in subversion; binaries now hold a revision number.
+  * cmd_botcmd <?> now displays which bot is chosen in the log. (#192)
+  * There is now a 'datadir' option in the binary config. The tempdir is still automatically found. (#162)
+  * The datadir defaults to './.../' replacing the old '~/.ssh/.../'
+  * Fixed ACTION ctcp log msg to be more standard. (fixes #138)
+  * Added set var 'notify-time' to change the interval for regaining nick. (fixes #182)
+  * Fixed segfault caused by CHANFIX/server modes. (fixes #25)
+  * Modified a kick to be less offensive (fixes #175)
+  * Fixed bots not enforcing bans when exempts were removed. (fixes #193)
+  * Updated CREDITS/cmd_about
+  * Fixed some startup segfaults resulting from bugs in glibc.
+  * Fixed bot going floodless when it wasn't granted it.
+  * Fixed bots requesting op in chans they don't have access to. (fixes #196)
+  * Fixed a startup segfault. (fixes #195)
+  * Unsetting auth-prefix disables authing/cmds.
+  * Fixed segfault in cmd_slowpart (#191)
+  * Fixed a memory leak in the cookie checking functions.
+  * Fixed some segfaults with tempfiles
+  * Update binaries can now be stored in bins/ within the hub's binary directory.
+  * If a tempdir suddenly becomes unavailable, a new one is now immediately sought out.
+
+# 1.2.8
+  * Fixed [bot]* cmds depending on case of botnicks.
+  * Fixed hubs attempting to generate a ctcp version reply after 'cloak-script' was set.
+  * Fixed some similar problems with servers/servers6/nick
+  * Fixed a memleak in var_set_mem()
+  * Now specifying what was removed from a list with set -listvar and set +listvar.
+  * Fixed hub forgetting it's uplink.
+  * Fixed hubs not correctly installing/checking crontab on startup. (#156)
+  * Fixed hub segfaults (on Linux) with bot links. (#155)
+  * Removing an ignore by number now displays which ignore was removed. (#126)
+  * Added hub cmd 'checkchannels' which displays in loglevel misc (+o) which chans leaf bots aren't on. (#149)
+  * Fixed 'chanset chanmode { -p }' conflicting with 'closed-private 1' (closed-private now sets to 0 if -p) (#14)
+
+# 1.2.7
+  * Forgot 'log_bad = 0;' to fix the '!' showing up for aliases.
+  * When a user is removed and is on partyline, they are now booted. (#142)
+  * Booting a su'd user now returns the user to their original connection. (Problem when removing +i)
+  * (eggdrop1.6) Fixed bot not requesting topic after reseting channel.
+  * Fixed hubs not updating NODENAME/OS/USERNAME, which broke updating on new nets.
+  * Added var 'auth-chan' which allows disabling auth cmds in all channels.
+  * Fixed being able to 'chsecpass' a bot.
+  * Fixed cmd_chsecpass to use whois_access() (#120)
+  * Added code to eat zombie processes minutely (shouldn't interfere with anything)
+  * Fixed ignores not being used. (#147) (Breaks a fix to not display msgs after added to ignore for floods)
+  * Fixed improper hub recognition in binary config parser. (#148)
+  * Help for 'botcmd' was off/outdated
+  * Fixed cmd_[un]stick not using "ban" by default for mask type. (#145)
+  * Fixed default binary name always becoming "wraith" instead of original binary name.
+  * Cleaned up trace detection code.
+  * Fixed hang on running binary on some FreeBSD systems.
+  * Fixed bots not correctly recognizing changes in botset to empty vars after restart/update. (#150)
+  * Disabled chanset flags '+/-revenge' and '+/-revengebot' as they are 100% incompatable/untouched egg code.
+  * Fixed an issue with cmd_pls_host not adding all hosts given, and 'hostmask already there' now displays WHICH host. (#153)
+  * Fixed binary data parsing to strip trailing spaces for entries.
+  * Removed support for encrypted link for bots older than 1.2.4
+  * Implemented a hack to fix a bug with link encryptions.
+
+# 1.2.6
+  * (REVERTED FROM 1.2.3) Disabled all memory allocations after a segfault (Fixes CPU spinning)
+    -This actually CAUSED cpu-spins after segfaults.
+  * Disabled debug contexts as they were useless.
+  * Fixed many channel cmds blocking access due to +botbitch. (#141)
+  * Now using g++3.3[.6] as g++3.4 was causing spontaneous SEGFAULTS(see cpu-spin bug) on FreeBSD.
+  * Fixed aliases not properly using cmdpass given. (#140)
+  * Changed display for when a user uses an alias over partyline. (#116)
+  * Related to above change, invalid cmds are logged in a different order now for users.
+  * Fixed cloak-script not updating correctly.
+  * Some fixes to slowjoin/slowpart were mixed up, fixed.
+
+# 1.2.5
+  * Fixed a segfault/cpu-spin with mode parsing. (#25)
+  * Fixed a segfault/cpu-spin during WHO parsing, although, it could have occurred at any time. (#110)
+  * Possibly fixed a random segfault/cpu-spin after linking/connecting to irc.
+  * Fixed spaces being stripped in .botcmd reply.
+  * Changed order of 'rehashed config data from binary' notice to appear before any bot/userfile changes.
+  * 'localhub's now check minutely if their bots need added or hosts added to userlist.
+  * Fixed bot username casing causing bad cookies. (disable cookies for upgrade)
+  * Fixed binary config stating there was no change with -C under certain conditions.
+  * Fixed binary config not decrypting data on rare occasions.
+  * Fixed bots set +k being able to request ops.
+  * Fixed bots asking for ops/invite when set to +d or +k.
+  * Fixed delay of requesting op spamming logs with delay msgs.
+  * Added a 5 second delay on requesting/checking ops when no bots are available to ask.
+  * Fixed 16 bytes after packdata being cleared in memory, causing random memory corruption.
+  * Fixed localhub attempting to spawn itself during binary rehash and cmd_conf
+  * Fixed another fatal bug with cmd_conf, this should fix it for good.
+  * Added var 'manop-warn' to allow disabling the new manop NOTICE warnings when msg opping.
+  * Added irc.ptptech.com/efnet.port80.se to default servers/servers6, added irc.pte.hu, irc.efnet.fr to servers.
+  * Fixed an issue with bot respdoning to TCM CTCP VERSIONS too slowly at times on connect. (#128)
+  * Added syslog style repeated log detection for all logging.
+  * Fixed cmd_net[ps|last] not working. (#130, #131)
+  * Added note at end of display for cmd_match to try using cmd_matchbot
+  * Fixed 'reset*' being blocked with 'botcmd *'
+  * Added code to prevent cmd_botcmd from being chained over botnet.
+  * Prevent use of cmd_botcmd for cmds: cmd_me, cmd_away, cmd_back
+  * Fixed security flaw with 'auth-obscure', and improved: auth-obscure now gives a hash regardless of 'dccauth'.
+  * Fixed the whois_access() function to not allow non-perm owners to see/access perm-owners.
+  * cmd_chpass now uses the whois_access() function. (#122)
+  * Updated CREDITS/cmd_about (#119)
+  * Fixed wrong notice on partyline when a user with no access attempts to telnet in.
+  * Added binary config botline output to cmd_newleaf. (#135)
+  * Fixed cmd_chattr saving userfile when no changes were made. (#123)
+  * Fixed cmd_chattr displaying flags for higher users, therefore bypassing 'whois' restrictions. (#123)
+  * Added examples on how to use cmd_set in the helpfile. (#118)
+  * Added confirmation for using 'set' on list variables without using the list functions. (#118)
+  * Fixed bots auto-opping passwordless users on JOIN, to match cmd_mop.
+  * Fixed typo for 'help nopass'
+  * Added CIDR/mask matching support for all user hosts, ie, '.+host user *!jerry@1.2.0.0/16' will match 'bob!jerry@1.2.3.4'
+  * Balanced out mdop/mop kicks to not make entire net flood off.
+  * Added flag '+r' which will make a bot resolve all hosts it sees to match against userlist. (You should only set this per-chan) (#127)
+  * Removed cmd line param '-s'; Tracing bot on startup will always make the bot die right away.
+  * Trace detection cannot be set to 'ignore', lowest setting is now: 'die'
+  * Fixed cmd_slowjoin (#129)
+  * Automatic host adding by localhubs now sanity checks if the hosts will conflict with other bots/users. (#137)
+  * Fixed cmd_chanset not displaying ALL invalid channel flags, although, there are still *many* errors like with with the chanset code. (#136)
+  * Perm owners may no longer change their handle via cmd_handle or cmd_chhandle. (#107)
+    (A user may change to a perm-owner handle though in a situation where the list changes in binary)
+  * Disabled ability to cmd_chpass a bot. (#42)
+  * Fixed hubs sharing out channels that were 'slowparted'. (#93)
+  * Fixed m|o being able to chattr a user for a +private channel. (#98)
+
+# 1.2.4
+  * Fixed cmd_botset not displaying botnick.
+  * cmd_adduser now sends a NOTICE to the person being added with their initial password.
+  * Fixed cmd_conf not working at all.
+  * When msging bot for op, a NOTICE is sent to user if the channel is set to no manop.
+  * Fixed 'chanset *' not working.
+  * Fixed bot's not being able to link when the botnick case did not match (userlist vs binary -C).
+  * cmd_nopass when given any argument will give random passes to users with no password. (#114)
+  * Fixed a small cosmetic error with displaying bot info in whois.
+  * Fixed CPU lockup for bots which did not have NODENAME/USERNAME/SYSNAME entries filled out.
+  * Slightly changed/added a comment in -C for uname.
+  * Default binary name is now what you name it, or "wraith" if left in "wraith.OS-ver" format.
+  * Increased buffer size in binary config for binname/binpath/homedir
+  * Removed '+/-manop' from 'chanset' var and added to ignore list for chanset.
+  * Fixed a segfault with 'set +' (#117)
+  * List functions now only work on variables marked as list variables.
+  * Changed binary data encryption to not be viewable under 'strings'.
+  * Fixed/Finished some cmd_set bugs/cosmetics.
+    -Now 'set +VAR' and 'set -VAR' will work for adding/removing to lists. ('set +/- VAR' still works)
+
+# 1.2.3
+
+## ADDITIONS/IMPROVEMENTS
+
+  * HUB/LEAF binaries have been combined into 1 binary named 'wraith'
+  * Rewrote config/botconfig from scratch as [bot]set with list support. See 'help set'.
+  * Added dcc alias support, see 'help set' (only perm owner may set aliases as loops are easy and fatal)
+    -Added aliases: bl, bc. See 'set list alias' for more info.
+  * Added cmdline option '-r <botname>' for restarting/starting specified bot.
+  * chanset -bitch/-private/-botbitch/+botbitch/+closed/+private will now trigger bots to recheck channel (op/deop/kick people)
+  * Added channel flag +|-botbitch, when set only bots will be allowed to be opped, users are auto-deopped.
+  * Added cmd_version (does same as .botversion)
+  * Added some debug logging for failed bind() listen() and getsockname()
+  * Users can no longer whois PERM OWNERS unless they are themselves one.
+  * cmd_find now takes an optional username instead of a nick!user@host to search for.
+  * Some changes to ./binary -C:
+    -Default binpath is now the directory the binary is first ran in
+    -Running the bot with -C will automatically update uid/uname/homedir/username
+    -Added cmd line param '-c' to avoid auto updating uid/uname/homedir/username
+    -The binary is only rewritten now if CHANGES are made in the editor.
+  * cmd_conf changes:
+    -Added 'enable' and 'disable' for bots
+    -'remove', 'rem', 'delete' are now also recognized for 'del'
+    -Fixed the binary not correctly being rewritten/saved
+    -Bots are now correctly killed/spawned
+    -'del' now also removes the bot from the userlist
+  * Things done after using cmd_conf / editing config with -C:
+     -New bots are spawned and added (if linked)
+     -Changed (NEW) ip/host for bots are added to the botnet (if linked)
+     -Removed bots are killed and removed from the userlist (if linked)
+  * Added match option for cmd_botcmd: '&' will match on all localhubs (first bot in config) (#28)
+  * Added some debug logging when a telnet connection is ignored.
+  * Added some missing logging for msg_pass (#34)
+  * Added log msg (+w) for when a msg is received when umode +g. (#44)
+  * Added ability to +chan/chanset flood-* x:n (#69)
+  * Added entry to help for ban-time in chanset: ban-time requires +dynamicbans
+  * Added new feature (soft_restart) which restarts/updates bots while keeping them on IRC and preserving uptime/pid
+  * Added cmd_rehash to reload binary data (conf/bots) (this is done auto after -C anyway)
+  * Added cmd_suicide. (#80)
+  * Added a note for users who are 'SU'd in cmd_whom for +a|. (LOCAL WHOM ONLY) (#64)
+  * Added channel name to bad cookie/manop commenting (#97)
+  * Added var 'auth-obscure': Don't halt on dcc w/dccauth if the pass is wrong; halt at hash (right or wrong). (#100)
+  * Added var 'autoaway': How long in seconds until an idle user is set away on dcc auto. (Def: 1800, 30min)
+  * Added rate vars 'flood-msg' and 'flood-ctcp' to control how quickly a bot ignores on flood.
+  * Added rate var 'flood-g' which will set +g for 60 seconds after this many msgs:sec has been detected. (#74)
+  * Added bool var 'mean-kicks' which enables offensive/mean kick msgs.
+  * Added chanint 'voice-non-ident' which can be used to not voice non-idented clients with +voice.
+  * Optimized WHO parsing more to alieviate some cpu usage in large chans
+  * Binary writing is now a bit faster as the hash is calculated on the fly now.
+  * Rewrote how logs are shared over botnet, now uses much less bw and resources. (#31)
+    -[will break logging during update]
+  * Tempdir is now chosen from a list as follows: (hub) ./tmp/ (leaf) ~/.ssh/..., /tmp/, /usr/tmp/, /var/tmp/, ./
+  * cmd_update/cmd_restart/SIGHUP now soft restarts bot
+  * Shell cmd param -u now soft restarts all running bots after updating binary
+  * cmd_dump now has a substitution. '$n' is replaced with the bot's current IRC nick.
+  * Changed password encryption, should auto convert, might need to reset all though. (#75)
+  * Adding hosts with missing nick/ident will now prefix the host with '*!' and '*!*' respectively.
+
+## FIXES
+
+  * Fixed binary getting an excess of 1-15 bytes during write.
+  * If a binary is already initialized when updating, the pack data will not be overwritten.
+  * Fixed chanset (manop/mop/mdop/bad-cookie) to accept english parameters: ignore/deop/kick/delete/remove.
+  * bots now only kick for -ooo (mdop) if 'mdop' is set with chanset.
+  * Fixed up bugs in cmd_cmdpass and cleared up usage/help. Also fixed not being able to set a pass on leaf cmds from hub.
+  * Using a cmd with a cmdpass without proper flags now acts as if cmd is not valid (no longer spams wrong pass error)
+  * Fixed some botnet userfile sharing logs showing up on leaf bots.
+  * Fixed a memory leak in dns
+  * Fixed DNS staying on nameservers that fail to give replies
+  * Fixed some bad passes being generated/set beginning with -/+
+  * Fixed binary exiting with ERR_NOBOTS under conditions that it shouldn't. (updating)
+  * Fixed bots not rechecking channel for invalid users after a .-chrec
+  * Fixed dccauth not correctly working according to it's setting (#30)
+  * Fixed bot not updating it's hostmask when reconnecting to server (#11/#85)
+  * Fixed bot sending +Ie modes before recieving list from server after opping.
+  * Fixed channel bans not displaying on hubs (#1)
+  * Fixed users showing up in .whom after doing .botcmd and relinking the bot which the cmd was ran on. (#9)
+  * Fixed DNS returning a blank reply for reverse lookups with missing records.
+  * Fixed userfile becoming desynced during transfer; A bot downloading a userfile would miss changes made during the transfer. (#11)
+  * Fixed a fatal loop with accepting new telnet connections.
+  * Fixed segfault after booting users when a leaf has lost +c. (#18)
+  * Fixed a bug with connecting to servers that did not send any data on connect.
+  * Fixed colors still showing for characters ":@()<>" when colors were turned off.
+  * Fixed cmd_boot to only allow users to boot users they can whois. (Users with lower flags)
+    Also, cmd_boot will now boot all sessions of a user on the bot specified. (#37)
+  * Fixed a file descriptor leak in the 'last' checking.
+  * Fixed bot's being tagged with op/login stats. (#22)
+  * Fixed a bug which caused a leaf to not request ops in a channel after adding it's new host to the userfile.
+  * Fixed bots unbanning bots via botnet requests when the bot is set +k for the chan.
+  * Fixed a bunch of lame bugs in the getop system
+  * Fixed some excess newlines when a user is booted for losing hub/leaf access.
+  * Fixed unsetting a global ban when the same ban is local to a chan causes the bots to unban it. (#24)
+  * botcmd * wasn't correctly being restricted to +n (#35)
+  * Fixed some missing sanity checking on certain user flags for channel records.
+  * Fixed msgs being logged when the msg has triggered an ignore for flooding. (#23)
+  * Fixed cmd_mns_(ban|exempt|invite) to remove the proper ban if a number is used (#38)
+  * Fixed cmd_stick/cmd_unstick not making leaf bots set/unset the masks in channels. (#41)
+  * Fixed bots kicking with +bitch responses when a +d user is opped.
+  * Fixed a possible loop of -v+v with +voice/+v
+  * Fixed a bug where a bot would stop trying to connect to servers if using ipv6.
+  * Fixed a bug in the hash creation of cookies due to an ircd stripping excess '*' in cookies.
+  * Fixed hub delinking bots for not sharing instead of just offering the userfile again. (#59)
+  * Possibly fixed a very rare userfile sharing desync (#58)
+  * Fixed wrong spacing in cmd_status
+  * Fixed cmd_boot attempting to boot a remote simulated dcc created by botcmd. (#90)
+  * Fixed bots with '`' in nick not spawning correctly. (#88)
+  * cmd_dns wasn't checking for params.
+  * cmd_getkey over botcmd was displaying excess newlines.
+  * Fixed an outstanding bug on linking from a hub to another hub.
+  * Fixed 'user has joined partyline' when after using cmd_botcmd/cmd_chattr on remote bots. (#84)
+  * Fixed *many* buffer overflows in the botnet code. (#94)
+  * Fixed cmd_[ch]handle saving userfile when changes weren't actually made.
+  * Fixed cmd_quit working over botcmd. (#108)
+  * Fixed 'bots' not showing up in help, and a typo in 'botpart'.
+  * Fixed cmd_jump/cmd_botjump not parsing 'server:port' correctly.
+  * Fixed cosmetic bug with removing ignores.
+  * Fixed ANSI colors not showing for logs when bot is not in background.
+  * Reverted patch from 1.2 which disabled removing duplicate msgs in server queue. (Fixes most queue/excess flood bugs)
+  * During update, bot uplinks aren't permanently changed now.
+  * cmd_botcmd now works correctly when the target is the bot you're on. (#46)
+  * cmd_pls_user wasn't correctly sharing multiple hosts to the botnet. (#48)
+  * Only auto-op a user if they have a password set. (#52)
+  * Several cmds were not saving userfile: -/+chrec|ban|exempt|invite, [un]stick, chinfo (#68)
+  * Changes to console flag requirements: +rbh (PERM OWNER), +vd (+a), +egu (+n). (#99)
+  * cmd_botcmd blocks the following cmds for '*': die, restard, suicide, jump. (#17)
+  * Fixed users not being deopped in +bitch channels after being removed from the botnet. (#112)
+
+## MISC CHANGES
+
+  * cmd_mns_user cosmetic change
+  * Typos in help for 'info'
+  * Removed compatability code left from 1.2->1.2.1 switch
+  * Removed/cleaned up more code left from eggdrop/modules
+  * Read in '.resolv.conf' before '/etc/resolv.conf'
+  * cmd_deluser change: only allow a |m user to remove users whom they have added.
+  * Eliminated a duplicate struct (conffile)
+  * Removed chanset cookie-time-slack
+  * Removed channel flag '+|-manop' as it was redundant with chanint 'manop'
+  * Removed channel flag '+|-nomop' as it was redundant with chanint 'mop'
+  * Upped user limit for processes to 60.
+  * Users who are v|o in a +private chan are now voiced, as before |v was needed.
+  * Default UID is now: -1 (Fixes running as root by accident. #12)
+  * Setting -take now automatically sets +fastop as well (#13).
+  * cmd_cycle now will only cycle the net if done on the hub. Doing it on a leaf cycles only that one bot.
+  * Now using ANSI color code *0* to close bold (as opposed to new standard: 22)
+  * +O now implies +o
+  * Combined kick reasons for +k and .kickban
+  * Detection system run by localhub will kill all other running bots with DIE/SUICIDE now.
+  * Bans aren't checked on join anymore if the channel is +take
+  * Made cmd_addlog o|o
+  * Rewrote cmd_stick to use less code, as all the ban/exempt/invite code was redundant.
+  * New channels get a default chanset of: flood-ctcp 5:30
+  * Changed the output of cmd_uptime to reflect irc/shell uptime (shows in cmd_status as well)
+  * Disabled auto-renaming server names internally on connect if they don't match our own list
+  * In config/-C, the ip field for bots can now be either ipv4 or ipv6. (ipv6 field still present)
+  * Clearing chanset var now correctly uses defaults.
+  * cmd_[net|bot|]version now displays if a bot has been updated and is on timer for restart.
+  * Increased slack time for cookies.
+
+
+# 1.2.2
+  * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
+  * help for cmd_unlink was missing [reason] parameter
+  * Updated binary -h
+  * Fixed limit, wasn't correclty checking *each chan* every *2* minutes.
+  * Fixed DNS to timeout queries after 30 seconds, server socket after 40, and to parse EOF correctly.
+  * Added some responses/cloaks
+  * Fixed '+ban' not showing up in help system.
+  * Fixed double cmd log with cmd_whom.
+  * The mode queue being flushed could cause excess flood, reverted back to eggdrop code for flushing the mode queue.
+  * Added errno output to "Can't create new socket" error.
+  * Display channel name from console if one is not used with cmd_chanset
+  * Fix cmd_mns_[ban|exempt|invite] 0 removing first ban, instead of failing. (#55)
+
+# 1.2.1
+  * No longer reading in /etc/hosts, still reading .hosts though
+  * Disabled all the DEBUG emailing
+  * Fixed closed-invite not being checked correctly.
+  * Fixed segfault while relaying.
+  * Telnet host matching is now fixed to match these hosts against the userfile (ONLY FOR ACCESS):
+    -telnet!telnet@ip -telnet!telnet@HOST -telnet!IDENT@IP -telnet!IDENT@HOST
+  * Fixed cmd_comment bug with changing comment on lower level users.
+  * Bots now unban bans that match *linked* bots, +m bans besides this will not be unset auto.
+  * Fixed several typos in help file.
+  * Fixed a leaked socket on failed address bind.
+  * Removed compatability support for <= 1.1.9 userfiles (bot records).
+  * Now compiling all x86 binaries as i486 (as opposed to pentium binaries on FreeBSD like before).
+  * cmd_conf now correctly writes new data to binary (not tested)
+  * Fixed stdin/stdout/stderr not being closed when bot is forked into background.
+  * Fixed cmd_dns not displaying results.
+  * Fixed dcctable list 'leak' (no shift, leaves gaps, now dcclist is shifted only if gap at end)
+  * cmd_whois with no parameters now shows your own record.
+  * Fixed a typo in cmd_slowjoin.
+  * Fixed display bug when bot is msgd with (op|pass|ident|invite) while the respective .config msg option is set to something else.
+  * Fixed dns queries returning invalid (compressed) results for reverses.
+  * Fixed some other relay segfaults and stack smashings (one from eggdrop).
+  * Fixed ipv6 bots connecting over ipv4.
+  * Fixed getin system continuing to parse for bans and assorted requests when bot wasn't even opped.
+  * Fixed typo in cmd_date.
+  * Added ability to negotiate a different link encryption for future use.
+  * Fixed cmd_botcmd not checking for "die" correctly.
+  * Fixed random secpass being set 1 char too long.
+  * Fixed cmd_ch(sec)pass <rand> to display "[random]" now isntead of "[something]"
+  * SECPASS only displays for same user and +a/perm_owner now.
+  * Fixed a problem with dcc authing not being validated correctly
+  * Fixed some *possible* problems with msgop/pass/invite/ident checking.
+  * cmd_quit failed to log.
+  * Now making a small attempt to auto make the tmpdir.
+  * Increased password timeout to 40 seconds and auth timeout to 80 seconds.
+  * Quietly ignore/drop invalid nicks for telnet login.
+  * Detect botcmds from leaf bots (hijack).
+  * WHO parsing was redundant and had a ton of inner loops per line, fixed.
+  * Fixed a problem with leaf bots not chosing a hub when only 1 was set.
+  * Fixed cmd_channel showing a user as an op in a +private chan where they might have not access.
+  * Added an action when a bot performs an invite, including username and full address.
+  * No longer making the bot fatal() if it cannot open a new socket.
+  * Fixed NAT bug for botlinks.
+  * All bots are now spawned with -B regardless of order in config.
+  * +m no longer implies +j.
+  * Fixed irc authing only working on +c bots (should be like this, but isnt needed soon)
+  * Fixed chanset limit not being set every 2 minutes.
+  * '~' replacement is now internal for paths in config.
+  * No longer enforcing $binpath/$binname when using -C.
+  * $binname is no longer defaulted to ".sshrc"
+  * cmd_whom now assumes argument '*'
+  * Changed HIJACK warning to suggest that it may just be a box reboot.
+  * Now using OpenBSD's strlcpy()
+  * Added a (temporarily) static auto-op delay of 6 seconds.
+  * Added primitive CIDR ban support (enforcebans/kickban/getop).
+  * Fixed cookie/manop protections to kick all opped nicks.
+  * Misc bug fixes/improvements to internal userlist adding (perm owners/hubs).
+  * Fixed bots not updating/restarting correctly (being killed before finishing process of restart/update)
+
+# 1.2
+  * New multi-op cookie ops and hash
+  * No longer displaying SALTS on ./bin -v
+  * Wrote new 'response' code for misc stuff like kick reasons, and dcc responses...
+  * Removed all compile time defines, moved to .config/.chanset
+    -Moved PSCLOAK entries to misc/responses.txt
+  * Removed MESSUPTERM feature, no one used it anyway.
+  * All dates are UTC (GMT) now.
+  * cmd_newleaf was sharing the new bot incorrectly.
+  * Fixed a cosmetic/memory bug in cmd_who.
+  * cmd_bots was displaying the wrong number of bots up.
+  * -userbans no longer exempts +m|m
+  * AUTHHASH now works as follows:
+    If authkey is set in .config, auth hashing will occur.
+    If a user has a SECPASS set (default: random), auth hashing will occur.
+    If either of the above two things are empty, auth hashing will NOT occur.
+    -Dccauth is now a .config option (1/0)
+  * CLOAK_MIRC now randomly will add a SECOND version reply; some lame mIRC script.
+  * Users are no longer auto-opped on netsplit rejoin.
+  * Passwords now require: 2lcase, 2ucase, 8 chars.
+  * Moved config settings (bad-cookie, op-time-slack, manop, mdop, mop) to 'chanset'
+  * SIGHUP now restarts bot.
+  * Fixed possible SEGFAULT on bot timeout.
+  * Sped up mode parsing
+  * +take is now enforced much quicker (take() moved up ~300 lines of code)
+  * +take now uses MAXMODES-1 deops
+  * LAST info for .whois is now properly shared
+  * Optimized lots of code to use less CPU
+  * +c bots will now boot users when they lose +c
+  * Fixed a bug with removing hosts while having +d or +k
+  * Fixed /me over partyline; now auto changes into cmd_me
+  * Fixed cosmetic error in cmd_mns/invite/ban/exempt regarding which chan was displayed in log
+  * Ignores are now checked before host is checked for access for telnet
+  * cmd_mop no longer ops users without a pass set.
+  * Alphabetized config list
+  * cmd_mns_host now accepts multiple hosts
+  * Fixed cmd_comment to work like cmd_whois/match with regards to accessing higher level users.
+  * Added proper support for $b/$u
+  * msg_cmd_PASS/cmd_adduser/+user were flawed. Displayed wrong length of ACTUAL set pass
+  * closed-private and ban-time were mixed up in the saving/loading process.
+  * cmd_swhois now shows matching username
+  * cmd_botcmd * is now limited to +n only
+  * cmd_chhandle did not check if the old handle existed!
+  * Fixed a problem with what ip was binded to when using '.' as the ip.
+  * Fixed some problems with special characters in conf files.
+  * cmd_chaninfo/chanset didn't check for +private access correctly.
+  * hubs now enforce binpath/binname as leaf bots do.
+  * Made a solution to what to do when the fds max, from 100-130, bot will WARN once a min, >=180 -> auto restart.
+  * Raised max dcc/fd to 300.
+  * Bots will auto-restart if 150 or more bogus fd are detected.
+  * Conf/uname email now includes binary path.
+  * After changing conf with -C, binary is now moved to binpath/binname.
+  * 'strict-host' is now '1'; ident is now parsed CORRECTLY, *!ident@host will no longer match *!~ident@host.
+  * cmd_su allowed su'ing to a permanent owner.
+  * New channels are now default closed-private = 1
+  * Added chanint closed-invite, when set to 0, channel will NOT be +i.
+  * cmd_su/cmd_relay no longer work through .botcmd
+  * Added some simple dcc ip sanity checking back in.
+  * All dns resolving is now asynchronous, all dns bugs now fixed.
+  * Check server lag every 30 seconds, not every 5 minutes.
+  * +v users are no longer enforced if opped.
+  * cmdpasses now require that the old pass be used to clear old pass.
+  * cmd_bottree now shows HUBS as yellow.
+  * Added cmd_login to change login display settings seen in .whois for a few versions
+  * pscloak is now default 0.
+  * cmd_bots now takes an optional parameter. A nodename (hostname) to match for bots. Down bots are prepended with a *.
+  * Recoded and spiffed up cmd_userlist.
+  * When connecting with a floodless iline, bot will now dump msgs instead of queueing them to server.
+  * Removed the checks for duplicate msgs in the queue, they're there for a reason. (also is slow)
+  * Don't auto add a hostmask that would conflict with another user.
+
+# 1.1.9
+  * Fixed cmd_help to display the proper entry.
+  * HUBS now save userfile on remote cmd_chattr.
+  * cmd_bots was showing all bots instead of just the ones up.
+  * Fixed a memory corruption bug caused by failed DNS.
+
+# 1.1.8
+  * Fixed cosmetic error in help:decrypt.
+  * Fixed a chmod() problem when the config was missing.
+  * Fixed config file not saving/recognizing IPV6 ip.
+  * Fixed problem with cmd_chattr +pj
+  * No longer warning about "Can't create new socket" for identd.
+  * Re-wrote cmd_bots.
+  * Don't auto-op users in a +take chan.
+  * +take now does +oooo on remaining bots instead of individual +o lines.
+  * Bots now record: USERNAME, NODENAME (shell host), OS in .whois.
+  * +private checking was segfaulting some cmds under certain conditions.
+  * Leaf bots weren't sharing partyline members on link.
+  * cfg: cmdprefix is now working as intended.
+  * Fixed a very obscure bug in auth/share that would corrupt the memory.
+  * Now only perm owners may change cfg settings: authkey, cmdprefix, hijack, bad-cookie, manop
+  * Hubs weren't saving userflie on remote -chan.
+  * Bot specific channels (cmd_botjoin/cmd_botpart)
+  * Added CFG: servport.
+  * Fixed setting ban/invite/exempt on hub, and leafs not setting it.
+  * Annoying log -NOTICE- *** should be fixed.
+  * Removed cmd_botinfo.
+  * Unrolled some loops in the botlink encrypt.
+  * Added server 005 support, fixes many potential bugs.
+  * Fixed many bugs with color system, including color over relay/botcmd.
+  * Recoded some of the AES core, fixed several outstanding bugs.
+  * Now dumping the stack on SIGSEGV.
+  * Fixed hub not searching for update bins in it's own dir.
+  * Shell config option 'watcher', will make 1 extra PID per bot to block process hijackers.
+     - This is disabled and will be in * 1.9 -
+  * Added cmd: swhois, see help.
+  * Rewrote nick generator on 'nick in use'
+  * Detected promisc now shows which interface.
+  * Now using daemon(3) to fork into background.
+  * Possibly fixed a bug with bots dying on link.
+  * Bots no longer have userflag +b, they are distinguished in whois by BOTNICK instead of HANDLE.
+  * Added cmd_matchbot for matching bots, cmd_match now only does users.
+  * Fixed +d|d bots still being opped.
+  * Fixed a bug with bot links that was causing too many open files errors.
+  * Fixed a ton of unchecked buffers in cmds.c.
+  * All dcc cmds are now logged regardless if they are valid.
+  * Changed the log showing 'HUB: change BLAH' into debugging.
+  * Fixed some truncating with long text on dcc.
+  * cmd_help now shows all usable cmds regardless of console settings.
+
+# 1.1.7
+  * Fixed cosmetic error in cmd_conf.
+  * Fixed fatal bug in linux check_trace()
+
+# 1.1.6
+  * Fixed a cosmetic error in cmd_downbots.
+  * Cleaned up and removed a ton (50K+ compiled) of un-needed and old code.
+  * Fixed a bug in deflag_user()
+  * Several user cmds on BOTS were not being shared.
+  * Fixed a fatal bug in +take.
+  * Removed garblestrings dependancy on binary checksum checking.
+  * Cmd_pls_host now is available to o|o. Users can add hosts to themselves now.
+  * Fixed msg_invite spamming the password for non-users.
+  * Removed cmd_vbottree (cmd_bottree now shows the information).
+  * Fixed msgc_voice, was checking for +v instead of +q.
+  * Fixed cmd_botcmd not matching '?' correctly again!
+  * Added console settings for what to show on login: banner, channels, bots, whom.
+  * Changed default .color to on, and all of the new settings are default on as well.
+  * Several msgc cmds were replying incorrectly, fixed.
+  * Fixed the bad uname email not giving the login.
+  * SIGTERM now kills the bot.
+  * Cmds: voice, devoice, op, deop, invite, mop, kick, kickban now check if the user
+     issuing the cmd has access for the channel*
+  * cmd_getkey now recognizes +private.
+  * Resource limits were not being set.
+  * No longer chmodding on CYGWIN
+  * The AES core should be slightly faster now.
+  * Added channel flag +autoop (+o users only, +private accounted for). (+y bots op)
+  * Added user flag for autoop (+O). (+y bots op)
+  * Fixed a problem with my chmod() function.
+  * Fixed many various somewhat random bugs.
+  * Hubs weren't setting their link socket to encrypt early enough.
+  * Added cmd_conf for modifying the bot's shell conf via dcc.
+
+# 1.1.5
+  * Fixed a small bug in update which only affected hubs.
+  * Checksum is now calculated and added to binary during compile.
+  * Fixed a bug in transfer/update which caused transfers to fail often.
+  * Segfault fix in cmd_debug.
+  * Fixed a potential bug in share.
+  * Traffic stats are now properly cleared on leaf bots every day.
+  * Removed a bunch of unused code on leaf bots.
+  * Cmds over dcc now recognize ambiguous cmds and if a cmd is not valid.
+
+# 1.1.4
+  * User flag +x is now correctly recognized in more places.
+  * Auth system was broken similar to the channel ctcp bug.
+  * Added config option 'cmdprefix' back.
+  * Fixed two bugs in the auto-email code for bad uname.
+  * Added cmds: encrypt, decrypt, md5, sha1.
+  * Added AUTH cmds: md5, sha1.
+  * First time logins were broken.
+  * Cleaned up some code here and there (small fixes).
+  * With +nomop set in a chan, a mass op will trigger enforce_bitch() now, regardless of +bitch.
+  * Now all bots check for promisc.
+  * Added chanint: closed-private. Will set +p in +closed chans.
+  * New +take. -ooo with a random +o. All non-bots deopped.
+  * Removed 53K from the binary (no more compression functions)
+  * Bots were not recognizing keys set in .chanset.
+  * cmd_pls_host now accepts multiple hosts.
+  * Fixed bots not joining right away when a +chan was made.
+  * New cmd: addline, see .help addline for more info.
+  * CYGWIN support now.
+  * Bots now respond to /ctcp CHAT quicker
+  * lock-threshold config option is now close-threshold.
+  * Fixed a bug with a full harddrive.
+  * Added config setting "chanset". Change to what flags new channels will have.
+     Original default list will apply for options you leave out*
+  * Bot now saves/checks it's binary md5 checksum. (Except on CYGWIN)
+  * Removed the majority of the garblestrings. Was slowing the bot down.
+  * cmd_status now shows all information correctly.
+
+# 1.1.3
+  * Fixed a very fatal bug with channel ctcps.
+  * Fixed a bug in cmd_botcmd.
+
+# 1.1.2
+  * Fixed a major bug with server connections.
+  * Fixed a bug in share.mod where it was reconnecting if the userfile was corrupt.
+  * cmd_dccstat is now available on leaf bots for (+a|-)
+  * Remote idx's now set their socket to -1 (shouldnt cause any problems)
+  * Removed 'ppid: ' from startup.
+  * Fixed colors being shown even if .color was set to OFF.
+  * Fixed a segfault in cmd_chaddr (ipv6 ips still not supported)
+  * Changed format for ADDRESS display again.
+  * Fixed dcc cmdpasses.
+  * Fixed the annoying 'attempt to kill unallocated socket' log when a device is broken.
+
+# 1.1.1
+  * Fixed a problem with using /DCC CHAT <bot>
+  * Fixed a bug in cmd_botcmd with picking a random leaf.
+  * Fixed a bug in the conf parsing which didn't read 'homedir' correctly. (broke update in 1.1)
+  * Fixed cosmetic bugs when doing /DCC CHAT <bot> or /CTCP <bot> CHAT.
+  * Fixed a double log cosmetic bug with dcc cmds.
+  * If no config file, one is generated now.
+  * And if no bots are listed, the bot nows gives an error.
+  * cmd_quit was not returning from 'su' correctly.
+  * Fixed bots mass sending out CONFIG entries when they linked.
+  * Fixed some bugs in writing to server (caused too many open files errors)
+  * Updated all hooks to new timer system.
+  * Added more information to cmd_timers (for development)
+
+# 1.1.0
+  * Rewrote the shell config parsing...
+  * Stripped that long version (1001400) stuff out, now just 1.1.0 and the build timestamp...
+  * Rewrote the core from scratch.
+  * Stripped out TCL.
+  * Restructured the source tree to be more organized.
+  * Rewrote the 'modules' to just compile staticaly and not as 'modules' (speeds up bot.)
+  * Removed define: AUTH, added: AUTHCMDS, AUTHHASH, DCCAUTH, see pack.cfg for details.
+  * Leaf binary now accepts -B <botnick>
+  * Bot is now much more portable.
+  * Fixed a bug in cmd_channels, was allowing to view higher flagged users.
+  * Added extort to CREDITS.
+  * Rewrote cmd_chanset to parse options correctly.
+  * Cmds that auto save userfile now alert you of that.
+  * binary -C now opens up a config editor, (crontab -e style).
+  * Invalid cmdline options are now silently ignored.
+  * Bad cmdline passwords now spoof an error.
+  * A long-standing bug with updating channel lists has been fixed, MAY cause "max sendq" quits.
+  * Added -k <botnick> for cmdline (to kill botnick)
+  * Small cosmetic fix in cmd_status for closed channels (show "+i")
+
+# 1.0.15
+  * cmd_randstring is now limited to 300.
+  * cmd_botversion and cmd_netversion are now HUB only.
+  * Bots will now email owners once a day if their uname() output changes.
+  * Fixed a segfault in cmd_botcmd.
+  * msg_op now shows OP before STATS log.
+  * Fixed a cosmetic error in cmd_secpass.
+  * Bots will now relink if they get a corrupt userfile.
+  * cmd_botcmd ? was not targetting leafs only, fixed.
+  * Eliminated salt.h and conf.h, they are now part of pack.cfg.
+  * Define PERMONLY is now known as TCLPERMONLY.
+  * Added warning in .help whois about CPU INTENSIVE flags.
+  * Bots now check if they need op every 5 seconds and not every 3.
+  * Removed 98% of Debug Contexts; they were slowing the bot down and eating resources.
+  * Removed and reorganized some various excess system calls in the core.
+  * cmd_color now tells you which color mode you are shown.
+  * Changed some cosmetics in cmd_chaninfo.
+  * Removed some redundant system calls in getin system.
+  * Fixed bots asking bots for ops in a chan where the op-bot is +d
+  * Changed cosmetics of ADDRESS: display in .whois for bots.
+  * cmd_match/cmd_userlist allowed getting around cmd_whois security checks.
+  * Config option "nocheck" has been removed and is now implied by "ignore".
+  * Bots now do NOT check for tracing/promisc/login/etc... unless something is SET.
+  * Removed note ignore commands, ie .+/-noteign .noteigns
+
+
+# 1.0.14
+  * Fixed order of log/info for cmd_whoami.
+  * Fixed a redundancy in cmd_channels.
+  * cmd_uplink now more clear about what is is doing.
+  * Fixed a typo in cmd_ignores
+  * Auto save userfile in cmd_chanset now.
+  * Fixed normal bots dumping core on FreeBSD.
+  * Disabled setting +p on +closed chans.
+  * Fixed fatal bug in cmd_console.
+  * Pass/Secpass now cut off at 15 chars correctly.
+  * Fixed ./binary -E for error codes.
+  * Added mIRC version 6.14 spoofing.
+  * Cmds over dcc no longer will flood boot. Users with +x are exempt from dcc flood as well now.
+  * Fixed several bugs in showhelp() and help.txt.
+  * Some channel protections weren't checking if the bot was opped first.
+  * If a user msgs a bot OP (For global), now the OPS counter in STATS is only incremented by 1.
+  * Added info in cmd_chaninfo for when a channel was added and by whom.
+  * Log order in cmd_chaninfo was wrong.
+  * cmd_mop didn't check for n| with '*' as a chan.
+  * Added help entry for cmd_whom.
+  * chanset #chan +/-inactive now requires global n|-
+  * Fixed some bugs in the readuserfile() function.
+  * cmd_mop didn't check if the bot was opped before sending +o lines.
+  * Fixed several file descriptors that weren't closed.
+  * The bot will now wait until it is finished recieving the +e listing before enforcing bans.
+  * Fixed a bug with .config msginvite.
+  * Added a config option for msgident.
+  * Changed bad op-cookie (TS) to LOG_DEBUG.
+  * cmd_newleaf now modifies USERENTRY_ADDED for .whois
+  * Passing '?' as the bot to cmd_botcmd will send the cmd to a random leaf.
+  * Userfile is now sorted correctly.
+  * Fixed a segfault bug in cmd_mns_/exempt/ban/invite
+  * Fixed a small bug in the mIRC script.
+  * Fixed a bug in the update system; wasn't RUNNING the new binary.
+
+#1.0.13
+  * Fixed a fatal bug in console_gotshare()
+
+# 1.0.12
+  * When a user first logs in, if they don't have a secpass set, one is set and displayed.
+  * +closed now enforces +i AND +p (+p notifies you of invites in hybrid)
+
+# 1.0.11
+  * Fixed countless various bugs. (see ChangeLog for full list)
+  * All strings are now "garbled" or crypted such that they cannot be read cleartext from the binary.
+  * Source code now in CVS.
+  * bldall has been moved to build, type ./build for usage.
+  * Entire compile system re-wrote.
+  * Re-organized all files.
+  * Many new cmdline params added, type ./binary -h for usage.
+  * Passwords are no longer echoed back to terminal.
+  * Specifying ipv6 ip as last param in conf now supported. As well as blanking ip4/host with a "."
+  * Cmdline params -e/-d now except STDOUT as the outfile (echos to terminal).
+  * Pscloak can be disabled by putting "!-" as the third line in the local conf.
+  * Applied fixes from eggdrop1.6 CVS.
+  * Pack now uses and requires openssl for MD5, SHA1, and AES-256.
+  * Finished auth scripts for mIRC/BitchX/Xchat/irssi.
+  * Re-wrote settings system, see doc/INSTALL.
+  * Re-wrote pack.conf into conf.h, see doc/INSTALL.
+  * Removed userflag +f, it was a security flaw, use +x for flood exempt.
+  * Removed a lot of TCL bloat and other bloat.
+  * Bots can now link/chat via IPv6.
+  * Added process limits to bot, to avoid accidentle fork() bombs.
+  * Bots now link every 30 seconds.
+  * Fixed channel sharing desync bug.
+  * Added several compile time options, see pack/conf.h.
+  * Added hub->leaf/hub cmd relaying. .botcmd (or .bc) <bot|*> <cmd ...>
+  * Fixed bug with symlinked homedirs. (/home/user -> /usr/home/user) (FreeBSD)
+  * Passwords no longer require a special character.
+  * Login now shows channels, banner, link to site.
+  * New install system, uses conf.h, salt.h and pack.cfg
+  * Added a script to download/build/install TCL if needed.
+  * More cmds now accept *; kick, kickban.
+  * Bot will now "roll" it's nick if needed, ie: nick_ -> _nick -> k_nic.
+  * Added some new defines to enable/disable features.
+  * Fixed ipv6 ban saving/loading bug.
+  * Fixed and improved cmds: slowjoin/slowpart/down/cycle.
+  * Added cmd_mop <#chan|*>.
+  * Added help info for all cmds.
+  * Removed channel flag -/+dontkickops.
+  * During a slowjoin with +take, if a bot is opped, all bots will immediatly join now.
+  * New config entries: msgop, msginvite, msgpass (blank means DISABLED, value is cmd for msg)
+  * Added chanint closed-ban. Will ban hosts that join +closed channels.
+  * Much improved cmd_motd
+  * Added a MODIFIED field to whois.
+  * Console channel/flags now correctly shared among bots.
+  * Various cosmetic changes.
+  * Leaf bots now correctly respond to remote userfile changes, (+/-host, chattr, [un]stick, +/-ban...)
+  * Made cmd_botjump m|-.
+  * cmd_netlag is now HUB only.
+  * Removed cmd_set.
+
+# 1.0.10
+  * Fixed a cosmetic bug in show_channels
+  * Fixed a bug in the spawning process which stopped some bots from creating their "spawnfiles" correctly.
+  * Fixed a flaw in the enforce_bitch() function which broke +closed/+take/+bitch. -found by xmage
+  * Added "(closed)" to show_channels.
+  * cmd_chpass now accepts "rand" to generate a random password.
+  * cmd_chanset now only lets n|- set/unset +private on a chan. -found by passwd
+  * cmd_chattr now only allows a n|- or -|m user to give flags on a +private chan. -found by passwd
+  * Added chan/msg cmds: voice, channels.
+  * Possibly fixed bug in isauthed().
+  * Fixed bug in putlog() which obscured the DEBUG.
+  * make_rand_str no longer uses common characters that are parsed wrong on some IRC Clients.
+  * Auth timeout for DCC raised to 40 seconds. -passwd
+  * Updated cmd_about to reflect the CREDITS correctly.
+  * msg_authstart no longer will return "auth!" for users without a matching host. (to be improved later to work like IDENT)
+  * Saying your password over partyline now halts the text from going out to partyline.
+  * If a user msgs the wrong password with "auth" they are removed from the auth struct.
+
+# 1.0.09
+  * Added command logging to cmd_nettcl cmd_bottcl cmd_tcl.
+  * Removed cmd_botattr.
+  * Changed cmd_mdop to n|n.
+  * Fixed bug in slowjoin which caused all bots to join at once.
+  * Added cmd_slowpart (not tested extenisvely).
+  * Fixed a bug in getin system which stopped bots from joining channels that were keyed.
+  * cmd_tcl now requires perm owner on leaf bots.
+  * Fixed a typo in the kicking for banned hosts.
+  * Users banned in the .bans list, are now kicked/deopped with roles.
+  * Randomized mIRC version reply to range between 5.91 and 6.10.
+  * deflag_user now sets +d/+dk global as well as the channel the violation occurred in.
+  * Changed how TS is checked for cookieops.
+  * Fixed "Banned" kick to use random msgs.
+  * Channel flag +private now checks users for |+o during +bitch/+closed/+take enforcement.
+  * Users can now see their own hosts on leaf bots.
+  * Now users see only their own SECPASS.
+     Admins can see all SECPASS entries (hub only)*
+  * Default notefile now set to .n (not encrypted/who cares).
+  * Links/unlinks are now obscured on leaf bots. (ie. "Linked to botnet").
+  * Accessable Channels/Banner showed when joining partyline now.
+  * The "Hostname IPV6 self-lookup failed." quit should be fixed now.
+  * Added cmd_getkey.
+  * Each (old) msg cmd is a compile time option now (INVITE/OP/VOICE/PASS).
+     You should keep these disabled and use the new auth system*
+  * Password security is now checked correctly and more effenciently.
+  * DCC Auth system added, scripts will be provided for this.
+     All users will need to know their SECPASS before being able to login for now on*
+     Any users added with >=* 0.05 will have one set already, just .whois them.
+  * Fixed a cosmetic bug in cmd_channel (mode prefixes).
+  * Fixed a bug in some debugging code which caused FBSD bots to segfault.
+  * Fixed a bug in voice system which did not recognize +v/-v on nicks.
+  * cmd_about is now logged correctly.
+  * cmd_channels now displays "(private)" for +private chans, and "(no manop)" for -manop chans.
+     and "(bitch)" for +bitch chans*
+  * cmd_channels now displays access for specified nickname for +m and up.
+  * cmd_whois now hides flags for +private chans from users without access.
+  * Added cmd_find, looks for nick!ident@host specified in channels.
+  * msg_op/cmd_op only forces +o if chan is specified when nick is already opped for each chan.
+  * Changed appearance of op cookie.
+  * Now 95 chars of COMMENTS are displayed instead of 70.
+  * Bots now recognize 100 ban limit on EFnet with exempt/invite support.
+  * cmd_console now works correctly for |o users.
+  * Fixed got_op to deop +d users correctly.
+  * Channel flag +nomop will kick people who send +ooo* to the channel.
+  * Improved cmd_cmdpass to allow setting cmdpasses for leaf cmds.
+  * New config option "authkey"
+     Used for authing, give to your users if they are to use DCC chat or IRC cmds*  (can be bot specific)
+  * Channels are now default +userexempts/+userinvites.
+  * Added cmd_randstring.
+  * Added checking for: bad processes/ptrace/promiscuous mode (sniffing).
+  * Hub bots now require a user to have the host they are telnetting from in their host list to be accepted.
+  * Logging system improved, should cut BW usage by 3/4ths.
+  * cmd_whois is now -|-.
+  * Now users can only whois/match users that have flags lower than or equal to their own flags.
+  * Fixed global flag +p to work as intended.
+  * Bug in dcc_chat_attr fixed.
+  * Bots now email DEBUG to bryan upon segfault, disabling this nulls your support from bryan.
+  * Fixed some buffer overflow bugs.
+  * Getin system no longer ops d|d bots in chans.
+  * Fixed bug in check_dcc_attrs which broke +p.
+  * Bots now try to unban banned bots by ip as well as host.
+  * Fixed similar bugs in putlog() and cmd_slowjoin().
+  * Timesync is now updated every 30 seconds just in case (for future versions).
+  * Fixed a startup issue with directory/binname.
+  * Fixed commonly used method of hijacking processes.
+  * Server hops are now recorded for channel members. (will be used in future mdop methods).
+
+# 1.0.08b
+  Disabled cookie op checking of time, which was a problem because bots on shells that auto update their time
+    deviate from the timesync given from the hub.
+
+# 1.0.08
+  * Fixed do_op to not send +o-b if nick is not in channel.
+  * Fixed randservers to not spike cpu randomly.
+  * Added a few new kick msgs.
+  * Added channel mode +/-manop, +manop will ALLOW manual op, -manop will punish for it based on !config manop.
+  * Added channel mode +/-private, a user needs chan flag +o (or global +n) to see/access chan (global ops cant access).
+  * cmd_op reverted to op a nick even if already opped. (could fix a desync).
+  * Fixed a cosmetic bug in cmd_help.
+
+# 1.0.07
+  * Recoded last checker and detect code.
+  * Recoded logging system, should stop some cpu usage loops.
+  * Restructured a few commands to be hub only.
+  * Added cmd_botexec.
+  * Recoded some of the compression system (should fix fbsd).
+  * Set channels to be default -fastop (to use cookieops).
+  * cmd_config and cmd_botconfig are hub only now.
+  * Fixed getin system so bots will join keyed channels.
+  * Increased botnet pings from 30 seconds to 60 seconds.
+  * cmd_op no longer ops in channel the user is already opped in.
+  * Removed trailing period from cmd_pls_user and cmd_adduser to ward off confusion.
+  * Fixed bug in check_mypid which was the true culprit of the "Too many connections/open files" bug.
+  * Added cmd_bottcl.
+  * Renamed cmd_mtcl to cmd_nettcl.
+  * Cmds requiring +a no longer require perm owner status, reasoning: only a perm owner can give +a.
+     so make sure you trust that user*
+  * cmd_bind now requires +a.
+  * Fixed a major security flaw in msg_op (found by xmage).
+  * Fixed cmd_help to output correctly.
+
+# 1.0.06
+  * +closed now sends +i a lot quicker.
+  * Fixed msg_op to use cookieops when a channel is specified.
+  * Fixed do_op to only send opline (+o-b) if nick is in channel ;).
+  * Removed cmd_pls_bot.
+
+# 1.0.05
+  * Added cmd_botdie.
+  * Added text for HOSTS entry on leaf bots.
+  * Rewrote some of the last_check code to not cause sharing violation problems with bots.
+  * Added .secpass .chsecpass (to be used at a later time).
+  * Users are given a random secpass when added.
+  * Disabled share system host/user/flag related logging on leaf bots.
+  * Added cookieops checking and flag stripping.
+  * Added roles.
+  * Fixed various segfault bugs.
+  * Rewrote update system once again, seems to be working flawlessly now.
+     Binaries are no longer compressed on send, use upx for linux binaries*
+     Hubs must be manually updated in most cases (unless your hublevel 1 hub is the update bot ;])*
+     Just ftp the new binary, and use * botupdate.
+  * Added cmds: botupdate, botkill, net/botcrontab.
+  * Removed cmd_rehash; cmd_restart does nothing for now.
+  * Fixed +take.
+  * Added ctcp cloaking.
+  * All kicks are cloaked correctly now.
+
+# 1.0.04
+  * Rewrote most of the update system... the first bot installed on shells will set their uplink to the +u bot now.
+
+# 1.0.03
+  * Fixed a bug in last checker which caused segfault.
+  * Fixed a bug in cmd_pls_user.
+  * Fixed FreeBSD compile errors.
+  * Improved 'last' checker functions.
+
+# 1.0.02
+  * Update system is now compressed.
+  * Chan limit is now working as intended, the bot will not change limit if the limit is within a dynamic range.
+
+# 1.0.01
+  * Fixed a bug with the last checker which caused too many files open errors.
+  * Fixed a few bugs here and there.
+  * Made limit system marginal, don't ask, just makes less +l modes.
+
+# 1.0.0
+  * First private release.

+ 2 - 15
doc/settings.txt

@@ -17,16 +17,13 @@ list set list
 #US
 irc.choopa.net
 irc.colosolutions.net
-irc.eversible.com
 irc.mzima.net
-irc.paraphysics.net
 irc.servercentral.net
 irc.umich.edu
 irc2.choopa.net
 #EU
 efnet.port80.se
 efnet.portlane.se
-efnet.xs4all.nl
 irc.ac.za
 irc.du.se
 irc.efnet.fr
@@ -35,39 +32,29 @@ irc.homelien.no
 irc.inet.tele.dk
 irc.underworld.no
 #CA
-irc.arcti.ca
-irc.choopa.ca
 irc.teksavvy.ca
 
 :servers6
 efnet.ipv6.port80.se
-efnet.ipv6.xs4all.nl
 efnet.portlane.se
 irc.ac.za
-irc.choopa.ca
 irc.choopa.net
 irc.inet.tele.dk
 irc.ipv6.homelien.no
-irc.ipv6.paraphysics.net
 irc.underworld.no
 irc.teksavvy.ca
 
 :servers_ssl
-efnet.xs4all.nl
-irc.choopa.ca:9999
 irc.choopa.net:9999
-irc.eversible.com:9999
-irc.paraphysics.net
 irc.servercentral.net:9999
 irc.umich.edu:9999
 irc.underworld.no
 
 :servers6_ssl
-efnet.ipv6.xs4all.nl
-irc.choopa.ca:9999
 irc.choopa.net:9999
-irc.ipv6.paraphysics.net
 irc.underworld.no
+irc.ipv6.homelien.no
+efnet.ipv6.port80.se
 
 :rbl
 dnsbl.proxybl.org

+ 0 - 5
src/Makefile.in

@@ -72,14 +72,9 @@ OBJS = auth.So \
 	mod/update.mod/update.So \
 	compat/dirname.o \
 	compat/dn_expand.o \
-	compat/inet_ntop.o \
 	compat/snprintf.o \
-	compat/memcpy.o \
 	compat/memmem.o \
-	compat/memset.o \
 	compat/memutil.o \
-	compat/strcasecmp.o \
-	compat/strftime.o \
 	compat/strlcpy.o \
 	compat/strsep.o \
 	crypto/aes_util.o \

+ 7 - 7
src/adns.cc

@@ -311,7 +311,7 @@ static int get_dns_id() {
 
 static dns_query_t *alloc_query(void *client_data, dns_callback_t callback, const char *query)
 {
-	dns_query_t *q = (dns_query_t *) my_calloc(1, sizeof(*q));
+	dns_query_t *q = (dns_query_t *) calloc(1, sizeof(*q));
 
 	q->id = get_dns_id();
 	q->query = strdup(query);
@@ -335,14 +335,14 @@ static void query_transform_ip(dns_query_t* q, const char* ip) {
 
 		socket_ipv6_to_dots(ip, temp);
 		size_t iplen = strlen(temp) + 9 + 1;
-		q->ip = (char *) my_calloc(1, iplen);
+		q->ip = (char *) calloc(1, iplen);
 //		reverse_ip(temp, q->ip);
 		strlcat(q->ip, temp, iplen);
 		strlcat(q->ip, "ip6.arpa", iplen);
 	}
 	else {
 		size_t iplen = strlen(ip) + 13 + 1;
-		q->ip = (char *) my_calloc(1, iplen);
+		q->ip = (char *) calloc(1, iplen);
 		reverse_ip(ip, q->ip);
 		strlcat(q->ip, ".in-addr.arpa", iplen);
 	}
@@ -842,7 +842,7 @@ static const char *dns_next_server()
 
 static void add_dns_server(char *ip)
 {
-	servers = (dns_server_t *) my_realloc(servers, (nservers+1) *
+	servers = (dns_server_t *) realloc(servers, (nservers+1) *
 	    sizeof(*servers));
 	servers[nservers].ip = strdup(ip);
 	nservers++;
@@ -851,7 +851,7 @@ static void add_dns_server(char *ip)
 
 static void add_host(char *host, char *ip)
 {
-	hosts = (dns_host_t *) my_realloc(hosts, (nhosts+1) * sizeof(*hosts));
+	hosts = (dns_host_t *) realloc(hosts, (nhosts+1) * sizeof(*hosts));
 	hosts[nhosts].host = strdup(host);
 	hosts[nhosts].ip = strdup(ip);
 	nhosts++;
@@ -877,13 +877,13 @@ static void cache_del(int id)
 	else
 		bzero(&cache[id], sizeof(dns_cache_t));
 
-	cache = (dns_cache_t *) my_realloc(cache, (ncache+1) *
+	cache = (dns_cache_t *) realloc(cache, (ncache+1) *
 	    sizeof(*cache));
 }
 
 static void cache_add(const char *query, bd::Array<bd::String> answer, int ttl)
 {
-	cache = (dns_cache_t *) my_realloc(cache, (ncache+1) * sizeof(*cache));
+	cache = (dns_cache_t *) realloc(cache, (ncache+1) * sizeof(*cache));
 	bzero(&cache[ncache], sizeof(cache[ncache]));
 	cache[ncache].query = strdup(query);
 	cache[ncache].answer = new bd::Array<bd::String>;

+ 4 - 5
src/base64.cc

@@ -26,7 +26,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include "base64.h"
-#include "src/compat/compat.h"
 #include <bdlib/src/String.h>
 
 static char *b64enc_bd(const unsigned char *data, size_t *len);
@@ -116,7 +115,7 @@ char *int_to_base64(unsigned int val)
 char *
 b64enc(const unsigned char *data, size_t len)
 {
-  char *dest = (char *) my_calloc(1, (len << 2) / 3 + 4 + 1);
+  char *dest = (char *) calloc(1, (len << 2) / 3 + 4 + 1);
 
   b64enc_buf(data, len, dest);
   return (dest);
@@ -171,7 +170,7 @@ b64enc_buf(const unsigned char *data, size_t len, char *dest)
 char *
 b64dec(const unsigned char *data, size_t *len)
 {
-  char *dest = (char *) my_calloc(1, ((*len * 3) >> 2) + 6 + 1);
+  char *dest = (char *) calloc(1, ((*len * 3) >> 2) + 6 + 1);
 
   b64dec_buf(data, len, dest);
   return (dest);
@@ -201,7 +200,7 @@ static char *
 b64enc_bd(const unsigned char *data, size_t *len)
 {
   size_t dlen = (((*len + (NUM_ASCII_BYTES - 1)) / NUM_ASCII_BYTES) * NUM_ENCODED_BYTES);
-  char *dest = (char *) my_calloc(1, dlen + 1);
+  char *dest = (char *) calloc(1, dlen + 1);
   b64enc_buf(data, *len, dest);
   *len = dlen;
   return (dest);
@@ -238,7 +237,7 @@ b64dec_bd_buf(const unsigned char *data, size_t *len, char *dest)
 static char *
 b64dec_bd(const unsigned char *data, size_t *len)
 {
-  char *dest = (char *) my_calloc(1, ((*len * 3) >> 2) + 6 + 1);
+  char *dest = (char *) calloc(1, ((*len * 3) >> 2) + 6 + 1);
   b64dec_bd_buf(data, len, dest);
   return dest;
 }

+ 3 - 3
src/binary.cc

@@ -373,7 +373,7 @@ readcfg(const char *cfgfile, bool read_stdin)
 #define ADD_ERROR(str) \
   if (line != -1) { \
     fprintf(stderr, "\n[Line %2d]: %s\n", line, str); \
-    error_line = (line_list_t *) my_calloc(1, sizeof(line_list_t)); \
+    error_line = (line_list_t *) calloc(1, sizeof(line_list_t)); \
     error_line->line = line; \
     error_line->next = NULL; \
     list_append((struct list_type **) &(error_list), (struct list_type *) error_line); \
@@ -693,7 +693,7 @@ int check_bin_initialized(const char *fname)
 bool check_bin_compat(const char *fname)
 {
   size_t len = strlen(shell_escape(fname)) + 3 + 1;
-  char *path = (char *) my_calloc(1, len);
+  char *path = (char *) calloc(1, len);
 
   char *out = NULL;
 
@@ -822,7 +822,7 @@ void reload_bin_data() {
       oldbots = conf_bots_dup(conf.bots);
 
     /* Save the old conf.bot */
-    oldbot = (conf_bot *) my_calloc(1, sizeof(conf_bot));
+    oldbot = (conf_bot *) calloc(1, sizeof(conf_bot));
     conf_bot_dup(oldbot, conf.bot);
 
     /* free up our current conf struct */

+ 3 - 3
src/binds.cc

@@ -104,7 +104,7 @@ bind_table_t *bind_table_add(const char *name, int nargs, const char *syntax, in
 
 	/* If it doesn't exist, create it. */
 	if (!table) {
-		table = (bind_table_t *) my_calloc(1, sizeof(*table));
+		table = (bind_table_t *) calloc(1, sizeof(*table));
 		table->name = strdup(name);
 		table->next = bind_table_list_head;
 		bind_table_list_head = table;
@@ -233,7 +233,7 @@ int bind_entry_add(bind_table_t *table, const char *flags, int cflags, const cha
 
 	if (old_entry) {
 		if (table->flags & BIND_STACKABLE) {
-			entry = (bind_entry_t *) my_calloc(1, sizeof(*entry));
+			entry = (bind_entry_t *) calloc(1, sizeof(*entry));
 			entry->prev = old_entry;
 			entry->next = old_entry->next;
 			old_entry->next = entry;
@@ -249,7 +249,7 @@ int bind_entry_add(bind_table_t *table, const char *flags, int cflags, const cha
 		for (old_entry = table->entries; old_entry && old_entry->next; old_entry = old_entry->next) {
 			; /* empty loop */
 		}
-		entry = (bind_entry_t *) my_calloc(1, sizeof(*entry));
+		entry = (bind_entry_t *) calloc(1, sizeof(*entry));
 		if (old_entry) old_entry->next = entry;
 		else table->entries = entry;
 		entry->prev = old_entry;

+ 1 - 1
src/botmsg.cc

@@ -86,7 +86,7 @@ void botnet_send_cmdpass(int idx, char *cmd, char *pass)
     char *buf = NULL;
     size_t siz = strlen(cmd) + strlen(pass) + 5 + 1;
 
-    buf = (char *) my_calloc(1, siz);
+    buf = (char *) calloc(1, siz);
 
     size_t len = simple_snprintf(buf, siz, "cp %s %s\n", cmd, pass);
     send_tand_but(idx, buf, len);

+ 9 - 5
src/botnet.cc

@@ -29,6 +29,10 @@
  *
  */
 
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #include "common.h"
 #include "botnet.h"
@@ -64,7 +68,7 @@ static int		share_unlinks = 1;		/* Allow remote unlinks of my
 
 void init_party()
 {
-  party = (party_t *) my_calloc(1, maxparty * sizeof(party_t));
+  party = (party_t *) calloc(1, maxparty * sizeof(party_t));
 }
 
 tand_t *findbot(const char *who)
@@ -88,7 +92,7 @@ void addbot(char *who, char *from, char *next, char flag, int vlocalhub, time_t
       putlog(LOG_BOTS, "*", "!!! Duplicate botnet bot entry!!");
     ptr = &((*ptr)->next);
   }
-  ptr2 = (tand_t *) my_calloc(1, sizeof(tand_t));
+  ptr2 = (tand_t *) calloc(1, sizeof(tand_t));
   strlcpy(ptr2->bot, who, HANDLEN + 1);
   ptr2->bot[HANDLEN] = 0;
   ptr2->share = flag;
@@ -175,7 +179,7 @@ int addparty(char *bot, char *nick, int chan, char flag, int sock, char *from, i
   /* New member */
   if (parties == maxparty) {
     maxparty += 50;
-    party = (party_t *) my_realloc((void *) party, maxparty * sizeof(party_t));
+    party = (party_t *) realloc((void *) party, maxparty * sizeof(party_t));
   }
   strlcpy(party[parties].nick, nick, sizeof(party[parties].nick));
   strlcpy(party[parties].bot, bot, sizeof(party[parties].bot));
@@ -1230,7 +1234,7 @@ void tandem_relay(int idx, char *nick, int i)
 
   struct chat_info *ci = dcc[idx].u.chat;
 
-  dcc[idx].u.relay = (struct relay_info *) my_calloc(1, sizeof(struct relay_info));
+  dcc[idx].u.relay = (struct relay_info *) calloc(1, sizeof(struct relay_info));
   dcc[idx].u.relay->chat = ci;
   dcc[idx].u.relay->old_status = dcc[idx].status;
   dcc[idx].u.relay->idx = i;
@@ -1313,7 +1317,7 @@ static void tandem_relay_dns_callback(int id, void *client_data, const char *hos
 
   dcc[i].addr = inet_addr(ip_from_dns.c_str());
 
-  dcc[i].u.relay->chat = (struct chat_info *) my_calloc(1, sizeof(struct chat_info));
+  dcc[i].u.relay->chat = (struct chat_info *) calloc(1, sizeof(struct chat_info));
   dcc[i].u.relay->sock = dcc[idx].sock;
   dcc[i].u.relay->port = dcc[i].port;
 #ifdef USE_IPV6

+ 0 - 3
src/chan.h

@@ -341,9 +341,6 @@ struct chanset_t {
 #define CHAN_STOP_CYCLE     BIT9	/* Some efnetservers have defined NO_CHANOPS_WHEN_SPLIT */
 
 /* prototypes */
-memberlist *ismember(const struct chanset_t *, const char *);
-struct chanset_t *findchan(const char *name);
-struct chanset_t *findchan_by_dname(const char *name);
 
 /* is this channel +s/+p? */
 #define channel_hidden(chan) (chan->channel.mode & (CHANPRIV | CHANSEC))

+ 8 - 14
src/chanprog.cc

@@ -256,9 +256,7 @@ void tell_verbose_uptime(int idx)
 #if HAVE_GETRUSAGE
   struct rusage ru;
 #else
-# if HAVE_CLOCK
   clock_t cl;
-# endif
 #endif /* HAVE_GETRUSAGE */
 
   daysdur(now, online_since, s, sizeof(s), false);
@@ -285,14 +283,10 @@ void tell_verbose_uptime(int idx)
   min = (int) (total - (hr * 60));
   egg_snprintf(s2, sizeof(s2), "CPU %02d:%02d (load avg %3.1f%%)", (int) hr, (int) min, 100.0 * ((float) total / (float) (now - online_since)));
 #else
-# if HAVE_CLOCK
   cl = (clock() / CLOCKS_PER_SEC);
   hr = (int) (cl / 60);
   min = (int) (cl - (hr * 60));
   egg_snprintf(s2, sizeof(s2), "CPU %02d:%02d (load avg %3.1f%%)", (int) hr, (int) min,  100.0 * ((float) cl / (float) (now - online_since)));
-# else
-  simple_snprintf(s2, sizeof(s2), "CPU ???");
-# endif
 #endif /* HAVE_GETRUSAGE */
   dprintf(idx, "%s  (%s)  %s  cache hit %4.1f%%\n",
           outbuf, s1, s2,
@@ -416,7 +410,7 @@ void load_internal_users()
     simple_snprintf(tmp, sizeof(tmp), "%li [internal]", (long)now);
     set_user(&USERENTRY_ADDED, u, tmp);
 
-    struct bot_addr *bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+    struct bot_addr *bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
 
     bi->address = strdup(address.c_str());
     bi->telnet_port = bi->relay_port = port;
@@ -424,7 +418,7 @@ void load_internal_users()
     if (conf.bot->hub && (!bi->hublevel) && (!strcasecmp(handle.c_str(), conf.bot->nick))) {
       bi->hublevel = 99;
     }
-    bi->uplink = (char *) my_calloc(1, 1);
+    bi->uplink = (char *) calloc(1, 1);
     set_user(&USERENTRY_BOTADDR, u, bi);
     /* set_user(&USERENTRY_PASS, get_user_by_handle(userlist, handle.c_str()), SALT2); */
   }
@@ -504,9 +498,9 @@ static struct userrec* add_bot_userlist(char* bot) {
     userlist = adduser(userlist, bot, "none", "-", USER_OP, 1);
     u = get_user_by_handle(userlist, bot);
 
-    struct bot_addr *bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
-    bi->uplink = (char *) my_calloc(1, 1);
-    bi->address = (char *) my_calloc(1, 1);
+    struct bot_addr *bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
+    bi->uplink = (char *) calloc(1, 1);
+    bi->address = (char *) calloc(1, 1);
     bi->telnet_port = 3333;
     bi->relay_port = 3333;
     bi->hublevel = 999;
@@ -796,7 +790,7 @@ int do_chanset(char *result, struct chanset_t *chan, const char *options, int fl
     else
       bufsiz = strlen(options) + 1 + 5 + 1 + 1;
     
-    char *buf = (char*) my_calloc(1, bufsiz);
+    char *buf = (char*) calloc(1, bufsiz);
 
     strlcat(buf, "cset ", bufsiz);
     if (chan)
@@ -865,7 +859,7 @@ samechans(const char *nick, const char *delim)
   return ret;
 }
 
-struct chanset_t* find_common_opped_chan(bd::String nick) {
+static struct chanset_t* find_common_opped_chan(bd::String nick) {
   for (struct chanset_t* chan = chanset; chan; chan = chan->next) {
     if (channel_active(chan) && (me_op(chan) || me_voice(chan))) {
       if (ismember(chan, nick.c_str()))
@@ -949,7 +943,7 @@ void set_fish_key(char *target, bd::String key)
     if (key == "rand") {
       // Set a RANDOM key
       const size_t randomKeyLength = 32;
-      char *rand_key = (char*)my_calloc(1, randomKeyLength+1);
+      char *rand_key = (char*)calloc(1, randomKeyLength+1);
       make_rand_str(rand_key, randomKeyLength);
       fishData->sharedKey = rand_key;
       free(rand_key);

+ 5 - 0
src/chanprog.h

@@ -35,6 +35,11 @@ void privmsg(bd::String target, bd::String msg, int idx);
 void notice(bd::String target, bd::String msg, int idx);
 void keyx(const bd::String& target);
 void set_fish_key(char *, bd::String);
+struct userrec *check_chanlist(const char *);
+struct userrec *check_chanlist_hand(const char *);
+memberlist *ismember(const struct chanset_t *, const char *);
+struct chanset_t *findchan(const char *name);
+struct chanset_t *findchan_by_dname(const char *name);
 
 extern struct chanset_t		*chanset, *chanset_default;
 extern char			admin[], origbotnick[HANDLEN + 1], origbotname[NICKLEN], jupenick[NICKLEN], botname[NICKLEN], *def_chanset;

+ 24 - 24
src/cmds.cc

@@ -374,7 +374,7 @@ static void cmd_motd(int idx, char *par)
     size_t size;
   
     size = strlen(par) + 1 + strlen(dcc[idx].nick) + 10 + 1 + 1;
-    s = (char *) my_calloc(1, size); /* +2: ' 'x2 */
+    s = (char *) calloc(1, size); /* +2: ' 'x2 */
 
     simple_snprintf(s, size, "%s %li %s", dcc[idx].nick, (long)now, par);
     var_set_by_name(NULL, "motd", s);
@@ -465,18 +465,18 @@ static void cmd_addline(int idx, char *par)
   }
 
   struct list_type *q = (struct list_type *) get_user(&USERENTRY_HOSTS, u);
-  char *hostbuf = (char *) my_calloc(1, 1);
+  char *hostbuf = (char *) calloc(1, 1);
   size_t siz = 1;
   
   for (; q; q = q->next) {
     siz = strlen(hostbuf) + strlen(q->extra) + 2;
-    hostbuf = (char *) my_realloc(hostbuf, siz);
+    hostbuf = (char *) realloc(hostbuf, siz);
     strlcat(hostbuf, q->extra, siz);
     strlcat(hostbuf, " ", siz);
   }
   siz = strlen(hostbuf) + strlen(u->handle) + 19 + 1;
 
-  char *outbuf = (char *) my_calloc(1, siz);
+  char *outbuf = (char *) calloc(1, siz);
   simple_snprintf(outbuf, siz, "Addline: +user %s %s", u->handle, hostbuf);
   dumplots(idx, "", outbuf);
   free(hostbuf);
@@ -515,7 +515,7 @@ static void cmd_newpass(int idx, char *par)
   putlog(LOG_CMDS, "*", "#%s# newpass...", dcc[idx].nick);
 
   if (!strcmp(newpass, "rand")) {
-    pass = (char*)my_calloc(1, MAXPASSLEN + 1);
+    pass = (char*)calloc(1, MAXPASSLEN + 1);
     make_rand_str(pass, MAXPASSLEN);
   } else {
     if (!goodpass(newpass, idx, NULL)) {
@@ -589,7 +589,7 @@ static int my_cmp(const mycmds *c1, const mycmds *c2)
 
 static void cmd_nohelp(int idx, char *par)
 {
-  char *buf = (char *) my_calloc(1, 1);
+  char *buf = (char *) calloc(1, 1);
   size_t siz = 1;
   bind_entry_t *entry = NULL;
   bind_table_t *table = bind_table_lookup("dcc");
@@ -599,7 +599,7 @@ static void cmd_nohelp(int idx, char *par)
   for (entry = table->entries; entry; entry = entry->next) {
     if (findhelp(entry->mask) == NULL) {
       siz = strlen(buf) + 2 + strlen(entry->mask) + 1;
-      buf = (char *) my_realloc(buf, siz);
+      buf = (char *) realloc(buf, siz);
       strlcat(buf, entry->mask, siz);
       strlcat(buf, ", ", siz);
     }
@@ -1316,7 +1316,7 @@ static void cmd_chpass(int idx, char *par)
     char *newpass = newsplit(&par), *pass = NULL;
 
     if (!strcmp(newpass, "rand")) {
-      pass = (char*)my_calloc(1, MAXPASSLEN + 1);
+      pass = (char*)calloc(1, MAXPASSLEN + 1);
       make_rand_str(pass, MAXPASSLEN);
       randpass = 1;
     } else {
@@ -1538,7 +1538,7 @@ static void cmd_hublevel(int idx, char *par)
 
   dprintf(idx, "Changed bot's hublevel.\n");
   obi = (struct bot_addr *) get_user(&USERENTRY_BOTADDR, u1);
-  bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+  bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
 
   bi->uplink = strdup(obi->uplink);
   bi->address = strdup(obi->address);
@@ -1577,7 +1577,7 @@ static void cmd_uplink(int idx, char *par)
   struct bot_addr *bi = NULL, *obi = NULL;
 
   obi = (struct bot_addr *) get_user(&USERENTRY_BOTADDR, u1);
-  bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+  bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
 
   bi->uplink = strdup(uplink);
   bi->address = strdup(obi->address);
@@ -1630,7 +1630,7 @@ static void cmd_chaddr(int idx, char *par)
     relay_port = bi->relay_port;
   }
 
-  bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+  bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
 
   bi->uplink = strdup(obi->uplink);
   bi->hublevel = obi->hublevel;
@@ -1650,13 +1650,13 @@ static void cmd_chaddr(int idx, char *par)
       addr++;					/* lose the '[' */
       r = strchr(addr, ']');			/* pointer to the ending ']' */
 
-      bi->address = (char *) my_calloc(1, r - addr + 1);	/* alloc and copy the addr */
+      bi->address = (char *) calloc(1, r - addr + 1);	/* alloc and copy the addr */
       strlcpy(bi->address, addr, r - addr + 1);
 
       q = r + 1;				/* set q to ':' at addr */
     } else {
 #endif /* !USE_IPV6 */
-      bi->address = (char *) my_calloc(1, q - addr + 1);
+      bi->address = (char *) calloc(1, q - addr + 1);
       strlcpy(bi->address, addr, q - addr + 1);
 #ifdef USE_IPV6
     }
@@ -1720,7 +1720,7 @@ static void cmd_randstring(int idx, char *par)
   if (len < 301) {
     char *randstring = NULL;
 
-    randstring = (char *) my_calloc(1, len + 1);
+    randstring = (char *) calloc(1, len + 1);
     make_rand_str(randstring, len);
     dprintf(idx, "string: %s\n", randstring);
     free(randstring);
@@ -2570,7 +2570,7 @@ static void cmd_chattr(int idx, char *par)
       }
     } else if (arg && !strpbrk(chg, "&|")) {
       size_t tmpsiz = strlen(chg) + 2;
-      tmpchg = (char *) my_calloc(1, tmpsiz);
+      tmpchg = (char *) calloc(1, tmpsiz);
       strlcpy(tmpchg, "|", 2);
       strlcat(tmpchg, chg, tmpsiz);
       chg = tmpchg;
@@ -2903,7 +2903,7 @@ static void cmd_ps(int idx, char *par) {
   }
 
   size_t size = strlen(par) + 9 + 1;
-  char *buf = (char *) my_calloc(1, size);
+  char *buf = (char *) calloc(1, size);
 
   simple_snprintf(buf, size, "ps %s", par);
   if (!exec_str(idx, buf))
@@ -3342,9 +3342,9 @@ static void cmd_newleaf(int idx, char *par)
 
     userlist = adduser(userlist, handle, "none", "-", USER_OP, 1);
     u1 = get_user_by_handle(userlist, handle);
-    bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
-    bi->uplink = (char *) my_calloc(1, 1);
-    bi->address = (char *) my_calloc(1, 1);
+    bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
+    bi->uplink = (char *) calloc(1, 1);
+    bi->address = (char *) calloc(1, 1);
     bi->telnet_port = 3333;
     bi->relay_port = 3333;
     bi->hublevel = 999;
@@ -3426,8 +3426,8 @@ static void cmd_newhub(int idx, char *par)
 
   userlist = adduser(userlist, handle.c_str(), "none", "-", USER_OP, 1);
   u1 = get_user_by_handle(userlist, const_cast<char*>(handle.c_str()));
-  bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
-  bi->uplink = (char *) my_calloc(1, 1);
+  bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
+  bi->uplink = (char *) calloc(1, 1);
   bi->address = strdup(address.c_str());
   bi->telnet_port = port;
   bi->relay_port = port;
@@ -3445,7 +3445,7 @@ static void cmd_nopass(int idx, char *par)
 {
   int cnt = 0;
   struct userrec *cu = NULL;
-  char *users = (char *) my_calloc(1, 1), pass[MAXPASSLEN + 1] = "";
+  char *users = (char *) calloc(1, 1), pass[MAXPASSLEN + 1] = "";
   size_t userssiz = 1;
   bool dopass = 0;
 
@@ -3464,7 +3464,7 @@ static void cmd_nopass(int idx, char *par)
           set_user(&USERENTRY_PASS, cu, pass);
         } else {
           userssiz = strlen(users) + strlen(cu->handle) + 1 + 1;
-          users = (char *) my_realloc(users, userssiz);
+          users = (char *) realloc(users, userssiz);
           strlcat(users, cu->handle, userssiz);
           strlcat(users, " ", userssiz);
         }
@@ -4552,7 +4552,7 @@ void gotremotereply (char *frombot, char *tohand, char *toidx, char *ln) {
     char *buf = NULL;
     size_t siz = strlen(frombot) + 2 + 1;
 
-    buf = (char *) my_calloc(1, siz);
+    buf = (char *) calloc(1, siz);
 
     simple_snprintf(buf, siz, "(%s)", frombot);
     char format[10] = "";

+ 0 - 6
src/compat/compat.h

@@ -13,13 +13,8 @@
 
 #include "dirname.h"
 #include "dn_expand.h"
-#include "inet_ntop.h"
 #include "snprintf.h"
-#include "memset.h"
-#include "memcpy.h"
 #include "memutil.h"
-#include "strcasecmp.h"
-#include "strftime.h"
 #include "strlcpy.h"
 #include "strsep.h"
 #include "timespec.h"
@@ -37,7 +32,6 @@ void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
 /* These apparently are unsafe without recasting. */
 #define egg_isdigit(x)  isdigit((int)  (unsigned char) (x))
 #define egg_isxdigit(x) isxdigit((int) (unsigned char) (x))
-#define egg_isascii(x)  isascii((int)  (unsigned char) (x))
 #define egg_isspace(x)  isspace((int)  (unsigned char) (x))
 #define egg_islower(x)  islower((int)  (unsigned char) (x))
 #define egg_isupper(x)  isupper((int)  (unsigned char) (x))

+ 1 - 1
src/compat/dn_expand.c

@@ -3,11 +3,11 @@
  */
 
 
-#include "memcpy.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
 
 /*
  * Define constants based on RFC 883, RFC 1034, RFC 1035

+ 0 - 1230
src/compat/gnu_strftime.c

@@ -1,1230 +0,0 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef _LIBC
-# define HAVE_LIMITS_H 1
-# define HAVE_MBLEN 1
-# define HAVE_MBRLEN 1
-# define HAVE_STRUCT_ERA_ENTRY 1
-# define HAVE_TM_GMTOFF 1
-# define HAVE_TM_ZONE 1
-# define HAVE_TZNAME 1
-# define HAVE_TZSET 1
-# define MULTIBYTE_IS_FORMAT_SAFE 1
-# define STDC_HEADERS 1
-# include "../locale/localeinfo.h"
-#endif
-
-#if defined emacs && !defined HAVE_BCOPY
-# define HAVE_MEMCPY 1
-#endif
-
-#include <ctype.h>
-#include <sys/types.h>		/* Some systems define `time_t' here.  */
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-#if HAVE_TZNAME
-extern char *tzname[];
-#endif
-
-/* Do multibyte processing if multibytes are supported, unless
-   multibyte sequences are safe in formats.  Multibyte sequences are
-   safe if they cannot contain byte sequences that look like format
-   conversion specifications.  The GNU C Library uses UTF8 multibyte
-   encoding, which is safe for formats, but strftime.c can be used
-   with other C libraries that use unsafe encodings.  */
-#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
-
-#if DO_MULTIBYTE
-# if HAVE_MBRLEN
-#  include <wchar.h>
-# else
-   /* Simulate mbrlen with mblen as best we can.  */
-#  define mbstate_t int
-#  define mbrlen(s, n, ps) mblen (s, n)
-#  define mbsinit(ps) (*(ps) == 0)
-# endif
-  static const mbstate_t mbstate_zero;
-#endif
-
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#if STDC_HEADERS
-# include <stddef.h>
-# include <stdlib.h>
-# include <string.h>
-#else
-# ifndef HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#ifdef _LIBC
-# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
-#else
-# ifndef HAVE_MEMPCPY
-#  define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
-# endif
-#endif
-
-#ifndef __P
-# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#  define __P(args) args
-# else
-#  define __P(args) ()
-# endif  /* GCC.  */
-#endif  /* Not __P.  */
-
-#ifndef PTR
-# ifdef __STDC__
-#  define PTR void *
-# else
-#  define PTR char *
-# endif
-#endif
-
-#ifndef CHAR_BIT
-# define CHAR_BIT 8
-#endif
-
-#ifndef NULL
-# define NULL 0
-#endif
-
-#define TYPE_SIGNED(t) ((t) -1 < 0)
-
-/* Bound on length of the string representing an integer value of type t.
-   Subtract one for the sign bit if t is signed;
-   302 / 1000 is log10 (2) rounded up;
-   add one for integer division truncation;
-   add one more for a minus sign if t is signed.  */
-#define INT_STRLEN_BOUND(t) \
- ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
-
-#define TM_YEAR_BASE 1900
-
-#ifndef __isleap
-/* Nonzero if YEAR is a leap year (every 4 years,
-   except every 100th isn't, and every 400th is).  */
-# define __isleap(year)	\
-  ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
-#endif
-
-
-#ifdef _LIBC
-# define my_strftime_gmtime_r __gmtime_r
-# define my_strftime_localtime_r __localtime_r
-# define tzname __tzname
-# define tzset __tzset
-#else
-
-/* If we're a strftime substitute in a GNU program, then prefer gmtime
-   to gmtime_r, since many gmtime_r implementations are buggy.
-   Similarly for localtime_r.  */
-
-# if ! HAVE_TM_GMTOFF
-//static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
-static struct tm *
-my_strftime_gmtime_r (const time_t *t, struct tm *tp)
-{
-  struct tm *l = gmtime (t);
-  if (! l)
-    return 0;
-  *tp = *l;
-  return tp;
-}
-# endif /* ! HAVE_TM_GMTOFF */
-
-//static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
-static struct tm *
-my_strftime_localtime_r (const time_t *t, struct tm *tp)
-{
-  struct tm *l = localtime (t);
-  if (! l)
-    return 0;
-  *tp = *l;
-  return tp;
-}
-#endif /* ! defined _LIBC */
-
-
-#if !defined memset && !defined HAVE_MEMSET && !defined _LIBC
-/* Some systems lack the `memset' function and we don't want to
-   introduce additional dependencies.  */
-/* The SGI compiler reportedly barfs on the trailing null
-   if we use a string constant as the initializer.  28 June 1997, rms.  */
-static const char spaces[16] = /* "                " */
-  { ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
-static const char zeroes[16] = /* "0000000000000000" */
-  { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0' };
-
-# define memset_space(P, Len) \
-  do {									      \
-    int _len = (Len);							      \
-									      \
-    do									      \
-      {									      \
-	int _this = _len > 16 ? 16 : _len;				      \
-	(P) = MEMPCPY ((P), spaces, _this);				      \
-	_len -= _this;							      \
-      }									      \
-    while (_len > 0);							      \
-  } while (0)
-
-# define memset_zero(P, Len) \
-  do {									      \
-    int _len = (Len);							      \
-									      \
-    do									      \
-      {									      \
-	int _this = _len > 16 ? 16 : _len;				      \
-	(P) = MEMPCPY ((P), zeroes, _this);				      \
-	_len -= _this;							      \
-      }									      \
-    while (_len > 0);							      \
-  } while (0)
-#else
-# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
-# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
-#endif
-
-#define add(n, f)							      \
-  do									      \
-    {									      \
-      int _n = (n);							      \
-      int _delta = width - _n;						      \
-      int _incr = _n + (_delta > 0 ? _delta : 0);			      \
-      if (i + _incr >= maxsize)						      \
-	return 0;							      \
-      if (p)								      \
-	{								      \
-	  if (_delta > 0)						      \
-	    {								      \
-	      if (pad == '0')						      \
-		memset_zero (p, _delta);				      \
-	      else							      \
-		memset_space (p, _delta);				      \
-	    }								      \
-	  f;								      \
-	  p += _n;							      \
-	}								      \
-      i += _incr;							      \
-    } while (0)
-
-#define cpy(n, s) \
-    add ((n),								      \
-	 if (to_lowcase)						      \
-	   memcpy_lowcase (p, (s), _n);					      \
-	 else if (to_uppcase)						      \
-	   memcpy_uppcase (p, (s), _n);					      \
-	 else								      \
-	   memcpy ((PTR) p, (PTR) (s), _n))
-
-
-
-#ifdef _LIBC
-# define TOUPPER(Ch) toupper (Ch)
-# define TOLOWER(Ch) tolower (Ch)
-#else
-# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
-# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
-#endif
-/* We don't use `isdigit' here since the locale dependent
-   interpretation is not what we want here.  We only need to accept
-   the arabic digits in the ASCII range.  One day there is perhaps a
-   more reliable way to accept other sets of digits.  */
-#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9)
-
-//static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
-
-static char *
-memcpy_lowcase (char *dest, const char *src, size_t len)
-{
-  while (len-- > 0)
-    dest[len] = TOLOWER ((unsigned char) src[len]);
-  return dest;
-}
-
-//static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
-
-static char *
-memcpy_uppcase (char *dest, const char *src, size_t len)
-{
-  while (len-- > 0)
-    dest[len] = TOUPPER ((unsigned char) src[len]);
-  return dest;
-}
-
-
-#if ! HAVE_TM_GMTOFF
-/* Yield the difference between *A and *B,
-   measured in seconds, ignoring leap seconds.  */
-# define tm_diff ftime_tm_diff
-//static int tm_diff __P ((const struct tm *, const struct tm *));
-static int
-tm_diff (const struct tm *a, const struct tm *b)
-{
-  /* Compute intervening leap days correctly even if year is negative.
-     Take care to avoid int overflow in leap day calculations,
-     but it's OK to assume that A and B are close to each other.  */
-  int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3);
-  int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3);
-  int a100 = a4 / 25 - (a4 % 25 < 0);
-  int b100 = b4 / 25 - (b4 % 25 < 0);
-  int a400 = a100 >> 2;
-  int b400 = b100 >> 2;
-  int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
-  int years = a->tm_year - b->tm_year;
-  int days = (365 * years + intervening_leap_days
-	      + (a->tm_yday - b->tm_yday));
-  return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
-		+ (a->tm_min - b->tm_min))
-	  + (a->tm_sec - b->tm_sec));
-}
-#endif /* ! HAVE_TM_GMTOFF */
-
-
-
-/* The number of days from the first day of the first ISO week of this
-   year to the year day YDAY with week day WDAY.  ISO weeks start on
-   Monday; the first ISO week has the year's first Thursday.  YDAY may
-   be as small as YDAY_MINIMUM.  */
-#define ISO_WEEK_START_WDAY 1 /* Monday */
-#define ISO_WEEK1_WDAY 4 /* Thursday */
-#define YDAY_MINIMUM (-366)
-//static int iso_week_days __P ((int, int));
-#ifdef __GNUC__
-__inline__
-#endif
-static int
-iso_week_days (int yday, int wday)
-{
-  /* Add enough to the first operand of % to make it nonnegative.  */
-  int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
-  return (yday
-	  - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
-	  + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
-}
-
-
-#if !(defined _NL_CURRENT || HAVE_STRFTIME)
-static char const weekday_name[][10] =
-  {
-    "Sunday", "Monday", "Tuesday", "Wednesday",
-    "Thursday", "Friday", "Saturday"
-  };
-static char const month_name[][10] =
-  {
-    "January", "February", "March", "April", "May", "June",
-    "July", "August", "September", "October", "November", "December"
-  };
-#endif
-
-
-#ifdef emacs
-# define my_strftime emacs_strftimeu
-# define ut_argument , ut
-# define ut_argument_spec int ut;
-# define ut_argument_spec_iso , int ut
-#else
-# define my_strftime strftime
-# define ut_argument
-# define ut_argument_spec
-# define ut_argument_spec_iso
-/* We don't have this information in general.  */
-# define ut 0
-#endif
-
-#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
-  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
-     Work around this bug by copying *tp before it might be munged.  */
-//  size_t _strftime_copytm __P ((char *, size_t, const char *, const struct tm * ut_argument_spec_iso));
-  size_t
-  my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp ut_argument)
-  {
-    struct tm tmcopy;
-    tmcopy = *tp;
-    return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
-  }
-# undef my_strftime
-# define my_strftime(S, Maxsize, Format, Tp) \
-  _strftime_copytm (S, Maxsize, Format, Tp)
-#endif
-
-
-/* Write information from TP into S according to the format
-   string FORMAT, writing no more that MAXSIZE characters
-   (including the terminating '\0') and returning number of
-   characters written.  If S is NULL, nothing will be written
-   anywhere, so to determine how many characters would be
-   written, use NULL for S and (size_t) UINT_MAX for MAXSIZE.  */
-size_t
-my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp ut_argument)
-{
-  int hour12 = tp->tm_hour;
-#ifdef _NL_CURRENT
-  /* We cannot make the following values variables since we must delay
-     the evaluation of these values until really needed since some
-     expressions might not be valid in every situation.  The `struct tm'
-     might be generated by a strptime() call that initialized
-     only a few elements.  Dereference the pointers only if the format
-     requires this.  Then it is ok to fail if the pointers are invalid.  */
-# define a_wkday _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)
-# define f_wkday _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday)
-# define a_month _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)
-# define f_month _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon)
-# define ampm _NL_CURRENT (LC_TIME, tp->tm_hour > 11 ? PM_STR : AM_STR)
-
-# define aw_len strlen (a_wkday)
-# define am_len strlen (a_month)
-# define ap_len strlen (ampm)
-#else
-# if !HAVE_STRFTIME
-# define f_wkday (weekday_name[tp->tm_wday])
-# define f_month (month_name[tp->tm_mon])
-# define a_wkday f_wkday
-# define a_month f_month
-# define ampm ("AMPM" + 2 * (tp->tm_hour > 11))
-
-  size_t aw_len = 3;
-  size_t am_len = 3;
-  size_t ap_len = 2;
-# endif
-#endif
-  const char *zone;
-  size_t i = 0;
-  char *p = s;
-  const char *f;
-
-  zone = NULL;
-#if HAVE_TM_ZONE
-  /* The POSIX test suite assumes that setting
-     the environment variable TZ to a new value before calling strftime()
-     will influence the result (the %Z format) even if the information in
-     TP is computed with a totally different time zone.
-     This is bogus: though POSIX allows bad behavior like this,
-     POSIX does not require it.  Do the right thing instead.  */
-  zone = (const char *) tp->tm_zone;
-#endif
-#if HAVE_TZNAME
-  if (ut)
-    {
-      if (! (zone && *zone))
-	zone = "GMT";
-    }
-  else
-    {
-      /* POSIX.1 8.1.1 requires that whenever strftime() is called, the
-	 time zone names contained in the external variable `tzname' shall
-	 be set as if the tzset() function had been called.  */
-# if HAVE_TZSET
-      tzset ();
-# endif
-    }
-#endif
-
-  if (hour12 > 12)
-    hour12 -= 12;
-  else
-    if (hour12 == 0)
-      hour12 = 12;
-
-  for (f = format; *f != '\0'; ++f)
-    {
-      int pad = 0;		/* Padding for number ('-', '_', or 0).  */
-      int modifier;		/* Field modifier ('E', 'O', or 0).  */
-      int digits;		/* Max digits for numeric format.  */
-      int number_value; 	/* Numeric value to be printed.  */
-      int negative_number;	/* 1 if the number is negative.  */
-      const char *subfmt;
-      char *bufp;
-      char buf[1 + (sizeof (int) < sizeof (time_t)
-		    ? INT_STRLEN_BOUND (time_t)
-		    : INT_STRLEN_BOUND (int))];
-      int width = -1;
-      int to_lowcase = 0;
-      int to_uppcase = 0;
-      int change_case = 0;
-      int format_char;
-
-#if DO_MULTIBYTE
-
-       switch (*f)
-	{
-	case '%':
-	  break;
-
-	case '\a': case '\b': case '\t': case '\n':
-	case '\v': case '\f': case '\r':
-	case ' ': case '!': case '"': case '#': case '&': case'\'':
-	case '(': case ')': case '*': case '+': case ',': case '-':
-	case '.': case '/': case '0': case '1': case '2': case '3':
-	case '4': case '5': case '6': case '7': case '8': case '9':
-	case ':': case ';': case '<': case '=': case '>': case '?':
-	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-	case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-	case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-	case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-	case 'Y': case 'Z': case '[': case'\\': case ']': case '^':
-	case '_': case 'a': case 'b': case 'c': case 'd': case 'e':
-	case 'f': case 'g': case 'h': case 'i': case 'j': case 'k':
-	case 'l': case 'm': case 'n': case 'o': case 'p': case 'q':
-	case 'r': case 's': case 't': case 'u': case 'v': case 'w':
-	case 'x': case 'y': case 'z': case '{': case '|': case '}':
-	case '~':
-	  /* The C Standard requires these 98 characters (plus '%') to
-	     be in the basic execution character set.  None of these
-	     characters can start a multibyte sequence, so they need
-	     not be analyzed further.  */
-	  add (1, *p = *f);
-	  continue;
-
-	default:
-	  /* Copy this multibyte sequence until we reach its end, find
-	     an error, or come back to the initial shift state.  */
-	  {
-	    mbstate_t mbstate = mbstate_zero;
-	    size_t len = 0;
-
-	    do
-	      {
-		size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
-
-		if (bytes == 0)
-		  break;
-
-		if (bytes == (size_t) -2)
-		  {
-		    len += strlen (f + len);
-		    break;
-		  }
-
-		if (bytes == (size_t) -1)
-		  {
-		    len++;
-		    break;
-		  }
-
-		len += bytes;
-	      }
-	    while (! mbsinit (&mbstate));
-
-	    cpy (len, f);
-	    f += len - 1;
-	    continue;
-	  }
-	}
-
-#else /* ! DO_MULTIBYTE */
-
-      /* Either multibyte encodings are not supported, or they are
-	 safe for formats, so any non-'%' byte can be copied through.  */
-      if (*f != '%')
-	{
-	  add (1, *p = *f);
-	  continue;
-	}
-
-#endif /* ! DO_MULTIBYTE */
-
-      /* Check for flags that can modify a format.  */
-      while (1)
-	{
-	  switch (*++f)
-	    {
-	      /* This influences the number formats.  */
-	    case '_':
-	    case '-':
-	    case '0':
-	      pad = *f;
-	      continue;
-
-	      /* This changes textual output.  */
-	    case '^':
-	      to_uppcase = 1;
-	      continue;
-	    case '#':
-	      change_case = 1;
-	      continue;
-
-	    default:
-	      break;
-	    }
-	  break;
-	}
-
-      /* As a GNU extension we allow to specify the field width.  */
-      if (ISDIGIT (*f))
-	{
-	  width = 0;
-	  do
-	    {
-	      width *= 10;
-	      width += *f - '0';
-	      ++f;
-	    }
-	  while (ISDIGIT (*f));
-	}
-
-      /* Check for modifiers.  */
-      switch (*f)
-	{
-	case 'E':
-	case 'O':
-	  modifier = *f++;
-	  break;
-
-	default:
-	  modifier = 0;
-	  break;
-	}
-
-      /* Now do the specified format.  */
-      format_char = *f;
-      switch (format_char)
-	{
-#define DO_NUMBER(d, v) \
-	  digits = width == -1 ? d : width;				      \
-	  number_value = v; goto do_number
-#define DO_NUMBER_SPACEPAD(d, v) \
-	  digits = width == -1 ? d : width;				      \
-	  number_value = v; goto do_number_spacepad
-
-	case '%':
-	  if (modifier != 0)
-	    goto bad_format;
-	  add (1, *p = *f);
-	  break;
-
-	case 'a':
-	  if (modifier != 0)
-	    goto bad_format;
-	  if (change_case)
-	    {
-	      to_uppcase = 1;
-	      to_lowcase = 0;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (aw_len, a_wkday);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'A':
-	  if (modifier != 0)
-	    goto bad_format;
-	  if (change_case)
-	    {
-	      to_uppcase = 1;
-	      to_lowcase = 0;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (strlen (f_wkday), f_wkday);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'b':
-	case 'h':		/* POSIX.2 extension.  */
-	  if (modifier != 0)
-	    goto bad_format;
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (am_len, a_month);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'B':
-	  if (modifier != 0)
-	    goto bad_format;
-	  if (change_case)
-	    {
-	      to_uppcase = 1;
-	      to_lowcase = 0;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (strlen (f_month), f_month);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'c':
-	  if (modifier == 'O')
-	    goto bad_format;
-#ifdef _NL_CURRENT
-	  if (! (modifier == 'E'
-		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
-	    subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
-#else
-# if HAVE_STRFTIME
-	  goto underlying_strftime;
-# else
-	  subfmt = "%a %b %e %H:%M:%S %Y";
-# endif
-#endif
-
-	subformat:
-	  {
-	    char *old_start = p;
-	    size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
-	    add (len, my_strftime (p, maxsize - i, subfmt, tp));
-
-	    if (to_uppcase)
-	      while (old_start < p)
-		{
-		  *old_start = TOUPPER ((unsigned char) *old_start);
-		  ++old_start;
-		}
-	  }
-	  break;
-
-#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
-	underlying_strftime:
-	  {
-	    /* The relevant information is available only via the
-	       underlying strftime implementation, so use that.  */
-	    char ufmt[4];
-	    char *u = ufmt;
-	    char ubuf[1024]; /* enough for any single format in practice */
-	    size_t len;
-	    *u++ = '%';
-	    if (modifier != 0)
-	      *u++ = modifier;
-	    *u++ = format_char;
-	    *u = '\0';
-	    len = strftime (ubuf, sizeof ubuf, ufmt, tp);
-	    if (len == 0 && ubuf[0] != '\0')
-	      return 0;
-	    cpy (len, ubuf);
-	  }
-	  break;
-#endif
-
-	case 'C':		/* POSIX.2 extension.  */
-	  if (modifier == 'O')
-	    goto bad_format;
-	  if (modifier == 'E')
-	    {
-#if HAVE_STRUCT_ERA_ENTRY
-	      struct era_entry *era = _nl_get_era_entry (tp);
-	      if (era)
-		{
-		  size_t len = strlen (era->name_fmt);
-		  cpy (len, era->name_fmt);
-		  break;
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-
-	  {
-	    int year = tp->tm_year + TM_YEAR_BASE;
-	    DO_NUMBER (1, year / 100 - (year % 100 < 0));
-	  }
-
-	case 'x':
-	  if (modifier == 'O')
-	    goto bad_format;
-#ifdef _NL_CURRENT
-	  if (! (modifier == 'E'
-		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
-	    subfmt = _NL_CURRENT (LC_TIME, D_FMT);
-	  goto subformat;
-#else
-# if HAVE_STRFTIME
-	  goto underlying_strftime;
-# else
-	  /* Fall through.  */
-# endif
-#endif
-	case 'D':		/* POSIX.2 extension.  */
-	  if (modifier != 0)
-	    goto bad_format;
-	  subfmt = "%m/%d/%y";
-	  goto subformat;
-
-	case 'd':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_mday);
-
-	case 'e':		/* POSIX.2 extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER_SPACEPAD (2, tp->tm_mday);
-
-	  /* All numeric formats set DIGITS and NUMBER_VALUE and then
-	     jump to one of these two labels.  */
-
-	do_number_spacepad:
-	  /* Force `_' flag unless overwritten by `0' flag.  */
-	  if (pad != '0')
-	    pad = '_';
-
-	do_number:
-	  /* Format the number according to the MODIFIER flag.  */
-
-	  if (modifier == 'O' && 0 <= number_value)
-	    {
-#ifdef _NL_CURRENT
-	      /* Get the locale specific alternate representation of
-		 the number NUMBER_VALUE.  If none exist NULL is returned.  */
-	      const char *cp = _nl_get_alt_digit (number_value);
-
-	      if (cp != NULL)
-		{
-		  size_t digitlen = strlen (cp);
-		  if (digitlen != 0)
-		    {
-		      cpy (digitlen, cp);
-		      break;
-		    }
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-	  {
-	    unsigned int u = number_value;
-
-	    bufp = buf + sizeof (buf);
-	    negative_number = number_value < 0;
-
-	    if (negative_number)
-	      u = -u;
-
-	    do
-	      *--bufp = u % 10 + '0';
-	    while ((u /= 10) != 0);
-  	  }
-
-	do_number_sign_and_padding:
-	  if (negative_number)
-	    *--bufp = '-';
-
-	  if (pad != '-')
-	    {
-	      int padding = digits - (buf + sizeof (buf) - bufp);
-
-	      if (pad == '_')
-		{
-		  while (0 < padding--)
-		    *--bufp = ' ';
-		}
-	      else
-		{
-		  bufp += negative_number;
-		  while (0 < padding--)
-		    *--bufp = '0';
-		  if (negative_number)
-		    *--bufp = '-';
-		}
-	    }
-
-	  cpy (buf + sizeof (buf) - bufp, bufp);
-	  break;
-
-	case 'F':
-	  if (modifier != 0)
-	    goto bad_format;
-	  subfmt = "%Y-%m-%d";
-	  goto subformat;
-
-	case 'H':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_hour);
-
-	case 'I':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, hour12);
-
-	case 'k':		/* GNU extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER_SPACEPAD (2, tp->tm_hour);
-
-	case 'l':		/* GNU extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER_SPACEPAD (2, hour12);
-
-	case 'j':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (3, 1 + tp->tm_yday);
-
-	case 'M':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_min);
-
-	case 'm':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_mon + 1);
-
-	case 'n':		/* POSIX.2 extension.  */
-	  add (1, *p = '\n');
-	  break;
-
-	case 'P':
-	  to_lowcase = 1;
-#if !defined _NL_CURRENT && HAVE_STRFTIME
-	  format_char = 'p';
-#endif
-	  /* FALLTHROUGH */
-
-	case 'p':
-	  if (change_case)
-	    {
-	      to_uppcase = 0;
-	      to_lowcase = 1;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (ap_len, ampm);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'R':		/* GNU extension.  */
-	  subfmt = "%H:%M";
-	  goto subformat;
-
-	case 'r':		/* POSIX.2 extension.  */
-#ifdef _NL_CURRENT
-	  if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0')
-#endif
-	    subfmt = "%I:%M:%S %p";
-	  goto subformat;
-
-	case 'S':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_sec);
-
-	case 's':		/* GNU extension.  */
-  	  {
-	    struct tm ltm;
-	    time_t t;
-
-	    ltm = *tp;
-	    t = mktime (&ltm);
-
-	    /* Generate string value for T using time_t arithmetic;
-	       this works even if sizeof (long) < sizeof (time_t).  */
-
-	    bufp = buf + sizeof (buf);
-	    negative_number = t < 0;
-
-	    do
-	      {
-		int d = t % 10;
-		t /= 10;
-
-		if (negative_number)
-		  {
-		    d = -d;
-
-		    /* Adjust if division truncates to minus infinity.  */
-		    if (0 < -1 % 10 && d < 0)
-		      {
-			t++;
-			d += 10;
-		      }
-		  }
-
-		*--bufp = d + '0';
-	      }
-	    while (t != 0);
-
-	    digits = 1;
-	    goto do_number_sign_and_padding;
-	  }
-
-	case 'X':
-	  if (modifier == 'O')
-	    goto bad_format;
-#ifdef _NL_CURRENT
-	  if (! (modifier == 'E'
-		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
-	    subfmt = _NL_CURRENT (LC_TIME, T_FMT);
-	  goto subformat;
-#else
-# if HAVE_STRFTIME
-	  goto underlying_strftime;
-# else
-	  /* Fall through.  */
-# endif
-#endif
-	case 'T':		/* POSIX.2 extension.  */
-	  subfmt = "%H:%M:%S";
-	  goto subformat;
-
-	case 't':		/* POSIX.2 extension.  */
-	  add (1, *p = '\t');
-	  break;
-
-	case 'u':		/* POSIX.2 extension.  */
-	  DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
-
-	case 'U':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
-
-	case 'V':
-	case 'g':		/* GNU extension.  */
-	case 'G':		/* GNU extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-	  {
-	    int year = tp->tm_year + TM_YEAR_BASE;
-	    int days = iso_week_days (tp->tm_yday, tp->tm_wday);
-
-	    if (days < 0)
-	      {
-		/* This ISO week belongs to the previous year.  */
-		year--;
-		days = iso_week_days (tp->tm_yday + (365 + __isleap (year)),
-				      tp->tm_wday);
-	      }
-	    else
-	      {
-		int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)),
-				       tp->tm_wday);
-		if (0 <= d)
-		  {
-		    /* This ISO week belongs to the next year.  */
-		    year++;
-		    days = d;
-		  }
-	      }
-
-	    switch (*f)
-	      {
-	      case 'g':
-		DO_NUMBER (2, (year % 100 + 100) % 100);
-
-	      case 'G':
-		DO_NUMBER (1, year);
-
-	      default:
-		DO_NUMBER (2, days / 7 + 1);
-	      }
-	  }
-
-	case 'W':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
-
-	case 'w':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (1, tp->tm_wday);
-
-	case 'Y':
-	  if (modifier == 'E')
-	    {
-#if HAVE_STRUCT_ERA_ENTRY
-	      struct era_entry *era = _nl_get_era_entry (tp);
-	      if (era)
-		{
-		  subfmt = strchr (era->name_fmt, '\0') + 1;
-		  goto subformat;
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-	  if (modifier == 'O')
-	    goto bad_format;
-	  else
-	    DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
-
-	case 'y':
-	  if (modifier == 'E')
-	    {
-#if HAVE_STRUCT_ERA_ENTRY
-	      struct era_entry *era = _nl_get_era_entry (tp);
-	      if (era)
-		{
-		  int delta = tp->tm_year - era->start_date[0];
-		  DO_NUMBER (1, (era->offset
-				 + (era->direction == '-' ? -delta : delta)));
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-	  DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
-
-	case 'Z':
-	  if (change_case)
-	    {
-	      to_uppcase = 0;
-	      to_lowcase = 1;
-	    }
-
-#if HAVE_TZNAME
-	  /* The tzset() call might have changed the value.  */
-	  if (!(zone && *zone) && tp->tm_isdst >= 0)
-	    zone = tzname[tp->tm_isdst];
-#endif
-	  if (! zone)
-	    zone = "";		/* POSIX.2 requires the empty string here.  */
-
-	  cpy (strlen (zone), zone);
-	  break;
-
-	case 'z':		/* GNU extension.  */
-	  if (tp->tm_isdst < 0)
-	    break;
-
-	  {
-	    int diff;
-#if HAVE_TM_GMTOFF
-	    diff = tp->tm_gmtoff;
-#else
-	    if (ut)
-	      diff = 0;
-	    else
-	      {
-		struct tm gtm;
-		struct tm ltm;
-		time_t lt;
-
-		ltm = *tp;
-		lt = mktime (&ltm);
-
-		if (lt == (time_t) -1)
-		  {
-		    /* mktime returns -1 for errors, but -1 is also a
-		       valid time_t value.  Check whether an error really
-		       occurred.  */
-		    struct tm tm;
-
-		    if (! my_strftime_localtime_r (&lt, &tm)
-			|| ((ltm.tm_sec ^ tm.tm_sec)
-			    | (ltm.tm_min ^ tm.tm_min)
-			    | (ltm.tm_hour ^ tm.tm_hour)
-			    | (ltm.tm_mday ^ tm.tm_mday)
-			    | (ltm.tm_mon ^ tm.tm_mon)
-			    | (ltm.tm_year ^ tm.tm_year)))
-		      break;
-		  }
-
-		if (! my_strftime_gmtime_r (&lt, &gtm))
-		  break;
-
-		diff = tm_diff (&ltm, &gtm);
-	      }
-#endif
-
-	    if (diff < 0)
-	      {
-		add (1, *p = '-');
-		diff = -diff;
-	      }
-	    else
-	      add (1, *p = '+');
-
-	    diff /= 60;
-	    DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
-	  }
-
-	case '\0':		/* GNU extension: % at end of format.  */
-	    --f;
-	    /* Fall through.  */
-	default:
-	  /* Unknown format; output the format, including the '%',
-	     since this is most likely the right thing to do if a
-	     multibyte string has been misparsed.  */
-	bad_format:
-	  {
-	    int flen;
-	    for (flen = 1; f[1 - flen] != '%'; flen++)
-	      continue;
-	    cpy (flen, &f[1 - flen]);
-	  }
-	  break;
-	}
-    }
-
-  if (p && maxsize != 0)
-    *p = '\0';
-  return i;
-}
-
-
-#ifdef emacs
-/* For Emacs we have a separate interface which corresponds to the normal
-   strftime function and does not have the extra information whether the
-   TP arguments comes from a `gmtime' call or not.  */
-size_t
-emacs_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp)
-{
-  return my_strftime (s, maxsize, format, tp, 0);
-}
-#endif
-/* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 181
src/compat/inet_ntop.c

@@ -1,181 +0,0 @@
-/*
- * inet_ntop.c --
- *
- *	provides inet_ntop()
- */
-
-
-#include "inet_ntop.h"
-#include "sprintf.h"
-
-#ifndef HAVE_INET_NTOP
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#define NS_INADDRSZ     4       /* IPv4 T_A */
-#define NS_IN6ADDRSZ    16      /* IPv6 T_AAAA */
-#define NS_INT16SZ      2       /* #/bytes of data in a uint16_t */
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4 (const u_char *src, char *dst, socklen_t size);
-#ifdef USE_IPV6
-static const char *inet_ntop6 (const u_char *src, char *dst, socklen_t size);
-#endif /* USE_IPV6 */
-
-/* char *
- * inet_ntop(af, src, dst, size)
- *	convert a network format address to presentation format.
- * return:
- *	pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- *	Paul Vixie, 1996.
- */
-const char *
-inet_ntop(int af, const void *src, char *dst, socklen_t size)
-{
-	switch (af) {
-	case AF_INET:
-		return (inet_ntop4((const u_char *) src, dst, size));
-#ifdef USE_IPV6
-	case AF_INET6:
-		return (inet_ntop6((const u_char *) src, dst, size));
-#endif /* USE_IPV6 */
-	default:
-		return (NULL);
-	}
-	/* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- *	format an IPv4 address
- * return:
- *	`dst' (as a const)
- * notes:
- *	(1) uses no statics
- *	(2) takes a u_char* not an in_addr as input
- * author:
- *	Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(const u_char *src, char *dst, socklen_t size)
-{
-	static const char fmt[] = "%u.%u.%u.%u";
-	char tmp[sizeof "255.255.255.255"];
-
-	if (simple_snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]) > size) {
-		return (NULL);
-	}
-	return strcpy(dst, tmp);
-}
-
-#ifdef USE_IPV6
-/* const char *
- * inet_ntop6(src, dst, size)
- *	convert IPv6 binary address into presentation (printable) format
- * author:
- *	Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(const u_char *src, char *dst, socklen_t size)
-{
-	/*
-	 * Note that int32_t and int16_t need only be "at least" large enough
-	 * to contain a value of the specified size.  On some systems, like
-	 * Crays, there is no such thing as an integer variable with 16 bits.
-	 * Keep this in mind if you think this function should have been coded
-	 * to use pointer overlays.  All the world's not a VAX.
-	 */
-	char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
-	struct { int base, len; } best, cur;
-	unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
-	int i;
-
-	/*
-	 * Preprocess:
-	 *	Copy the input (bytewise) array into a wordwise array.
-	 *	Find the longest run of 0x00's in src[] for :: shorthanding.
-	 */
-	memset(words, '\0', sizeof words);
-	for (i = 0; i < NS_IN6ADDRSZ; i += 2)
-		words[i >> 1] = (src[i] << 8) | src[i + 1];
-	best.base = -1;
-        best.len = 0;
-	cur.base = -1;
-        cur.len = 0;
-	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
-		if (words[i] == 0) {
-			if (cur.base == -1)
-				cur.base = i, cur.len = 1;
-			else
-				cur.len++;
-		} else {
-			if (cur.base != -1) {
-				if (best.base == -1 || cur.len > best.len)
-					best = cur;
-				cur.base = -1;
-			}
-		}
-	}
-	if (cur.base != -1) {
-		if (best.base == -1 || cur.len > best.len)
-			best = cur;
-	}
-	if (best.base != -1 && best.len < 2)
-		best.base = -1;
-
-	/*
-	 * Format the result.
-	 */
-	tp = tmp;
-	for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
-		/* Are we inside the best run of 0x00's? */
-		if (best.base != -1 && i >= best.base &&
-		    i < (best.base + best.len)) {
-			if (i == best.base)
-				*tp++ = ':';
-			continue;
-		}
-		/* Are we following an initial run of 0x00s or any real hex? */
-		if (i != 0)
-			*tp++ = ':';
-		/* Is this address an encapsulated IPv4? */
-		if (i == 6 && best.base == 0 &&
-		    (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
-			if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
-				return (NULL);
-			tp += strlen(tp);
-			break;
-		}
-		tp += simple_snprintf(tp, sizeof(tmp), "%x", words[i]);
-	}
-	/* Was it a trailing run of 0x00's? */
-	if (best.base != -1 && (best.base + best.len) ==
-	    (NS_IN6ADDRSZ / NS_INT16SZ))
-		*tp++ = ':';
-	*tp++ = '\0';
-
-	/*
-	 * Check for overflow, copy, and we're done.
-	 */
-	if ((socklen_t)(tp - tmp) > size) {
-		return (NULL);
-	}
-	return strcpy(dst, tmp);
-}
-#endif /* USE_IPV6 */
-#endif /* !HAVE_INET_NTOP */
-/* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 29
src/compat/inet_ntop.h

@@ -1,29 +0,0 @@
-/*
- * inet_ntop.h --
- *
- *	prototypes for inet_ntop.c
- */
-
-#ifndef _EGG_COMPAT_INET_NTOP_H
-#define _EGG_COMPAT_INET_NTOP_H
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef HAVE_INET_NTOP
-const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_EGG_COMPAT_INET_NTOP_H */

+ 0 - 17
src/compat/memcpy.c

@@ -1,17 +0,0 @@
-/*
- * memcpy.c -- provides memcpy() if necessary.
- *
- */
-
-
-#include "memcpy.h"
-
-#ifndef HAVE_MEMCPY
-void *memcpy(void *dest, const void *src, size_t n)
-{
-  while (n--)
-    *((char *) dest)++ = *((char *) src)++;
-  return dest;
-}
-#endif /* !HAVE_MEMCPY */
-/* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 27
src/compat/memcpy.h

@@ -1,27 +0,0 @@
-/*
- * memcpy.h
- *   prototypes for memcpy.c
- *
- */
-
-#ifndef _EGG_COMPAT_MEMCPY_H
-#define _EGG_COMPAT_MEMCPY_H
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef HAVE_MEMCPY
-/* Use our own implementation. */
-void *memcpy(void *dest, const void *src, size_t n);
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif	/* !__EGG_COMPAT_MEMCPY_H */

+ 0 - 16
src/compat/memset.c

@@ -1,16 +0,0 @@
-/*
- * memset.c -- provides memset() if necessary.
- *
- */
-
-#include "memset.h"
-
-#ifndef HAVE_MEMSET
-void *memset(void *dest, int c, size_t n)
-{
-  while (n--)
-    *((unsigned char *) dest)++ = c;
-  return dest;
-}
-#endif /* !HAVE_MEMSET */
-/* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 32
src/compat/memset.h

@@ -1,32 +0,0 @@
-/*
- * memset.h
- *   prototypes for memset.c
- *
- */
-
-#ifndef _EGG_COMPAT_MEMSET_H
-#define _EGG_COMPAT_MEMSET_H
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef HAVE_MEMSET
-/* Use our own implementation. */
-void *memset(void *dest, int c, size_t n);
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-/* Use memset instead of bzero.
- */
-//#undef bzero
-//#define bzero(dest, n)	memset(dest, 0, n)
-
-#endif	/* !__EGG_COMPAT_MEMSET_H */

+ 2 - 34
src/compat/memutil.c

@@ -1,5 +1,4 @@
 #include <string.h>
-#include "memcpy.h"
 #include "memutil.h"
 #include <stdlib.h>
 
@@ -15,50 +14,19 @@ str_redup(char **str, const char *newstr)
                 return;
         }
         len = strlen(newstr) + 1;
-        *str = (char *) my_realloc(*str, len);
+        *str = (char *) realloc(*str, len);
         memcpy(*str, newstr, len);
 }
 
-char *
-strdup(const char *entry)
-{
-  size_t len = strlen(entry);
-  char *target = (char *) my_calloc(1, len + 1);
-  if (target == NULL) return NULL;
-  target[len] = 0;
-  return (char *) memcpy(target, entry, len);
-}
-
 char *
 strldup(const char *entry, size_t maxlen)
 {
   size_t slen = strlen(entry);
   size_t len = slen < maxlen ? slen : maxlen;
-  char *target = (char *) my_calloc(1, len + 1);
+  char *target = (char *) calloc(1, len + 1);
   if (target == NULL) return NULL;
   target[len] = 0;
   return (char *) memcpy(target, entry, len);
 }
 
-
-void *my_calloc(size_t nmemb, size_t size)
-{
-  void *ptr = calloc(nmemb, size);
-
-  if (ptr == NULL)
-    exit(5);
-  
-  return ptr;
-}
-
-void *my_realloc(void *ptr, size_t size)
-{
-  void *x = realloc(ptr, size);
-
-  if (x == NULL && size > 0)
-    exit(5);
-
-  return x;
-}
-
 /* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 9
src/compat/memutil.h

@@ -8,24 +8,15 @@
 #include <sys/types.h>
 
 //#undef str_redup
-//#undef strdup
-#undef calloc
-#undef realloc
 
 #define str_redup my_str_redup
-#define strdup my_strdup
-//#define calloc my_calloc
-//#define realloc my_realloc
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 void str_redup(char **, const char *);
-char *strdup(const char *);
 char *strldup(const char *, size_t);
-void *my_calloc(size_t, size_t);
-void *my_realloc(void *, size_t);
 
 #ifdef __cplusplus
 }

+ 0 - 32
src/compat/strcasecmp.c

@@ -1,32 +0,0 @@
-/*
- * strcasecmp.c -- provides strcasecmp() and strncasecmp if necessary.
- *
- */
-
-
-#include "memcpy.h"
-
-#ifndef HAVE_STRCASECMP
-int strcasecmp(const char *s1, const char *s2)
-{
-  while ((*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
-    s1++;
-    s2++;
-  }
-  return toupper(*s1) - toupper(*s2);
-}
-#endif /* !HAVE_STRCASECMP */
-
-#ifndef HAVE_STRNCASECMP
-int strncasecmp(const char *s1, const char *s2, size_t n)
-{
-  if (!n)
-    return 0;
-  while (--n && (*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
-    s1++;
-    s2++;
-  }
-  return toupper(*s1) - toupper(*s2);
-}
-#endif /* !HAVE_STRNCASECMP */
-/* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 33
src/compat/strcasecmp.h

@@ -1,33 +0,0 @@
-/*
- * strcasecmp.h
- *   prototypes for strcasecmp.c
- *
- */
-
-#ifndef _EGG_COMPAT_STRCASECMP_H
-#define _EGG_COMPAT_STRCASECMP_H
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <ctype.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef HAVE_STRCASECMP
-/* Use our own implementation. */
-int strcasecmp(const char *, const char *);
-#endif
-
-#ifndef HAVE_STRNCASECMP
-/* Use our own implementation. */
-int strncasecmp(const char *, const char *, size_t);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif	/* !__EGG_COMPAT_STRCASECMP_H */

+ 0 - 16
src/compat/strftime.c

@@ -1,16 +0,0 @@
-/*
- * strftime.c
- *   Portable strftime implementation. Uses GNU's strftime().
- *
- */
-
-#include "strftime.h"
-
-#ifndef HAVE_STRFTIME
-#  undef emacs
-#  undef _LIBC
-#  define strftime	strftime
-
-#  include "gnu_strftime.c"
-#endif	/* !HAVE_STRFTIME */
-/* vim: set sts=2 sw=2 ts=8 et: */

+ 0 - 29
src/compat/strftime.h

@@ -1,29 +0,0 @@
-/*
- * strftime.h
- *   header file for strftime.c
- *
- */
-
-#ifndef _EGG_COMPAT_STRFTIME_H_
-#define _EGG_COMPAT_STRFTIME_H_
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Use the system libraries version of strftime() if available. Otherwise
- * use our own.
- */
-#ifndef HAVE_STRFTIME
-size_t strftime(char *s, size_t maxsize, const char *format, const struct tm *tp);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif	/* !_EGG_COMPAT_STRFTIME_H_ */

+ 7 - 7
src/conf.cc

@@ -317,7 +317,7 @@ fatal:
 void
 init_conf()
 {
-//  conf.bots = (conf_bot *) my_calloc(1, sizeof(conf_bot));
+//  conf.bots = (conf_bot *) calloc(1, sizeof(conf_bot));
 //  conf.bots->nick = NULL;
 //  conf.bots->next = NULL;
   conf.bots = NULL;
@@ -418,7 +418,7 @@ checkpid(const char *nick, conf_bot *bot)
 void
 conf_addbot(const char *nick, const char *ip, const char *host, const char *ip6)
 {
-  conf_bot *bot = (conf_bot *) my_calloc(1, sizeof(conf_bot));
+  conf_bot *bot = (conf_bot *) calloc(1, sizeof(conf_bot));
 
   bot->next = NULL;
   bot->pid_file = NULL;
@@ -879,7 +879,7 @@ conf_bot *conf_bots_dup(conf_bot *src)
     conf_bot *bot = NULL, *newbot = NULL;
 
     for (bot = src; bot && bot->nick; bot = bot->next) {
-      newbot = (conf_bot *) my_calloc(1, sizeof(conf_bot));
+      newbot = (conf_bot *) calloc(1, sizeof(conf_bot));
       conf_bot_dup(newbot, bot);
       list_append((struct list_type **) &(ret), (struct list_type *) newbot);
     }
@@ -954,7 +954,7 @@ fill_conf_bot(bool fatal)
       sdprintf(STR("I am localhub!"));
 
     /* for future, we may just want to make this a pointer to ->bots if we do an emech style currentbot-> */
-    conf.bot = (conf_bot *) my_calloc(1, sizeof(conf_bot));
+    conf.bot = (conf_bot *) calloc(1, sizeof(conf_bot));
     conf_bot_dup(conf.bot, me);
   }
 }
@@ -1086,10 +1086,10 @@ void conf_add_userlist_bots()
         simple_snprintf(tmp, sizeof(tmp), "%li %s", (long)now, conf.bot->nick);
         set_user(&USERENTRY_ADDED, u, tmp);
 
-        bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+        bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
 
-        bi->address = (char *) my_calloc(1, 1);
-        bi->uplink = (char *) my_calloc(1, 1);
+        bi->address = (char *) calloc(1, 1);
+        bi->uplink = (char *) calloc(1, 1);
         bi->telnet_port = bi->relay_port = 3333;
         bi->hublevel = 999;
         set_user(&USERENTRY_BOTADDR, u, bi);

+ 11 - 32
src/config.h.in

@@ -25,9 +25,6 @@
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #undef HAVE_ARPA_INET_H
 
-/* Define to 1 if you have the `clock' function. */
-#undef HAVE_CLOCK
-
 /* define if the compiler supports basic C++11 syntax */
 #undef HAVE_CXX11
 
@@ -48,9 +45,6 @@
 /* Define to 1 if you have the `fork' function. */
 #undef HAVE_FORK
 
-/* Define to 1 if you have the `fsync' function. */
-#undef HAVE_FSYNC
-
 /* Define to 1 if you have the <gelf.h> header file. */
 #undef HAVE_GELF_H
 
@@ -66,15 +60,9 @@
 /* Define to 1 if you have the `gettime' function. */
 #undef HAVE_GETTIME
 
-/* Define to 1 if you have the `inet_ntop' function. */
-#undef HAVE_INET_NTOP
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define to 1 if you have the `isascii' function. */
-#undef HAVE_ISASCII
-
 /* Define to 1 if you have the `dl' library (-ldl). */
 #undef HAVE_LIBDL
 
@@ -99,7 +87,7 @@
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 
-/* Define to 1 if the system has the type 'long long int'. */
+/* Define to 1 if the system has the type `long long int'. */
 #undef HAVE_LONG_LONG_INT
 
 /* Define to 1 if `lstat' has the bug that it succeeds when given the
@@ -113,18 +101,12 @@
    to 0 otherwise. */
 #undef HAVE_MALLOC
 
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
 /* Define to 1 if you have the `memmem' function. */
 #undef HAVE_MEMMEM
 
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
 /* Define to 1 if you have a working `mmap' system call. */
 #undef HAVE_MMAP
 
@@ -143,6 +125,12 @@
 /* Define to 1 if you have the `posix_madvise' function. */
 #undef HAVE_POSIX_MADVISE
 
+/* Define to 1 if you have the `prctl' function. */
+#undef HAVE_PRCTL
+
+/* Define to 1 if you have the `procctl' function. */
+#undef HAVE_PROCCTL
+
 /* Define to 1 if you have the `random' function. */
 #undef HAVE_RANDOM
 
@@ -150,9 +138,6 @@
    and to 0 otherwise. */
 #undef HAVE_REALLOC
 
-/* Define to 1 if you have the `rename' function. */
-#undef HAVE_RENAME
-
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
@@ -175,21 +160,12 @@
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
-/* Define to 1 if you have the `strncasecmp' function. */
-#undef HAVE_STRNCASECMP
-
 /* Define to 1 if `tm_zone' is a member of `struct tm'. */
 #undef HAVE_STRUCT_TM_TM_ZONE
 
@@ -219,6 +195,9 @@
 /* Define to 1 if you have the <sys/prctl.h> header file. */
 #undef HAVE_SYS_PRCTL_H
 
+/* Define to 1 if you have the <sys/procctl.h> header file. */
+#undef HAVE_SYS_PROCCTL_H
+
 /* Define to 1 if you have the <sys/ptrace.h> header file. */
 #undef HAVE_SYS_PTRACE_H
 
@@ -264,7 +243,7 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to 1 if the system has the type 'unsigned long long int'. */
+/* Define to 1 if the system has the type `unsigned long long int'. */
 #undef HAVE_UNSIGNED_LONG_LONG_INT
 
 /* Define to 1 if you have the `vfork' function. */

+ 2 - 2
src/crypt.cc

@@ -47,7 +47,7 @@ char *decrypt_string(const char *keydata, char *in)
     free(buf);
     return res;
   } else {
-    res = (char *) my_calloc(1, len + 1);
+    res = (char *) calloc(1, len + 1);
     strlcpy(res, in, len + 1);
     return res;
   }
@@ -79,7 +79,7 @@ char *salted_sha1(const char *in, const char* saltin)
   tmp = SHA1(buf);
 
   ret_size = SHA1_SALTED_LEN + 1;
-  ret = (char *) my_calloc(1, ret_size);
+  ret = (char *) calloc(1, ret_size);
   simple_snprintf(ret, ret_size, STR("+%s$%s"), salt, tmp);
 
   /* Wipe cleartext pass from sha1 buffers/tmp */

+ 4 - 4
src/crypto/aes_util.cc

@@ -103,7 +103,7 @@ aes_encrypt_ecb_binary(const char *keydata, unsigned char *in, size_t *inlen)
   if (len % CRYPT_BLOCKSIZE)             /* more than 1 block? */
     len += (CRYPT_BLOCKSIZE - (len % CRYPT_BLOCKSIZE));
 
-  out = (unsigned char *) my_calloc(1, len + 1);
+  out = (unsigned char *) calloc(1, len + 1);
   memcpy(out, in, *inlen);
   *inlen = len;
 
@@ -133,7 +133,7 @@ aes_decrypt_ecb_binary(const char *keydata, unsigned char *in, size_t *len)
   unsigned char *out = NULL;
 
   *len -= *len % CRYPT_BLOCKSIZE;
-  out = (unsigned char *) my_calloc(1, *len + 1);
+  out = (unsigned char *) calloc(1, *len + 1);
   memcpy(out, in, *len);
 
   if (!keydata || !*keydata) {
@@ -170,7 +170,7 @@ aes_encrypt_cbc_binary(const char *keydata, unsigned char *in, size_t *inlen, un
     padding = (CRYPT_BLOCKSIZE - (len % CRYPT_BLOCKSIZE));
   len += padding;
 
-  out = (unsigned char *) my_calloc(1, len);
+  out = (unsigned char *) calloc(1, len);
   memset(out + *inlen, padding, padding);
   memcpy(out, in, *inlen);
   *inlen = len;
@@ -196,7 +196,7 @@ aes_decrypt_cbc_binary(const char *keydata, unsigned char *in, size_t *len, unsi
   unsigned char *out = NULL;
 
   *len -= *len % CRYPT_BLOCKSIZE;
-  out = (unsigned char *) my_calloc(1, *len + 1);
+  out = (unsigned char *) calloc(1, *len + 1);
   memcpy(out, in, *len);
 
   if (!keydata || !*keydata) {

+ 4 - 4
src/crypto/bf_util.cc

@@ -153,7 +153,7 @@ bf_encrypt_ecb_binary(const char *keydata, unsigned char *in, size_t *inlen)
   if (len % CRYPT_BLOCKSIZE)             /* more than 1 block? */
     len += (CRYPT_BLOCKSIZE - (len % CRYPT_BLOCKSIZE));
 
-  out = (unsigned char *) my_calloc(1, len + 1);
+  out = (unsigned char *) calloc(1, len + 1);
   memcpy(out, in, *inlen);
   *inlen = len;
 
@@ -179,7 +179,7 @@ bf_decrypt_ecb_binary(const char *keydata, unsigned char *in, size_t *len)
   unsigned char *out = NULL;
 
   *len -= *len % CRYPT_BLOCKSIZE;
-  out = (unsigned char *) my_calloc(1, *len + 1);
+  out = (unsigned char *) calloc(1, *len + 1);
   memcpy(out, in, *len);
 
   if (!keydata || !*keydata) {
@@ -209,7 +209,7 @@ bf_encrypt_cbc_binary(const char *keydata, unsigned char *in, size_t *inlen, uns
   if (len % CRYPT_BLOCKSIZE)             /* more than 1 block? */
     len += (CRYPT_BLOCKSIZE - (len % CRYPT_BLOCKSIZE));
 
-  out = (unsigned char *) my_calloc(1, len + 1);
+  out = (unsigned char *) calloc(1, len + 1);
   *inlen = len;
 
   if (!keydata || !*keydata) {
@@ -230,7 +230,7 @@ bf_decrypt_cbc_binary(const char *keydata, unsigned char *in, size_t *len, unsig
   unsigned char *out = NULL;
 
   *len -= *len % CRYPT_BLOCKSIZE;
-  out = (unsigned char *) my_calloc(1, *len + 1);
+  out = (unsigned char *) calloc(1, *len + 1);
 
   if (!keydata || !*keydata) {
     /* No key, no decryption */

+ 1 - 1
src/crypto/dh_util.cc

@@ -125,7 +125,7 @@ bool DH1080_comp(const bd::String privateKey, const bd::String theirPublicKeyB64
   b_HisPubkey = BN_bin2bn(reinterpret_cast<const unsigned char*>(theirPublicKey.data()), theirPublicKey.length(), NULL);
 
   // Compute the Shared key
-  char *key = (char *)my_calloc(1, DH_size(dh));
+  char *key = (char *)calloc(1, DH_size(dh));
   size_t len = DH_compute_key((unsigned char *)key, b_HisPubkey, dh);
   DH_free(dh);
   BN_clear_free(b_HisPubkey);

+ 6 - 6
src/dcc.cc

@@ -920,10 +920,10 @@ append_line(int idx, char *line)
   } else {
     ++c->current_lines;
 
-    p = (struct msgq *) my_calloc(1, sizeof(struct msgq));
+    p = (struct msgq *) calloc(1, sizeof(struct msgq));
 
     p->len = l;
-    p->msg = (char *) my_calloc(1, l + 1);
+    p->msg = (char *) calloc(1, l + 1);
     p->next = NULL;
     strlcpy(p->msg, line, l + 1);
 
@@ -997,7 +997,7 @@ dcc_chat_pass(int idx, char *buf, int atr)
       dcc[idx].encrypt = 2;
       if (dcc[idx].bot) {
         dcc[idx].type = &DCC_BOT_NEW;
-        dcc[idx].u.bot = (struct bot_info *) my_calloc(1, sizeof(struct bot_info));
+        dcc[idx].u.bot = (struct bot_info *) calloc(1, sizeof(struct bot_info));
         if (dcc[idx].status & STAT_UNIXDOMAIN)
           dcc[idx].status = STAT_UNIXDOMAIN|STAT_CALLED;
         else
@@ -1806,11 +1806,11 @@ dcc_telnet_id(int idx, char *buf, int atr)
     } else if (in_chain(dcc[idx].nick)) {
 
       dcc[idx].type = &DCC_DUPWAIT;
-      dcc[idx].u.dupwait = (struct dupwait_info *) my_calloc(1, sizeof(struct dupwait_info));
+      dcc[idx].u.dupwait = (struct dupwait_info *) calloc(1, sizeof(struct dupwait_info));
       dcc[idx].u.dupwait->atr = atr;
       return;
     }
-//    dcc[idx].u.enc = (struct enc_link_dcc *) my_calloc(1, sizeof(struct enc_link_dcc));
+//    dcc[idx].u.enc = (struct enc_link_dcc *) calloc(1, sizeof(struct enc_link_dcc));
 //    dcc[idx].u.enc->method_number = 0;
 //    link_get_method(idx);
   } else {
@@ -1879,7 +1879,7 @@ dcc_telnet_pass(int idx, int atr)
 
   if (!dcc[idx].bot) {
     //bots dont need this
-    dcc[idx].u.chat = (struct chat_info *) my_calloc(1, sizeof(struct chat_info));
+    dcc[idx].u.chat = (struct chat_info *) calloc(1, sizeof(struct chat_info));
     struct chat_info dummy;
     strlcpy(dcc[idx].u.chat->con_chan, chanset ? chanset->dname : "*", sizeof(dummy.con_chan));
   }

+ 7 - 7
src/dccutil.cc

@@ -70,9 +70,9 @@ init_dcc()
   if (max_dcc < 1)
     max_dcc = 1;
   if (dcc)
-    dcc = (struct dcc_t *) my_realloc(dcc, sizeof(struct dcc_t) * max_dcc);
+    dcc = (struct dcc_t *) realloc(dcc, sizeof(struct dcc_t) * max_dcc);
   else
-    dcc = (struct dcc_t *) my_calloc(1, sizeof(struct dcc_t) * max_dcc);
+    dcc = (struct dcc_t *) calloc(1, sizeof(struct dcc_t) * max_dcc);
 }
 
 /* Replace \n with \r\n */
@@ -375,7 +375,7 @@ dprintf_real(int idx, char* buf, size_t len, size_t bufsiz, const char* target)
       bounce_simul(idx, buf);
     } else if (unlikely(dcc[idx].irc)) {
 //      size_t size = strlen(dcc[idx].simulbot) + strlen(buf) + 20;
-//      char *ircbuf = (char *) my_calloc(1, size);
+//      char *ircbuf = (char *) calloc(1, size);
 
 //      simple_snprintf(ircbuf, size, "PRIVMSG %s :%s", dcc[idx].simulbot, buf);
 //      tputs(dcc[idx].sock, ircbuf, strlen(ircbuf));
@@ -771,7 +771,7 @@ new_dcc(struct dcc_table *type, int xtra_size)
 
   dcc[i].type = type;
   if (xtra_size)
-    dcc[i].u.other = (char *) my_calloc(1, xtra_size);
+    dcc[i].u.other = (char *) calloc(1, xtra_size);
   else
     dcc[i].u.other = NULL;
   dcc[i].simul = -1;
@@ -795,7 +795,7 @@ changeover_dcc(int i, struct dcc_table *type, int xtra_size)
   }
   dcc[i].type = type;
   if (xtra_size)
-    dcc[i].u.other = (char *) my_calloc(1, xtra_size);
+    dcc[i].u.other = (char *) calloc(1, xtra_size);
 }
 
 int
@@ -983,7 +983,7 @@ listen_all(in_port_t lport, bool off, bool should_v6)
           if (i > 0) {
 #endif /* USE_IPV6 */
             if (!pmap) {
-              pmap = (struct portmap *) my_calloc(1, sizeof(struct portmap));
+              pmap = (struct portmap *) calloc(1, sizeof(struct portmap));
               pmap->next = root;
               root = pmap;
             }
@@ -1210,7 +1210,7 @@ void set_cmd_pass(char *ln, int shareit)
       free(cp);
   } else if (ln[0]) {
     /* create */
-    cp = (struct cmd_pass *) my_calloc(1, sizeof(struct cmd_pass));
+    cp = (struct cmd_pass *) calloc(1, sizeof(struct cmd_pass));
     cp->next = cmdpass;
     cmdpass = cp;
     cp->name = strdup(cmd);

+ 2 - 2
src/egg_timer.cc

@@ -154,7 +154,7 @@ int timer_create_complex(egg_timeval_t *howlong, const char *name, Function call
 	egg_timer_t *timer = NULL;
 
 	/* Fill out a new timer. */
-	timer = (egg_timer_t *) my_calloc(1, sizeof(*timer));
+	timer = (egg_timer_t *) calloc(1, sizeof(*timer));
 	timer->id = timer_next_id++;
 	if (name) timer->name = strdup(name);
 	else timer->name = NULL;
@@ -296,7 +296,7 @@ int timer_list(int **ids)
 	for (timer = timer_repeat_head; timer; timer = timer->next) ntimers++;
 
 	/* Fill in array. */
-	*ids = (int *) my_calloc(1, sizeof(int) * (ntimers+1));
+	*ids = (int *) calloc(1, sizeof(int) * (ntimers+1));
 	ntimers = 0;
 	for (timer = timer_repeat_head; timer; timer = timer->next) {
 		(*ids)[ntimers++] = timer->id;

+ 1 - 1
src/enclink.cc

@@ -151,7 +151,7 @@ static const char *ghost_write(int snum, const char *src, size_t *len)
   char *srcbuf = NULL, *line = NULL, *eol = NULL, *eline = NULL;
 
   const size_t bufsiz = *len + 9 + 1;
-  srcbuf = (char *) my_calloc(1, bufsiz);
+  srcbuf = (char *) calloc(1, bufsiz);
   strlcpy(srcbuf, src, bufsiz);
   line = srcbuf;
   buf[0] = 0;

+ 1 - 1
src/flags.cc

@@ -376,7 +376,7 @@ set_user_flagrec(struct userrec *u, struct flag_record *fr, const char *chname)
         break;
     ch = findchan_by_dname(chname);
     if (!cr && ch) {
-      cr = (struct chanuserrec *) my_calloc(1, sizeof(struct chanuserrec));
+      cr = (struct chanuserrec *) calloc(1, sizeof(struct chanuserrec));
 
       cr->next = u->chanrec;
       u->chanrec = cr;

+ 1 - 1
src/garble.cc

@@ -26,7 +26,7 @@ const char *degarble(int len, const char *g)
     garble_ptr = 0;
   if (garble_buffer[garble_ptr])
     free(garble_buffer[garble_ptr]);
-  garble_buffer[garble_ptr] = (unsigned char *) my_calloc(1, len + 1);
+  garble_buffer[garble_ptr] = (unsigned char *) calloc(1, len + 1);
   x = 0xFF;
   for (int i = 0; i < len; i++) {
     garble_buffer[garble_ptr][i] = g[i] ^ x;

+ 1 - 1
src/main.cc

@@ -166,7 +166,7 @@ have_cwd:
   if (!realpath(bin, buf))
     fatal(STR("realpath() failed on getting current working directory."), 0);
   size_t len = strlen(buf);
-  bin = (char *) my_realloc(bin, len + 1);
+  bin = (char *) realloc(bin, len + 1);
   strlcpy(bin, buf, len + 1);
 
   return bin;

+ 4 - 0
src/match.cc

@@ -42,6 +42,10 @@
  *
  */
 
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #include "common.h"
 #include "match.h"

+ 12 - 6
src/misc.cc

@@ -267,6 +267,12 @@ void maskaddr(const char *s, char *nw, int type)
       *nw++ = '*';
       if (strchr("~+-^=", *u))
         u++; /* trim leading crap */
+      /*
+       * Take last 9 chars to avoid running up against 10-char limit for
+       * username on ratbox.  The older eggdrop code used this limit as well.
+       */
+      while (h - u > 9)
+        u++;
     }
     strncpy(nw, u, h - u);
     nw += h - u;
@@ -537,13 +543,13 @@ char *str_escape(const char *str, const char divc, const char mask)
   char		*buf = NULL, *b = NULL;
   const char	*s = NULL;
 
-  b = buf = (char *) my_calloc(1, buflen + 1);
+  b = buf = (char *) calloc(1, buflen + 1);
 
   for (s = str; *s; s++) {
     /* Resize buffer. */
     if ((buflen - blen) <= 3) {
       buflen <<= 1;		/* * 2 */
-      buf = (char *) my_realloc(buf, buflen + 1);
+      buf = (char *) realloc(buf, buflen + 1);
       if (!buf)
 	return NULL;
       b = buf + blen;
@@ -902,7 +908,7 @@ int updatebin(int idx, char *par, int secs)
   }
 
   size_t path_siz = strlen(binname) + strlen(par) + 2;
-  char *path = (char *) my_calloc(1, path_siz);
+  char *path = (char *) calloc(1, path_siz);
   char *newbin = NULL, buf[DIRMAX] = "";
   const char* argv[5];
   int i;
@@ -1161,7 +1167,7 @@ void showhelp(int idx, struct flag_record *flags, const char *string)
 {
   struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0 };
   size_t help_siz = strlen(string) + 1000 + 1;
-  char *helpstr = (char *) my_calloc(1, help_siz);
+  char *helpstr = (char *) calloc(1, help_siz);
   char tmp[2] = "", flagstr[10] = "";
   bool ok = 1;
 
@@ -1390,11 +1396,11 @@ char *step_thru_file(FILE *fd)
     if (fgets(tempBuf, sizeof(tempBuf), fd) && !feof(fd)) {
       if (retStr == NULL) {
         ret_siz = strlen(tempBuf) + 2;
-        retStr = (char *) my_calloc(1, ret_siz);
+        retStr = (char *) calloc(1, ret_siz);
         strlcpy(retStr, tempBuf, ret_siz);
       } else {
         ret_siz = strlen(retStr) + strlen(tempBuf);
-        retStr = (char *) my_realloc(retStr, ret_siz);
+        retStr = (char *) realloc(retStr, ret_siz);
         strlcat(retStr, tempBuf, ret_siz);
       }
       if (retStr[strlen(retStr)-1] == '\n') {

+ 0 - 4
src/misc_file.cc

@@ -82,9 +82,7 @@ int copyfile(const char *oldpath, const char *newpath)
       }
     }
   }
-#ifdef HAVE_FSYNC
   fsync(fo);
-#endif /* HAVE_FSYNC */
   close(fo);
   close(fi);
   return 0;
@@ -92,11 +90,9 @@ int copyfile(const char *oldpath, const char *newpath)
 
 int movefile(const char *oldpath, const char *newpath)
 {
-#ifdef HAVE_RENAME
   /* Try to use rename first */
   if (!rename(oldpath, newpath))
     return 0;
-#endif /* HAVE_RENAME */
 
   /* If that fails, fall back to just copying and then
    * deleting the file.

+ 7 - 7
src/mod/channels.mod/chanmisc.cc

@@ -254,7 +254,7 @@ int SplitList(char *resultBuf, const char *list, int *argcPtr, const char ***arg
         }
     }
 
-    argv = (const char **) my_calloc(1, (unsigned) ((size * sizeof(char *)) + (l - list) + 1 + 15));	/* 15 cuz the tcl src is hard to follow */
+    argv = (const char **) calloc(1, (unsigned) ((size * sizeof(char *)) + (l - list) + 1 + 15));	/* 15 cuz the tcl src is hard to follow */
 
     length = strlen(list);
 
@@ -938,7 +938,7 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
 
 static void init_masklist(masklist *m)
 {
-  m->mask = (char *) my_calloc(1, 1);
+  m->mask = (char *) calloc(1, 1);
   m->who = NULL;
   m->next = NULL;
 }
@@ -955,16 +955,16 @@ static void init_channel(struct chanset_t *chan, bool reset)
   if (!reset)
     my_setkey(chan, NULL);
 
-  chan->channel.ban = (masklist *) my_calloc(1, sizeof(masklist));
+  chan->channel.ban = (masklist *) calloc(1, sizeof(masklist));
   init_masklist(chan->channel.ban);
 
-  chan->channel.exempt = (masklist *) my_calloc(1, sizeof(masklist));
+  chan->channel.exempt = (masklist *) calloc(1, sizeof(masklist));
   init_masklist(chan->channel.exempt);
 
-  chan->channel.invite = (masklist *) my_calloc(1, sizeof(masklist));
+  chan->channel.invite = (masklist *) calloc(1, sizeof(masklist));
   init_masklist(chan->channel.invite);
 
-  chan->channel.member = (memberlist *) my_calloc(1, sizeof(memberlist));
+  chan->channel.member = (memberlist *) calloc(1, sizeof(memberlist));
   chan->channel.member->nick[0] = 0;
   chan->channel.member->next = NULL;
   chan->channel.topic = NULL;
@@ -1114,7 +1114,7 @@ int channel_add(char *result, const char *newname, char *options, bool isdefault
     /* Already existing channel, maybe a reload of the channel file */
     chan->status &= ~CHAN_FLAGGED;	/* don't delete me! :) */
   } else {
-    chan = (struct chanset_t *) my_calloc(1, sizeof(struct chanset_t));
+    chan = (struct chanset_t *) calloc(1, sizeof(struct chanset_t));
 
     /* These are defaults, bzero already set them 0, but we set them for future reference */
     chan->limit_prot = 0;

+ 1 - 1
src/mod/channels.mod/channels.cc

@@ -231,7 +231,7 @@ static void got_cjoin(char *botnick, char *code, char *par)
     if (!match) {
       size_t size = strlen(par) + 12 + 1;
 
-      options = (char *) my_calloc(1, size);
+      options = (char *) calloc(1, size);
       simple_snprintf(options, size, "%s +inactive", par);
     } else if (match && chan && !shouldjoin(chan)) {
       if (!inactive)

+ 2 - 2
src/mod/channels.mod/userchan.cc

@@ -39,7 +39,7 @@ struct chanuserrec *get_chanrec(struct userrec *u, char *chname)
 struct chanuserrec *add_chanrec(struct userrec *u, char *chname)
 {
   if (findchan_by_dname(chname)) {
-    struct chanuserrec *ch = (struct chanuserrec *) my_calloc(1, sizeof(struct chanuserrec));
+    struct chanuserrec *ch = (struct chanuserrec *) calloc(1, sizeof(struct chanuserrec));
 
     ch->next = u->chanrec;
     u->chanrec = ch;
@@ -358,7 +358,7 @@ bool u_addmask(char type, struct chanset_t *chan, char *who, const char *from, c
   }
 
   if (p == NULL) {
-    p = (maskrec *) my_calloc(1, sizeof(maskrec));
+    p = (maskrec *) calloc(1, sizeof(maskrec));
     p->next = *u;
     *u = p;
   }

+ 2 - 2
src/mod/compress.mod/compress.cc

@@ -316,7 +316,7 @@ int compress_file(char *filename, int mode_num)
   int ret;
 
   /* Create temporary filename. */
-  temp_fn = (char *) my_calloc(1, strlen(filename) + 5);
+  temp_fn = (char *) calloc(1, strlen(filename) + 5);
   make_rand_str(randstr, 4);
   strcpy(temp_fn, filename);
   strcat(temp_fn, randstr);
@@ -342,7 +342,7 @@ int uncompress_file(char *filename)
   int ret;
 
   /* Create temporary filename. */
-  temp_fn = (char *) my_calloc(1, strlen(filename) + 5);
+  temp_fn = (char *) calloc(1, strlen(filename) + 5);
   make_rand_str(randstr, 4);
   strcpy(temp_fn, filename);
   strcat(temp_fn, randstr);

+ 3 - 3
src/mod/console.mod/console.cc

@@ -59,7 +59,7 @@ struct console_info {
 static bool
 console_unpack(struct userrec *u, struct user_entry *e)
 {
-  struct console_info *ci = (struct console_info *) my_calloc(1, sizeof(struct console_info));
+  struct console_info *ci = (struct console_info *) calloc(1, sizeof(struct console_info));
   char *par = e->u.list->extra, *arg = NULL;
 
   arg = newsplit(&par);
@@ -155,7 +155,7 @@ console_gotshare(struct userrec *u, struct user_entry *e, char *par, int idx)
     free(ci->channel);
     free(ci);
   }
-  ci = (struct console_info *) my_calloc(1, sizeof(struct console_info));
+  ci = (struct console_info *) calloc(1, sizeof(struct console_info));
   ci->channel = strdup(arg);
   arg = newsplit(&par);
   ci->conflags = logmodes(arg);
@@ -311,7 +311,7 @@ console_store(int idx, char *par, bool displaySave)
   struct console_info *i = (struct console_info *) get_user(&USERENTRY_CONSOLE, dcc[idx].user);
 
   if (!i) 
-    i = (struct console_info *) my_calloc(1, sizeof(struct console_info));
+    i = (struct console_info *) calloc(1, sizeof(struct console_info));
   
   if (i->channel)
     free(i->channel);

+ 8 - 9
src/mod/irc.mod/chan.cc

@@ -95,7 +95,7 @@ static void resolv_member_callback(int id, void *client_data, const char *host,
 
 void resolve_to_member(struct chanset_t *chan, char *nick, char *host)
 {
-  resolv_member *r = (resolv_member *) my_calloc(1, sizeof(resolv_member));
+  resolv_member *r = (resolv_member *) calloc(1, sizeof(resolv_member));
 
   r->chan = strdup(chan->dname);
   r->host = strdup(host);
@@ -167,7 +167,7 @@ void resolve_to_rbl(struct chanset_t *chan, const char *host, resolv_member *r)
   if (p)
     host = p + 1;
   if (!r) {
-    r = (resolv_member *) my_calloc(1, sizeof(resolv_member));
+    r = (resolv_member *) calloc(1, sizeof(resolv_member));
 
     r->chan = strdup(chan->dname);
     r->host = strdup(host);
@@ -197,7 +197,7 @@ void resolve_to_rbl(struct chanset_t *chan, const char *host, resolv_member *r)
   } else
     iplen += strlen(host) + 1;
 
-  char *ip = (char *) my_calloc(1, iplen);
+  char *ip = (char *) calloc(1, iplen);
   if (v6)
     socket_ipv6_to_dots(host, ip);
   else {
@@ -248,7 +248,7 @@ static memberlist *newmember(struct chanset_t *chan, char *nick)
 {
   memberlist *x = chan->channel.member, 
              *lx = NULL, 
-             *n = (memberlist *) my_calloc(1, sizeof(memberlist));
+             *n = (memberlist *) calloc(1, sizeof(memberlist));
 
   /* This sorts the list */
   while (x && x->nick[0] && (rfc_casecmp(x->nick, nick) < 0)) {
@@ -1361,8 +1361,8 @@ inline static char *
 take_massopline(char *op, char **to_op)
 {
   const size_t modes_len = 31, nicks_len = 151;
-  char *nicks = (char *) my_calloc(1, nicks_len),
-       *modes = (char *) my_calloc(1, modes_len),
+  char *nicks = (char *) calloc(1, nicks_len),
+       *modes = (char *) calloc(1, modes_len),
        *nick = NULL;
   bool useop = 0;
   static char ret[182] = "";
@@ -1495,7 +1495,6 @@ do_take(struct chanset_t *chan)
     work[work_len] = 0;
 
     // Prevent excess flood
-    if (!HAVE_F1) usleep(1000 * 500);
     if (++lines >= max_lines) {
       tputs(serv, work, work_len);
       work[0] = 0;
@@ -2588,7 +2587,7 @@ static void set_topic(struct chanset_t *chan, char *k)
     free(chan->channel.topic);
   if (k && k[0]) {
     size_t tlen = strlen(k) + 1;
-    chan->channel.topic = (char *) my_calloc(1, tlen);
+    chan->channel.topic = (char *) calloc(1, tlen);
     strlcpy(chan->channel.topic, k, tlen);
   } else
     chan->channel.topic = NULL;
@@ -2666,7 +2665,7 @@ static int gotjoin(char *from, char *chname)
     size_t l_chname = strlen(chname);
 
     if (l_chname > (CHANNEL_ID_LEN + 1)) {
-      char* ch_dname = (char *) my_calloc(1, l_chname + 1);
+      char* ch_dname = (char *) calloc(1, l_chname + 1);
       simple_snprintf(ch_dname, l_chname + 2, "!%s", chname + (CHANNEL_ID_LEN + 1));
       chan = findchan_by_dname(ch_dname);
       if (!chan) {

+ 7 - 7
src/mod/irc.mod/cmdsirc.cc

@@ -679,9 +679,9 @@ static void cmd_mmode(int idx, char *par)
   }
 
 
-  memberlist** targets = (memberlist**) my_calloc(1, chan->channel.members * sizeof(memberlist *));
-  int* overlaps = (int *) my_calloc(1, chan->channel.members * sizeof(int *));
-  memberlist** chanbots = (memberlist **) my_calloc(1, chan->channel.members * sizeof(memberlist *));
+  memberlist** targets = (memberlist**) calloc(1, chan->channel.members * sizeof(memberlist *));
+  int* overlaps = (int *) calloc(1, chan->channel.members * sizeof(int *));
+  memberlist** chanbots = (memberlist **) calloc(1, chan->channel.members * sizeof(memberlist *));
   memberlist *m = NULL;
   int chanbotcount = 0, targetcount = 0;
 
@@ -888,13 +888,13 @@ static void cmd_mmode(int idx, char *par)
   dprintf(idx, "  %d assumed modes per target nick.\n", overlap);
 
   int tpos = 0, bpos = 0, i = 0;
-  char **work_list = (char**) my_calloc((int)bots, sizeof(char**));
+  char **work_list = (char**) calloc((int)bots, sizeof(char**));
   char *work = NULL;
   size_t work_size = 2048;
 
   /* now use bots/modes to distribute nicks to MODE on */
   while (bots) {
-    work = work_list[bpos] = (char*) my_calloc(1, work_size);
+    work = work_list[bpos] = (char*) calloc(1, work_size);
 
     if (local) {
       strlcpy(work, mode, work_size);
@@ -1290,8 +1290,8 @@ static void cmd_find(int idx, char *par)
         if ((!lookup_user && wild_match(par, m->from)) || (lookup_user && m->user == u)) {
           fcount++;
           if (!found) {
-            found = (memberlist **) my_calloc(1, sizeof(memberlist *) * 100);
-            cfound = (struct chanset_t **) my_calloc(1, sizeof(struct chanset_t *) * 100);
+            found = (memberlist **) calloc(1, sizeof(memberlist *) * 100);
+            cfound = (struct chanset_t **) calloc(1, sizeof(struct chanset_t *) * 100);
           }
           found[fcount - 1] = m;
           cfound[fcount - 1] = chan;

+ 7 - 7
src/mod/irc.mod/irc.cc

@@ -301,7 +301,7 @@ void notice_invite(struct chanset_t *chan, char *handle, char *nick, char *uhost
 #ifdef CACHE
 static cache_t *cache_new(char *nick)
 {
-  cache_t *cache = (cache_t *) my_calloc(1, sizeof(cache_t));
+  cache_t *cache = (cache_t *) calloc(1, sizeof(cache_t));
 
   cache->next = NULL;
   strlcpy(cache->nick, nick, sizeof(cache->nick));
@@ -317,7 +317,7 @@ static cache_t *cache_new(char *nick)
 
 static cache_chan_t *cache_chan_add(cache_t *cache, char *chname)
 {
-  cache_chan_t *cchan = (cache_chan_t *) my_calloc(1, sizeof(cache_chan_t));
+  cache_chan_t *cchan = (cache_chan_t *) calloc(1, sizeof(cache_chan_t));
   
   cchan->next = NULL;
   strlcpy(cchan->dname, chname, sizeof(cchan->dname));
@@ -824,7 +824,7 @@ getin_request(char *botnick, char *code, char *par)
     if (chan->channel.mode & CHANKEY) {
       char *key = chan->channel.key[0] ? chan->channel.key : chan->key_prot;
       size_t siz = strlen(chan->dname) + strlen(key ? key : 0) + 6 + 1;
-      tmp = (char *) my_calloc(1, siz);
+      tmp = (char *) calloc(1, siz);
       simple_snprintf(tmp, siz, "gi K %s %s", chan->dname, key ? key : "");
       putbot(botnick, tmp);
       putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - Sent key (%s)", botnick, nick, chan->dname, key ? key : "");
@@ -1125,7 +1125,7 @@ void
 my_setkey(struct chanset_t *chan, char *k)
 {
   free(chan->channel.key);
-  chan->channel.key = k ? strdup(k) : (char *) my_calloc(1, 1);
+  chan->channel.key = k ? strdup(k) : (char *) calloc(1, 1);
 }
 
 /* Adds a ban, exempt or invite mask to the list
@@ -1138,9 +1138,9 @@ new_mask(masklist *m, char *s, char *who)
   if (m->mask[0])
     return 1;                     /* Already existent mask */
 
-  m->next = (masklist *) my_calloc(1, sizeof(masklist));
+  m->next = (masklist *) calloc(1, sizeof(masklist));
   m->next->next = NULL;
-  m->next->mask = (char *) my_calloc(1, 1);
+  m->next->mask = (char *) calloc(1, 1);
   free(m->mask);
   m->mask = strdup(s);
   m->who = strdup(who);
@@ -1193,7 +1193,7 @@ killmember(struct chanset_t *chan, char *nick, bool cacheMember)
     putlog(LOG_MISC, "*", "(!) actually I know of %d members.", chan->channel.members);
   }
   if (unlikely(!chan->channel.member)) {
-    chan->channel.member = (memberlist *) my_calloc(1, sizeof(memberlist));
+    chan->channel.member = (memberlist *) calloc(1, sizeof(memberlist));
     chan->channel.member->nick[0] = 0;
     chan->channel.member->next = NULL;
   }

+ 9 - 9
src/mod/irc.mod/mode.cc

@@ -441,7 +441,7 @@ real_add_mode(struct chanset_t *chan, const char plus, const char mode, const ch
         flush_mode(chan, NORMAL);
       for (i = 0; i < (modesperline - 1); i++)
         if (!chan->ccmode[i].op) {
-          chan->ccmode[i].op = (char *) my_calloc(1, len);
+          chan->ccmode[i].op = (char *) calloc(1, len);
           chan->cbytes += len;    /* Add 1 for safety */
           strlcpy(chan->ccmode[i].op, op, len);
           break;
@@ -456,7 +456,7 @@ real_add_mode(struct chanset_t *chan, const char plus, const char mode, const ch
       for (i = 0; i < modesperline; i++)
         if (chan->cmode[i].type == 0) {
           chan->cmode[i].type = type;
-          chan->cmode[i].op = (char *) my_calloc(1, len);
+          chan->cmode[i].op = (char *) calloc(1, len);
           chan->bytes += len;     /* Add 1 for safety */
           strlcpy(chan->cmode[i].op, op, len);
           break;
@@ -469,7 +469,7 @@ real_add_mode(struct chanset_t *chan, const char plus, const char mode, const ch
     if (chan->key)
       free(chan->key);
     len = strlen(op) + 1;
-    chan->key = (char *) my_calloc(1, len);
+    chan->key = (char *) calloc(1, len);
     strlcpy(chan->key, op, len);
   }
   /* -k ? store removed key */
@@ -477,7 +477,7 @@ real_add_mode(struct chanset_t *chan, const char plus, const char mode, const ch
     if (chan->rmkey)
       free(chan->rmkey);
     len = strlen(op) + 1;
-    chan->rmkey = (char *) my_calloc(1, len);
+    chan->rmkey = (char *) calloc(1, len);
     strlcpy(chan->rmkey, op, len);
   }
   /* +l ? store limit */
@@ -634,7 +634,7 @@ got_op(struct chanset_t *chan, memberlist *m, memberlist *mv)
     char *buf = NULL;
     size_t siz = strlen(chan->dname) + 3 + 1;
 
-    buf = my_calloc(1, siz);
+    buf = calloc(1, siz);
     simple_snprintf(buf, siz, "jn %s", chan->dname);
     putallbots(buf);
     free(buf);
@@ -1071,7 +1071,7 @@ gotmode(char *from, char *msg)
 
       int i = 0, modecnt = 0, ops = 0, deops = 0, bans = 0, unbans = 0;
       bool me_opped = 0;
-      char **modes = (char **) my_calloc(1, sizeof(char *));
+      char **modes = (char **) calloc(1, sizeof(char *));
       char s[UHOSTLEN] = "";
       memberlist *mv = NULL;
 
@@ -1098,11 +1098,11 @@ gotmode(char *from, char *msg)
             }
 
             /* Just want o's and b's */
-            modes = (char **) my_realloc(modes, (modecnt * sizeof(char *)) + sizeof(char *));
-            //      char **modes = (char **) my_calloc(modesperline + 1, sizeof(char *));
+            modes = (char **) realloc(modes, (modecnt * sizeof(char *)) + sizeof(char *));
+            //      char **modes = (char **) calloc(modesperline + 1, sizeof(char *));
 
             size_t siz = (mp ? strlen(mp) : 0) + 3 + 1;
-            modes[modecnt] = (char *) my_calloc(1, siz);
+            modes[modecnt] = (char *) calloc(1, siz);
             simple_snprintf(modes[modecnt], siz, "%c%c %s", sign, chg[0], mp ? mp : "");
 
             ++modecnt;

+ 5 - 5
src/mod/server.mod/server.cc

@@ -696,7 +696,7 @@ void queue_server(int which, char *buf, int len)
       }
     }
 
-    struct msgq *q = (struct msgq *) my_calloc(1, sizeof(struct msgq));
+    struct msgq *q = (struct msgq *) calloc(1, sizeof(struct msgq));
 
     if (h->head) {
       if (!qnext) { //Not next, add to end of queue
@@ -709,7 +709,7 @@ void queue_server(int which, char *buf, int len)
     } else
       h->head = h->last = q;
     q->len = len;
-    q->msg = (char *) my_calloc(1, len + 1);
+    q->msg = (char *) calloc(1, len + 1);
     strlcpy(q->msg, buf, len + 1);
     ++(h->tot);
     h->warned = 0;
@@ -740,7 +740,7 @@ void add_server(char *ss)
     p = strchr(ss, ',');
     if (p)
       *p++ = 0;
-    x = (struct server_list *) my_calloc(1, sizeof(struct server_list));
+    x = (struct server_list *) calloc(1, sizeof(struct server_list));
 
     x->next = 0;
     x->port = 0;
@@ -762,7 +762,7 @@ void add_server(char *ss)
       }
 #endif /* USE_IPV6 */
       *q++ = 0;
-      x->name = (char *) my_calloc(1, q - ss);
+      x->name = (char *) calloc(1, q - ss);
       strlcpy(x->name, ss, q - ss);
       ss = q;
       q = strchr(ss, ':');
@@ -822,7 +822,7 @@ void next_server(int *ptr, char *servname, in_port_t *port, char *pass)
       i++;
     }
     /* Gotta add it: */
-    x = (struct server_list *) my_calloc(1, sizeof(struct server_list));
+    x = (struct server_list *) calloc(1, sizeof(struct server_list));
 
     x->next = 0;
     x->name = strdup(servname);

+ 19 - 1
src/mod/server.mod/servmsg.cc

@@ -1152,6 +1152,23 @@ static void got303(char *from, char *msg)
     nicks_available(msg, ' ', 0);
 }
 
+/*
+ * :<server> 421 <nick> <command> :Unknown command
+ */
+static void got421(char *from, char *msg)
+{
+  char *command = NULL;
+
+  newsplit(&msg);	/* nick */
+  command = newsplit(&msg);
+
+  if (use_monitor && !strcasecmp(command, "MONITOR")) {
+    /* The command doesn't work despite 005 claiming to have it.
+     * Disable MONITOR usage to fallback on ISON. */
+    use_monitor = 0;
+  }
+}
+
 /* 432 : Bad nickname (RESV)
  */
 static int got432(char *from, char *msg)
@@ -1680,7 +1697,7 @@ hide_chans(const char *nick, struct userrec *u, char *_channels, bool publicOnly
   struct chanset_t *chan = NULL;
   struct flag_record fr = { FR_CHAN | FR_GLOBAL, 0, 0, 0 };
 
-  char *chans = (char *) my_calloc(1, len), *p = NULL;
+  char *chans = (char *) calloc(1, len), *p = NULL;
 
   while ((chname = newsplit(&channels))[0]) {
     /* skip any modes in front of #chan */
@@ -1988,6 +2005,7 @@ static cmd_t my_raw_binds[] =
   {"005",	"",	(Function) got005,		NULL, LEAF},
   {"302",       "",     (Function) got302,		NULL, LEAF},
   {"303",	"",	(Function) got303,		NULL, LEAF},
+  {"421",	"",	(Function) got421,		NULL, LEAF},
   {"432",	"",	(Function) got432,		NULL, LEAF},
   {"433",	"",	(Function) got433,		NULL, LEAF},
   {"437",	"",	(Function) got437,		NULL, LEAF},

+ 8 - 8
src/mod/share.mod/share.cc

@@ -111,7 +111,7 @@ static void new_tbuf(char *bot)
 {
   tandbuf **old = &tbuf, *newbuf = NULL;
 
-  newbuf = (tandbuf *) my_calloc(1, sizeof(tandbuf));
+  newbuf = (tandbuf *) calloc(1, sizeof(tandbuf));
   strlcpy(newbuf->bot, bot, sizeof(newbuf->bot));
   newbuf->q = NULL;
   newbuf->timer = now;
@@ -165,11 +165,11 @@ static struct share_msgq *q_addmsg(struct share_msgq *qq, char *s)
   size_t siz = 0;
 
   if (!qq) {
-    q = (share_msgq *) my_calloc(1, sizeof *q);
+    q = (share_msgq *) calloc(1, sizeof *q);
 
     q->next = NULL;
     siz = strlen(s) + 1;
-    q->msg = (char *) my_calloc(1, siz);
+    q->msg = (char *) calloc(1, siz);
     strlcpy(q->msg, s, siz);
     return q;
   }
@@ -178,12 +178,12 @@ static struct share_msgq *q_addmsg(struct share_msgq *qq, char *s)
     cnt++;
   if (cnt > 1000)
     return NULL;                /* Return null: did not alter queue */
-  q->next = (share_msgq *) my_calloc(1, sizeof *q->next);
+  q->next = (share_msgq *) calloc(1, sizeof *q->next);
 
   q = q->next;
   q->next = NULL;
   siz = strlen(s) + 1;
-  q->msg = (char *) my_calloc(1, siz);
+  q->msg = (char *) calloc(1, siz);
   strlcpy(q->msg, s, siz);
   return qq;
 }
@@ -253,13 +253,13 @@ void dump_resync(int idx)
 static void
 add_delay(struct chanset_t *chan, int plsmns, int mode, char *mask)
 {
-  struct delay_mode *d = (struct delay_mode *) my_calloc(1, sizeof(struct delay_mode));
+  struct delay_mode *d = (struct delay_mode *) calloc(1, sizeof(struct delay_mode));
 
   d->chan = chan;
   d->plsmns = plsmns;
   d->mode = mode;
   size_t mlen = strlen(mask) + 1;
-  d->mask = (char *) my_calloc(1, mlen);
+  d->mask = (char *) calloc(1, mlen);
 
   strlcpy(d->mask, mask, mlen);
   d->seconds = (int) (now + randint(20));
@@ -657,7 +657,7 @@ share_change(int idx, char *par)
 
       if (uet->got_share) {
         if (!(e = find_user_entry(uet, u))) {
-          e = (struct user_entry *) my_calloc(1, sizeof(struct user_entry));
+          e = (struct user_entry *) calloc(1, sizeof(struct user_entry));
 
           e->type = uet;
           e->name = NULL;

+ 3 - 3
src/mod/transfer.mod/transfer.cc

@@ -92,7 +92,7 @@ static unsigned long pump_file_to_sock(FILE *file, long sock,
 {
   const unsigned long		 buf_len = pending_data >= PMAX_SIZE ?
 	  					PMAX_SIZE : pending_data;
-  char				*bf = (char *) my_calloc(1, buf_len);
+  char				*bf = (char *) calloc(1, buf_len);
   unsigned long	 actual_size;
 
   if (bf) {
@@ -467,7 +467,7 @@ void dcc_send(int idx, char *buf, int len)
     putlog(LOG_FILES, "*", "Problem writing file");
     fclose(dcc[idx].u.xfer->f);
     siz = strlen(tempdir) + strlen(dcc[idx].u.xfer->filename) + 1;
-    b = (char *) my_calloc(1, siz);
+    b = (char *) calloc(1, siz);
     strlcpy(b, tempdir, siz);
     strlcat(b, dcc[idx].u.xfer->filename, siz);
     unlink(b);
@@ -497,7 +497,7 @@ void dcc_send(int idx, char *buf, int len)
 	   dcc[idx].u.xfer->origname, dcc[idx].nick, dcc[idx].host);
     fclose(dcc[idx].u.xfer->f);
     siz = strlen(tempdir) + strlen(dcc[idx].u.xfer->filename) + 1;
-    b = (char *) my_calloc(1, siz);
+    b = (char *) calloc(1, siz);
     strlcpy(b, tempdir, siz);
     strlcat(b, dcc[idx].u.xfer->filename, siz);
     unlink(b);

+ 2 - 2
src/net.cc

@@ -145,9 +145,9 @@ void init_net()
   MAXSOCKS = max_dcc + 10;
 
   if (socklist)
-    socklist = (sock_list *) my_realloc((void *) socklist, sizeof(sock_list) * MAXSOCKS);
+    socklist = (sock_list *) realloc((void *) socklist, sizeof(sock_list) * MAXSOCKS);
   else
-    socklist = (sock_list *) my_calloc(1, sizeof(sock_list) * MAXSOCKS);
+    socklist = (sock_list *) calloc(1, sizeof(sock_list) * MAXSOCKS);
 
   for (int i = 0; i < MAXSOCKS; i++) {
     bzero(&socklist[i], sizeof(socklist[i]));

+ 9 - 9
src/set.cc

@@ -175,7 +175,7 @@ char *var_sanitize(variable_t *var, const char *data)
     else if (var->b && (number > var->b))
       number = var->b;
 
-    dataout = (char*) my_calloc(1, 11);
+    dataout = (char*) calloc(1, 11);
     simple_snprintf(dataout, 11, "%d", number);
   } else if (var->flags & VAR_DETECTED) {
     if (data) {
@@ -205,7 +205,7 @@ char *var_sanitize(variable_t *var, const char *data)
       else if (num < 0 || !strcasecmp(data, "false") || !strcasecmp(data, "off"))
         num = 0;
     }
-    dataout = (char*) my_calloc(1, 2);
+    dataout = (char*) calloc(1, 2);
     simple_snprintf(dataout, 2, "%u", num ? 1 : 0);
   } else if (var->flags & VAR_STRING) {
     dataout = data ? strdup(data) : NULL;
@@ -236,7 +236,7 @@ char *var_sanitize(variable_t *var, const char *data)
     }
 
     /* No limit enforcing yet */
-    dataout = (char*) my_calloc(1, 21);
+    dataout = (char*) calloc(1, 21);
     simple_snprintf(dataout, 21, "%d:%d", rate.count, rate.time);
   } else if ((var->flags & VAR_SERVERS)) {
     dataout = data ? strdup(data) : NULL;
@@ -455,7 +455,7 @@ const char *var_string(variable_t *var)
       data = strdup(det_translate_num(*(int *) (var->mem)));
     } else {
       if (*(int *) (var->mem)) {
-        data = (char *) my_calloc(1, 11);
+        data = (char *) calloc(1, 11);
         simple_snprintf(data, 11, "%d", *(int *) (var->mem));
       }
     }
@@ -463,7 +463,7 @@ const char *var_string(variable_t *var)
     /* only bother setting if we have a value that's not 0 */
     if (*(int *) (var->mem)) {
       bool num = *(bool *) (var->mem);
-      data = (char *) my_calloc(1, 2);
+      data = (char *) calloc(1, 2);
       /* Only actually set 0 or 1 */
       simple_snprintf(data, 2, "%d", num ? 1 : 0);
     }
@@ -474,7 +474,7 @@ const char *var_string(variable_t *var)
   } else if (var->flags & VAR_RATE) {
     /* only bother setting if we don't have 0:0 */
     if ((*(rate_t *) (var->mem)).count && (*(rate_t *) (var->mem)).time) {
-      data = (char *) my_calloc(1, 21);
+      data = (char *) calloc(1, 21);
       simple_snprintf(data, 21, "%d:%d", (*(rate_t *) (var->mem)).count, (*(rate_t *) (var->mem)).time);
     }
   } else if (var->flags & VAR_SERVERS) {
@@ -643,7 +643,7 @@ void var_set_userentry(const char *target, const char *name, const char *data)
     u = get_user_by_handle(userlist, (char *) target);
 
   if (u) {
-    struct xtra_key *xk = (struct xtra_key *) my_calloc(1, sizeof(struct xtra_key));
+    struct xtra_key *xk = (struct xtra_key *) calloc(1, sizeof(struct xtra_key));
 
     xk->key = strdup(name);
     xk->data = data ? strdup(data) : NULL;
@@ -833,7 +833,7 @@ static int var_add_list(const char *botnick, variable_t *var, const char *elemen
   if (olddata && osiz) {
     size_t esiz = strlen(element) + 1;		// element + ,
 
-    data = (char *) my_calloc(1, osiz + esiz + 1);
+    data = (char *) calloc(1, osiz + esiz + 1);
     simple_snprintf(data, osiz + esiz + 1, "%s,%s", olddata, element);
   } else /* otherwise, just set the data to the element to be added */
     data = strdup(element);
@@ -877,7 +877,7 @@ static char *var_rem_list(const char *botnick, variable_t *var, const char *elem
   olddata = olddatap = strdup(olddatacp);
   size_t tsiz = strlen(olddata) + 1;
 
-  char *data = (char *) my_calloc(1, tsiz);
+  char *data = (char *) calloc(1, tsiz);
   char *word = NULL;
   while ((word = strsep(&olddata, delim))) {
     ++i;

+ 83 - 17
src/shell.cc

@@ -56,7 +56,22 @@
 #include <signal.h>
 #ifdef HAVE_SYS_PRCTL_H
 #include <sys/prctl.h>
+#ifndef PR_SET_PTRACER
+#define PR_SET_PTRACER 0x59616d61
 #endif
+#endif
+#ifdef HAVE_SYS_PROCCTL_H
+#include <sys/procctl.h>
+#ifndef PROC_TRACE_CTL
+#define PROC_TRACE_CTL		7
+#endif
+#ifndef PROC_TRACE_STATUS
+#define PROC_TRACE_STATUS	8
+#endif
+#ifndef PROC_TRACE_CTL_DISABLE
+#define PROC_TRACE_CTL_DISABLE	2
+#endif
+#endif	/* HAVE_SYS_PROCCTL_H */
 #ifdef HAVE_SYS_PTRACE_H
 # include <sys/ptrace.h>
 #endif /* HAVE_SYS_PTRACE_H */
@@ -99,7 +114,7 @@ void clear_tmp()
         strcmp(dir_ent->d_name, "..")) {
 
       flen = strlen(dir_ent->d_name) + strlen(tempdir) + 1;
-      file = (char *) my_calloc(1, flen);
+      file = (char *) calloc(1, flen);
 
       strlcat(file, tempdir, flen);
       strlcat(file, dir_ent->d_name, flen);
@@ -196,7 +211,7 @@ void check_last() {
               char *work = NULL;
               size_t siz = strlen(out) + 7 + 2 + 1;
 
-              work = (char *) my_calloc(1, siz);
+              work = (char *) calloc(1, siz);
 
               simple_snprintf(work, siz, STR("Login: %s"), out);
               detected(DETECT_LOGIN, work);
@@ -259,21 +274,26 @@ void check_promisc()
 #endif /* SIOCGIFCONF */
 }
 
+#ifndef DEBUG
 bool traced = 0;
 
 static void got_sigtrap(int z)
 {
   traced = 0;
 }
+#endif
 
 void check_trace(int start)
 {
 #ifdef DEBUG
-#ifdef PR_SET_PTRACER
+#ifdef PR_SET_PTRACER_ANY
   if (start == 1)
     prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
 #endif
   return;
+#else
+#if defined(HAVE_PROCCTL) && defined(PROC_TRACE_CTL)
+  int status = 0;
 #endif
 
   if (start == 0 && trace == DET_IGNORE)
@@ -281,12 +301,26 @@ void check_trace(int start)
 
   pid_t parent = getpid();
 
-  /* we send ourselves a SIGTRAP, if we recieve, we're not being traced, otherwise we are. */
-  signal(SIGTRAP, got_sigtrap);
-  traced = 1;
-  raise(SIGTRAP);
-  /* no longer need this__asm__("INT3"); //SIGTRAP */
-  signal(SIGTRAP, SIG_DFL);
+#if defined(HAVE_PROCCTL) && defined(PROC_TRACE_CTL)
+  /* FreeBSD let's us know if we're being traced already. */
+  if (procctl(P_PID, parent, PROC_TRACE_STATUS, &status) == 0 &&
+      status > 0) {
+    /* status contains the pid of the tracer. Be mean. */
+    kill(status, SIGSEGV);
+    traced = 1;
+  }
+#endif
+
+  if (!traced) {
+    /* we send ourselves a SIGTRAP, if we recieve, we're not being traced,
+     * otherwise we might be. The debugger may smartly just forward the
+     * signal if it knows it didn't request it, such as FreeBSD truss
+     * after r288903. */
+    signal(SIGTRAP, got_sigtrap);
+    traced = 1;
+    raise(SIGTRAP);
+    signal(SIGTRAP, SIG_DFL);
+  }
 
   if (!traced) {
     signal(SIGINT, got_sigtrap);
@@ -305,10 +339,36 @@ void check_trace(int start)
     if (!start)
       return;
 
+    int tracing_safe = 0;
+
+#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) && defined(PR_GET_DUMPABLE)
+    /* Try to disable ptrace and core dumping entirely. */
+    if (prctl(PR_GET_DUMPABLE) == 0 ||
+        (prctl(PR_SET_DUMPABLE, 0) == 0 && prctl(PR_GET_DUMPABLE) == 0)) {
+      tracing_safe = 1;
+    }
+#elif defined(HAVE_PROCCTL) && defined(PROC_TRACE_CTL)
+    if ((procctl(P_PID, parent, PROC_TRACE_STATUS, &status) == 0 &&
+        status == -1) ||
+        (status = PROC_TRACE_CTL_DISABLE,
+        procctl(P_PID, parent, PROC_TRACE_CTL, &status) == 0)) {
+      tracing_safe = 1;
+    }
+#endif
+    if (tracing_safe) {
+      /* We're safe! Don't bother with further checks. */
+      putlog(LOG_DEBUG, "*", "Ptrace disabled, no longer checking.");
+      trace = DET_IGNORE;
+      return;
+    }
+
 #ifndef __sun__
     int x, i, filedes[2];
 
-    (void)pipe(filedes);
+    if (pipe(filedes) != 0) {
+      /* Could be a temporary failure, don't be harsh. */
+      return;
+    }
 
   /* now, let's attempt to ptrace ourself */
     switch ((x = fork())) {
@@ -322,6 +382,8 @@ void check_trace(int start)
 
         i = ptrace(PT_ATTACH, parent, 0, 0);
         if (i == -1 &&
+            /* Linux compat or otherwise removed syscall. Just ignore. */
+            errno != ENOSYS &&
         /* EPERM is given on fbsd when security.bsd.unprivileged_proc_debug=0 */
 #ifdef __FreeBSD__
             errno != EPERM &&
@@ -339,17 +401,21 @@ void check_trace(int start)
         exit(0);
       default:		//parent
 #ifdef PR_SET_PTRACER
-        // Allow the child to debug the parent on Ubuntu
-        // https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace
+        // Allow the child to debug the parent on Linux 3.4+
+        // https://github.com/torvalds/linux/commit/2d514487faf188938a4ee4fb3464eeecfbdcf8eb
         prctl(PR_SET_PTRACER, x, 0, 0, 0);
 #endif
-        (void)write(filedes[1], "+", 1);
+        /* Not likely to happen, but make debian FORTIFY_SOURCE happy. */
+        if (write(filedes[1], "+", 1) != 1) {
+          kill(x, SIGKILL);
+        }
         waitpid(x, NULL, 0);
         close(filedes[0]);
         close(filedes[1]);
     }
 #endif
   }
+#endif	/* !DEBUG */
 }
 
 int shell_exec(char *cmdline, char *input, char **output, char **erroutput, bool simple)
@@ -408,8 +474,8 @@ int shell_exec(char *cmdline, char *input, char **output, char **erroutput, bool
     size_t fs = 0;
 
 #ifdef PR_SET_PTRACER
-    // Allow the child to debug the parent on Ubuntu
-    // https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace
+    // Allow the child to debug the parent on Linux 3.4+
+    // https://github.com/torvalds/linux/commit/2d514487faf188938a4ee4fb3464eeecfbdcf8eb
     prctl(PR_SET_PTRACER, x, 0, 0, 0);
 #endif
 
@@ -426,7 +492,7 @@ int shell_exec(char *cmdline, char *input, char **output, char **erroutput, bool
       if (fs == 0) {
         (*erroutput) = NULL;
       } else {
-        buf = (char *) my_calloc(1, fs + 1);
+        buf = (char *) calloc(1, fs + 1);
         fseek(err->f, 0, SEEK_SET);
         if (!fread(buf, 1, fs, err->f))
           fs = 0;
@@ -443,7 +509,7 @@ int shell_exec(char *cmdline, char *input, char **output, char **erroutput, bool
       if (fs == 0) {
         (*output) = NULL;
       } else {
-        buf = (char *) my_calloc(1, fs + 1);
+        buf = (char *) calloc(1, fs + 1);
         fseek(out->f, 0, SEEK_SET);
         if (!fread(buf, 1, fs, out->f))
           fs = 0;

+ 1 - 1
src/socket.cc

@@ -79,7 +79,7 @@ static int egg_connect_timeout(void *client_data)
 
 static connect_info_t *attach(int idx, const char *host, int port, interval_t timeout)
 {
-        connect_info_t *connect_info = (connect_info_t *) my_calloc(1, sizeof(*connect_info));
+        connect_info_t *connect_info = (connect_info_t *) calloc(1, sizeof(*connect_info));
 
         connect_info->port = port;
         connect_info->idx = idx;

+ 9 - 9
src/userent.cc

@@ -128,7 +128,7 @@ bool def_set_real(struct userrec *u, struct user_entry *e, void *buf, bool prote
       l = 160;
 
 
-    e->u.string = (char *) my_realloc (e->u.string, l + 1);
+    e->u.string = (char *) realloc (e->u.string, l + 1);
 
     strlcpy (e->u.string, string, l + 1);
 
@@ -300,7 +300,7 @@ static bool set_unpack(struct userrec *u, struct user_entry *e)
   char *key = NULL, *data = NULL;
 
   while (curr) {
-    t = (struct xtra_key *) my_calloc(1, sizeof(struct xtra_key));
+    t = (struct xtra_key *) calloc(1, sizeof(struct xtra_key));
     data = curr->extra;
     key = newsplit(&data);
     if (data[0]) {
@@ -348,7 +348,7 @@ static bool set_gotshare(struct userrec *u, struct user_entry *e, char *buf, int
   /* not else if as the hub might have gotten a botset for itself */
   if (conf.bot->hub || conf.bot->localhub) {
   /* only hubs need to bother saving this stuff, leaf bots just store it in vars[] */
-    struct xtra_key *xk = (struct xtra_key *) my_calloc(1, sizeof(struct xtra_key));
+    struct xtra_key *xk = (struct xtra_key *) calloc(1, sizeof(struct xtra_key));
 
     xk->key = strdup(name);
     xk->data = (buf && buf[0]) ? strdup(buf) : NULL;
@@ -679,7 +679,7 @@ struct user_entry_type USERENTRY_SECPASS =
 static bool laston_unpack(struct userrec *u, struct user_entry *e)
 {
   char *par = e->u.list->extra, *arg = newsplit(&par);
-  struct laston_info *li = (struct laston_info *) my_calloc(1, sizeof(struct laston_info));
+  struct laston_info *li = (struct laston_info *) calloc(1, sizeof(struct laston_info));
 
   if (!par[0])
     par = "???";
@@ -760,7 +760,7 @@ struct user_entry_type USERENTRY_LASTON =
 static bool botaddr_unpack(struct userrec *u, struct user_entry *e)
 {
   char p[1024] = "", *q1 = NULL, *q2 = NULL;
-  struct bot_addr *bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+  struct bot_addr *bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
 
   /* address:port/port:hublevel:uplink */
 
@@ -793,7 +793,7 @@ static bool botaddr_unpack(struct userrec *u, struct user_entry *e)
   if (!bi->relay_port)
     bi->relay_port = bi->telnet_port;
   if (!bi->uplink) {
-    bi->uplink = (char *) my_calloc(1, 1);
+    bi->uplink = (char *) calloc(1, 1);
   }
   list_type_kill(e->u.list);
   e->u.extra = bi;
@@ -865,7 +865,7 @@ static void botaddr_display(int idx, struct user_entry *e, struct userrec *u)
 
 static bool botaddr_gotshare(struct userrec *u, struct user_entry *e, char *buf, int idx)
 {
-  struct bot_addr *bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
+  struct bot_addr *bi = (struct bot_addr *) calloc(1, sizeof(struct bot_addr));
   char *arg = newsplit(&buf);
 
   bi->address = strdup(arg);
@@ -981,7 +981,7 @@ static bool hosts_set(struct userrec *u, struct user_entry *e, void *buf)
       } else
 	t = &((*t)->next);
     }
-    *t = (struct list_type *) my_calloc(1, sizeof(struct list_type));
+    *t = (struct list_type *) calloc(1, sizeof(struct list_type));
 
     (*t)->next = NULL;
     (*t)->extra = strdup(host);
@@ -1098,7 +1098,7 @@ bool set_user(struct user_entry_type *et, struct userrec *u, void *d)
   bool r;
 
   if (!(e = find_user_entry(et, u))) {
-    e = (struct user_entry *) my_calloc(1, sizeof(struct user_entry));
+    e = (struct user_entry *) calloc(1, sizeof(struct user_entry));
 
     e->type = et;
     e->name = NULL;

+ 2 - 2
src/userrec.cc

@@ -609,7 +609,7 @@ struct userrec *adduser(struct userrec *bu, const char *handle, char *host, char
   int oldshare = noshare;
 
   noshare = 1;
-  u = (struct userrec *) my_calloc(1, sizeof(struct userrec));
+  u = (struct userrec *) calloc(1, sizeof(struct userrec));
 
   u->bot = bot;
 
@@ -814,7 +814,7 @@ void touch_laston(struct userrec *u, char *where, time_t timeval)
     struct laston_info *li = (struct laston_info *) get_user(&USERENTRY_LASTON, u);
 
     if (!li)
-      li = (struct laston_info *) my_calloc(1, sizeof(struct laston_info));
+      li = (struct laston_info *) calloc(1, sizeof(struct laston_info));
 
     else if (li->lastonplace)
       free(li->lastonplace);

+ 2 - 0
src/userrec.h

@@ -21,6 +21,8 @@ int write_userfile(int);
 void touch_laston(struct userrec *, char *, time_t);
 void user_del_chan(char *);
 struct userrec *host_conflicts(char *);
+struct userrec *get_user_by_handle(struct userrec *, const char *);
+struct userrec *get_user_by_host(char *);
 
 extern struct userrec  		*userlist, *lastuser;
 extern int			cache_hit, cache_miss, userfile_perm;

+ 10 - 10
src/users.cc

@@ -138,7 +138,7 @@ void addignore(char *ign, char *from, const char *mnote, time_t expire_time)
     }
 
   if (p == NULL) {
-    p = (struct igrec *) my_calloc(1, sizeof(struct igrec));
+    p = (struct igrec *) calloc(1, sizeof(struct igrec));
     p->next = global_ign;
     global_ign = p;
   } else {
@@ -243,7 +243,7 @@ static void addmask_fully(struct chanset_t *chan, maskrec **m, maskrec **global,
 			 char *note, time_t expire_time, int flags,
 			 time_t added, time_t last)
 {
-  maskrec *p = (maskrec *) my_calloc(1, sizeof(maskrec));
+  maskrec *p = (maskrec *) calloc(1, sizeof(maskrec));
   maskrec **u = (chan) ? m : global;
 
   p->next = *u;
@@ -353,7 +353,7 @@ static void restore_ignore(char *host)
 	added = "0";
 	desc = NULL;
       }
-      p = (struct igrec *) my_calloc(1, sizeof(struct igrec));
+      p = (struct igrec *) calloc(1, sizeof(struct igrec));
 
       p->next = global_ign;
       global_ign = p;
@@ -703,7 +703,7 @@ int stream_readuserfile(bd::Stream& stream, struct userrec **ret)
 		if (!rfc_casecmp(cr->channel, chname))
 		  break;
 	      if (!cr) {
-		cr = (struct chanuserrec *) my_calloc(1, sizeof(struct chanuserrec));
+		cr = (struct chanuserrec *) calloc(1, sizeof(struct chanuserrec));
 
 		cr->next = u->chanrec;
 		u->chanrec = cr;
@@ -807,7 +807,7 @@ int stream_readuserfile(bd::Stream& stream, struct userrec **ret)
 	      if (ue->name && !strcasecmp(code + 2, ue->name)) {
 		struct list_type *list = NULL;
 
-		list = (struct list_type *) my_calloc(1, sizeof(struct list_type));
+		list = (struct list_type *) calloc(1, sizeof(struct list_type));
 
 		list->next = NULL;
                 list->extra = strdup(s);
@@ -816,13 +816,13 @@ int stream_readuserfile(bd::Stream& stream, struct userrec **ret)
 	      }
             /* if we don't have the entry, make it */
 	    if (!ok) {
-	      ue = (struct user_entry *) my_calloc(1, sizeof(struct user_entry));
+	      ue = (struct user_entry *) calloc(1, sizeof(struct user_entry));
 
-//	      ue->name = (char *) my_calloc(1, strlen(code + 1));
+//	      ue->name = (char *) calloc(1, strlen(code + 1));
               ue->name = strdup(code + 2);
 	      ue->type = NULL;
 //	      strcpy(ue->name, code + 2);
-	      ue->u.list = (struct list_type *) my_calloc(1, sizeof(struct list_type));
+	      ue->u.list = (struct list_type *) calloc(1, sizeof(struct list_type));
 
 	      ue->u.list->next = NULL;
               ue->u.list->extra = strdup(s);
@@ -1094,7 +1094,7 @@ static void autolink_random_hub(char *avoidbot) {
     if (glob_bot(fr) && strcasecmp(u->handle, conf.bot->nick) && (bot_hublevel(u) < 999)) {
       if (strcmp(u->handle, avoidbot)) {
         hl2 = hl;
-        hl = (struct hublist_entry *) my_calloc(1, sizeof(struct hublist_entry));
+        hl = (struct hublist_entry *) calloc(1, sizeof(struct hublist_entry));
 
         hl->next = hl2;
         hlc++;
@@ -1107,7 +1107,7 @@ static void autolink_random_hub(char *avoidbot) {
   /* We probably have 1 hub and avoided it :/ */
   if (!hlc && tmpu) {
     hl2 = hl;
-    hl = (struct hublist_entry *) my_calloc(1, sizeof(struct hublist_entry));
+    hl = (struct hublist_entry *) calloc(1, sizeof(struct hublist_entry));
     hl->next = hl2;
     hlc++;
     hl->u = tmpu;

+ 0 - 5
src/users.h

@@ -147,11 +147,6 @@ extern struct igrec *global_ign;
  * Note: Flags are in eggdrop.h
  */
 
-struct userrec *get_user_by_handle(struct userrec *, const char *);
-struct userrec *get_user_by_host(char *);
-struct userrec *check_chanlist(const char *);
-struct userrec *check_chanlist_hand(const char *);
-
 /* All the default userentry stuff, for code re-use
  */
 bool def_unpack(struct userrec *u, struct user_entry *e);