Showing with 6,536 additions and 5,199 deletions.
  1. +29 −1 NEWS
  2. +0 −3 config.h.in
  3. +11 −14 configure
  4. +2 −3 configure.ac
  5. +9 −0 doc/reference.conf
  6. +36 −0 help/extban
  7. +9 −17 include/channel.h
  8. +46 −0 include/channel_invite.h
  9. +3 −2 include/channel_mode.h
  10. +0 −1 include/client.h
  11. +1 −0 include/conf.h
  12. +91 −0 include/extban.h
  13. +1 −0 include/numeric.h
  14. +1 −1 include/patchlevel.h
  15. +9 −5 modules/core/m_bmask.c
  16. +3 −2 modules/core/m_nick.c
  17. +1 −0 modules/core/m_server.c
  18. +4 −3 modules/core/m_sjoin.c
  19. +1 −0 modules/extra/m_opme.c
  20. +1 −0 modules/m_hash.c
  21. +6 −0 modules/m_info.c
  22. +3 −2 modules/m_invite.c
  23. +2 −0 modules/m_stats.c
  24. +1 −0 modules/m_svshost.c
  25. +6 −5 modules/m_svsmode.c
  26. +7 −5 modules/m_svsnick.c
  27. +1 −0 modules/m_tburst.c
  28. +1 −1 modules/m_who.c
  29. +11 −0 src/Makefile.am
  30. +81 −27 src/Makefile.in
  31. +6 −6 src/auth.c
  32. +223 −258 src/channel.c
  33. +112 −0 src/channel_invite.c
  34. +204 −148 src/channel_mode.c
  35. +282 −282 src/client.c
  36. +62 −61 src/conf.c
  37. +3 −3 src/conf_class.c
  38. +3 −3 src/conf_cluster.c
  39. +1,367 −1,354 src/conf_lexer.c
  40. +1 −0 src/conf_lexer.l
  41. +1,997 −1,967 src/conf_parser.c
  42. +389 −387 src/conf_parser.h
  43. +7 −0 src/conf_parser.y
  44. +7 −7 src/conf_resv.c
  45. +278 −0 src/extban.c
  46. +55 −0 src/extban_account.c
  47. +85 −0 src/extban_channel.c
  48. +53 −0 src/extban_fingerprint.c
  49. +52 −0 src/extban_gecos.c
  50. +57 −0 src/extban_join.c
  51. +77 −0 src/extban_mute.c
  52. +53 −0 src/extban_operclass.c
  53. +51 −0 src/extban_server.c
  54. +89 −0 src/extban_usermode.c
  55. +69 −69 src/hash.c
  56. +2 −0 src/ircd.c
  57. +4 −3 src/isupport.c
  58. +37 −36 src/motd.c
  59. +4 −3 src/numeric.c
  60. +56 −56 src/packet.c
  61. +46 −46 src/parse.c
  62. +32 −32 src/s_bsd.c
  63. +74 −74 src/send.c
  64. +70 −70 src/server.c
  65. +10 −0 src/tls_wolfssl.c
  66. +181 −181 src/user.c
  67. +40 −40 src/watch.c
  68. +21 −21 src/whowas.c
30 NEWS
@@ -1,9 +1,37 @@
-- Noteworthy changes in version 8.2.29 (2020-02-19)
o) Extbans have been implemented. Currently supported extbans:

Matching:

$a:<account> Matches users logged into a matching account.
$c:<channel> Matches users that are on the given channel. An additional
prefix of either @, %, or + can be specified to test for
certain channel privileges.
$o:<class> Matches IRC operators that have joined a class
matching the mask.
$r:<realname> Matches users with a matching realname.
$s:<server> Matches users that are connected to a server matching the mask.
$u:<modes> Matches users having the specified user modes set or not set.
$z:<certfp> Matches users having the given TLS certificate fingerprint.

Acting:

$j:<banmask> Prevents matching users from joining the channel.
$m:<banmask> Blocks messages from matching users. Users with voice
or above are not affected.

For more details, see help/extban.
o) Added 'channel::enable_extbans' configuration option. See doc/reference.conf
for more information.
o) For a full list of all changes in this release, see https://git.io/JvBca


-- Noteworthy changes in version 8.2.28 (2020-01-26)
o) Fixed issue with topics set by TBURST not being propagated properly to clients
o) Allow IRC operators to search for real hosts in "WHO"
o) Ban/exempt/invex masks are now also tested against realhosts to prevent clients
from bypassing channel bans by activating a fakehost
o) For a full list of all changes in this release, see https://git.io/JvqpT
o) For a full list of all changes in this release, see https://git.io/Jv37M


-- Noteworthy changes in version 8.2.27 (2020-01-22)
@@ -9,9 +9,6 @@
/* Define if SSP C support is enabled. */
#undef ENABLE_SSP_CC

/* Define to 1 if you have the `accept4' function. */
#undef HAVE_ACCEPT4

