Compare commits
27 Commits
armageddon
...
devel
Author | SHA1 | Date |
---|---|---|
Christine Dodrill | f0fc7fa407 | |
Sam Dodrill | 79bd2087c4 | |
Christine Dodrill | ad62a8365f | |
Christine Dodrill | a03437b725 | |
Christine Dodrill | 81c857c332 | |
Sam Dodrill | 417a320324 | |
Sam Dodrill | e1657f04ec | |
Sam Dodrill | daac54878c | |
Sam Dodrill | e7f3a5ad93 | |
Sam Dodrill | 9c83aac397 | |
Sam Dodrill | 0c372c65fc | |
Sam Dodrill | 8cff086fc5 | |
Sam Dodrill | 48a3589d5e | |
Sam Dodrill | 7c4267175b | |
Sam Dodrill | aa4ebff4a5 | |
Sam Dodrill | a3e2e47b86 | |
Sam Dodrill | 88cd0168ad | |
Sam Dodrill | 874ca05045 | |
Sam Dodrill | 2c0ee6900c | |
Sam Dodrill | 9b969de641 | |
Sam Dodrill | cc0c8d338d | |
Sam Dodrill | 0361eeeedf | |
Sam Dodrill | a6eb07553e | |
Sam Dodrill | 62a511ab7b | |
Sam Dodrill | 3e6d026b38 | |
Sam Dodrill | 100324f5c9 | |
Sam Dodrill | 771cc10e92 |
|
@ -0,0 +1 @@
|
|||
.gitignore
|
|
@ -40,3 +40,5 @@ tools/mkpasswd
|
|||
tools/viconf
|
||||
include/serno.h
|
||||
libratbox/src/version.c.last
|
||||
*.pyc
|
||||
.git
|
||||
|
|
|
@ -5,8 +5,5 @@ compiler:
|
|||
before-install:
|
||||
- sudo apt-get update
|
||||
install:
|
||||
- sudo apt-get install build-essential libssl-dev flex bison
|
||||
script: "./configure && make"
|
||||
|
||||
notifications:
|
||||
irc: "irc.yolo-swag.com#elemental-ircd"
|
||||
- sudo apt-get install build-essential libssl-dev flex bison astyle
|
||||
script: "(cd ./testsuite/astyle && ./check_style.sh) && ./configure && make"
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
import os
|
||||
import ycm_core
|
||||
|
||||
# These are the compilation flags that will be used in case there's no
|
||||
# compilation database set (by default, one is not set).
|
||||
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
|
||||
flags = [
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Werror',
|
||||
'-g',
|
||||
'-g',
|
||||
'-Iinclude',
|
||||
'-Ilibratbox/include',
|
||||
]
|
||||
|
||||
# Set this to the absolute path to the folder (NOT the file!) containing the
|
||||
# compile_commands.json file to use that instead of 'flags'. See here for
|
||||
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
||||
#
|
||||
# You can get CMake to generate this file for you by adding:
|
||||
# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
|
||||
# to your CMakeLists.txt file.
|
||||
#
|
||||
# Most projects will NOT need to set this to anything; you can just change the
|
||||
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
|
||||
compilation_database_folder = ''
|
||||
|
||||
if os.path.exists( compilation_database_folder ):
|
||||
database = ycm_core.CompilationDatabase( compilation_database_folder )
|
||||
else:
|
||||
database = None
|
||||
|
||||
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
|
||||
|
||||
def DirectoryOfThisScript():
|
||||
return os.path.dirname( os.path.abspath( __file__ ) )
|
||||
|
||||
|
||||
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
|
||||
if not working_directory:
|
||||
return list( flags )
|
||||
new_flags = []
|
||||
make_next_absolute = False
|
||||
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
|
||||
for flag in flags:
|
||||
new_flag = flag
|
||||
|
||||
if make_next_absolute:
|
||||
make_next_absolute = False
|
||||
if not flag.startswith( '/' ):
|
||||
new_flag = os.path.join( working_directory, flag )
|
||||
|
||||
for path_flag in path_flags:
|
||||
if flag == path_flag:
|
||||
make_next_absolute = True
|
||||
break
|
||||
|
||||
if flag.startswith( path_flag ):
|
||||
path = flag[ len( path_flag ): ]
|
||||
new_flag = path_flag + os.path.join( working_directory, path )
|
||||
break
|
||||
|
||||
if new_flag:
|
||||
new_flags.append( new_flag )
|
||||
return new_flags
|
||||
|
||||
|
||||
def IsHeaderFile( filename ):
|
||||
extension = os.path.splitext( filename )[ 1 ]
|
||||
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
|
||||
|
||||
|
||||
def GetCompilationInfoForFile( filename ):
|
||||
# The compilation_commands.json file generated by CMake does not have entries
|
||||
# for header files. So we do our best by asking the db for flags for a
|
||||
# corresponding source file, if any. If one exists, the flags for that file
|
||||
# should be good enough.
|
||||
if IsHeaderFile( filename ):
|
||||
basename = os.path.splitext( filename )[ 0 ]
|
||||
for extension in SOURCE_EXTENSIONS:
|
||||
replacement_file = basename + extension
|
||||
if os.path.exists( replacement_file ):
|
||||
compilation_info = database.GetCompilationInfoForFile(
|
||||
replacement_file )
|
||||
if compilation_info.compiler_flags_:
|
||||
return compilation_info
|
||||
return None
|
||||
return database.GetCompilationInfoForFile( filename )
|
||||
|
||||
|
||||
def FlagsForFile( filename, **kwargs ):
|
||||
if database:
|
||||
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
|
||||
# python list, but a "list-like" StringVec object
|
||||
compilation_info = GetCompilationInfoForFile( filename )
|
||||
if not compilation_info:
|
||||
return None
|
||||
|
||||
final_flags = MakeRelativePathsInFlagsAbsolute(
|
||||
compilation_info.compiler_flags_,
|
||||
compilation_info.compiler_working_dir_ )
|
||||
|
||||
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
|
||||
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
|
||||
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
|
||||
try:
|
||||
final_flags.remove( '-stdlib=libc++' )
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
relative_to = DirectoryOfThisScript()
|
||||
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
|
||||
|
||||
return {
|
||||
'flags': final_flags,
|
||||
'do_cache': True
|
||||
}
|
|
@ -1,20 +1,43 @@
|
|||
# Contribution guidelines
|
||||
|
||||
Please open contributions as either issue reports or pull requests. We will ask
|
||||
that anything that requires testing outside our normally supported platforms be
|
||||
Please open contributions as either issue reports or pull requests. We will ask
|
||||
that anything that requires testing outside our normally supported platforms be
|
||||
marked as such.
|
||||
|
||||
As ircd is such an ancient project with varying code styles, please try to
|
||||
follow the current coding style of the file you are in. If all else fails,
|
||||
please use the [Linux Kernel](https://www.kernel.org/doc/Documentation/CodingStyle)
|
||||
coding style.
|
||||
Style
|
||||
-----
|
||||
|
||||
Please run all code against the following `astyle` command before sending in
|
||||
Please run all code against the following `astyle` command before sending in
|
||||
a pull request:
|
||||
|
||||
```console
|
||||
$ astyle --style=linux --mode=c -n $file
|
||||
```
|
||||
|
||||
It should be trivial to set up your text editor to do this for you.
|
||||
It should be trivial to set up your text editor to do this for you. If you use
|
||||
vim, add this to your vim configuration:
|
||||
|
||||
```vimscript
|
||||
" Lvimrc
|
||||
" if .lvimrc exists in current or parent directory of the currently loaded file,
|
||||
" load it as config
|
||||
if filereadable('../.lvimrc')
|
||||
source ../.lvimrc
|
||||
endif
|
||||
if filereadable('./.lvimrc')
|
||||
source ./.lvimrc
|
||||
endif
|
||||
```
|
||||
|
||||
Otherwise please make sure the appropriate command is ran as part of your
|
||||
editing process before you send a pull request. All pull requests that do not
|
||||
follow the coding style will not be considered until they follow the coding
|
||||
style.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
When testing Elemental, please be sure to test it on a network of at least
|
||||
3 instances of elemental. Please also be sure to have one of these instances
|
||||
run **without** the patch you are testing, to be able to show that there is
|
||||
a difference.
|
||||
|
|
4
CREDITS
4
CREDITS
|
@ -4,7 +4,7 @@ Elemental-IRCd is a fork of the now-defunct ShadowIRCD project.
|
|||
|
||||
The Elemental-IRCd team is listed below in nick-alphabetical order:
|
||||
|
||||
Xena, Sam Dodrill <shadowh511 -at- gmail.com>
|
||||
Xena, Christine Dodrill <xena -at- yolo-swag.com>
|
||||
|
||||
Some Elemental-IRCd features are modeled after or direct ports of
|
||||
code from Charybdis.
|
||||
|
@ -17,7 +17,7 @@ The ponychat-ircd team is listed in nick-alphabetical order:
|
|||
|
||||
aji, Alex Iadicico <alex -at- ajitek.net>
|
||||
Kabaka, Kyle Johnson <kabaka -at- ponychat.net>
|
||||
Xe, Sam Dodrill <shadowh511 -at- gmail.com>
|
||||
Xena, Christine Dodrill <xena -at- yolo-swag.com>
|
||||
|
||||
ShadowIRCd 6 is a modern restart of the old ShadowIRCd project
|
||||
based on Charybdis with a few additional features to make it appeal
|
||||
|
|
4
NEWS
4
NEWS
|
@ -1,6 +1,10 @@
|
|||
This is elemental-ircd 6.6.1, Copyright (c) 2014 elemental-ircd team.
|
||||
See LICENSE for licensing details (GPL v2).
|
||||
|
||||
-- elemental-ircd 6.6.2
|
||||
|
||||
Fix ban logic
|
||||
|
||||
-- elemental-ircd 6.6.1
|
||||
|
||||
All code is now in the linux kernel coding style. Patches that do not
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for elemental-ircd 6.6.1.
|
||||
# Generated by GNU Autoconf 2.69 for elemental-ircd 6.6.2.
|
||||
#
|
||||
# 2014 elemental-ircd Team
|
||||
#
|
||||
|
@ -579,8 +579,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='elemental-ircd'
|
||||
PACKAGE_TARNAME='elemental-ircd'
|
||||
PACKAGE_VERSION='6.6.1'
|
||||
PACKAGE_STRING='elemental-ircd 6.6.1'
|
||||
PACKAGE_VERSION='6.6.2'
|
||||
PACKAGE_STRING='elemental-ircd 6.6.2'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
|
@ -1303,7 +1303,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 elemental-ircd 6.6.1 to adapt to many kinds of systems.
|
||||
\`configure' configures elemental-ircd 6.6.2 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of elemental-ircd 6.6.1:";;
|
||||
short | recursive ) echo "Configuration of elemental-ircd 6.6.2:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
@ -1488,7 +1488,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
elemental-ircd configure 6.6.1
|
||||
elemental-ircd configure 6.6.2
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
@ -2092,7 +2092,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 elemental-ircd $as_me 6.6.1, which was
|
||||
It was created by elemental-ircd $as_me 6.6.2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
@ -10100,7 +10100,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 elemental-ircd $as_me 6.6.1, which was
|
||||
This file was extended by elemental-ircd $as_me 6.6.2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
@ -10166,7 +10166,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="\\
|
||||
elemental-ircd config.status 6.6.1
|
||||
elemental-ircd config.status 6.6.2
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ AC_PREREQ(2.57)
|
|||
dnl Sneaky way to get an Id tag into the configure script
|
||||
AC_COPYRIGHT([2014 elemental-ircd Team])
|
||||
|
||||
AC_INIT([elemental-ircd],[6.6.1])
|
||||
AC_INIT([elemental-ircd],[6.6.2])
|
||||
|
||||
AC_CONFIG_HEADER(include/setup.h)
|
||||
|
||||
|
|
|
@ -57,13 +57,6 @@ serverinfo {
|
|||
helpurl = "http://www.mynet.net/help";
|
||||
hub = yes;
|
||||
|
||||
/* On multi-homed hosts you may need the following. These define
|
||||
* the addresses we connect from to other servers. */
|
||||
/* for IPv4 */
|
||||
#vhost = "192.169.0.1";
|
||||
/* for IPv6 */
|
||||
#vhost6 = "3ffe:80e8:546::2";
|
||||
|
||||
/* ssl_private_key: our ssl private key */
|
||||
ssl_private_key = "etc/ssl.key";
|
||||
|
||||
|
|
|
@ -159,16 +159,6 @@ serverinfo {
|
|||
*/
|
||||
hub = no;
|
||||
|
||||
/* vhost: the IP to bind to when we connect outward to ipv4 servers.
|
||||
* This should be an ipv4 IP only.
|
||||
*/
|
||||
#vhost = "192.169.0.1";
|
||||
|
||||
/* vhost6: the IP to bind to when we connect outward to ipv6 servers.
|
||||
* This should be an ipv6 IP only.
|
||||
*/
|
||||
#vhost6 = "3ffe:80e8:546::2";
|
||||
|
||||
/* ssl_private_key: our ssl private key */
|
||||
ssl_private_key = "etc/ssl.key";
|
||||
|
||||
|
|
|
@ -155,16 +155,6 @@ serverinfo {
|
|||
*/
|
||||
hub = no;
|
||||
|
||||
/* vhost: the IP to bind to when we connect outward to ipv4 servers.
|
||||
* This should be an ipv4 IP only.
|
||||
*/
|
||||
#vhost = "192.169.0.1";
|
||||
|
||||
/* vhost6: the IP to bind to when we connect outward to ipv6 servers.
|
||||
* This should be an ipv6 IP only.
|
||||
*/
|
||||
#vhost6 = "3ffe:80e8:546::2";
|
||||
|
||||
/* ssl_private_key: our ssl private key */
|
||||
ssl_private_key = "etc/ssl.key";
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ SRCS = \
|
|||
extb_ssl.c \
|
||||
extb_realname.c \
|
||||
extb_extgecos.c \
|
||||
extb_usermode.c \
|
||||
force_user_invis.c \
|
||||
hurt.c \
|
||||
ip_cloaking.c \
|
||||
|
@ -67,7 +68,6 @@ SRCS = \
|
|||
m_mkpasswd.c \
|
||||
m_oaccept.c \
|
||||
m_ojoin.c \
|
||||
m_olist.c \
|
||||
m_okick.c \
|
||||
m_omode.c \
|
||||
m_opme.c \
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Usermode extban type: bans all users with a specific usermode
|
||||
* -- nenolod
|
||||
*/
|
||||
|
||||
#include "stdinc.h"
|
||||
#include "modules.h"
|
||||
#include "hook.h"
|
||||
#include "client.h"
|
||||
#include "ircd.h"
|
||||
#include "send.h"
|
||||
#include "hash.h"
|
||||
#include "s_conf.h"
|
||||
#include "s_user.h"
|
||||
#include "s_serv.h"
|
||||
#include "numeric.h"
|
||||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
static int eb_usermode(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
|
||||
|
||||
DECLARE_MODULE_AV1(extb_usermode, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision: 1299 $");
|
||||
|
||||
static int
|
||||
_modinit(void)
|
||||
{
|
||||
extban_table['m'] = eb_usermode;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_moddeinit(void)
|
||||
{
|
||||
extban_table['m'] = NULL;
|
||||
}
|
||||
|
||||
static int eb_usermode(const char *data, struct Client *client_p,
|
||||
struct Channel *chptr, long mode_type)
|
||||
{
|
||||
int dir = MODE_ADD;
|
||||
unsigned int modes_ack = 0, modes_nak = 0;
|
||||
const char *p;
|
||||
|
||||
(void)chptr;
|
||||
|
||||
/* $m must have a specified mode */
|
||||
if (data == NULL)
|
||||
return EXTBAN_INVALID;
|
||||
|
||||
for (p = data; *p != '\0'; p++)
|
||||
{
|
||||
switch (*p)
|
||||
{
|
||||
case '+':
|
||||
dir = MODE_ADD;
|
||||
break;
|
||||
case '-':
|
||||
dir = MODE_DEL;
|
||||
break;
|
||||
default:
|
||||
switch (dir)
|
||||
{
|
||||
case MODE_DEL:
|
||||
modes_nak |= user_modes[(unsigned char) *p];
|
||||
break;
|
||||
case MODE_ADD:
|
||||
default:
|
||||
modes_ack |= user_modes[(unsigned char) *p];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ((client_p->umodes & modes_ack) == modes_ack &&
|
||||
!(client_p->umodes & modes_nak)) ?
|
||||
EXTBAN_MATCH : EXTBAN_NOMATCH;
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
* ircd-ratbox: A slightly useful ircd.
|
||||
* m_olist.c: List channels. olist is an oper only command
|
||||
* that shows channels regardless of modes. This
|
||||
* is kinda evil, and might be morally wrong, but
|
||||
* somebody will likely need it.
|
||||
*
|
||||
* Copyright (C) 2002 by the past and present ircd coders, and others.
|
||||
* Copyright (C) 2004 ircd-ratbox 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "stdinc.h"
|
||||
#include "channel.h"
|
||||
#include "client.h"
|
||||
#include "ircd.h"
|
||||
#include "numeric.h"
|
||||
#include "logger.h"
|
||||
#include "s_serv.h"
|
||||
#include "send.h"
|
||||
#include "whowas.h"
|
||||
#include "match.h"
|
||||
#include "hash.h"
|
||||
#include "msg.h"
|
||||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static int mo_olist(struct Client *, struct Client *, int parc, const char *parv[]);
|
||||
|
||||
#ifndef STATIC_MODULES
|
||||
|
||||
struct Message olist_msgtab = {
|
||||
"OLIST", 0, 0, 0, MFLG_SLOW,
|
||||
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_olist, 1}}
|
||||
};
|
||||
|
||||
mapi_clist_av1 olist_clist[] = { &olist_msgtab, NULL };
|
||||
|
||||
DECLARE_MODULE_AV1(okick, NULL, NULL, olist_clist, NULL, NULL, "$Revision: 6 $");
|
||||
|
||||
#endif
|
||||
|
||||
static void list_all_channels(struct Client *source_p);
|
||||
static void list_named_channel(struct Client *source_p, const char *name);
|
||||
|
||||
/*
|
||||
** mo_olist
|
||||
** parv[1] = channel
|
||||
*/
|
||||
static int
|
||||
mo_olist(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsOperSpy(source_p)) {
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "oper_spy");
|
||||
sendto_one(source_p, form_str(RPL_LISTEND),
|
||||
me.name, source_p->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If no arg, do all channels *whee*, else just one channel */
|
||||
if(parc < 2 || EmptyString(parv[1]))
|
||||
list_all_channels(source_p);
|
||||
else
|
||||
list_named_channel(source_p, parv[1]);
|
||||
|
||||
sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* list_all_channels
|
||||
* inputs - pointer to client requesting list
|
||||
* output - 0/1
|
||||
* side effects - list all channels to source_p
|
||||
*/
|
||||
static void
|
||||
list_all_channels(struct Client *source_p)
|
||||
{
|
||||
struct Channel *chptr;
|
||||
rb_dlink_node *ptr;
|
||||
|
||||
report_operspy(source_p, "LIST", NULL);
|
||||
sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name);
|
||||
|
||||
RB_DLINK_FOREACH(ptr, global_channel_list.head) {
|
||||
chptr = ptr->data;
|
||||
|
||||
sendto_one(source_p, ":%s 322 %s %s %lu :[%s] %s",
|
||||
me.name, source_p->name, chptr->chname,
|
||||
rb_dlink_list_length(&chptr->members),
|
||||
channel_modes(chptr, &me),
|
||||
chptr->topic == NULL ? "" : chptr->topic);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* list_named_channel
|
||||
* inputs - pointer to client requesting list
|
||||
* output - 0/1
|
||||
* side effects - list all channels to source_p
|
||||
*/
|
||||
static void
|
||||
list_named_channel(struct Client *source_p, const char *name)
|
||||
{
|
||||
struct Channel *chptr;
|
||||
char *p;
|
||||
char *n = LOCAL_COPY(name);
|
||||
|
||||
if((p = strchr(n, ',')))
|
||||
*p = '\0';
|
||||
|
||||
/* Put operspy notice before any output, but only if channel exists */
|
||||
chptr = EmptyString(n) ? NULL : find_channel(n);
|
||||
if(chptr != NULL)
|
||||
report_operspy(source_p, "LIST", chptr->chname);
|
||||
|
||||
sendto_one(source_p, form_str(RPL_LISTSTART), me.name, source_p->name);
|
||||
|
||||
if(EmptyString(n))
|
||||
return;
|
||||
|
||||
if(chptr == NULL)
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
|
||||
form_str(ERR_NOSUCHCHANNEL), n);
|
||||
else
|
||||
sendto_one(source_p, ":%s 322 %s %s %lu :[%s] %s", me.name, source_p->name,
|
||||
chptr->chname, rb_dlink_list_length(&chptr->members),
|
||||
channel_modes(chptr, &me), chptr->topic ? chptr->topic : "");
|
||||
}
|
|
@ -130,6 +130,9 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
}
|
||||
}
|
||||
|
||||
/* Set UMODE_WEBCLIENT */
|
||||
source_p->umodes = source_p->umodes | UMODE_WEBCLIENT;
|
||||
|
||||
sendto_one(source_p, "NOTICE * :CGI:IRC host/IP set to %s %s", parv[3], parv[4]);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,30 @@
|
|||
#include "atheme.h"
|
||||
#include "uplink.h"
|
||||
#include "pmodule.h"
|
||||
#include "protocol/shadowircd.h"
|
||||
|
||||
/* Extended channel modes will eventually go here. */
|
||||
/* Note that these are involved in atheme.db file format */
|
||||
#define CMODE_NOCOLOR 0x00001000 /* hyperion +c */
|
||||
#define CMODE_REGONLY 0x00002000 /* hyperion +r */
|
||||
#define CMODE_OPMOD 0x00004000 /* hyperion +z */
|
||||
#define CMODE_FINVITE 0x00008000 /* hyperion +g */
|
||||
#define CMODE_EXLIMIT 0x00010000 /* charybdis +L */
|
||||
#define CMODE_PERM 0x00020000 /* charybdis +P */
|
||||
#define CMODE_FTARGET 0x00040000 /* charybdis +F */
|
||||
#define CMODE_DISFWD 0x00080000 /* charybdis +Q */
|
||||
#define CMODE_NOCTCP 0x00100000 /* charybdis +C */
|
||||
#define CMODE_IMMUNE 0x00200000 /* shadowircd +M */
|
||||
#define CMODE_ADMINONLY 0x00400000 /* shadowircd +A */
|
||||
#define CMODE_OPERONLY 0x00800000 /* shadowircd +O */
|
||||
#define CMODE_SSLONLY 0x01000000 /* shadowircd +S */
|
||||
#define CMODE_NOACTIONS 0x02000000 /* shadowircd +D */
|
||||
#define CMODE_NONOTICE 0x04000000 /* shadowircd +T */
|
||||
#define CMODE_NOCAPS 0x08000000 /* shadowircd +G */
|
||||
#define CMODE_NOKICKS 0x10000000 /* shadowircd +E */
|
||||
#define CMODE_NONICKS 0x20000000 /* shadowircd +N */
|
||||
#define CMODE_NOREPEAT 0x40000000 /* shadowircd +K */
|
||||
#define CMODE_KICKNOREJOIN 0x80000000 /* shadowircd +J */
|
||||
#define CMODE_HIDEBANS 0x100000000 /* elemental +u */
|
||||
|
||||
DECLARE_MODULE_V1("protocol/elemental-ircd", true, _modinit, NULL, PACKAGE_STRING, "PonyChat Development Group <http://www.ponychat.net>");
|
||||
|
||||
|
@ -71,6 +94,7 @@ struct cmode_ elemental_mode_list[] = {
|
|||
{ 'd', CMODE_NONICKS },
|
||||
{ 'K', CMODE_NOREPEAT },
|
||||
{ 'J', CMODE_KICKNOREJOIN },
|
||||
{ 'u', CMODE_HIDEBANS },
|
||||
{ '\0', 0 }
|
||||
};
|
||||
|
||||
|
|
|
@ -28,3 +28,4 @@ User modes: (* designates that the umode is oper only)
|
|||
+I - Prevents non-opers from seeing your channel list in
|
||||
a whois query.
|
||||
+Z - Is connected via SSL (set only on connection).
|
||||
+W - Is connected via a web client (set only on connection).
|
||||
|
|
|
@ -22,3 +22,4 @@ User modes: (? designates that the umode is provided by an extension
|
|||
anyone who's in a common channel with you to message you.
|
||||
+V - Prevents you from receiving invites.
|
||||
+Z - Is connected via SSL (set only on connection).
|
||||
+W - Is connected via a web client (set only on connection).
|
||||
|
|
|
@ -425,6 +425,7 @@ struct ListClient {
|
|||
#define UMODE_OPER 0x1000 /* Operator */
|
||||
#define UMODE_ADMIN 0x2000 /* Admin on server */
|
||||
#define UMODE_SSLCLIENT 0x4000 /* using SSL */
|
||||
#define UMODE_WEBCLIENT 0x100000 /* user is connected via a web client */
|
||||
#define UMODE_OVERRIDE 0x20000 /* able to override */
|
||||
|
||||
#define IsOverride(x) ((x)->umodes & UMODE_OVERRIDE)
|
||||
|
|
|
@ -330,6 +330,7 @@ extern const char *form_str(int);
|
|||
#define ERR_HELPNOTFOUND 524
|
||||
|
||||
#define RPL_WHOISSECURE 671 /* Unreal3.2 --nenolod */
|
||||
#define RPL_WHOISWEBIRC 672 /* plexus -- Xe */
|
||||
|
||||
#define RPL_MODLIST 702
|
||||
#define RPL_ENDOFMODLIST 703
|
||||
|
|
|
@ -485,6 +485,10 @@ msg_channel(int p_or_n, const char *command,
|
|||
rb_strlcpy(text2, text, BUFSIZE);
|
||||
strip_unprintable(text2);
|
||||
|
||||
if(!MyClient(source_p)) {
|
||||
goto skip_NOCAPS_check;
|
||||
}
|
||||
|
||||
// Don't count the "ACTION" part of action as part of the message --SnoFox
|
||||
if (p_or_n != NOTICE && *text == '\001' &&
|
||||
!strncasecmp(text + 1, "ACTION ", 7)) {
|
||||
|
@ -503,6 +507,7 @@ msg_channel(int p_or_n, const char *command,
|
|||
return;
|
||||
}
|
||||
}
|
||||
skip_NOCAPS_check:
|
||||
|
||||
if(chptr->mode.mode & MODE_NOCOLOR && (!ConfigChannel.exempt_cmode_c || !is_any_op(msptr))) {
|
||||
rb_strlcpy(text2, text, BUFSIZE);
|
||||
|
|
|
@ -313,6 +313,12 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
|||
if(IsSSLClient(target_p))
|
||||
sendto_one_numeric(source_p, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
|
||||
target_p->name);
|
||||
|
||||
if(!(target_p->umodes & UMODE_WEBCLIENT)) {
|
||||
sendto_one_numeric(source_p, RPL_WHOISWEBIRC, form_str(RPL_WHOISWEBIRC),
|
||||
target_p->name);
|
||||
}
|
||||
|
||||
if((source_p == target_p || IsOper(source_p)) &&
|
||||
target_p->certfp != NULL)
|
||||
sendto_one_numeric(source_p, RPL_WHOISCERTFP,
|
||||
|
|
|
@ -219,7 +219,7 @@ get_channel_access(struct Client *source_p, struct membership *msptr)
|
|||
/* check_bans_number()
|
||||
*
|
||||
* inputs - client, channel ban list
|
||||
* outputs - 0 on ban being allowed, 1 on ban being disallowed
|
||||
* outputs - 1 on ban being allowed, 0 on ban being disallowed
|
||||
* side effects - none
|
||||
*/
|
||||
int
|
||||
|
@ -227,10 +227,10 @@ check_bans_number(struct Client *source_p, struct Channel *chptr, rb_dlink_list
|
|||
{
|
||||
if (rb_dlink_list_length(list) >= (chptr->mode.mode & MODE_EXLIMIT ?
|
||||
ConfigChannel.max_bans_large : ConfigChannel.max_bans)) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* add_id()
|
||||
|
|
|
@ -693,7 +693,7 @@ static const char * replies[] = {
|
|||
/* 669 */ NULL,
|
||||
/* 670 */ NULL,
|
||||
/* 671 RPL_WHOISSECURE, */ "%s :is using a secure connection",
|
||||
/* 672 */ NULL,
|
||||
/* 672 RPL_WHOISWEBIRC, */ "%s :is using a web IRC client",
|
||||
/* 673 */ NULL,
|
||||
/* 674 */ NULL,
|
||||
/* 675 */ NULL,
|
||||
|
|
|
@ -1002,6 +1002,9 @@ validate_conf(void)
|
|||
cflag_orphan('M');
|
||||
continue;
|
||||
}
|
||||
if(*dm == 'u') {
|
||||
cflag_orphan('u');
|
||||
}
|
||||
}
|
||||
}
|
||||
construct_cflag_param_string();
|
||||
|
|
13
src/s_user.c
13
src/s_user.c
|
@ -88,7 +88,7 @@ int user_modes[256] = {
|
|||
0, /* T */
|
||||
0, /* U */
|
||||
UMODE_NOINVITE, /* V */
|
||||
0, /* W */
|
||||
UMODE_WEBCLIENT, /* W */
|
||||
0, /* X */
|
||||
0, /* Y */
|
||||
UMODE_SSLCLIENT, /* Z */
|
||||
|
@ -1011,13 +1011,14 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
}
|
||||
break;
|
||||
|
||||
/* we may not get these,
|
||||
* but they shouldnt be in default
|
||||
*/
|
||||
/* we may not get these,
|
||||
* but they shouldnt be in default
|
||||
*/
|
||||
|
||||
/* can only be set on burst */
|
||||
/* can only be set on burst */
|
||||
case 'S':
|
||||
case 'Z':
|
||||
case 'W':
|
||||
case ' ':
|
||||
case '\n':
|
||||
case '\r':
|
||||
|
@ -1046,7 +1047,7 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
source_p->umodes &= ~UMODE_SERVNOTICE;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
if (MyConnect(source_p) && *pm == 'Q' && !ConfigChannel.use_forward) {
|
||||
badflag = YES;
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
set -x
|
||||
|
||||
cd ../..
|
||||
|
||||
for file in $(find **/*.c)
|
||||
do
|
||||
if [[ $file = "bandb/sqlite3.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "src/lex.yy.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "src/y.tab.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "tools/convertilines.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "tools/convertklines.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "tools/mkpasswd.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "tools/viconf.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "unsupported/make_override_immune.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "unsupported/m_clearchan.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $file = "unsupported/sno_channeljoin.c" ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ $(astyle --style=linux --mode=c -n $file 2>&1 | cut -f1 -d' ') = "Unchanged" ]]
|
||||
then
|
||||
echo "$file passed coding standards"
|
||||
else
|
||||
echo "$file is not at coding standards."
|
||||
exit 1
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue