Merge backout of 8939a7e03d15

This commit is contained in:
Stephen Bennett 2010-08-24 21:31:55 +01:00
commit 51269a8737
34 changed files with 337 additions and 790 deletions

View file

@ -1,13 +1,10 @@
If you don't read this first, we won't help you.
:-)
******************************* IMPORTANT ************************************* ******************************* IMPORTANT *************************************
*********** Note for those who dont bother reading docs ***************** *********** Note for those who dont bother reading docs *****************
* - Reading INSTALL is now a must, as the old DPATH is now specified * * - Reading INSTALL is now a must, as the old DPATH is now specified *
* when configure is run. * * when configure is run. *
* You now need to ./configure --prefix="/path/to/install/it" * * You now need to ./configure --prefix="/path/to/install/it" *
* will be installed with your ircd! * * to specify the path that will be installed with your ircd! *
************************************************************************* *************************************************************************
ALSO, IF YOU ARE UPGRADING YOUR CURRENT SOURCE TREE, AND YOU TRY TO BUILD ALSO, IF YOU ARE UPGRADING YOUR CURRENT SOURCE TREE, AND YOU TRY TO BUILD
@ -16,22 +13,11 @@ If you don't read this first, we won't help you.
******************************* REQUIREMENTS ********************************** ******************************* REQUIREMENTS **********************************
New Features - A short introduction:
- charybdis-3.x now has several major changes over previous version that you
will notice right away.
o SSL Client support.
o Connection Throttling.
- Please see NEWS for more detailed changes.
Necessary Requirements: Necessary Requirements:
- A supported platform (look below) - A supported platform (look below)
- A working dynamic load library, unless - A working dynamic load library.
compiling as static, without module
support.
- A working lex. Solaris /usr/ccs/bin/lex - A working lex. Solaris /usr/ccs/bin/lex
appears to be broken, on this system flex appears to be broken, on this system flex
@ -41,9 +27,11 @@ Necessary Requirements:
Feature Specific Requirements: Feature Specific Requirements:
- For SSL Clients, SSL Challenge controlled OPER feature, and encrypted server links, - For SSL Clients, SSL Challenge controlled OPER feature, and encrypted server links,
a working OpenSSL library a working OpenSSL library or GnuTLS library. CHALLENGE is not supported on GnuTLS
yet.
- For encrypted oper and (optional) server passwords, a working DES, MD5, or SHA library. - For encrypted oper and (optional) server passwords, a working DES, MD5, or SHA library
implementing crypt().
******************************************************************************* *******************************************************************************
@ -54,10 +42,10 @@ Feature Specific Requirements:
- Please read doc/index.txt to get an overview of the current documentation. - Please read doc/index.txt to get an overview of the current documentation.
- The files, /etc/services, /etc/protocols, and /etc/resolv.conf, MUST be - The files, /etc/services, /etc/protocols, and /etc/resolv.conf, SHOULD be
readable by the user running the server in order for ircd to start. readable by the user running the server in order for ircd to start with
Errors from adns causing the ircd to refuse to start up are often related the correct settings. If these files are wrong, charybdis will try to use
to permission problems on these files. 127.0.0.1 for a resolver as a last-ditch effort.
- FREEBSD USERS: if you are compiling with ipv6 you may experience - FREEBSD USERS: if you are compiling with ipv6 you may experience
problems with ipv4 due to the way the socket code is written. To problems with ipv4 due to the way the socket code is written. To
@ -91,11 +79,7 @@ Feature Specific Requirements:
Solaris 2.6/7/8 Solaris 2.6/7/8
OpenBSD 2.8 OpenBSD 2.8
NetBSD 1.4 NetBSD 1.4
OpenVMS/Alpha 7.2 (static modules, no ssld)
- Please read NEWS for information about what is in this release - Please read NEWS for information about what is in this release.
- Other files recommended for reading: BUGS, INSTALL - Other files recommended for reading: BUGS, INSTALL
--------------------------------------------------------------------------------
$Id$

182
configure vendored
View file