/* Define to 1 if you have the `argz_add' function. */
#undef HAVE_ARGZ_ADD

@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Id: configure.ac 9183 2020-01-20 16:50:49Z michael .
# From configure.ac Id: configure.ac 9260 2020-02-02 19:22:23Z michael .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ircd-hybrid 8.2.28.
# Generated by GNU Autoconf 2.69 for ircd-hybrid 8.2.29.
#
# Report bugs to <bugs@ircd-hybrid.org>.
#
@@ -593,8 +593,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ircd-hybrid'
PACKAGE_TARNAME='ircd-hybrid'
PACKAGE_VERSION='8.2.28'
PACKAGE_STRING='ircd-hybrid 8.2.28'
PACKAGE_VERSION='8.2.29'
PACKAGE_STRING='ircd-hybrid 8.2.29'
PACKAGE_BUGREPORT='bugs@ircd-hybrid.org'
PACKAGE_URL=''

@@ -1378,7 +1378,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ircd-hybrid 8.2.28 to adapt to many kinds of systems.
\`configure' configures ircd-hybrid 8.2.29 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

@@ -1449,7 +1449,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ircd-hybrid 8.2.28:";;
short | recursive ) echo "Configuration of ircd-hybrid 8.2.29:";;
esac
cat <<\_ACEOF

@@ -1583,7 +1583,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ircd-hybrid configure 8.2.28
ircd-hybrid configure 8.2.29
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2052,7 +2052,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by ircd-hybrid $as_me 8.2.28, which was
It was created by ircd-hybrid $as_me 8.2.29, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
@@ -2332,7 +2332,6 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi

as_fn_append ac_func_list " accept4"
as_fn_append ac_func_list " strtok_r"
as_fn_append ac_func_list " strlcat"
as_fn_append ac_func_list " strlcpy"
@@ -2924,7 +2923,7 @@ fi

# Define the identity of the package.
PACKAGE='ircd-hybrid'
VERSION='8.2.28'
VERSION='8.2.29'


cat >>confdefs.h <<_ACEOF
@@ -14190,8 +14189,6 @@ done





# Checks for header files.


@@ -17747,7 +17744,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ircd-hybrid $as_me 8.2.28, which was
This file was extended by ircd-hybrid $as_me 8.2.29, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
@@ -17813,7 +17810,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ircd-hybrid config.status 8.2.28
ircd-hybrid config.status 8.2.29
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

@@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$Id$])

AC_PREREQ(2.69)
AC_INIT([ircd-hybrid], [8.2.28], [bugs@ircd-hybrid.org])
AC_INIT([ircd-hybrid], [8.2.29], [bugs@ircd-hybrid.org])
AM_INIT_AUTOMAKE(1.15 subdir-objects)
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])
@@ -33,8 +33,7 @@ AX_LIBRARY_NET
AC_C_BIGENDIAN

# Checks for library functions.
AC_CHECK_FUNCS_ONCE(accept4 \
strtok_r \
AC_CHECK_FUNCS_ONCE(strtok_r \
strlcat \
strlcpy)

@@ -882,6 +882,15 @@ pseudo {
* channel {}: the channel block contains options pertaining to channels
*/
channel {
/*
* enable_extbans: whether or not to enable extbans. This is set
* to 'no' by default and should not be enabled before all servers
* on the network have been updated to ircd-hybrid 8.2.29 or later.
*
* For a more detailed explanation of the extban feature, see help/extban.
*/
enable_extbans = no;

/*
* disable_fake_channels: this option, if set to 'yes', will
* disallow clients from creating or joining channels that have one
@@ -0,0 +1,36 @@
Extbans are split into two types: matching extbans, which match on
users in different ways, and acting extbans, which restrict users
in different ways to a standard ban.

To use an extban, simply set +b/e/I <ban> with it as the ban,
instead of a normal nick!user@host mask, to ban or exempt matching
users.

Matching extbans:

$a:<account> Matches users logged into a matching account.

$c:<channel> Matches users that are on the given channel. An additional
prefix of either @, %, or + can be specified to test for
certain channel privileges.

$o:<class> Matches IRC operators that have joined a class
matching the mask.

$r:<realname> Matches users with a matching realname.

$s:<server> Matches users that are connected to a server matching the mask.

$u:<modes> Matches users having the specified user modes set or not set.

$z:<certfp> Matches users having the given TLS certificate fingerprint.

Acting extbans:

$j:<banmask> Prevents matching users from joining the channel.

$m:<banmask> Blocks messages from matching users. Users with voice
or above are not affected.

A ban given to an acting extban may either be a nick!user@host mask,
matched against users as a normal ban, or a matching extban.
@@ -28,6 +28,7 @@
#define INCLUDED_channel_h

#include "ircd_defs.h" /* KEYLEN, CHANNELLEN */
#include "extban.h"

#define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
#define AddMemberFlag(x, y) ((x)->flags |= (y))
@@ -102,42 +103,36 @@ struct ChannelMember
{
dlink_node locchannode; /**< link to channel->members_local */
dlink_node channode; /**< link to channel->members */
dlink_node usernode; /**< link to source_p->channel */
dlink_node usernode; /**< link to client->channel */
struct Channel *channel; /**< Channel pointer */
struct Client *client; /**< Client pointer */
unsigned int flags; /**< user/channel flags, e.g. CHFL_CHANOP */
};

enum { BANSTRLEN = 200 }; /* XXX */

/*! \brief Ban structure. Used for b/e/I n!u\@h masks */
struct Ban
{
dlink_node node;
unsigned int extban;
char banstr[BANSTRLEN];
char name[NICKLEN + 1];
char user[USERLEN + 1];
char host[HOSTLEN + 1];
char who[NICKLEN + USERLEN + HOSTLEN + 3];
size_t len;
size_t banstr_len; /**< Cached string length of Ban::banstr */
uintmax_t when; /**< Time this ban has been set; real time */
struct irc_ssaddr addr;
int bits;
int type;
};

/*! \brief Invite structure */
struct Invite
{
dlink_node user_node; /**< link to client_p->connection->invited */
dlink_node chan_node; /**< link to channel->invites */
struct Channel *channel; /**< Channel pointer */
struct Client *client; /**< Client pointer */
uintmax_t when; /**< Time the invite has been created; monotonic time */
};


extern const dlink_list *channel_get_list(void);
extern bool channel_check_name(const char *, bool);
extern int can_send(struct Channel *, struct Client *, struct ChannelMember *, const char *, bool);
extern bool is_banned(const struct Channel *, const struct Client *);
extern bool is_banned(struct Channel *, struct Client *);
extern bool find_bmask(struct Client *, struct Channel*, const dlink_list *, struct Extban *);
extern int has_member_flags(const struct ChannelMember *, const unsigned int);

extern void channel_do_join(struct Client *, char *, char *);
@@ -146,9 +141,6 @@ extern void remove_ban(struct Ban *, dlink_list *);
extern void add_user_to_channel(struct Channel *, struct Client *, unsigned int, bool);
extern void remove_user_from_channel(struct ChannelMember *);
extern void channel_member_names(struct Client *, struct Channel *, bool);
extern void add_invite(struct Channel *, struct Client *);
extern void del_invite(struct Invite *);
extern void clear_invite_list(dlink_list *);
extern void channel_send_modes(struct Client *, const struct Channel *);
extern void channel_modes(const struct Channel *, const struct Client *, char *, char *);
extern void check_spambot_warning(struct Client *, const char *);
@@ -0,0 +1,46 @@
/*
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
*
* Copyright (c) 1997-2020 ircd-hybrid development team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/

/*! \file channel_invite.h
* \brief Channel invitation related functions
* \version $Id$
*/

#ifndef INCLUDED_channel_invite_h
#define INCLUDED_channel_invite_h


/*! \brief Invite structure */
struct Invite
{
dlink_node user_node; /**< link to client->connection->invited */
dlink_node chan_node; /**< link to channel->invites */
struct Channel *channel; /**< Channel pointer */
struct Client *client; /**< Client pointer */
uintmax_t when; /**< Time the invite has been created; monotonic time */
};


extern struct Invite *invite_find(struct Channel *, struct Client *);
extern void invite_add(struct Channel *, struct Client *);
extern void invite_del(struct Invite *);
extern void invite_clear_list(dlink_list *);
#endif
@@ -63,7 +63,8 @@ enum
CHFL_INVEX = 1 << 5,
/* Cache flags for silence on ban */
CHFL_BAN_CHECKED = 1 << 6,
CHFL_BAN_SILENCED = 1 << 7
CHFL_BAN_SILENCED = 1 << 7,
CHFL_MUTE_CHECKED = 1 << 8
};

/* channel modes ONLY */
@@ -124,7 +125,7 @@ extern const struct chan_mode *cmode_map[];
extern const struct chan_mode cmode_tab[];

extern void channel_mode_init(void);
extern bool add_id(struct Client *, struct Channel *, char *, dlink_list *);
extern const char *add_id(struct Client *, struct Channel *, const char *, dlink_list *, unsigned int);
extern void channel_mode_set(struct Client *, struct Channel *,
struct ChannelMember *, int, char **);
extern void clear_ban_cache_list(dlink_list *);
@@ -32,7 +32,6 @@
#include "fdlist.h"
#include "ircd_defs.h"
#include "dbuf.h"
#include "channel.h"
#include "auth.h"


@@ -220,6 +220,7 @@ struct config_general_entry

struct config_channel_entry
{
unsigned int enable_extbans;
unsigned int disable_fake_channels;
unsigned int invite_client_count;
unsigned int invite_client_time;