Compare commits

...

22 Commits

Author SHA1 Message Date
Sam Dodrill 417a320324 Remove m_olist
Operspy support for /list exists. Use that.
2015-02-21 08:18:47 -08:00
Sam Dodrill e1657f04ec addset -x for #travis op sinthetix 2015-02-21 08:18:47 -08:00
Sam Dodrill daac54878c modules/core/m_message: fix build 2015-02-21 08:18:16 -08:00
Sam Dodrill e7f3a5ad93 modules/core/m_message: don't apply local policy remotely
Closes #33
2015-02-21 08:18:16 -08:00
Sam Dodrill 9c83aac397 Add ability to disable channel mode +u
Closes #43
2015-02-21 08:18:16 -08:00
Sam Dodrill 0c372c65fc disable IRC notifications again 2015-02-21 08:17:04 -08:00
Sam Dodrill 8cff086fc5 Remove git history from docker builds 2015-02-20 23:21:28 -08:00
Sam Dodrill 48a3589d5e Merge branch 'master' of github.com:Elemental-IRCd/elemental-ircd 2015-02-20 23:21:07 -08:00
Sam Dodrill 7c4267175b ycm extra conf: fix paths for headers 2015-02-20 22:41:53 -08:00
Sam Dodrill aa4ebff4a5 Add YouCompleteMe semantic completion support 2015-02-20 22:41:42 -08:00
Sam Dodrill a3e2e47b86 Merge pull request #47 from Elemental-IRCd/doc/contributing/revision-2015-02-20
Update contributing guidelines
2015-02-20 11:14:42 -08:00
Sam Dodrill 88cd0168ad Merge branch 'testsuite-astyle-fixes'
Conflicts:
	.travis.yml

Closes #48
2015-02-20 11:12:46 -08:00
Sam Dodrill 874ca05045 Revert "remove IRC notifications from travis"
This reverts commit 0361eeeedf.
2015-02-20 00:35:50 -08:00
Sam Dodrill 2c0ee6900c Add travis tests for astyle 2015-02-20 00:33:55 -08:00
Sam Dodrill 9b969de641 testsuite/astyle: Add script to check coding style 2015-02-20 00:31:20 -08:00
Sam Dodrill cc0c8d338d Update contributing guidelines 2015-02-20 00:11:51 -08:00
Sam Dodrill 0361eeeedf remove IRC notifications fron travis 2015-02-16 00:52:59 -08:00
Sam Dodrill a6eb07553e Merge pull request #40 from Elemental-IRCd/fix/39/deprecated-entries-example-config
Remove deprecated settings from example configs

Thanks @YodaNetwork for finding this!
2015-02-16 00:51:49 -08:00
Sam Dodrill 62a511ab7b Remove deprecated settings from example configs
Ref #39
Ref #38
2015-02-16 00:48:32 -08:00
Sam Dodrill 3e6d026b38 Merge pull request #37 from Elemental-IRCd/staging/6.6.2
Staging/6.6.2
2014-12-16 08:26:52 -08:00
Sam Dodrill 100324f5c9 Elemental-ircd 6.6.2 2014-12-16 08:26:32 -08:00
Sam Dodrill 771cc10e92 Fix ban list add logic 2014-12-16 08:24:50 -08:00
17 changed files with 245 additions and 203 deletions

1
.dockerignore Symbolic link
View File

@ -0,0 +1 @@
.gitignore

2
.gitignore vendored
View File

@ -40,3 +40,5 @@ tools/mkpasswd
tools/viconf
include/serno.h
libratbox/src/version.c.last
*.pyc
.git

View File

@ -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"

118
.ycm_extra_conf.py Normal file
View File

@ -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
}

View File

@ -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
NEWS
View File

@ -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

18
configure vendored
View File

@ -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\\"

View File

@ -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)

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -67,7 +67,6 @@ SRCS = \
m_mkpasswd.c \
m_oaccept.c \
m_ojoin.c \
m_olist.c \
m_okick.c \
m_omode.c \
m_opme.c \

View File

@ -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 : "");
}

View File

@ -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);

View File

@ -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()

View File

@ -1002,6 +1002,9 @@ validate_conf(void)
cflag_orphan('M');
continue;
}
if(*dm == 'u') {
cflag_orphan('u');
}
}
}
construct_cflag_param_string();

66
testsuite/astyle/check_style.sh Executable file
View File

@ -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