ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/extban_account.c
Revision: 9234
Committed: Fri Jan 31 17:38:34 2020 UTC (4 years, 2 months ago) by michael
Content type: text/x-csrc
File size: 1683 byte(s)
Log Message:
- Extbans have been implemented. Main implementation done by Adam for p4.
  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.

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 2015-2016 plexus development team
5 * Copyright (c) 2019-2020 ircd-hybrid development team
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20 * USA
21 */
22
23 /*! \file extban_account.c
24 * \brief Implements services account based extended channel bans.
25 * \version $Id: extban_account.c 9223 2020-01-26 11:35:22Z michael $
26 */
27
28 #include "stdinc.h"
29 #include "list.h"
30 #include "irc_string.h"
31 #include "channel.h"
32 #include "channel_mode.h"
33 #include "client.h"
34 #include "extban.h"
35
36
37 static enum extban_match
38 extban_account_matches(struct Client *client_p, struct Channel *channel, struct Ban *ban)
39 {
40 if (!EmptyString(client_p->account))
41 if (match(ban->host, client_p->account) == 0)
42 return EXTBAN_MATCH;
43
44 return EXTBAN_NO_MATCH;
45 }
46
47 struct Extban extban_account =
48 {
49 .character = 'a',
50 .type = EXTBAN_MATCHING,
51 .types = CHFL_BAN | CHFL_EXCEPTION | CHFL_INVEX,
52 .matches = extban_account_matches
53 };