@ -1,12 +1,14 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.64 for charybdis 3.3. # Generated by GNU Autoconf 2.65 for charybdis 3.3.
# #
# $Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $ # $Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $
# #
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Foundation, Inc. # Inc.
#
# #
# This configure script is free software; the Free Software Foundation # This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it. # gives unlimited permission to copy, distribute and modify it.
@ -526,7 +528,8 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 7<&0 </dev/null 6>&1 test -n "$DJDIR" || exec 7<&0 </dev/null
exec 6>&1
# Name of the host. # Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@ -1366,7 +1369,7 @@ Some influential environment variables:
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir> nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library> LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir> you have headers in a nonstandard directory <include dir>
CPP C preprocessor CPP C preprocessor
YACC The `Yet Another C Compiler' implementation to use. Defaults to YACC The `Yet Another C Compiler' implementation to use. Defaults to
@ -1442,7 +1445,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
charybdis configure 3.3 charybdis configure 3.3
generated by GNU Autoconf 2.64 generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc. Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation This configure script is free software; the Free Software Foundation
@ -1491,7 +1494,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1 ac_retval=1
fi fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
return $ac_retval as_fn_set_status $ac_retval
} # ac_fn_c_try_compile } # ac_fn_c_try_compile
@ -1528,7 +1531,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1 ac_retval=1
fi fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
return $ac_retval as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp } # ac_fn_c_try_cpp
@ -1657,7 +1660,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
return $ac_retval as_fn_set_status $ac_retval
} # ac_fn_c_try_run } # ac_fn_c_try_run
@ -1734,7 +1737,7 @@ fi
# left behind by Apple's compiler. We do this before executing the actions. # left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
return $ac_retval as_fn_set_status $ac_retval
} # ac_fn_c_try_link } # ac_fn_c_try_link
@ -1966,7 +1969,7 @@ rm -f conftest.val
fi fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
return $ac_retval as_fn_set_status $ac_retval
} # ac_fn_c_compute_int } # ac_fn_c_compute_int
@ -2041,7 +2044,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by charybdis $as_me 3.3, which was It was created by charybdis $as_me 3.3, which was
generated by GNU Autoconf 2.64. Invocation command line was generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@ $ $0 $@
@ -2294,7 +2297,7 @@ fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2" for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do do
test "x$ac_site_file" = xNONE && continue test "x$ac_site_file" = xNONE && continue
if test -r "$ac_site_file"; then if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;} $as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5 sed 's/^/| /' "$ac_site_file" >&5
@ -2303,9 +2306,9 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
done done
if test -r "$cache_file"; then if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special # Some versions of bash will fail to source /dev/null (special files
# files actually), so we avoid doing that. # actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test -f "$cache_file"; then if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;} $as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in case $cache_file in
@ -2715,32 +2718,30 @@ $as_echo "$ac_try_echo"; } >&5
... rest of stderr output deleted ... ... rest of stderr output deleted ...
10q' conftest.err >conftest.er1 10q' conftest.err >conftest.er1
cat conftest.er1 >&5 cat conftest.er1 >&5
rm -f conftest.er1 conftest.err
fi fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } test $ac_status = 0; }
done done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include <stdio.h>
int int
main () main ()
{ {
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
; ;
return 0; return 0;
} }
_ACEOF _ACEOF
ac_clean_files_save=$ac_clean_files ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out. # Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition # It will help us diagnose broken compilers, and finding out an intuition
# of exeext. # of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; } $as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files: # The possible output files:
@ -2802,10 +2803,10 @@ test "$ac_cv_exeext" = no && ac_cv_exeext=
else else
ac_file='' ac_file=''
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
if test -z "$ac_file"; then : if test -z "$ac_file"; then :
$as_echo "$as_me: failed program was:" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@ -2813,51 +2814,18 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ as_fn_set_status 77 { as_fn_set_status 77
as_fn_error "C compiler cannot create executables as_fn_error "C compiler cannot create executables
See \`config.log' for more details." "$LINENO" 5; }; } See \`config.log' for more details." "$LINENO" 5; }; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext ac_exeext=$ac_cv_exeext
# Check that the compiler produces executables we can run. If not, either rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
ac_clean_files=$ac_clean_files_save ac_clean_files=$ac_clean_files_save
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; } $as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link" if { { ac_try="$ac_link"
@ -2890,13 +2858,72 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot compute suffix of executables: cannot compile and link as_fn_error "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." "$LINENO" 5; } See \`config.log' for more details." "$LINENO" 5; }
fi fi
rm -f conftest$ac_cv_exeext rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; } $as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; } $as_echo_n "checking for suffix of object files... " >&6; }
if test "${ac_cv_objext+set}" = set; then : if test "${ac_cv_objext+set}" = set; then :
@ -3945,8 +3972,8 @@ $as_echo "$ac_try_echo"; } >&5
... rest of stderr output deleted ... ... rest of stderr output deleted ...
10q' conftest.err >conftest.er1 10q' conftest.err >conftest.er1
cat conftest.er1 >&5 cat conftest.er1 >&5
rm -f conftest.er1 conftest.err
fi fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } test $ac_status = 0; }
done done
@ -9432,7 +9459,7 @@ _ACEOF
fi fi
ac_config_files="$ac_config_files Makefile bandb/Makefile ssld/Makefile extensions/Makefile unsupported/Makefile src/Makefile modules/Makefile tools/Makefile doc/Makefile help/Makefile" ac_config_files="$ac_config_files Makefile bandb/Makefile ssld/Makefile extensions/Makefile src/Makefile modules/Makefile tools/Makefile doc/Makefile help/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
@ -9943,7 +9970,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by charybdis $as_me 3.3, which was This file was extended by charybdis $as_me 3.3, which was
generated by GNU Autoconf 2.64. Invocation command line was generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_HEADERS = $CONFIG_HEADERS
@ -9982,6 +10009,7 @@ Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit -h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit -V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent -q, --quiet, --silent
do not print progress messages do not print progress messages
-d, --debug don't remove temporary files -d, --debug don't remove temporary files
@ -10001,10 +10029,11 @@ Report bugs to the package provider."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
charybdis config.status 3.3 charybdis config.status 3.3
configured by $0, generated by GNU Autoconf 2.64, configured by $0, generated by GNU Autoconf 2.65,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"\$ac_cs_config\\"
Copyright (C) 2009 Free Software Foundation, Inc. Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation This config.status script is free software; the Free Software Foundation
@ -10040,6 +10069,8 @@ do
ac_cs_recheck=: ;; ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V ) --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;; $as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d ) --debug | --debu | --deb | --de | --d | -d )
debug=: ;; debug=: ;;
--file | --fil | --fi | --f ) --file | --fil | --fi | --f )
@ -10121,7 +10152,6 @@ do
"bandb/Makefile") CONFIG_FILES="$CONFIG_FILES bandb/Makefile" ;; "bandb/Makefile") CONFIG_FILES="$CONFIG_FILES bandb/Makefile" ;;
"ssld/Makefile") CONFIG_FILES="$CONFIG_FILES ssld/Makefile" ;; "ssld/Makefile") CONFIG_FILES="$CONFIG_FILES ssld/Makefile" ;;
"extensions/Makefile") CONFIG_FILES="$CONFIG_FILES extensions/Makefile" ;; "extensions/Makefile") CONFIG_FILES="$CONFIG_FILES extensions/Makefile" ;;
"unsupported/Makefile") CONFIG_FILES="$CONFIG_FILES unsupported/Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;;
"tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
@ -10229,7 +10259,7 @@ s/'"$ac_delim"'$//
t delim t delim
:nl :nl
h h
s/\(.\{148\}\).*/\1/ s/\(.\{148\}\)..*/\1/
t more1 t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p p
@ -10243,7 +10273,7 @@ s/.\{148\}//
t nl t nl
:delim :delim
h h
s/\(.\{148\}\).*/\1/ s/\(.\{148\}\)..*/\1/
t more2 t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/ s/["\\]/\\&/g; s/^/"/; s/$/"/
p p

View file

@ -1160,7 +1160,6 @@ AC_CONFIG_FILES( \
bandb/Makefile \ bandb/Makefile \
ssld/Makefile \ ssld/Makefile \
extensions/Makefile \ extensions/Makefile \
unsupported/Makefile \
src/Makefile \ src/Makefile \
modules/Makefile \ modules/Makefile \
tools/Makefile \ tools/Makefile \

View file

@ -370,8 +370,8 @@ serverhide {
* See <http://www.ahbl.org/services.php> for more information. * See <http://www.ahbl.org/services.php> for more information.
*/ */
blacklist { blacklist {
host = "dnsbl.dronebl.org"; host = "rbl.efnetrbl.org";
reject_reason = "${nick}, your IP (${ip}) is listed in DroneBL. For assistance, see http://dronebl.org/lookup_branded.do?ip=${ip}&network=${network-name}"; reject_reason = "${nick}, your IP (${ip}) is listed in EFnet's RBL. For assistance, see http://efnetrbl.org/?i=${ip}";
# host = "ircbl.ahbl.org"; # host = "ircbl.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect."; # reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect.";

View file

@ -806,8 +806,8 @@ serverhide {
* See <http://www.ahbl.org/services.php> for more information. * See <http://www.ahbl.org/services.php> for more information.
*/ */
blacklist { blacklist {
host = "dnsbl.dronebl.org"; host = "rbl.efnetrbl.org";
reject_reason = "${nick}, your IP (${ip}) is listed in DroneBL. For assistance, see http://dronebl.org/lookup_branded.do?ip=${ip}&network=${network-name}"; reject_reason = "${nick}, your IP (${ip}) is listed in EFnet's RBL. For assistance, see http://efnetrbl.org/?i=${ip}";
# host = "ircbl.ahbl.org"; # host = "ircbl.ahbl.org";
# reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect."; # reject_reason = "${nick}, your IP (${ip}) is listed in ${dnsbl-host} for having an open proxy. In order to protect ${network-name} from abuse, we are not allowing connections with open proxies to connect.";

View file

@ -157,7 +157,9 @@ parameters: type, user mask, host mask, creation TS, duration, lifetime, oper, r
Propagates a network wide ban. Propagates a network wide ban.
The type is K for K:lines; other types are reserved. The type is K for K:lines, R for resvs and X for X:lines; other types are
reserved. The user mask field is only used for K:lines; for resvs and X:lines
the field is ignored in input and sent as an asterisk.
The creation TS indicates when this ban was last modified. An incoming ban MUST The creation TS indicates when this ban was last modified. An incoming ban MUST
be ignored and not propagated if the creation TS is older than the creation TS be ignored and not propagated if the creation TS is older than the creation TS
@ -455,7 +457,7 @@ Remote LUSERS request. Most servers ignore the server mask, treating it as '*'.
MLOCK MLOCK
charybdis TS6 charybdis TS6
source: services server source: services server
parameters: channelTS, channel, cmode changes, opt. cmode parameters... parameters: channelTS, channel, mode letters
propagation: broadcast (restricted) propagation: broadcast (restricted)
Propagates a channel mode lock change. Propagates a channel mode lock change.
@ -463,13 +465,9 @@ Propagates a channel mode lock change.
If the channelTS is greater (newer) than the current TS of the channel, drop If the channelTS is greater (newer) than the current TS of the channel, drop
the message. the message.
On input, only the limit on parameters per line restricts how many cmode The final parameter is a list of mode letters that may not be changed by local
parameters can be present. Apart from this, arbitrary modes shall be users. This applies to setting or unsetting simple modes, and changing or
processed. Redundant modes may be dropped. For example, +n-n may be applied and removing mode parameters.
propagated as +n-n, -n or (if the channel was already -n) nothing, but not as
+n.
The parameter for mode -k (removing a key) shall be ignored.
An MLOCK message with no modes disables the MLOCK, therefore the MLOCK message An MLOCK message with no modes disables the MLOCK, therefore the MLOCK message
always contains the literal MLOCK for simplicity. always contains the literal MLOCK for simplicity.

View file

@ -16,7 +16,7 @@ SYMLINKS= topic accept cmode admin names links away whowas \
version kick who invite quit join list nick oper part \ version kick who invite quit join list nick oper part \
time credits motd userhost users whois ison lusers \ time credits motd userhost users whois ison lusers \
user help pass error challenge knock ping pong \ user help pass error challenge knock ping pong \
cprivmsg cnotice map trace chantrace cprivmsg cnotice map trace chantrace extban
all: all:
build: build:

View file

@ -1,10 +1,20 @@
DLINE [duration] <ip> :[reason] DLINE [duration] <ip> :[reason] [| oper reason]
Adds a DLINE to the database which will deny any Adds a DLINE to the database which will deny any
connections from the IP address of the banned client. connections from the IP address of the banned client.
The banned client will receive a message saying The banned client will receive a message saying
he/she is banned with reason [reason]. he/she is banned with reason [reason].
Duration is optional, and is in minutes. Duration is optional, and is in minutes. If specified,
the DLINE will not be saved in the database.
If an oper reason is added (the pipe must be specified
to seperate the fields) this will be added into the
database but will not be shown to the user when they
are given the kline reason.
DLINE [duration] <ip> ON irc.server :[reason] [| oper reason]
will dline the user on irc.server if irc.server accepts
remote dlines. irc.server can contain wildcards.
- Requires Oper Priv: K - Requires Oper Priv: K

35
help/opers/extban Normal file
View file

@ -0,0 +1,35 @@
MODE <channel> <+|-><b|q|e|I> $[~]<type>[:<data>]
Extended bans (ban conditionals) allow different checks than the usual
nick!user@host or nick!user@ip match to determine whether someone should
be banned, quieted, exempted or invited.
Extended bans are of the form $[~]<type>[:<data>]. The <type> is one
character (case insensitive) and determines the type of match. Most types
allow or require an extra field <data>. If the tilde (~) is present, the
result of the comparison will be negated, unless the ban is invalid in which
case it will never match. Invalid bans are ones where <data> is missing but
required or where <data> is otherwise invalid as noted below.
Unless noted below, all types can be used with +b, +q, +e and +I.
extb Type - DESCRIPTION
------------------------------------------------------------------------
$a - Matches all logged in users
$a:<mask> - Matches users logged in with a username matching the mask
(* and ? wildcards)
$c:<chan> - Matches users who are on the given channel; this is only
valid if the channel exists and is not +s or +p. (The ops
of the channel the ban is on cannot necessarily see whether
the user is in the target channel, so it should not
influence whether they can join either.)
$o - Matches opers (most useful with +I)
$r:<mask> - Matches users with a realname (gecos) matching the mask
(* and ? wildcards); this can only be used with +b and +q
$s:<mask> - matches users connected to a server matching the mask
(* and ? wildcards); this can only be used with +b and +q
$j:<chan> - matches users who are or are not banned from a specified
channel
$x:<mask> - Bans all users with matching nick!user@host#gecos
$z - Matches all SSL users

View file

@ -5,19 +5,20 @@ CHALLENGE CHANTRACE CLOSE CMODE
CNOTICE CONNECT CPRIVMSG CREDITS CNOTICE CONNECT CPRIVMSG CREDITS
DIE DLINE ERROR ETRACE DIE DLINE ERROR ETRACE
HELP INDEX INFO INVITE HELP INDEX INFO INVITE
ISON JOIN KICK KILL EXTBAN ISON JOIN KICK
KLINE KNOCK LINKS LIST KILL KLINE KNOCK LINKS
LOCOPS LUSERS MAP MASKTRACE LIST LOCOPS LUSERS MAP
MODLIST MODLOAD MODRELOAD MODRESTART MASKTRACE MODLIST MODLOAD MODRELOAD
MODUNLOAD MOTD NAMES NICK MODRESTART MODUNLOAD MOTD NAMES
NOTICE OPER OPERSPY OPERWALL NICK NOTICE OPER OPERSPY
PART PASS PING PONG OPERWALL PART PASS PING
POST PRIVMSG QUIT REHASH PONG POST PRIVMSG QUIT
RESTART RESV SCAN SERVER REHASH RESTART RESV SCAN
SET SJOIN SNOMASK SQUIT SERVER SET SJOIN SNOMASK
STATS SVINFO TESTGECOS TESTLINE SQUIT STATS SVINFO TESTGECOS
TESTMASK TIME TOPIC TRACE TESTLINE TESTMASK TIME TOPIC
UHELP UMODE UNDLINE UNKLINE TRACE UHELP UMODE UNDLINE
UNREJECT UNRESV UNXLINE USER UNKLINE UNREJECT UNRESV UNXLINE
USERHOST USERS VERSION WALLOPS USER USERHOST USERS VERSION
WHO WHOIS WHOWAS XLINE WALLOPS WHO WHOIS WHOWAS
XLINE

View file

@ -2,12 +2,13 @@ Help topics available to users:
ACCEPT ADMIN AWAY CHALLENGE ACCEPT ADMIN AWAY CHALLENGE
CMODE CNOTICE CPRIVMSG CREDITS CMODE CNOTICE CPRIVMSG CREDITS
ERROR HELP INDEX INFO ERROR EXTBAN HELP INDEX
INVITE ISON JOIN KICK INFO INVITE ISON JOIN
KNOCK LINKS LIST LUSERS KICK KNOCK LINKS LIST
MAP MOTD NAMES NICK LUSERS MAP MOTD NAMES
NOTICE OPER PART PASS NICK NOTICE OPER PART
PING PONG PRIVMSG QUIT PASS PING PONG PRIVMSG
STATS TIME TOPIC TRACE QUIT STATS TIME TOPIC
UMODE USER USERHOST USERS TRACE UMODE USER USERHOST
VERSION WHO WHOIS WHOWAS USERS VERSION WHO WHOIS
WHOWAS

View file

@ -39,7 +39,6 @@ struct Client;
struct Mode struct Mode
{ {
unsigned int mode; unsigned int mode;
unsigned int off_mode;
int limit; int limit;
char key[KEYLEN]; char key[KEYLEN];
unsigned int join_num; unsigned int join_num;
@ -52,7 +51,7 @@ struct Channel
{ {
rb_dlink_node node; rb_dlink_node node;
struct Mode mode; struct Mode mode;
struct Mode mode_lock; char *mode_lock;
char *topic; char *topic;
char *topic_info; char *topic_info;
time_t topic_time; time_t topic_time;
@ -240,9 +239,7 @@ extern void channel_member_names(struct Channel *chptr, struct Client *,
extern void del_invite(struct Channel *chptr, struct Client *who); extern void del_invite(struct Channel *chptr, struct Client *who);
const char *channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *who); const char *channel_modes(struct Channel *chptr, struct Client *who);
#define channel_modes(chptr, who) channel_modes_real(chptr, &(chptr)->mode, who)
#define channel_mlock(chptr, who) channel_modes_real(chptr, &(chptr)->mode_lock, who)
extern struct Channel *find_bannickchange_channel(struct Client *client_p); extern struct Channel *find_bannickchange_channel(struct Client *client_p);
@ -264,7 +261,7 @@ void resv_chan_forcepart(const char *name, const char *reason, int temp_time);
extern void set_channel_mode(struct Client *client_p, struct Client *source_p, extern void set_channel_mode(struct Client *client_p, struct Client *source_p,
struct Channel *chptr, struct membership *msptr, int parc, const char *parv[]); struct Channel *chptr, struct membership *msptr, int parc, const char *parv[]);
extern void set_channel_mlock(struct Client *client_p, struct Client *source_p, extern void set_channel_mlock(struct Client *client_p, struct Client *source_p,
struct Channel *chptr, int parc, const char *parv[]); struct Channel *chptr, const char *newmlock, int propagate);
extern struct ChannelMode chmode_table[256]; extern struct ChannelMode chmode_table[256];

View file

@ -58,6 +58,7 @@ strip_colour(char *string)
case 22: case 22:
case 23: case 23:
case 27: case 27:
case 29:
case 31: case 31:
break; break;
case 32: case 32:

View file

@ -297,6 +297,8 @@ extern const char *form_str(int);
#define ERR_NOOPERHOST 491 #define ERR_NOOPERHOST 491
#define ERR_OWNMODE 494 /* from bahamut -- jilles */
#define ERR_UMODEUNKNOWNFLAG 501 #define ERR_UMODEUNKNOWNFLAG 501
#define ERR_USERSDONTMATCH 502 #define ERR_USERSDONTMATCH 502
@ -359,6 +361,8 @@ extern const char *form_str(int);
#define RPL_ENDOFMONLIST 733 #define RPL_ENDOFMONLIST 733
#define ERR_MONLISTFULL 734 #define ERR_MONLISTFULL 734
#define ERR_MLOCKRESTRICTED 735
#define RPL_RSACHALLENGE2 740 #define RPL_RSACHALLENGE2 740
#define RPL_ENDOFRSACHALLENGE2 741 #define RPL_ENDOFRSACHALLENGE2 741

View file

@ -287,6 +287,15 @@ verify_accept_all_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
return 1; return 1;
} }
static const char *
get_ssl_error(unsigned long err)
{
static char buf[512];
ERR_error_string_n(err, buf, sizeof buf);
return buf;
}
int int
rb_init_ssl(void) rb_init_ssl(void)
{ {
@ -299,7 +308,7 @@ rb_init_ssl(void)
if(ssl_server_ctx == NULL) if(ssl_server_ctx == NULL)
{ {
rb_lib_log("rb_init_openssl: Unable to initialize OpenSSL server context: %s", rb_lib_log("rb_init_openssl: Unable to initialize OpenSSL server context: %s",
ERR_error_string(ERR_get_error(), NULL)); get_ssl_error(ERR_get_error()));
ret = 0; ret = 0;
} }
/* Disable SSLv2, make the client use our settings */ /* Disable SSLv2, make the client use our settings */
@ -311,7 +320,7 @@ rb_init_ssl(void)
if(ssl_client_ctx == NULL) if(ssl_client_ctx == NULL)
{ {
rb_lib_log("rb_init_openssl: Unable to initialize OpenSSL client context: %s", rb_lib_log("rb_init_openssl: Unable to initialize OpenSSL client context: %s",
ERR_error_string(ERR_get_error(), NULL)); get_ssl_error(ERR_get_error()));
ret = 0; ret = 0;
} }
return ret; return ret;
@ -332,7 +341,7 @@ rb_setup_ssl_server(const char *cert, const char *keyfile, const char *dhfile)
{ {
err = ERR_get_error(); err = ERR_get_error();
rb_lib_log("rb_setup_ssl_server: Error loading certificate file [%s]: %s", cert, rb_lib_log("rb_setup_ssl_server: Error loading certificate file [%s]: %s", cert,
ERR_error_string(err, NULL)); get_ssl_error(err));
return 0; return 0;
} }
@ -347,7 +356,7 @@ rb_setup_ssl_server(const char *cert, const char *keyfile, const char *dhfile)
{ {
err = ERR_get_error(); err = ERR_get_error();
rb_lib_log("rb_setup_ssl_server: Error loading keyfile [%s]: %s", keyfile, rb_lib_log("rb_setup_ssl_server: Error loading keyfile [%s]: %s", keyfile,
ERR_error_string(err, NULL)); get_ssl_error(err));
return 0; return 0;
} }
@ -363,7 +372,7 @@ rb_setup_ssl_server(const char *cert, const char *keyfile, const char *dhfile)
err = ERR_get_error(); err = ERR_get_error();
rb_lib_log rb_lib_log
("rb_setup_ssl_server: Error loading DH params file [%s]: %s", ("rb_setup_ssl_server: Error loading DH params file [%s]: %s",
dhfile, ERR_error_string(err, NULL)); dhfile, get_ssl_error(err));
BIO_free(bio); BIO_free(bio);
return 0; return 0;
} }
@ -374,7 +383,7 @@ rb_setup_ssl_server(const char *cert, const char *keyfile, const char *dhfile)
{ {
err = ERR_get_error(); err = ERR_get_error();
rb_lib_log("rb_setup_ssl_server: Error loading DH params file [%s]: %s", rb_lib_log("rb_setup_ssl_server: Error loading DH params file [%s]: %s",
dhfile, ERR_error_string(err, NULL)); dhfile, get_ssl_error(err));
} }
} }
return 1; return 1;
@ -609,7 +618,7 @@ rb_get_pseudo_random(void *buf, size_t length)
const char * const char *
rb_get_ssl_strerror(rb_fde_t *F) rb_get_ssl_strerror(rb_fde_t *F)
{ {
return ERR_error_string(F->ssl_errno, NULL); return get_ssl_error(F->ssl_errno);
} }
int int

View file

@ -116,6 +116,7 @@ ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *p
ptr = find_prop_ban(ntype, parv[2], parv[3]); ptr = find_prop_ban(ntype, parv[2], parv[3]);
if (ptr != NULL) if (ptr != NULL)
{ {
/* We already know about this ban mask. */
aconf = ptr->data; aconf = ptr->data;
if (aconf->created > created || if (aconf->created > created ||
(aconf->created == created && (aconf->created == created &&
@ -130,6 +131,11 @@ ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *p
aconf->host); aconf->host);
return 0; return 0;
} }
/* act indicates if something happened (from the oper's
* point of view). This is the case if the ban was
* previously active (not deleted) or if the new ban
* is not a removal and not already expired.
*/
act = !(aconf->status & CONF_ILLEGAL) || (hold != created && act = !(aconf->status & CONF_ILLEGAL) || (hold != created &&
hold > rb_current_time()); hold > rb_current_time());
if (lifetime > aconf->lifetime) if (lifetime > aconf->lifetime)
@ -137,6 +143,7 @@ ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *p
/* already expired, hmm */ /* already expired, hmm */
if (aconf->lifetime <= rb_current_time()) if (aconf->lifetime <= rb_current_time())
return 0; return 0;
/* Deactivate, it will be reactivated later if appropriate. */
deactivate_conf(aconf, ptr); deactivate_conf(aconf, ptr);
rb_free(aconf->user); rb_free(aconf->user);
aconf->user = NULL; aconf->user = NULL;
@ -151,6 +158,7 @@ ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *p
} }
else else
{ {
/* New ban mask. */
aconf = make_conf(); aconf = make_conf();
aconf->status = CONF_ILLEGAL | ntype; aconf->status = CONF_ILLEGAL | ntype;
aconf->lifetime = lifetime; aconf->lifetime = lifetime;
@ -171,6 +179,13 @@ ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *p
aconf->passwd = rb_strndup(parv[parc - 1], p - parv[parc - 1] + 1); aconf->passwd = rb_strndup(parv[parc - 1], p - parv[parc - 1] + 1);
aconf->spasswd = rb_strdup(p + 1); aconf->spasswd = rb_strdup(p + 1);
} }
/* The ban is fully filled in and in the prop_bans list
* but still deactivated. Now determine if it should be activated
* and send the server notices.
*/
/* We only reject *@* and the like here.
* Otherwise malformed bans are fairly harmless and can be removed.
*/
switch (ntype) switch (ntype)
{ {
case CONF_KILL: case CONF_KILL:
@ -244,6 +259,11 @@ ms_ban(struct Client *client_p, struct Client *source_p, int parc, const char *p
aconf->user ? " " : "", aconf->user ? " " : "",
aconf->host); aconf->host);
} }
/* If CONF_ILLEGAL is still set at this point, remove entries from the
* reject cache (for klines and xlines).
* If CONF_ILLEGAL is not set, add the ban to the type-specific data
* structure and take action on matched clients/channels.
*/
switch (ntype) switch (ntype)
{ {
case CONF_KILL: case CONF_KILL:

View file

@ -479,6 +479,9 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
source_p->servptr->name, source_p->servptr->name,
chptr->chname, modebuf, parabuf); chptr->chname, modebuf, parabuf);
*modebuf = *parabuf = '\0'; *modebuf = *parabuf = '\0';
/* since we're dropping our modes, we want to clear the mlock as well. --nenolod */
set_channel_mlock(client_p, source_p, chptr, NULL, FALSE);
} }
if(!IsMember(source_p, chptr)) if(!IsMember(source_p, chptr))
@ -739,6 +742,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
/* Update capitalization in channel name, this makes the /* Update capitalization in channel name, this makes the
* capitalization timestamped like modes are -- jilles */ * capitalization timestamped like modes are -- jilles */
strcpy(chptr->chname, parv[2]); strcpy(chptr->chname, parv[2]);
/* since we're dropping our modes, we want to clear the mlock as well. --nenolod */
set_channel_mlock(client_p, source_p, chptr, NULL, FALSE);
} }
if(*modebuf != '\0') if(*modebuf != '\0')

View file

@ -682,6 +682,32 @@ msg_client(int p_or_n, const char *command,
if(MyClient(source_p)) if(MyClient(source_p))
{ {
/*
* XXX: Controversial? Allow target users to send replies
* through a +g. Rationale is that people can presently use +g
* as a way to taunt users, e.g. harass them and hide behind +g
* as a way of griefing. --nenolod
*/
if(p_or_n != NOTICE && MyClient(source_p) &&
IsSetCallerId(source_p) &&
!accept_message(target_p, source_p) &&
!IsOper(target_p))
{
if(rb_dlink_list_length(&source_p->localClient->allow_list) <
ConfigFileEntry.max_accept)
{
rb_dlinkAddAlloc(target_p, &source_p->localClient->allow_list);
rb_dlinkAddAlloc(source_p, &target_p->on_allow_list);
}
else
{
sendto_one_numeric(source_p, ERR_OWNMODE,
form_str(ERR_OWNMODE),
target_p->name, "+g");
return;
}
}
/* reset idle time for message only if its not to self /* reset idle time for message only if its not to self
* and its not a notice */ * and its not a notice */
if(p_or_n != NOTICE) if(p_or_n != NOTICE)

View file

@ -58,7 +58,7 @@ struct Message tmode_msgtab = {
}; };
struct Message mlock_msgtab = { struct Message mlock_msgtab = {
"MLOCK", 0, 0, 0, MFLG_SLOW, "MLOCK", 0, 0, 0, MFLG_SLOW,
{mg_ignore, mg_ignore, {ms_mlock, 4}, {ms_mlock, 4}, mg_ignore, mg_ignore} {mg_ignore, mg_ignore, {ms_mlock, 3}, {ms_mlock, 3}, mg_ignore, mg_ignore}
}; };
struct Message bmask_msgtab = { struct Message bmask_msgtab = {
"BMASK", 0, 0, 0, MFLG_SLOW, "BMASK", 0, 0, 0, MFLG_SLOW,
@ -235,7 +235,7 @@ ms_mlock(struct Client *client_p, struct Client *source_p, int parc, const char
return 0; return 0;
if(IsServer(source_p)) if(IsServer(source_p))
set_channel_mlock(client_p, source_p, chptr, parc - 3, parv + 3); set_channel_mlock(client_p, source_p, chptr, parv[3], TRUE);
return 0; return 0;
} }

View file

@ -90,16 +90,13 @@ m_away(struct Client *client_p, struct Client *source_p, int parc, const char *p
return 0; return 0;
} }
if(source_p->user->away == NULL) if(source_p->user->away == NULL)
{
allocate_away(source_p); allocate_away(source_p);
if(strncmp(source_p->user->away, parv[1], AWAYLEN - 1))
{
rb_strlcpy(source_p->user->away, parv[1], AWAYLEN); rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
sendto_server(client_p, NULL, CAP_TS6, NOCAPS, sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
":%s AWAY :%s", use_id(source_p), source_p->user->away); ":%s AWAY :%s", use_id(source_p), source_p->user->away);
} else {
rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
} }
if(MyConnect(source_p)) if(MyConnect(source_p))

View file

@ -174,7 +174,7 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea
char *p; char *p;
int buflen = 0; int buflen = 0;
int curlen, mlen; int curlen, mlen;
int i; size_t i;
mlen = rb_sprintf(buf, ":%s CAP %s %s", mlen = rb_sprintf(buf, ":%s CAP %s %s",
me.name, me.name,

View file

@ -587,7 +587,7 @@ static struct InfoStruct info_table[] = {
{ {
"resv_forcepart", "resv_forcepart",
OUTPUT_BOOLEAN_YN, OUTPUT_BOOLEAN_YN,
{ &ConfigChannel.resv_forcepart }, &ConfigChannel.resv_forcepart,
"Force-part local users on channel RESV" "Force-part local users on channel RESV"
}, },
{ {

View file

@ -67,9 +67,16 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
memset(client_p->localClient->passwd, 0, memset(client_p->localClient->passwd, 0,
strlen(client_p->localClient->passwd)); strlen(client_p->localClient->passwd));
rb_free(client_p->localClient->passwd); rb_free(client_p->localClient->passwd);
client_p->localClient->passwd = NULL;
} }
client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN); if (client_p->localClient->auth_user)
{
memset(client_p->localClient->auth_user, 0,
strlen(client_p->localClient->auth_user));
rb_free(client_p->localClient->auth_user);
client_p->localClient->auth_user = NULL;
}
if ((pass = strchr(buf, ':')) != NULL) if ((pass = strchr(buf, ':')) != NULL)
{ {

View file

@ -114,7 +114,10 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
return 0; return 0;
} }
if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr)) if(((chptr->mode.mode & MODE_TOPICLIMIT) == 0 ||
is_chanop(msptr)) &&
(!MyClient(source_p) ||
can_send(chptr, source_p, msptr)))
{ {
char topic_info[USERHOST_REPLYLEN]; char topic_info[USERHOST_REPLYLEN];
rb_sprintf(topic_info, "%s!%s@%s", rb_sprintf(topic_info, "%s!%s@%s",

View file

@ -96,6 +96,7 @@ void
free_channel(struct Channel *chptr) free_channel(struct Channel *chptr)
{ {
rb_free(chptr->chname); rb_free(chptr->chname);
rb_free(chptr->mode_lock);
rb_bh_free(channel_heap, chptr); rb_bh_free(channel_heap, chptr);
} }
@ -1073,10 +1074,9 @@ set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_in
} }
} }
/* channel_modes_real() /* channel_modes()
* *
* inputs - pointer to channel * inputs - pointer to channel
* - pointer to channel Mode struct
* - pointer to client * - pointer to client
* output - string with simple modes * output - string with simple modes
* side effects - result from previous calls overwritten * side effects - result from previous calls overwritten
@ -1084,7 +1084,7 @@ set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_in
* Stolen from ShadowIRCd 4 --nenolod * Stolen from ShadowIRCd 4 --nenolod
*/ */
const char * const char *
channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *client_p) channel_modes(struct Channel *chptr, struct Client *client_p)
{ {
int i; int i;
char buf1[BUFSIZE]; char buf1[BUFSIZE];
@ -1097,40 +1097,40 @@ channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *clie
*pbuf = '\0'; *pbuf = '\0';
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
if(mode->mode & chmode_flags[i]) if(chptr->mode.mode & chmode_flags[i])
*mbuf++ = i; *mbuf++ = i;
if(mode->limit) if(chptr->mode.limit)
{ {
*mbuf++ = 'l'; *mbuf++ = 'l';
if(!IsClient(client_p) || IsMember(client_p, chptr)) if(!IsClient(client_p) || IsMember(client_p, chptr))
pbuf += rb_sprintf(pbuf, " %d", mode->limit); pbuf += rb_sprintf(pbuf, " %d", chptr->mode.limit);
} }
if(*mode->key) if(*chptr->mode.key)
{ {
*mbuf++ = 'k'; *mbuf++ = 'k';
if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr)) if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
pbuf += rb_sprintf(pbuf, " %s", mode->key); pbuf += rb_sprintf(pbuf, " %s", chptr->mode.key);
} }
if(mode->join_num) if(chptr->mode.join_num)
{ {
*mbuf++ = 'j'; *mbuf++ = 'j';
if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr)) if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
pbuf += rb_sprintf(pbuf, " %d:%d", mode->join_num, pbuf += rb_sprintf(pbuf, " %d:%d", chptr->mode.join_num,
mode->join_time); chptr->mode.join_time);
} }
if(*mode->forward && (ConfigChannel.use_forward || !IsClient(client_p))) if(*chptr->mode.forward && (ConfigChannel.use_forward || !IsClient(client_p)))
{ {
*mbuf++ = 'f'; *mbuf++ = 'f';
if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr)) if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
pbuf += rb_sprintf(pbuf, " %s", mode->forward); pbuf += rb_sprintf(pbuf, " %s", chptr->mode.forward);
} }
*mbuf = '\0'; *mbuf = '\0';

View file

@ -516,7 +516,7 @@ chm_simple(struct Client *source_p, struct Channel *chptr,
return; return;
/* setting + */ /* setting + */
if((dir == MODE_ADD) && !(chptr->mode.mode & mode_type) && !(chptr->mode_lock.off_mode & mode_type)) if((dir == MODE_ADD) && !(chptr->mode.mode & mode_type))
{ {
/* if +f is disabled, ignore an attempt to set +QF locally */ /* if +f is disabled, ignore an attempt to set +QF locally */
if(!ConfigChannel.use_forward && MyClient(source_p) && if(!ConfigChannel.use_forward && MyClient(source_p) &&
@ -533,7 +533,7 @@ chm_simple(struct Client *source_p, struct Channel *chptr,
mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].mems = ALL_MEMBERS;
mode_changes[mode_count++].arg = NULL; mode_changes[mode_count++].arg = NULL;
} }
else if((dir == MODE_DEL) && (chptr->mode.mode & mode_type) && !(chptr->mode_lock.mode & mode_type)) else if((dir == MODE_DEL) && (chptr->mode.mode & mode_type))
{ {
chptr->mode.mode &= ~mode_type; chptr->mode.mode &= ~mode_type;
@ -1662,6 +1662,12 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
dir = MODE_QUERY; dir = MODE_QUERY;
break; break;
default: default:
/* If this mode char is locked, don't allow local users to change it. */
if (MyClient(source_p) && chptr->mode_lock && strchr(chptr->mode_lock, c))
{
sendto_one_numeric(source_p, ERR_MLOCKRESTRICTED, form_str(ERR_MLOCKRESTRICTED), chptr->chname, c, chptr->mode_lock);
continue;
}
chmode_table[(unsigned char) c].set_func(fakesource_p, chptr, alevel, chmode_table[(unsigned char) c].set_func(fakesource_p, chptr, alevel,
parc, &parn, parv, parc, &parn, parv,
&errors, dir, c, &errors, dir, c,
@ -1768,41 +1774,15 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
*/ */
void void
set_channel_mlock(struct Client *client_p, struct Client *source_p, set_channel_mlock(struct Client *client_p, struct Client *source_p,
struct Channel *chptr, int parc, const char *parv[]) struct Channel *chptr, const char *newmlock, int propagate)
{ {
int dir = MODE_ADD; rb_free(chptr->mode_lock);
const char *ml = parv[0]; chptr->mode_lock = newmlock ? rb_strdup(newmlock) : NULL;
char c;
memset(&chptr->mode_lock, '\0', sizeof(struct Mode)); if (propagate)
for(; (c = *ml) != 0; ml++)
{ {
switch (c) sendto_server(client_p, NULL, CAP_TS6 | CAP_MLOCK, NOCAPS, ":%s MLOCK %ld %s :%s",
{ source_p->id, (long) chptr->channelts, chptr->chname,
case '+': chptr->mode_lock ? chptr->mode_lock : "");
dir = MODE_ADD;
break;
case '-':
dir = MODE_DEL;
break;
default:
if (chmode_table[(unsigned char) c].set_func == chm_simple)
switch(dir)
{
case MODE_ADD:
chptr->mode_lock.mode |= chmode_table[(unsigned char) c].mode_type;
chptr->mode_lock.off_mode &= ~chmode_table[(unsigned char) c].mode_type;
break;
case MODE_DEL:
chptr->mode_lock.off_mode |= chmode_table[(unsigned char) c].mode_type;
chptr->mode_lock.mode &= ~chmode_table[(unsigned char) c].mode_type;
break;
} }
break;
}
}
sendto_server(client_p, NULL, CAP_TS6 | CAP_MLOCK, NOCAPS, ":%s MLOCK %ld %s %s",
source_p->id, (long) chptr->channelts, chptr->chname, channel_mlock(chptr, &me));
} }

View file

@ -402,7 +402,7 @@ static const char * replies[] = {
/* 378 RPL_WHOISHOST, */ "%s :is connecting from *@%s %s", /* 378 RPL_WHOISHOST, */ "%s :is connecting from *@%s %s",
/* 379 */ NULL, /* 379 */ NULL,
/* 380 */ NULL, /* 380 */ NULL,
/* 381 RPL_YOUREOPER, */ ":%s 381 %s :You're a <censored> <censored> IRC operator! Did you know that? This message is FACTUAL.", /* 381 RPL_YOUREOPER, */ ":%s 381 %s :IRCOP FLAG TURN ON",
/* 382 RPL_REHASHING, */ ":%s 382 %s %s :Rehashing", /* 382 RPL_REHASHING, */ ":%s 382 %s %s :Rehashing",
/* 383 */ NULL, /* 383 */ NULL,
/* 384 RPL_MYPORTIS, */ NULL, /* 384 RPL_MYPORTIS, */ NULL,
@ -515,7 +515,7 @@ static const char * replies[] = {
/* 491 ERR_NOOPERHOST, */ ":No appropriate operator blocks were found for your host", /* 491 ERR_NOOPERHOST, */ ":No appropriate operator blocks were found for your host",
/* 492 */ NULL, /* 492 */ NULL,
/* 493 */ NULL, /* 493 */ NULL,
/* 494 */ NULL, /* 494 ERR_OWNMODE, */ "%s :cannot answer you while you are %s, your message was not sent",
/* 495 */ NULL, /* 495 */ NULL,
/* 496 */ NULL, /* 496 */ NULL,
/* 497 */ NULL, /* 497 */ NULL,
@ -756,7 +756,7 @@ static const char * replies[] = {
/* 732 RPL_MONLIST */ ":%s 732 %s :%s", /* 732 RPL_MONLIST */ ":%s 732 %s :%s",
/* 733 RPL_ENDOFMONLIST */ ":%s 733 %s :End of MONITOR list", /* 733 RPL_ENDOFMONLIST */ ":%s 733 %s :End of MONITOR list",
/* 734 ERR_MONLISTFULL */ ":%s 734 %s %d %s :Monitor list is full", /* 734 ERR_MONLISTFULL */ ":%s 734 %s %d %s :Monitor list is full",
/* 735 */ NULL, /* 735 ERR_MLOCKRESTRICTED */ "%s %c %s :MODE cannot be set due to channel having an active MLOCK restriction policy",
/* 736 */ NULL, /* 736 */ NULL,
/* 737 */ NULL, /* 737 */ NULL,
/* 738 */ NULL, /* 738 */ NULL,

View file

@ -483,14 +483,13 @@ attach_iline(struct Client *client_p, struct ConfItem *aconf)
int local_count = 0; int local_count = 0;
int global_count = 0; int global_count = 0;
int ident_count = 0; int ident_count = 0;
int unidented = 0; int unidented;
if(IsConfExemptLimits(aconf)) if(IsConfExemptLimits(aconf))
return (attach_conf(client_p, aconf)); return (attach_conf(client_p, aconf));
if(*client_p->username == '~') unidented = !IsGotId(client_p) && !IsNoTilde(aconf) &&
unidented = 1; (!IsConfDoSpoofIp(aconf) || !strchr(aconf->info.name, '@'));
/* find_hostname() returns the head of the list to search */ /* find_hostname() returns the head of the list to search */
RB_DLINK_FOREACH(ptr, find_hostname(client_p->host)) RB_DLINK_FOREACH(ptr, find_hostname(client_p->host))

View file

@ -659,9 +659,9 @@ burst_TS6(struct Client *client_p)
chptr->topic); chptr->topic);
if(IsCapable(client_p, CAP_MLOCK)) if(IsCapable(client_p, CAP_MLOCK))
sendto_one(client_p, ":%s MLOCK %ld %s %s", sendto_one(client_p, ":%s MLOCK %ld %s :%s",
me.id, (long) chptr->channelts, chptr->chname, me.id, (long) chptr->channelts, chptr->chname,
channel_mlock(chptr, client_p)); EmptyString(chptr->mode_lock) ? "" : chptr->mode_lock);
hchaninfo.chptr = chptr; hchaninfo.chptr = chptr;
call_hook(h_burst_channel, &hchaninfo); call_hook(h_burst_channel, &hchaninfo);

View file

@ -654,8 +654,8 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User *
if(MyConnect(source_p) && source_p->localClient->passwd) if(MyConnect(source_p) && source_p->localClient->passwd)
{ {
if (ConfigFileEntry.identifyservice[0] != '\0' && if (!EmptyString(ConfigFileEntry.identifyservice) &&
ConfigFileEntry.identifycommand[0] != '\0') !EmptyString(ConfigFileEntry.identifycommand))
{ {
/* use user@server */ /* use user@server */
p = strchr(ConfigFileEntry.identifyservice, '@'); p = strchr(ConfigFileEntry.identifyservice, '@');

View file

@ -1,70 +0,0 @@
#
# Makefile.in for ircd/unsupported
#
# $Id: Makefile.in 3478 2007-05-24 15:10:06Z jilles $
#
CC = @CC@
RM = @RM@
SED = @SED@
LEX = @LEX@
LEXLIB = @LEXLIB@
CFLAGS = @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\"
PICFLAGS = @PICFLAGS@
MKDEP = @MKDEP@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SUID = @INSTALL_PROGRAM@ -o root -m 4755
SHELL = /bin/sh
AUTOMODULEDIR = @moduledir@/unsupported
SSL_LIBS = @SSL_LIBS@
SSL_INCLUDES = @SSL_INCLUDES@
IRCDLIBS = @LIBS@ $(SSL_LIBS)
INCLUDES = -I. -I../include -I../libcharybdis -I../libratbox/include $(SSL_INCLUDES)
CPPFLAGS = ${INCLUDES} @CPPFLAGS@
SRCS = \
m_clearchan.c \
m_force.c \
sno_channeljoin.c
OBJS = ${SRCS:.c=.so}
default: build
build: all
all: $(OBJS)
install: all
-@if test ! -d $(DESTDIR)$(AUTOMODULEDIR); then \
mkdir $(DESTDIR)$(AUTOMODULEDIR); \
fi
@echo "Installing modules into $(DESTDIR)$(AUTOMODULEDIR) .."
@for file in $(OBJS); do \
$(INSTALL_DATA) $$file $(DESTDIR)$(AUTOMODULEDIR); \
done
.SUFFIXES: .so
.c.so:
${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $< -o $@
.PHONY: depend clean distclean
depend:
@${MKDEP} ${CPPFLAGS} ${SRCS} > .depend
@sed s/\\\.o/\\\.so/ < .depend > .depend.tmp
@sed -e '/^# DO NOT DELETE THIS LINE/,$$d' <Makefile >Makefile.depend
@echo '# DO NOT DELETE THIS LINE!!!' >>Makefile.depend
@echo '# make depend needs it.' >>Makefile.depend
@cat .depend.tmp >>Makefile.depend
@mv Makefile.depend Makefile
@rm -f .depend.tmp .depend
clean:
${RM} -f *.so *~
distclean: clean
${RM} -f Makefile

View file

@ -1,154 +0,0 @@
/*
* IRC - Internet Relay Chat, contrib/m_clearchan.c
* Copyright (C) 2002 Hybrid Development Team
* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: m_clearchan.c 3161 2007-01-25 07:23:01Z nenolod $
*/
#include "stdinc.h"
#include "channel.h"
#include "client.h"
#include "hash.h"
#include "match.h"
#include "ircd.h"
#include "numeric.h"
#include "s_user.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "packet.h"
static int mo_clearchan(struct Client *client_p, struct Client *source_p,
int parc, const char *parv[]);
struct Message clearchan_msgtab = {
"CLEARCHAN", 0, 0, 0, MFLG_SLOW,
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_clearchan, 2}}
};
mapi_clist_av1 clearchan_clist[] = { &clearchan_msgtab, NULL };
DECLARE_MODULE_AV1(clearchan, NULL, NULL, clearchan_clist, NULL, NULL, "$Revision: 3161 $");
/*
** mo_clearchan
** parv[1] = channel
*/
static int
mo_clearchan(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Channel *chptr;
struct membership *msptr;
struct Client *target_p;
rb_dlink_node *ptr;
rb_dlink_node *next_ptr;
/* admins only */
if(!IsOperAdmin(source_p))
{
sendto_one_notice(source_p, ":You have no A flag");
return 0;
}
if((chptr = find_channel(parv[1])) == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
return 0;
}
if(IsMember(source_p, chptr))
{
sendto_one_notice(source_p, ":*** Please part %s before using CLEARCHAN", parv[1]);
return 0;
}
/* quickly make everyone a peon.. */
RB_DLINK_FOREACH(ptr, chptr->members.head)
{
msptr = ptr->data;
msptr->flags &= ~CHFL_CHANOP | CHFL_VOICE;
}
sendto_wallops_flags(UMODE_WALLOP, &me,
"CLEARCHAN called for [%s] by %s!%s@%s",
parv[1], source_p->name, source_p->username, source_p->host);
ilog(L_MAIN, "CLEARCHAN called for [%s] by %s!%s@%s",
parv[1], source_p->name, source_p->username, source_p->host);
if(*chptr->chname != '&')
{
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
":%s WALLOPS :CLEARCHAN called for [%s] by %s!%s@%s",
me.name, parv[1], source_p->name, source_p->username, source_p->host);
/* SJOIN the user to give them ops, and lock the channel */
sendto_server(client_p, chptr, NOCAPS, NOCAPS,
":%s SJOIN %ld %s +ntsi :@%s",
me.name, (long) (chptr->channelts - 1),
chptr->chname, source_p->name);
}
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN %s",
source_p->name, source_p->username, source_p->host, chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +o %s",
me.name, chptr->chname, source_p->name);
add_user_to_channel(chptr, source_p, CHFL_CHANOP);
/* Take the TS down by 1, so we don't see the channel taken over
* again. */
if(chptr->channelts)
chptr->channelts--;
chptr->mode.mode = MODE_SECRET | MODE_TOPICLIMIT | MODE_INVITEONLY | MODE_NOPRIVMSGS;
chptr->mode.key[0] = '\0';
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->members.head)
{
msptr = ptr->data;
target_p = msptr->client_p;
/* skip the person we just added.. */
if(is_chanop(msptr))
continue;
sendto_channel_local(ALL_MEMBERS, chptr,
":%s KICK %s %s :CLEARCHAN",
source_p->name, chptr->chname, target_p->name);
if(*chptr->chname != '&')
sendto_server(NULL, chptr, NOCAPS, NOCAPS,
":%s KICK %s %s :CLEARCHAN",
source_p->name, chptr->chname, target_p->name);
remove_user_from_channel(msptr);
}
/* Join the user themselves to the channel down here, so they dont see a nicklist
* or people being kicked */
sendto_one(source_p, ":%s!%s@%s JOIN %s",
source_p->name, source_p->username, source_p->host, chptr->chname);
channel_member_names(chptr, source_p, 1);
return 0;
}

View file

@ -1,291 +0,0 @@
/* contrib/m_force.c
* Copyright (C) 1996-2002 Hybrid Development Team
* Copyright (C) 2004 ircd-ratbox Development Team
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1.Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2.Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3.The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Id: m_force.c 3297 2007-03-28 14:49:48Z jilles $
*/
#include "stdinc.h"
#include "channel.h"
#include "class.h"
#include "client.h"
#include "common.h"
#include "match.h"
#include "ircd.h"
#include "hostmask.h"
#include "numeric.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "logger.h"
#include "send.h"
#include "hash.h"
#include "s_serv.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
static int mo_forcejoin(struct Client *client_p, struct Client *source_p,
int parc, const char *parv[]);
static int mo_forcepart(struct Client *client_p, struct Client *source_p,
int parc, const char *parv[]);
struct Message forcejoin_msgtab = {
"FORCEJOIN", 0, 0, 0, MFLG_SLOW,
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_forcejoin, 3}}
};
struct Message forcepart_msgtab = {
"FORCEPART", 0, 0, 0, MFLG_SLOW,
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_forcepart, 3}}
};
mapi_clist_av1 force_clist[] = { &forcejoin_msgtab, &forcepart_msgtab, NULL };
DECLARE_MODULE_AV1(force, NULL, NULL, force_clist, NULL, NULL, "$Revision: 3297 $");
/*
* m_forcejoin
* parv[1] = user to force
* parv[2] = channel to force them into
*/
static int
mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
struct Channel *chptr;
int type;
char mode;
char sjmode;
char *newch;
if(!IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
return 0;
}
if((hunt_server(client_p, source_p, ":%s FORCEJOIN %s %s", 1, parc, parv)) != HUNTED_ISME)
return 0;
/* if target_p is not existant, print message
* to source_p and bail - scuzzy
*/
if((target_p = find_client(parv[1])) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]);
return 0;
}
if(!IsPerson(target_p))
return 0;
sendto_wallops_flags(UMODE_WALLOP, &me,
"FORCEJOIN called for %s %s by %s!%s@%s",
parv[1], parv[2], source_p->name, source_p->username, source_p->host);
ilog(L_MAIN, "FORCEJOIN called for %s %s by %s!%s@%s",
parv[1], parv[2], source_p->name, source_p->username, source_p->host);
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
":%s WALLOPS :FORCEJOIN called for %s %s by %s!%s@%s",
me.name, parv[1], parv[2],
source_p->name, source_p->username, source_p->host);
/* select our modes from parv[2] if they exist... (chanop) */
if(*parv[2] == '@')
{
type = CHFL_CHANOP;
mode = 'o';
sjmode = '@';
}
else if(*parv[2] == '+')
{
type = CHFL_VOICE;
mode = 'v';
sjmode = '+';
}
else
{
type = CHFL_PEON;
mode = sjmode = '\0';
}
if(mode != '\0')
parv[2]++;
if((chptr = find_channel(parv[2])) != NULL)
{
if(IsMember(target_p, chptr))
{
/* debugging is fun... */
sendto_one_notice(source_p, ":*** Notice -- %s is already in %s",
target_p->name, chptr->chname);
return 0;
}
add_user_to_channel(chptr, target_p, type);
sendto_server(target_p, chptr, NOCAPS, NOCAPS,
":%s SJOIN %ld %s + :%c%s",
me.name, (long) chptr->channelts,
chptr->chname, type ? sjmode : ' ', target_p->name);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
target_p->name, target_p->username,
target_p->host, chptr->chname);
if(type)
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +%c %s",
me.name, chptr->chname, mode, target_p->name);
if(chptr->topic != NULL)
{
sendto_one(target_p, form_str(RPL_TOPIC), me.name,
target_p->name, chptr->chname, chptr->topic);
sendto_one(target_p, form_str(RPL_TOPICWHOTIME),
me.name, source_p->name, chptr->chname,
chptr->topic_info, chptr->topic_time);
}
channel_member_names(chptr, target_p, 1);
}
else
{
newch = LOCAL_COPY(parv[2]);
if(!check_channel_name(newch))
{
sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
source_p->name, (unsigned char *) newch);
return 0;
}
/* channel name must begin with & or # */
if(!IsChannelName(newch))
{
sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
source_p->name, (unsigned char *) newch);
return 0;
}
/* newch can't be longer than CHANNELLEN */
if(strlen(newch) > CHANNELLEN)
{
sendto_one_notice(source_p, ":Channel name is too long");
return 0;
}
chptr = get_or_create_channel(target_p, newch, NULL);
add_user_to_channel(chptr, target_p, CHFL_CHANOP);
/* send out a join, make target_p join chptr */
sendto_server(target_p, chptr, NOCAPS, NOCAPS,
":%s SJOIN %ld %s +nt :@%s", me.name,
(long) chptr->channelts, chptr->chname, target_p->name);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
target_p->name, target_p->username,
target_p->host, chptr->chname);
chptr->mode.mode |= MODE_TOPICLIMIT;
chptr->mode.mode |= MODE_NOPRIVMSGS;
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +nt", me.name, chptr->chname);
target_p->localClient->last_join_time = rb_current_time();
channel_member_names(chptr, target_p, 1);
/* we do this to let the oper know that a channel was created, this will be
* seen from the server handling the command instead of the server that
* the oper is on.
*/
sendto_one_notice(source_p, ":*** Notice -- Creating channel %s", chptr->chname);
}
return 0;
}
static int
mo_forcepart(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
struct Channel *chptr;
struct membership *msptr;
if(!IsOperAdmin(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin");
return 0;
}
if((hunt_server(client_p, source_p, ":%s FORCEPART %s %s", 1, parc, parv)) != HUNTED_ISME)
return 0;
/* if target_p == NULL then let the oper know */
if((target_p = find_client(parv[1])) == NULL)
{
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]);
return 0;
}
if(!IsClient(target_p))
return 0;
sendto_wallops_flags(UMODE_WALLOP, &me,
"FORCEPART called for %s %s by %s!%s@%s",
parv[1], parv[2], source_p->name, source_p->username, source_p->host);
ilog(L_MAIN, "FORCEPART called for %s %s by %s!%s@%s",
parv[1], parv[2], source_p->name, source_p->username, source_p->host);
sendto_server(NULL, NULL, NOCAPS, NOCAPS,
":%s WALLOPS :FORCEPART called for %s %s by %s!%s@%s",
me.name, parv[1], parv[2],
source_p->name, source_p->username, source_p->host);
if((chptr = find_channel(parv[2])) == NULL)
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
return 0;
}
if((msptr = find_channel_membership(chptr, target_p)) == NULL)
{
sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL,
form_str(ERR_USERNOTINCHANNEL),
parv[1], parv[2]);
return 0;
}
sendto_server(target_p, chptr, NOCAPS, NOCAPS,
":%s PART %s :%s", target_p->name, chptr->chname, target_p->name);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
target_p->name, target_p->username,
target_p->host, chptr->chname, target_p->name);
remove_user_from_channel(msptr);
return 0;
}

View file

@ -1,45 +0,0 @@
/*
* +j snomask: Channel join notices.
* --nenolod
*
* To be discussed:
* + part notices?
*
* $Id: sno_channeljoin.c 3478 2007-05-24 15:10:06Z jilles $
*/
#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
static void
show_channeljoin(hook_data_channel_activity *info)
{
sendto_realops_snomask(snomask_modes['j'], L_ALL,
"%s (%s@%s) has joined channel %s", info->client->name,
info->client->username, info->client->host, info->chptr->chname);
}
mapi_hfn_list_av1 channeljoin_hfnlist[] = {
{"channel_join", (hookfn) show_channeljoin},
{NULL, NULL}
};
static int
init(void)
{
snomask_modes['j'] = find_snomask_slot();
return 0;
}
static void
fini(void)
{
snomask_modes['j'] = 0;
}
DECLARE_MODULE_AV1(sno_channeljoin, init, fini, NULL, NULL, channeljoin_hfnlist, "$Revision: 3478 $");