1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 19:23:13 +02:00

Merge pull request #6 from unrealircd/unreal34

Merge from unreal34
This commit is contained in:
Daniel Tan
2015-07-04 00:26:52 +08:00
123 changed files with 2770 additions and 2112 deletions
+5 -7
View File
@@ -7,16 +7,14 @@
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for Unreal3.4-alpha3
for Unreal3.4-alpha4
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.
regarding the setup of it, during the process.
If you have problems regarding the setup & compile, read Unreal.nfo to get
more information on where to get help. Please, before running this setup,
read the documentation in the "doc" folder. Docs are also avail online @
http://www.unrealircd.com/unreal32docs.html
A short installation guide is available online at:
https://www.unrealircd.org/docs/Installing_from_source
NOTE: The documentation has not been updated to reflect the changes
between UnrealIRCd 3.2.x and 3.4.x.
Full documentation is available at:
https://www.unrealircd.org/docs/UnrealIRCd_3.4.x_documentation
+58
View File
@@ -0,0 +1,58 @@
# Ignore configure step
config.log
conftest.*
config.settings
extras/pcre2*
extras/c-ares*
extras/regexp*
config.status
extras/tre*
extras/ircdcron/ircd.cron
extras/ircdcron/ircdchk
src/modules/snomasks/Makefile
src/modules/chanmodes/Makefile
src/modules/extbans/Makefile
src/modules/usermodes/Makefile
src/modules/Makefile
/Makefile
unrealircd
include/setup.h
# Ignores for platform stuff
.DS_Store
# Ignores for build artifacts
*.so
*.o
*.dSYM
*.dylib
src/ircd
src/version.c
src/include
# Ignores for mac stuff
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
src/macosx/build/
DerivedData
src/macosx/pods/
+5 -1
View File
@@ -32,6 +32,8 @@ if [ -z "$BINDIR" -o -z "$DATADIR" -o -z "$CONFDIR" -o -z "$MODULESDIR" -o -z "$
exit
fi
mkdir -p $TMPDIR
# Do this even if we're not in advanced mode
if [ "$SHOWLISTMODES" = "1" ] ; then
ARG="$ARG--with-showlistmodes "
@@ -447,7 +449,8 @@ echo "You can just press ENTER to accept the defaults!"
TEST="$BASEPATH"
echo ""
echo "In what directory do you want to install UnrealIRCd?"
echo "(Note: in Unreal3.4.x you should always install somewhere)"
echo "(Note: in Unreal3.4.x you should always install somewhere,"
echo "and if this directory does not exist it will be created)"
echo $n "[$TEST] -> $c"
read cc
if [ -z "$cc" ] ; then
@@ -829,6 +832,7 @@ fi
rm -f config.settings
cat > config.settings << __EOF__
#
BASEPATH="$BASEPATH"
BINDIR="$BINDIR"
DATADIR="$DATADIR"
CONFDIR="$CONFDIR"
+3 -1
View File
@@ -203,11 +203,13 @@ install: all
$(INSTALL) -m 0700 src/modules/usermodes/*.so @MODULESDIR@/usermodes
$(INSTALL) -m 0700 -d @MODULESDIR@/chanmodes
$(INSTALL) -m 0700 src/modules/chanmodes/*.so @MODULESDIR@/chanmodes
$(INSTALL) -m 0700 -d @MODULESDIR@/snomasks
$(INSTALL) -m 0700 src/modules/snomasks/*.so @MODULESDIR@/snomasks
$(INSTALL) -m 0700 -d @MODULESDIR@/extbans
$(INSTALL) -m 0700 src/modules/extbans/*.so @MODULESDIR@/extbans
$(INSTALL) -m 0700 -d @TMPDIR@
$(INSTALL) -m 0700 -d @CACHEDIR@
$(INSTALL) -m 0700 -d @DATADIR@
$(INSTALL) -m 0700 -d @PERMDATADIR@
$(INSTALL) -m 0700 -d @LOGDIR@
# TODO: ircdcron.. where?
-@if [ ! -f "@CONFDIR@/ssl/server.cert.pem" ] ; then \
Vendored
+21 -16
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for unrealircd 3.4-alpha3.
# Generated by GNU Autoconf 2.69 for unrealircd 3.4-alpha4.
#
# Report bugs to <http://bugs.unrealircd.org/>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='unrealircd'
PACKAGE_TARNAME='unrealircd'
PACKAGE_VERSION='3.4-alpha3'
PACKAGE_STRING='unrealircd 3.4-alpha3'
PACKAGE_VERSION='3.4-alpha4'
PACKAGE_STRING='unrealircd 3.4-alpha4'
PACKAGE_BUGREPORT='http://bugs.unrealircd.org/'
PACKAGE_URL='http://unrealircd.org/'
@@ -624,6 +624,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
BUILDDIR
UNRLINCDIR
URL
PTHREAD_CFLAGS
@@ -650,7 +651,7 @@ TRE_CFLAGS
FD_SETSIZE
PIDFILE
DOCDIR
DATADIR
PERMDATADIR
TMPDIR
CACHEDIR
LOGDIR
@@ -1312,7 +1313,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 unrealircd 3.4-alpha3 to adapt to many kinds of systems.
\`configure' configures unrealircd 3.4-alpha4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1377,7 +1378,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of unrealircd 3.4-alpha3:";;
short | recursive ) echo "Configuration of unrealircd 3.4-alpha4:";;
esac
cat <<\_ACEOF
@@ -1526,7 +1527,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
unrealircd configure 3.4-alpha3
unrealircd configure 3.4-alpha4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2132,7 +2133,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 unrealircd $as_me 3.4-alpha3, which was
It was created by unrealircd $as_me 3.4-alpha4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -6229,17 +6230,17 @@ fi
if test "${with_datadir+set}" = set; then :
withval=$with_datadir;
cat >>confdefs.h <<_ACEOF
#define DATADIR "$withval"
#define PERMDATADIR "$withval"
_ACEOF
DATADIR="$withval"
PERMDATADIR="$withval"
else
cat >>confdefs.h <<_ACEOF
#define DATADIR "$HOME/unrealircd/data"
_ACEOF
DATADIR="$HOME/unrealircd/data"
PERMDATADIR="$HOME/unrealircd/data"
fi
@@ -6274,10 +6275,10 @@ _ACEOF
else
cat >>confdefs.h <<_ACEOF
#define PIDFILE "$HOME/unrealircd/data/ircd.pid"
#define PIDFILE "$HOME/unrealircd/data/unrealircd.pid"
_ACEOF
PIDFILE="$HOME/unrealircd/data/ircd.pid"
PIDFILE="$HOME/unrealircd/data/unrealircd.pid"
fi
@@ -7987,7 +7988,10 @@ fi
UNRLINCDIR="`pwd`/include"
ac_config_files="$ac_config_files Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/extbans/Makefile unrealircd extras/ircdcron/ircdchk extras/ircdcron/ircd.cron"
BUILDDIR="`pwd`"
ac_config_files="$ac_config_files Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/snomasks/Makefile src/modules/extbans/Makefile unrealircd extras/ircdcron/ircdchk extras/ircdcron/ircd.cron"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -8495,7 +8499,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 unrealircd $as_me 3.4-alpha3, which was
This file was extended by unrealircd $as_me 3.4-alpha4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8558,7 +8562,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="\\
unrealircd config.status 3.4-alpha3
unrealircd config.status 3.4-alpha4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -8684,6 +8688,7 @@ do
"src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;;
"src/modules/chanmodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/chanmodes/Makefile" ;;
"src/modules/usermodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/usermodes/Makefile" ;;
"src/modules/snomasks/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/snomasks/Makefile" ;;
"src/modules/extbans/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/extbans/Makefile" ;;
"unrealircd") CONFIG_FILES="$CONFIG_FILES unrealircd" ;;
"extras/ircdcron/ircdchk") CONFIG_FILES="$CONFIG_FILES extras/ircdcron/ircdchk" ;;
+11 -5
View File
@@ -8,7 +8,7 @@ dnl src/win32/unrealinst.iss
dnl .CHANGES.NEW
dnl src/version.c.SH
AC_INIT([unrealircd], [3.4-alpha3], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/])
AC_INIT([unrealircd], [3.4-alpha4], [http://bugs.unrealircd.org/], [], [http://unrealircd.org/])
AC_CONFIG_SRCDIR([src/ircd.c])
AC_CONFIG_HEADER([include/setup.h])
AC_CONFIG_AUX_DIR([autoconf])
@@ -508,10 +508,10 @@ AC_ARG_WITH(tmpdir, [AS_HELP_STRING([--with-tmpdir=path],[Specify the directory
TMPDIR="$HOME/unrealircd/tmp"])
AC_ARG_WITH(datadir, [AS_HELP_STRING([--with-datadir=path],[Specify the directory where permanent data is stored])],
[AC_DEFINE_UNQUOTED([DATADIR], ["$withval"], [Define the location of permanent data files])
DATADIR="$withval"],
[AC_DEFINE_UNQUOTED([PERMDATADIR], ["$withval"], [Define the location of permanent data files])
PERMDATADIR="$withval"],
[AC_DEFINE_UNQUOTED([DATADIR], ["$HOME/unrealircd/data"], [Define the location of permanent data files])
DATADIR="$HOME/unrealircd/data"])
PERMDATADIR="$HOME/unrealircd/data"])
AC_ARG_WITH(docdir, [AS_HELP_STRING([--with-docdir=path],[Specify the directory where documentation is stored])],
[AC_DEFINE_UNQUOTED([DOCDIR], ["$withval"], [Define the location of the documentation])
@@ -532,7 +532,9 @@ AC_SUBST(MODULESDIR)
AC_SUBST(LOGDIR)
AC_SUBST(CACHEDIR)
AC_SUBST(TMPDIR)
AC_SUBST(DATADIR)
dnl Why o why PERMDATADIR and not DATADIR you ask?
dnl well, Because DATADIR conflicts with the Windows SDK header files.. amazing.
AC_SUBST(PERMDATADIR)
AC_SUBST(DOCDIR)
AC_SUBST(PIDFILE)
@@ -784,10 +786,14 @@ CHECK_LIBCURL
UNRLINCDIR="`pwd`/include"
AC_SUBST(UNRLINCDIR)
BUILDDIR="`pwd`"
AC_SUBST(BUILDDIR)
AC_CONFIG_FILES([Makefile
src/modules/Makefile
src/modules/chanmodes/Makefile
src/modules/usermodes/Makefile
src/modules/snomasks/Makefile
src/modules/extbans/Makefile
unrealircd
extras/ircdcron/ircdchk
+115 -43
View File
@@ -1,8 +1,8 @@
Unreal3.4-alpha3 Release Notes
Unreal3.4-alpha4 Release Notes
===============================
This is the third 'alpha' version of UnrealIRCd 3.4. We plan to move to
'beta' stage in 1-2 months and have a stable 3.4.x release later in 2015.
This is the fourth 'alpha' version of UnrealIRCd 3.4. We plan to move to
'beta' stage in a month to have a stable 3.4.x release later in 2015.
IMPORTANT REMARKS as long as UnrealIRCd 3.4.x is in alpha stage:
* Because this is an alpha version it is far more likely to crash or hang.
@@ -12,46 +12,54 @@ IMPORTANT REMARKS as long as UnrealIRCd 3.4.x is in alpha stage:
limited to: configuration, command syntax, location of files, etc.
Therefore:
* You should never run 3.4-alpha3 as a production server
* You should not link 3.4-alpha3 with a production 3.2.x network
* You should never run 3.4-alpha4 as a production server
* You should not link 3.4-alpha4 with a production 3.2.x network
Please do:
* Install 3.4-alpha3 to play around, show to your friends, have fun with
* Install 3.4-alpha4 to play around, show to your friends, have fun with
the latest features and improvements, test things.
* Report any problems, bugs, issues and other feedback on
https://bugs.unrealircd.org/ so we can improve 3.4.x!
During alpha stage we are still very flexible so feedback is really helpful.
Finally:
* If you are moving from 3.2.x then be sure to read 'CONFIGURATION CHANGES'!
* The documentation has not been updated to reflect the changes in 3.4.x.
* If you are moving from 3.2.x then be sure to read 'CONFIGURATION CHANGES'
which explains the new directory structure and how to make UnrealIRCd
convert your existing 3.2.x configuration file to the 3.4.x format.
==[ GENERAL INFORMATION ]==
* Documentation is still in doc\unreal32docs.html but - as said - is not
up to date for 3.4.x. FAQ is on: http://www.unrealircd.com/faq
* Please report bugs at http://bugs.unrealircd.org/
* Below you will see a summary of all changes. Changes may be tagged when
a change was made in a specific version, e.g. "(A3)" means 3.4-alpha3.
For a complete list of changes (500+) use 'git log' or have a look at
https://github.com/unrealircd/unrealircd/commits/unreal34
==[ DOCUMENTATION ]==
UnrealIRCd 3.4.x documentation is now located in a wiki online at:
* https://www.unrealircd.org/docs/
The old unreal32docs.*html files have been removed.
==[ CONFIGURATION CHANGES ]==
UnrealIRCd 3.4.x comes with an easy to use tool to upgrade your configuration
file from the 3.2.x syntax to 3.4.x. If you already have a good working
3.2.x configuration file then this should make it very easy to move to 3.4.x.
Starting with 3.4-alpha4 we use a new directory structure.
After UnrealIRCd is compiled/installed you copy your unrealircd.conf over
from 3.2.x (along with any other custom .conf's).
Then, on *NIX run './unreal upgrade-conf'.
On Windows simply try to boot and watch all the errors, click OK and
you will be asked if UnrealIRCd should upgrade your configuration file.
*NIX: If you are not on Windows then this means you must now choose a
target directory to install UnrealIRCd to. ./Config will ask this
and it's ~/unrealircd by default (eg: /home/nerd/unrealircd).
You also need to run 'make install' after 'make' now.
After compiling, you should leave your Unreal3.4-alphaX directory
and change to ~/unrealircd as everything takes place there.
For example to start UnrealIRCd you run './unrealircd start'
(again, from the /home/xxxx/unrealircd directory).
UnrealIRCd will go through your unrealircd.conf and any other files that
are included from there and upgrade the files one by one.
The new directory structure is as follows (both on Windows and *NIX):
conf/ contains all configuration files
logs/ for log files
modules/ all modules (.so files on *NIX, .dll files on Windows)
tmp/ temporary files
data/ persistent data such as ircd.tune
cache/ cached remote includes
For both *NIX and Windows, after running the step from above, simply
start UnrealIRCd (again) and it should boot up fine with your freshly
converted configuration file(s).
It is possible to use your existing 3.2.x configuration file, but it needs
to be 'upgraded' to the new 3.4.x syntax. UnrealIRCd can do this for you.
Simply place your unrealircd.conf (and any other .conf's you use) in the
conf/ directory and then:
* On *NIX run './unrealircd upgrade-conf' (from /home/xxxx/unrealircd)
* On Windows simply try to boot and watch all the errors, click OK and
you will be asked if UnrealIRCd should upgrade your configuration file.
On either OS, after running the step from above, simply start UnrealIRCd
again and it should boot up fine with your converted configuration file(s).
Note: UnrealIRCd can only convert *working* 3.2.x configuration files!
If your 3.2.x configuration contains mistakes or errors then the upgrade
@@ -60,14 +68,50 @@ process will likely fail or the resulting config file will fail to load.
You may still be interested in the configuration changes, they are
listed on: https://www.unrealircd.org/docs/Upgrading_from_3.2.x
==[ GENERAL INFORMATION ]==
* Below you will see a summary of all changes. Changes may be tagged when
a change was made in a specific version, e.g. "(A3)" means 3.4-alpha3.
For a complete list of changes (600+) use 'git log' or have a look at
https://github.com/unrealircd/unrealircd/commits/unreal34
==[ NEW ]==
* We moved a lot of channel and user modes to modules. These are all
loaded by modules.conf, but if you don't want to load a certain module
you can now simply comment them out or remove that line.
Since a lot of code has been moved from the core to these modules it
makes it A) easier for coders to see all source code related to a
specific feature, and B) makes it possible to fix something and reload
the module rather than restart the IRCd.
* We moved a lot of functionality, including most channel modes, user
modes and all extended bans into 145 separate modules.
This makes it...
A) possible to fully customize what exact functionality you want to load.
You could even strip down UnrealIRCd to get something close to the
basic RFC1459 features from the 1990s. (No idea why you would want
that, but it's possible)
B) easier for coders to see all source code related to a specific feature
C) possible to fix bugs and just reload rather than restart the IRCd.
Have a look at modules.default.conf which contains the "default" set of
modules that you can load if you just want to load all functionality.
If you want to customize the list of modules to load then simply make
a copy of that file, give it a different name, and include that one
instead. Since the file is fully documented, you can just comment out
or delete the loadmodule lines of things you don't want to load.
* Oper permissions have changed completely: (A4)
* All previous oper levels/ranks no longer exist (Netadmin, Admin, ..)
* oper::flags has been removed. Instead you must specify an operclass
in oper::operclass (for example, 'operclass netadmin').
* In operclass block(s) you define the privileges. You can now control
exactly what an IRCOp can and cannot do. (This process is on-going)
Have a look at operclass.default.conf which ships with UnrealIRCd,
it contains a number of default operclass blocks suitable for the
most common situations. See also the operclass block documentation:
https://www.unrealircd.org/docs/Operclass_block
* If you ask UnrealIRCd to convert your 3.2.x configuration file then
it will try to select a suitable operclass for the oper. This will
not always 100% match your current oper block rights, though.
* Channel Mode +A (Admin Only) has been removed. You can use the new
extended ban ~O:<operclass>. This allows you to, for example, create
an operclass 'netadmin' only channel: /MODE #chan +iI ~O:netadmin*
* set::hosts has been removed, use oper::vhost instead.
* Since oper levels have been removed you no longer see things like
"OperX is a Network Administrator" in /WHOIS by default.
If you want that, then you can set oper::swhois to
"is a Network Administrator" (or any other text).
* Entirely rewritten I/O and event loop. This allows the IRCd to scale
more easily to tens of thousands of clients by using kernel-evented I/O
mechanisms such as epoll and kqueue.
@@ -135,6 +179,31 @@ listed on: https://www.unrealircd.org/docs/Upgrading_from_3.2.x
* Because having both allow::ip and allow::hostname in the same allow
block was highly confusing (it was an OR-match) you must now choose
between either allow::ip OR allow::hostname. (A3)
* cgiirc block is renamed to webirc and the syntax has changed (A4)
* set::pingpong-warning is removed, warning always off now (A4)
* More helpful configuration file parse error messages (A4)
* You can use '/OPER username' without password if you use SSL
certificate (fingerprint) authentication. The same is true for
'/VHOST username'. (A4)
* You must now always use 'make install' on *NIX (A4)
* Changed (default) directory structure entirely, see the section
titled 'CONFIGURATION CHANGES' about 100 lines up. (A4)
* badword quit { } is removed, we use badword channel for it. (A4)
* badwords.*.conf is now just one badwords.conf
* To load all default modules you now include modules.default.conf.
This file was called modules.conf in earlier alpha's.
The file has been split up in sections and a lot of comments have
been added to aid the user in deciding whether to load or not to
load each module. (A4)
* Snomask +s is now (always) IRCOp-only. (A4)
* There's now actually an idea behind HalfOp permissions. The idea
is that halfops should be able to help out in case of a flood but
not be able to
* Previously there was little logic behind what modes halfops could
set. Now the idea is as follows: halfops should be able to help out
in case of a flood but not be able to change any 'policy decission
modes' such as +G, +S, +c, +s. Due to this change halfops can now
set modes +beiklmntIMKNCR (was: +beikmntI).
==[ MODULE CODERS / DEVELOPERS ]==
* A lot of technical documentation for module coders has been added
@@ -149,21 +218,24 @@ listed on: https://www.unrealircd.org/docs/Upgrading_from_3.2.x
==[ MAJOR BUGS FIXED ]==
* Crash bug on-boot in alpha1 (A2)
* IRCOp commands such as /GLINE were not always working (A2)
* link::outgoing::options::autoconnect did not work (A4)
* This is still an alpha release, so likely contains major issues
* If the IRCd could not bind to any ports it started anyway (A4)
* alpha3 did not compile on x86 (32 bit) systems (A4)
==[ MINOR BUGS FIXED ]==
* Errors in example configuration files (A2)
* Some fixes in delayjoin (Channel mode +d) (A2)
* Deal with services who allow you to log in by account name (A3)
* Detect "IRCd not running" situations better (A4)
* './unrealircd restart' will now always try to start UnrealIRCd,
so also if it wasn't running previously. (A4)
==[ REMOVED / DROPPED ]==
* Numeric server IDs, see above. (A1)
* PROTOCTL TOKEN and SJB64 are no longer implemented. (A1)
* Ziplinks have been removed. (A1)
* WebTV support. (A3)
==[ KNOWN ISSUES ]==
* Documentation has NOT been updated to reflect 3.4.x features!!!
==[ ADDITIONAL INFO ]==
* See Changelog for more details
* User mode +h (helpop). This user mode only added a line in /WHOIS
saying the user "is available for help". You can use a vhost block
with a vhost::swhois as a replacement. Or oper::swhois. (A4)
+16 -32
View File
@@ -22,22 +22,22 @@
# This is also a comment, again this line is ignored (comment type #3)
/* UnrealIRCd makes heavy use of modules. By using this include we
* tell the ircd to read the file 'modules.full.conf' which contains
* more than a hundred loadmodule lines that load all the necessary
* modules.
* tell the ircd to read the file 'modules.default.conf' which contains
* more than 150 loadmodule lines that load all the necessary modules.
*/
include "modules.full.conf";
include "modules.default.conf";
/* Now let's include some other files as well:
* - help.conf for our on-IRC /HELPOP system
* - badwords.*.conf for channel and user mode +G
* - help/help.conf for our on-IRC /HELPOP system
* - badwords.conf for channel and user mode +G
* - spamfilter.conf as an example for spamfilter usage
* - operclass.default.conf contains some good operclasses which
* you can use in your oper blocks.
*/
include "help.conf";
include "badwords.channel.conf";
include "badwords.message.conf";
include "badwords.quit.conf";
include "help/help.conf";
include "badwords.conf";
include "spamfilter.conf";
include "operclass.default.conf";
/* This is the me { } block which basically says who we are.
* It defines our server name, some information line and an unique "sid".
@@ -97,7 +97,6 @@ class servers
/* Allow everyone in, but only 5 connections per IP */
allow {
ip *@*;
hostname *@*;
class clients;
maxperip 5;
};
@@ -107,7 +106,6 @@ allow {
*/
allow {
ip *@192.0.2.1;
hostname *@NOMATCH;
class clients;
password "somesecretpasswd";
maxperip 20;
@@ -127,13 +125,9 @@ oper bobsmith {
class clients;
mask *@*;
password "test";
flags
{
netadmin;
can_zline;
can_gzline;
can_gkline;
};
operclass netadmin;
swhois "is a Network Administrator";
vhost netadmin.mynet.org;
};
/* Listen blocks define the ports where the server should listen on.
@@ -184,9 +178,10 @@ link hub.mynet.org
hostname hub.mynet.org;
port 6900;
options { ssl; };
password "00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF"; /* SSL fingerprint of other server */
};
password "00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF"; /* SSL fingerprint of other server */
class servers;
};
@@ -341,23 +336,12 @@ set {
"and another one";
"and another one";
};
/* on-oper host */
hosts {
local "locop.mynet.org";
global "ircop.mynet.org";
coadmin "coadmin.mynet.org";
admin "admin.mynet.org";
servicesadmin "csops.mynet.org";
netadmin "netadmin.mynet.org";
host-on-oper-up yes;
};
};
/* Server specific configuration */
set {
kline-address "set.this.email"; /* e-mail shown when a user is banned */
kline-address "set.this.to.email.address"; /* e-mail shown when a user is banned */
modes-on-connect "+ixw";
modes-on-oper "+xwgs";
oper-auto-join "#opers";
+4 -5
View File
@@ -33,9 +33,9 @@
/*
* UnrealIRCd supporte des modules et certains sont obligatoires.
* La ligne suivante charge tous les modules définis dans modules.full.conf
* La ligne suivante charge tous les modules définis dans modules.default.conf
*/
include "modules.full.conf";
include "modules.default.conf";
/*
* Vous pouvez également inclure d'autres fichiers de configuration.
@@ -46,10 +46,9 @@ include "modules.full.conf";
* Vous voudrez probablement les inclure:
*/
include "doc/help.fr.conf";
include "badwords.channel.conf";
include "badwords.message.conf";
include "badwords.quit.conf";
include "badwords.conf";
include "spamfilter.conf";
include "operclass.default.conf";
/*
* ACTUEL : me {}
+6 -6
View File
@@ -163,7 +163,7 @@ help Chmodes {
" b <nick!ident@host> = Bans the nick!ident@host from the channel [h]";
" (For more info on extended bantypes, see /HELPOP EXTBANS)";
" c = Block messages containing mIRC color codes [o]";
" C = No CTCPs allowed in the channel [o]";
" C = No CTCPs allowed in the channel [h]";
" e <nick!ident@host> = Overrides a ban for matching users [h]";
" f <floodparams> = Flood protection (for more info see /HELPOP CHMODEF) [o]";
" G = Filters out all Bad words in messages with <censored> [o]";
@@ -171,18 +171,18 @@ help Chmodes {
" I <nick!ident@host> = Overrides +i for matching users [h]";
" j <joins:sec> = Throttle joins per-user to 'joins' per 'sec' seconds [o]";
" k <key> = Users must specify <key> to join [h]";
" K = /KNOCK is not allowed [o]";
" K = /KNOCK is not allowed [h]";
" L <chan2> = Channel link (If +l is full, the next user will auto-join <chan2>) [q]";
" l <number of max users> = Channel may hold at most <number> of users [o]";
" l <number of max users> = Channel may hold at most <number> of users [h]";
" m = Moderated channel (only +vhoaq users may speak) [h]";
" M = Must be using a registered nick (+r), or have voice access to talk [o]";
" N = No Nickname changes are permitted in the channel [o]";
" M = Must be using a registered nick (+r), or have voice access to talk [h]";
" N = No Nickname changes are permitted in the channel [h]";
" n = Users outside the channel can not send PRIVMSGs to the channel [h]";
" O = IRC Operator only channel (settable by IRCops)";
" p = Private channel [o]";
" P = Permanent channel (the channel is not destroyed when empty) (settable by IRCops)";
" Q = No kicks allowed [o]";
" R = Only registered (+r) users may join the channel [o]";
" R = Only registered (+r) users may join the channel [h]";
" r = The channel is registered (settable by services only)";
" s = Secret channel [o]";
" S = Strips mIRC color codes [o]";
@@ -3,7 +3,7 @@
*
* If you want to have all UnrealIRCd functionality, then include this
* file from your unrealircd.conf by using:
* include "modules.full.conf";
* include "modules.default.conf";
*
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* If you want to customize the modules to load, make a copy of this
@@ -74,7 +74,6 @@ loadmodule "cap_invitenotify";
loadmodule "m_addline";
loadmodule "m_addmotd";
loadmodule "m_addomotd";
loadmodule "m_adminchat";
loadmodule "m_chatops";
loadmodule "m_chghost";
loadmodule "m_chgident";
@@ -87,7 +86,6 @@ loadmodule "m_globops";
loadmodule "m_kill"; /* also server-to-server */
loadmodule "m_locops";
loadmodule "m_mkpasswd";
loadmodule "m_nachat";
loadmodule "m_oper";
loadmodule "m_opermotd";
loadmodule "m_rping";
@@ -133,7 +131,6 @@ loadmodule "m_svsnick";
loadmodule "m_svsnline";
loadmodule "m_svsnolag";
loadmodule "m_svsnoop";
loadmodule "m_svso";
loadmodule "m_svspart";
loadmodule "m_svssilence";
loadmodule "m_svssno";
@@ -154,7 +151,6 @@ loadmodule "chanmodes/delayjoin"; /* +D */
loadmodule "chanmodes/noknock"; /* +K */
loadmodule "chanmodes/noinvite"; /* +V */
loadmodule "chanmodes/operonly"; /* +O */
loadmodule "chanmodes/adminonly"; /* +A */
loadmodule "chanmodes/nonotice"; /* +T */
loadmodule "chanmodes/regonly"; /* +R */
loadmodule "chanmodes/nonickchange"; /* +N */
@@ -174,14 +170,19 @@ loadmodule "usermodes/nokick"; /* +q (unkickable oper) */
loadmodule "usermodes/regonlymsg"; /* +R (only registered users may private message you) */
/*** Server notice masks */
loadmodule "snomasks/dccreject"; /* +D (rejected DCC's) */
/*** Extended Bans ***/
loadmodule "extbans/join"; /* +b ~j */
loadmodule "extbans/quiet"; /* +b ~q */
loadmodule "extbans/nickchange"; /* +b ~n */
loadmodule "extbans/realname"; /* +b ~r */
loadmodule "extbans/regnick"; /* +b ~R */
loadmodule "extbans/account"; /* +b ~a */
loadmodule "extbans/inchannel"; /* +b ~c */
loadmodule "extbans/join"; /* +b ~j (prevent only joins) */
loadmodule "extbans/quiet"; /* +b ~q (prevent only messaging) */
loadmodule "extbans/nickchange"; /* +b ~n (prevent only nick changes) */
loadmodule "extbans/realname"; /* +b ~r (ban by real name) */
loadmodule "extbans/regnick"; /* +b ~R (ban/exempt if using registered nick) */
loadmodule "extbans/account"; /* +b ~a (ban/exempt if logged in with services account) */
loadmodule "extbans/inchannel"; /* +b ~c (ban/exempt if in channel) */
loadmodule "extbans/operclass"; /* +b ~O (ban/exempt by operclass) */
/*** Other ***/
+156
View File
@@ -0,0 +1,156 @@
/* This file defines a number of default operclass blocks which you can
* use in your oper blocks (via oper::operclass).
*
* This file is normally included from your unrealircd.conf through:
* include "operclass.default.conf";
*
* The operclass block is extensively documented at:
* https://www.unrealircd.org/docs/Operclass_block
*
* DO NOT EDIT THIS FILE! IT WILL BE OVERWRITTEN DURING NEXT UPGRADE!!
* Instead, if you want to change the privileges in an operclass block,
* you should copy the definition, or this entire file, to either your
* unrealircd.conf or some other file (eg: operclass.conf) that you
* you will include from your unrealircd.conf.
* Then edit it, and while doing so don't forget to change the name
* of your custom operclass block(s), so operclass <name>.
*/
/* Local IRC Operator */
operclass locop {
privileges {
privacy;
chat;
channel;
client;
immune;
notice { local; };
server { info; module; rping; dns; rehash; };
route { local; };
kill { local; };
tkl {
kline;
zline { local; };
};
trace { local; invisible-users; };
};
};
/* Global IRC Operator */
operclass globop {
privileges {
privacy;
chat;
channel;
client;
immune;
notice;
server { info; remote; module; rping; dns; rehash; };
route;
kill;
tkl { shun; zline; kline; gline; };
trace;
who;
override { see; };
};
map;
};
/* Server administrator */
operclass admin {
privileges {
privacy;
chat;
channel;
client;
immune;
notice;
server { info; remote; module; rping; dns; addline; rehash; description; addmotd; addomotd; tsctl; };
route;
kill;
tkl { shun; zline; kline; gline; };
spamfilter;
trace;
who;
override { see; };
};
};
/* Services Admin */
operclass services-admin {
privileges {
privacy;
chat;
channel;
client;
immune;
notice;
server { info; remote; module; rping; dns; addline; rehash; description; addmotd; addomotd; tsctl; };
route;
kill;
tkl { shun; zline; kline; gline; };
spamfilter;
trace;
who;
sajoin;
sapart;
samode;
override { see; };
};
};
/* Network Administrator */
operclass netadmin {
privileges {
privacy;
chat;
channel;
client;
immune;
notice;
server { info; remote; module; rping; dns; addline; rehash; description; addmotd; addomotd; tsctl; };
kill;
tkl { shun; zline; kline; gline; };
route;
spamfilter;
trace;
who;
sajoin;
sapart;
samode;
servicebot { deop; kill; };
override { see; };
};
};
/* Same as 'globop' operclass, but with OperOverride capabilities added */
operclass globop-with-override {
parent globop;
privileges {
override;
};
};
/* Same as 'admin' operclass, but with OperOverride capabilities added */
operclass admin-with-override {
parent admin;
privileges {
override;
};
};
/* Same as 'services-admin' operclass, but with OperOverride capabilities added */
operclass services-admin-with-override {
parent services-admin;
privileges {
override;
};
};
/* Same as 'netadmin' operclass, but with OperOverride capabilities added */
operclass netadmin-with-override {
parent netadmin;
privileges {
override;
};
};
+71 -45
View File
@@ -14,179 +14,204 @@
*/
spamfilter {
regex "\x01DCC (SEND|RESUME)[ ]+\"(.+ ){20}";
match-type posix;
match "\x01DCC (SEND|RESUME)[ ]+\"(.+ ){20}";
target { private; channel; };
action kill;
reason "mIRC 6.0-6.11 exploit attempt";
action kill;
};
spamfilter {
regex "\x01DCC (SEND|RESUME).{225}";
match-type posix;
match "\x01DCC (SEND|RESUME).{225}";
target { private; channel; };
reason "Possible mIRC 6.12 exploit attempt";
action kill;
reason "Possible mIRC 6.12 exploit attempt";
};
spamfilter {
regex "Come watch me on my webcam and chat /w me :-\) http://.+:\d+/me\.mpg";
match-type posix;
match "Come watch me on my webcam and chat /w me :-\) http://.+:\d+/me\.mpg";
target private;
action gline;
reason "Infected by fyle trojan: see http://www.sophos.com/virusinfo/analyses/trojfylexa.html";
action gline;
};
spamfilter {
regex "Speed up your mIRC DCC Transfer by up to 75%.*www\.freewebs\.com/mircupdate/mircspeedup\.exe";
match-type posix;
match "Speed up your mIRC DCC Transfer by up to 75%.*www\.freewebs\.com/mircupdate/mircspeedup\.exe";
target private;
action gline;
reason "Infected by mirseed trojan: see http://www.sophos.com/virusinfo/analyses/trojmirseeda.html";
action gline;
};
spamfilter {
regex "^http://www\.angelfire\.com/[a-z0-9]+/[a-z0-9]+/[a-z_]+\.jpg <- .*!";
match-type posix;
match "^http://www\.angelfire\.com/[a-z0-9]+/[a-z0-9]+/[a-z_]+\.jpg <- .*!";
target private;
reason "Infected by fagot worm: see http://www.f-secure.com/v-descs/fagot.shtml";
action block;
reason "Infected by fagot worm: see http://www.f-secure.com/v-descs/fagot.shtml";
};
spamfilter {
regex "^FREE PORN: http://free:porn@([0-9]{1,3}\.){3}[0-9]{1,3}:8180$";
match-type posix;
match "^FREE PORN: http://free:porn@([0-9]{1,3}\.){3}[0-9]{1,3}:8180$";
target private;
action gline;
reason "Infected by aplore worm: see http://www.f-secure.com/v-descs/aplore.shtml";
action gline;
};
spamfilter {
regex "^!login Wasszup!$";
match-type posix;
match "^!login Wasszup!$";
target channel;
action gline;
reason "Attempting to login to a GTBot";
action gline;
};
spamfilter {
regex "^!login grrrr yeah baby!$";
match-type posix;
match "^!login grrrr yeah baby!$";
target channel;
action gline;
reason "Attempting to login to a GTBot";
action gline;
};
spamfilter {
regex "^!packet ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15}";
match-type posix;
match "^!packet ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15}";
target channel;
action gline;
reason "Attempting to use a GTBot";
action gline;
};
spamfilter {
regex "^!icqpagebomb ([0-9]{1,15} ){2}.+";
match-type posix;
match "^!icqpagebomb ([0-9]{1,15} ){2}.+";
target channel;
action gline;
reason "Attempting to use a GTBot";
action gline;
};
spamfilter {
regex "^!pfast [0-9]{1,15} ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5}$";
match-type posix;
match "^!pfast [0-9]{1,15} ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5}$";
target channel;
action gline;
reason "Attempting to use a GTBot";
action gline;
};
spamfilter {
regex "^!portscan ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5} [0-9]{1,5}$";
match-type posix;
match "^!portscan ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,5} [0-9]{1,5}$";
target channel;
action gline;
reason "Attempting to use a GTBot";
action gline;
};
spamfilter {
regex "^.u(dp)? ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15} [0-9]{1,15} [0-9]{1,15}( [0-9])*$";
match-type posix;
match "^.u(dp)? ([0-9]{1,3}\.){3}[0-9]{1,3} [0-9]{1,15} [0-9]{1,15} [0-9]{1,15}( [0-9])*$";
target channel;
action gline;
reason "Attempting to use an SDBot";
action gline;
};
spamfilter {
regex "^.syn ((([0-9]{1,3}\.){3}[0-9]{1,3})|([a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_.-]+)) [0-9]{1,5} [0-9]{1,15} [0-9]{1,15}";
match-type posix;
match "^.syn ((([0-9]{1,3}\.){3}[0-9]{1,3})|([a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_.-]+)) [0-9]{1,5} [0-9]{1,15} [0-9]{1,15}";
target { channel; private; };
reason "Attempting to use a SpyBot";
action gline;
reason "Attempting to use a SpyBot";
};
spamfilter {
regex "^porn! porno! http://.+\/sexo\.exe";
match-type posix;
match "^porn! porno! http://.+\/sexo\.exe";
target private;
action gline;
reason "Infected by soex trojan: see http://www.trendmicro.com/vinfo/virusencyclo/default5.asp?VName=TROJ%5FSOEX.A";
};
spamfilter {
regex "(^wait a minute plz\. i am updating my site|.*my erotic video).*http://.+/erotic(a)?/myvideo\.exe$";
match-type posix;
match "(^wait a minute plz\. i am updating my site|.*my erotic video).*http://.+/erotic(a)?/myvideo\.exe$";
target private;
action gline;
reason "Infected by some trojan (erotica?)";
};
spamfilter {
regex "^STOP SPAM, USE THIS COMMAND: //write nospam \$decode\(.+\) \| \.load -rs nospam \| //mode \$me \+R$";
match-type posix;
match "^STOP SPAM, USE THIS COMMAND: //write nospam \$decode\(.+\) \| \.load -rs nospam \| //mode \$me \+R$";
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
spamfilter {
regex "^FOR MATRIX 2 DOWNLOAD, USE THIS COMMAND: //write Matrix2 \$decode\(.+=,m\) \| \.load -rs Matrix2 \| //mode \$me \+R$";
match-type posix;
match "^FOR MATRIX 2 DOWNLOAD, USE THIS COMMAND: //write Matrix2 \$decode\(.+=,m\) \| \.load -rs Matrix2 \| //mode \$me \+R$";
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
spamfilter {
regex "^hey .* to get OPs use this hack in the chan but SHH! //\$decode\(.*,m\) \| \$decode\(.*,m\)$";
match-type posix;
match "^hey .* to get OPs use this hack in the chan but SHH! //\$decode\(.*,m\) \| \$decode\(.*,m\)$";
target private;
action gline;
reason "Infected by nkie worm: see http://www.trojaninfo.com/nkie/nkie.htm";
};
spamfilter {
regex ".*(http://jokes\.clubdepeche\.com|http://horny\.69sexy\.net|http://private\.a123sdsdssddddgfg\.com).*";
match-type posix;
match ".*(http://jokes\.clubdepeche\.com|http://horny\.69sexy\.net|http://private\.a123sdsdssddddgfg\.com).*";
target private;
action gline;
reason "Infected by LOI trojan"; /* Name is still unsure */
reason "Infected by LOI trojan";
};
/* This is a 'general sig' which might have a tad more false positives, hence just 'block' is used */
spamfilter {
regex "C:\\\\WINNT\\\\system32\\\\[][0-9a-z_-{|}`]+\.zip";
match-type posix;
match "C:\\WINNT\\system32\\[][0-9a-z_-{|}`]+\.zip";
target dcc;
action block;
reason "Infected by Gaggle worm?";
};
spamfilter {
regex "C:\\\\WINNT\\\\system32\\\\(notes|videos|xxx|ManualSeduccion|postal|hechizos|images|sex|avril)\.zip";
match-type posix;
match "C:\\WINNT\\system32\\(notes|videos|xxx|ManualSeduccion|postal|hechizos|images|sex|avril)\.zip";
target dcc;
action dccblock;
reason "Infected by Gaggle worm";
};
spamfilter {
regex "http://.+\.lycos\..+/[iy]server[0-9]/[a-z]{4,11}\.(gif|jpg|avi|txt)";
match-type posix;
match "http://.+\.lycos\..+/[iy]server[0-9]/[a-z]{4,11}\.(gif|jpg|avi|txt)";
target { private; quit; };
action block;
reason "Infected by Gaggle worm";
};
spamfilter {
regex "^Free porn pic.? and movies (www\.sexymovies\.da\.ru|www\.girlporn\.org)";
target private;
reason "Unknown virus. Site causes Backdoor.Delf.lq infection";
action block;
match-type posix;
match "^Free porn pic.? and movies (www\.sexymovies\.da\.ru|www\.girlporn\.org)";
target private;
action block;
reason "Unknown virus. Site causes Backdoor.Delf.lq infection";
};
spamfilter {
regex "^LOL! //echo -a \$\(\$decode\(.+,m\),[0-9]\)$";
match-type posix;
match "^LOL! //echo -a \$\(\$decode\(.+,m\),[0-9]\)$";
target channel;
reason "$decode exploit";
action block;
reason "$decode exploit";
};
/*
@@ -199,7 +224,8 @@ spamfilter {
*/
spamfilter {
regex "^Want To Be An IRCOp\? Try This New Bug Type: //write \$decode\(.+=.?,m\) \| \.load -rs \$decode\(.+=.?,m\)$";
match-type posix;
match "^Want To Be An IRCOp\? Try This New Bug Type: //write \$decode\(.+=.?,m\) \| \.load -rs \$decode\(.+=.?,m\)$";
target private;
action block;
reason "Spamming users with an mIRC trojan. Type '/unload -rs newb' to remove the trojan.";
+8 -1
View File
@@ -243,7 +243,7 @@
#define LPATH LOGDIR"/debug.log" /* Where the debug file lives, if DEBUGMODE */
#define VPATH CONFDIR"/ircd.svsmotd" /* Services MOTD append. */
#define BPATH CONFDIR"/bot.motd" /* Bot MOTD */
#define IRCDTUNE DATADIR"/ircd.tune" /* tuning .. */
#define IRCDTUNE PERMDATADIR"/ircd.tune" /* tuning .. */
/* CHROOTDIR
*
@@ -404,6 +404,13 @@
* DO NOT SET THIS TO ANYTHING MORE THAN 5. BETTER YET, JUST LEAVE IT AT 2!
*/
#define TIMESEC 2
/*
* Maximum delay for socket loop (in miliseconds, so 1000 = 1 second).
* This means any other events and such may be delayed up to this value
* when there is no socket data waiting for us (no clients sending anything).
* Was 2000ms in 3.2.x, 1000ms for versions below 3.4-alpha4.
*/
#define SOCKETLOOP_MAX_DELAY 500
/*
* If daemon doesn't receive anything from any of its links within
-19
View File
@@ -32,12 +32,6 @@ struct zNetwork {
char *x_ircnet005;
char *x_defserv;
char *x_services_name;
char *x_oper_host;
char *x_admin_host;
char *x_locop_host;
char *x_sadmin_host;
char *x_netadmin_host;
char *x_coadmin_host;
char *x_hidden_host;
char *x_prefix_quit;
char *x_helpchan;
@@ -195,12 +189,6 @@ extern MODVAR aConfiguration iConf;
#define ircnet005 iConf.network.x_ircnet005
#define defserv iConf.network.x_defserv
#define SERVICES_NAME iConf.network.x_services_name
#define oper_host iConf.network.x_oper_host
#define admin_host iConf.network.x_admin_host
#define locop_host iConf.network.x_locop_host
#define sadmin_host iConf.network.x_sadmin_host
#define netadmin_host iConf.network.x_netadmin_host
#define coadmin_host iConf.network.x_coadmin_host
#define hidden_host iConf.network.x_hidden_host
#define helpchan iConf.network.x_helpchan
#define STATS_SERVER iConf.network.x_stats_server
@@ -351,17 +339,10 @@ struct SetCheck {
unsigned has_spamfilter_virus_help_channel:1;
unsigned has_spamfilter_virus_help_channel_deny:1;
unsigned has_spamfilter_except:1;
unsigned has_hosts_host_on_oper_up:1;
unsigned has_network_name:1;
unsigned has_default_server:1;
unsigned has_services_server:1;
unsigned has_sasl_server:1;
unsigned has_hosts_global:1;
unsigned has_hosts_admin:1;
unsigned has_hosts_local:1;
unsigned has_hosts_servicesadmin:1;
unsigned has_hosts_netadmin:1;
unsigned has_hosts_coadmin:1;
unsigned has_hiddenhost_prefix:1;
unsigned has_prefix_quit:1;
unsigned has_help_channel:1;
+27 -35
View File
@@ -102,34 +102,34 @@ extern int config_is_blankorempty(ConfigEntry *cep, const char *block);
extern MODVAR int config_verbose;
extern void config_progress(char *format, ...) __attribute__((format(printf,1,2)));
extern void ipport_seperate(char *string, char **ip, char **port);
ConfigItem_class *Find_class(char *name);
ConfigItem_deny_dcc *Find_deny_dcc(char *name);
ConfigItem_oper *Find_oper(char *name);
ConfigItem_operclass *Find_operclass(char *name);
ConfigItem_listen *Find_listen(char *ipmask, int port);
ConfigItem_ulines *Find_uline(char *host);
ConfigItem_except *Find_except(aClient *, char *host, short type);
ConfigItem_tld *Find_tld(aClient *cptr, char *host);
ConfigItem_link *Find_link(char *servername, aClient *acptr);
ConfigItem_ban *Find_ban(aClient *, char *host, short type);
ConfigItem_ban *Find_banEx(aClient *,char *host, short type, short type2);
ConfigItem_vhost *Find_vhost(char *name);
ConfigItem_deny_channel *Find_channel_allowed(aClient *cptr, char *name);
ConfigItem_alias *Find_alias(char *name);
ConfigItem_help *Find_Help(char *command);
extern ConfigItem_class *Find_class(char *name);
extern ConfigItem_deny_dcc *Find_deny_dcc(char *name);
extern ConfigItem_oper *Find_oper(char *name);
extern ConfigItem_operclass *Find_operclass(char *name);
extern ConfigItem_listen *Find_listen(char *ipmask, int port);
extern ConfigItem_ulines *Find_uline(char *host);
extern ConfigItem_except *Find_except(aClient *, char *host, short type);
extern ConfigItem_tld *Find_tld(aClient *cptr, char *host);
extern ConfigItem_link *Find_link(char *servername, aClient *acptr);
extern ConfigItem_ban *Find_ban(aClient *, char *host, short type);
extern ConfigItem_ban *Find_banEx(aClient *,char *host, short type, short type2);
extern ConfigItem_vhost *Find_vhost(char *name);
extern ConfigItem_deny_channel *Find_channel_allowed(aClient *cptr, char *name);
extern ConfigItem_alias *Find_alias(char *name);
extern ConfigItem_help *Find_Help(char *command);
OperPermission OperClass_evaluateACLPath(char* path, aClient *sptr, aClient *victim, aChannel *channel, void* extra);
extern OperPermission OperClass_evaluateACLPath(char *path, aClient *sptr, aClient *victim, aChannel *channel, void *extra);
extern void OperClassValidatorDel(OperClassValidator *validator);
int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *username);
int parse_netmask(const char *text, struct irc_netmask *netmask);
int match_ip(struct IN_ADDR addr, char *uhost, char *mask, struct irc_netmask *netmask);
extern int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *username);
extern int parse_netmask(const char *text, struct irc_netmask *netmask);
extern int match_ip(struct IN_ADDR addr, char *uhost, char *mask, struct irc_netmask *netmask);
#ifdef INET6
int match_ipv6(struct IN_ADDR *addr, struct IN_ADDR *mask, int bits);
extern int match_ipv6(struct IN_ADDR *addr, struct IN_ADDR *mask, int bits);
#endif
ConfigItem_ban *Find_ban_ip(aClient *sptr);
void add_ListItem(ListStruct *, ListStruct **);
ListStruct *del_ListItem(ListStruct *, ListStruct **);
/* Remmed out for win32 compatibility.. as stated of 467leaf win32 port.. */
extern ConfigItem_ban *Find_ban_ip(aClient *sptr);
extern void add_ListItem(ListStruct *, ListStruct **);
extern ListStruct *del_ListItem(ListStruct *, ListStruct **);
extern aClient *find_match_server(char *mask);
extern MODVAR LoopStruct loop;
extern int del_banid(aChannel *chptr, char *banid);
@@ -325,11 +325,8 @@ extern int hunt_server(aClient *, aClient *, char *, int, int, char **);
extern aClient *next_client(aClient *, char *);
extern int m_server_estab(aClient *);
extern void umode_init(void);
extern long umode_get(char, int, int (*)(aClient *, int));
#define UMODE_GLOBAL 1
#define UMODE_LOCAL 0
#define umode_lget(x) umode_get(x, 0, 0);
#define umode_gget(x) umode_get(x, 1, 0);
extern int umode_allow_all(aClient *sptr, int what);
extern int umode_allow_opers(aClient *sptr, int what);
extern int umode_allow_none(aClient *sptr, int what);
@@ -400,15 +397,10 @@ extern MODVAR long UMODE_OPER; /* 0x0002 Operator */
extern MODVAR long UMODE_WALLOP; /* 0x0004 send wallops to them */
extern MODVAR long UMODE_FAILOP; /* 0x0008 Shows some global messages */
extern MODVAR long UMODE_REGNICK; /* 0x0020 Nick set by services as registered */
extern MODVAR long UMODE_SADMIN; /* 0x0040 Services Admin */
extern MODVAR long UMODE_ADMIN; /* 0x0080 Admin */
extern MODVAR long UMODE_SERVNOTICE;/* 0x0100 server notices such as kill */
extern MODVAR long UMODE_LOCOP; /* 0x0200 Local operator -- SRB */
extern MODVAR long UMODE_HIDE; /* 0x8000 Hide from Nukes */
extern MODVAR long UMODE_NETADMIN; /* 0x10000 Network Admin */
extern MODVAR long UMODE_COADMIN; /* 0x80000 Co Admin */
extern MODVAR long UMODE_SECURE; /* 0x800000 User is a secure connect */
extern MODVAR long UMODE_VICTIM; /* 0x8000000 Intentional Victim */
extern MODVAR long UMODE_DEAF; /* 0x10000000 Deaf */
extern MODVAR long UMODE_HIDEOPER; /* 0x20000000 Hide oper mode */
extern MODVAR long UMODE_SETHOST; /* 0x40000000 used sethost */
@@ -606,7 +598,7 @@ extern MODVAR char backupbuf[];
extern void add_invite(aClient *, aClient *, aChannel *);
extern void channel_modes(aClient *cptr, char *mbuf, char *pbuf, size_t mbuf_size, size_t pbuf_size, aChannel *chptr);
extern MODVAR char modebuf[BUFSIZE], parabuf[BUFSIZE];
extern int op_can_override(aClient *sptr);
extern int op_can_override(char* acl, aClient *sptr,aChannel *channel,void* extra);
extern aClient *find_chasing(aClient *sptr, char *user, int *chasing);
extern MODVAR long opermode;
extern void add_user_to_channel(aChannel *chptr, aClient *who, int flags);
@@ -719,7 +711,7 @@ extern char *unreal_time_synch_error(void);
extern int unreal_time_synch(int timeout);
extern int extban_is_banned_helper(char *buf);
extern char *getcloak(aClient *sptr);
extern unsigned char param_to_slot_mapping[256];
extern MODVAR unsigned char param_to_slot_mapping[256];
extern char *cm_getparameter(aChannel *chptr, char mode);
extern void cm_putparameter(aChannel *chptr, char mode, char *str);
extern void cm_freeparameter(aChannel *chptr, char mode);
@@ -761,6 +753,6 @@ extern char *our_strcasestr(char *haystack, char *needle);
extern void update_conf(void);
extern MODVAR int need_34_upgrade;
#ifdef _WIN32
extern BOOL IsService;
extern MODVAR BOOL IsService;
#endif
extern int match_ip46(char *a, char *b);
+13 -10
View File
@@ -112,19 +112,21 @@ typedef struct {
#define MOBJ_VALIDATOR 0x4000
typedef struct {
long mode;
char flag;
int (*allowed)(aClient *sptr, int what);
char unloaded;
Module *owner;
long mode; /**< Mode mask */
char flag; /**< Mode character */
int unset_on_deoper; /**< When set to 1 then this user mode will be unset on de-oper */
int (*allowed)(aClient *sptr, int what); /**< The 'is this user allowed to set this mode?' routine */
char unloaded; /**< Internal flag to indicate module is being unloaded */
Module *owner; /**< Module that owns this user mode */
} Umode;
typedef struct {
long mode;
char flag;
int (*allowed)(aClient *sptr, int what);
char unloaded;
Module *owner;
long mode; /**< Snomask mask */
char flag; /**< Snomask character */
int unset_on_deoper; /**< When set to 1 then this snomask will be unset on de-oper */
int (*allowed)(aClient *sptr, int what); /**< The 'is this user allowed to set this snomask?' routine */
char unloaded; /**< Internal flag to indicate module is being unloaded */
Module *owner; /**< Module that owns this snomask */
} Snomask;
typedef enum ModDataType { MODDATATYPE_CLIENT=1, MODDATATYPE_CHANNEL=2, MODDATATYPE_MEMBER=3, MODDATATYPE_MEMBERSHIP=4 } ModDataType;
@@ -749,6 +751,7 @@ extern char *moddata_client_get(aClient *acptr, char *varname);
#define HOOKTYPE_MODE_DEOP 84
#define HOOKTYPE_PRE_KILL 85
#define HOOKTYPE_SEE_CHANNEL_IN_WHOIS 86
#define HOOKTYPE_DCC_DENIED 87
/* Hook return values */
#define HOOK_CONTINUE 0
+3
View File
@@ -310,6 +310,9 @@
/* Define if you have the <sys/param.h> header file. */
#undef PARAMH
/* Define the location of permanent data files */
#undef PERMDATADIR
/* Define the path of the pid file */
#undef PIDFILE
+9 -138
View File
@@ -354,17 +354,11 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
/*
* flags macros.
*/
#define IsVictim(x) ((x)->umodes & UMODE_VICTIM)
#define IsDeaf(x) ((x)->umodes & UMODE_DEAF)
#define IsKillsF(x) ((x)->user->snomask & SNO_KILLS)
#define IsClientF(x) ((x)->user->snomask & SNO_CLIENT)
#define IsFloodF(x) ((x)->user->snomask & SNO_FLOOD)
#define IsEyes(x) ((x)->user->snomask & SNO_EYES)
#define IsAdmin(x) ((x)->umodes & UMODE_ADMIN)
#define IsNetAdmin(x) ((x)->umodes & UMODE_NETADMIN)
#define IsCoAdmin(x) ((x)->umodes & UMODE_COADMIN)
#define IsSAdmin(x) ((x)->umodes & UMODE_SADMIN)
#define SendFailops(x) ((x)->umodes & UMODE_FAILOP)
#define IsOper(x) ((x)->umodes & UMODE_OPER)
#define IsLocOp(x) ((x)->umodes & UMODE_LOCOP)
@@ -374,7 +368,6 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
#define IsRegNick(x) ((x)->umodes & UMODE_REGNICK)
#define IsLoggedIn(x) (IsRegNick(x) || (x->user && (*x->user->svid != '*') && !isdigit(*x->user->svid))) /* registered nick (+r) or just logged into services (may be -r) */
#define IsPerson(x) ((x)->user && IsClient(x))
#define IsPrivileged(x) (IsAnOper(x) || IsServer(x))
#define SendWallops(x) (!IsMe(x) && IsPerson(x) && ((x)->umodes & UMODE_WALLOP))
#define SendServNotice(x) (((x)->user) && ((x)->user->snomask & SNO_SNOTICE))
#define IsListening(x) ((x)->flags & FLAGS_LISTEN)
@@ -416,11 +409,6 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
#define SetClientF(x) ((x)->user->snomask |= SNO_CLIENT)
#define SetFloodF(x) ((x)->user->snomask |= SNO_FLOOD)
#define SetOper(x) ((x)->umodes |= UMODE_OPER)
#define SetLocOp(x) ((x)->umodes |= UMODE_LOCOP)
#define SetAdmin(x) ((x)->umodes |= UMODE_ADMIN)
#define SetSAdmin(x) ((x)->umodes |= UMODE_SADMIN)
#define SetNetAdmin(x) ((x)->umodes |= UMODE_NETADMIN)
#define SetCoAdmin(x) ((x)->umodes |= UMODE_COADMIN)
#define SetInvisible(x) ((x)->umodes |= UMODE_INVISIBLE)
#define SetEyes(x) ((x)->user->snomask |= SNO_EYES)
#define SetWallops(x) ((x)->umodes |= UMODE_WALLOP)
@@ -436,10 +424,6 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
#define SetHidden(x) ((x)->umodes |= UMODE_HIDE)
#define SetHideOper(x) ((x)->umodes |= UMODE_HIDEOPER)
#define IsSecureConnect(x) ((x)->umodes & UMODE_SECURE)
#define ClearAdmin(x) ((x)->umodes &= ~UMODE_ADMIN)
#define ClearNetAdmin(x) ((x)->umodes &= ~UMODE_NETADMIN)
#define ClearCoAdmin(x) ((x)->umodes &= ~UMODE_COADMIN)
#define ClearSAdmin(x) ((x)->umodes &= ~UMODE_SADMIN)
#define ClearKillsF(x) ((x)->user->snomask &= ~SNO_KILLS)
#define ClearClientF(x) ((x)->user->snomask &= ~SNO_CLIENT)
#define ClearFloodF(x) ((x)->user->snomask &= ~SNO_FLOOD)
@@ -504,114 +488,6 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
#define ClearTKLEXT(x) ((x)->proto &= ~PROTO_TKLEXT)
#define ClearTKLEXT2(x) ((x)->proto &= ~PROTO_TKLEXT2)
/*
* defined operator access levels
*/
#define OFLAG_REHASH 0x00000001 /* Oper can /rehash server */
#define OFLAG_DIE 0x00000002 /* Oper can /die the server */
#define OFLAG_RESTART 0x00000004 /* Oper can /restart the server */
#define OFLAG_DCCDENY 0x00000008 /* Oper can use /dccdeny and /undccdeny */
#define OFLAG_GLOBOP 0x00000020 /* Oper can send /GlobOps */
#define OFLAG_WALLOP 0x00000040 /* Oper can send /WallOps */
#define OFLAG_LOCOP 0x00000080 /* Oper can send /LocOps */
#define OFLAG_LROUTE 0x00000100 /* Oper can do local routing */
#define OFLAG_GROUTE 0x00000200 /* Oper can do global routing */
#define OFLAG_LKILL 0x00000400 /* Oper can do local kills */
#define OFLAG_GKILL 0x00000800 /* Oper can do global kills */
#define OFLAG_KLINE 0x00001000 /* Oper can /kline users */
#define OFLAG_UNKLINE 0x00002000 /* Oper can /unkline users */
#define OFLAG_LNOTICE 0x00004000 /* Oper can send local serv notices */
#define OFLAG_GNOTICE 0x00008000 /* Oper can send global notices */
#define OFLAG_ADMIN 0x00010000 /* Admin */
#define OFLAG_ADDLINE 0x00020000 /* Oper can use /addline */
#define OFLAG_TSCTL 0x00040000 /* Oper can use /tsctl */
#define OFLAG_ZLINE 0x00080000 /* Oper can use /zline and /unzline */
#define OFLAG_NETADMIN 0x00200000 /* netadmin gets +N */
#define OFLAG_COADMIN 0x00800000 /* co admin gets +C */
#define OFLAG_SADMIN 0x01000000 /* services admin gets +a */
#define OFLAG_HIDE 0x04000000 /* gets auto +x on oper up */
#define OFLAG_TKL 0x10000000 /* can use G:lines and shuns */
#define OFLAG_GZL 0x20000000 /* can use global Z:lines */
#define OFLAG_OVERRIDE 0x40000000 /* can use oper-override */
#define OFLAG_LOCAL (OFLAG_REHASH|OFLAG_GLOBOP|OFLAG_WALLOP|OFLAG_LOCOP|OFLAG_LROUTE|OFLAG_LKILL|OFLAG_KLINE|OFLAG_UNKLINE|OFLAG_LNOTICE)
#define OFLAG_GLOBAL (OFLAG_LOCAL|OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE)
#define OFLAG_ISGLOBAL (OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE|OFLAG_TKL|OFLAG_GZL|OFLAG_OVERRIDE)
#define OFLAG_NADMIN (OFLAG_NETADMIN | OFLAG_SADMIN | OFLAG_ADMIN | OFLAG_GLOBAL | OFLAG_DCCDENY)
#define OFLAG_ADMIN_ (OFLAG_ADMIN | OFLAG_GLOBAL | OFLAG_DCCDENY)
#define OFLAG_COADMIN_ (OFLAG_COADMIN | OFLAG_GLOBAL | OFLAG_DCCDENY)
#define OFLAG_SADMIN_ (OFLAG_SADMIN | OFLAG_GLOBAL | OFLAG_DCCDENY)
#define OPCanOverride(x) ((x)->oflag & OFLAG_OVERRIDE)
#define OPCanDCCDeny(x) ((x)->oflag & OFLAG_DCCDENY)
#define OPCanTKL(x) ((x)->oflag & OFLAG_TKL)
#define OPCanGZL(x) ((x)->oflag & OFLAG_GZL)
#define OPCanAddline(x) ((x)->oflag & OFLAG_ADDLINE)
#define OPCanZline(x) ((x)->oflag & OFLAG_ZLINE)
#define OPCanRehash(x) ((x)->oflag & OFLAG_REHASH)
#define OPCanDie(x) ((x)->oflag & OFLAG_DIE)
#define OPCanTSCtl(x) ((x)->oflag & OFLAG_TSCTL)
#define OPCanRestart(x) ((x)->oflag & OFLAG_RESTART)
#define OPCanGlobOps(x) ((x)->oflag & OFLAG_GLOBOP)
#define OPCanWallOps(x) ((x)->oflag & OFLAG_WALLOP)
#define OPCanLocOps(x) ((x)->oflag & OFLAG_LOCOP)
#define OPCanLRoute(x) ((x)->oflag & OFLAG_LROUTE)
#define OPCanGRoute(x) ((x)->oflag & OFLAG_GROUTE)
#define OPCanLKill(x) ((x)->oflag & OFLAG_LKILL)
#define OPCanGKill(x) ((x)->oflag & OFLAG_GKILL)
#define OPCanKline(x) ((x)->oflag & OFLAG_KLINE)
#define OPCanUnKline(x) ((x)->oflag & OFLAG_UNKLINE)
#define OPCanLNotice(x) ((x)->oflag & OFLAG_LNOTICE)
#define OPCanGNotice(x) ((x)->oflag & OFLAG_GNOTICE)
#define OPIsAdmin(x) ((x)->oflag & OFLAG_ADMIN)
#define OPIsSAdmin(x) ((x)->oflag & OFLAG_SADMIN)
#define OPIsNetAdmin(x) ((x)->oflag & OFLAG_NETADMIN)
#define OPIsCoAdmin(x) ((x)->oflag & OFLAG_COADMIN)
#ifdef SHOW_SECRET
#define OPCanSeeSecret(x) IsAnOper(x)
#else
#define OPCanSeeSecret(x) IsNetAdmin(x)
#endif
#define OPSetRehash(x) ((x)->oflag |= OFLAG_REHASH)
#define OPSetDie(x) ((x)->oflag |= OFLAG_DIE)
#define OPSetTSCtl(x) ((x)->oflag |= OFLAG_TSCTL)
#define OPSetRestart(x) ((x)->oflag |= OFLAG_RESTART)
#define OPSetGlobOps(x) ((x)->oflag |= OFLAG_GLOBOP)
#define OPSetWallOps(x) ((x)->oflag |= OFLAG_WALLOP)
#define OPSetLocOps(x) ((x)->oflag |= OFLAG_LOCOP)
#define OPSetLRoute(x) ((x)->oflag |= OFLAG_LROUTE)
#define OPSetGRoute(x) ((x)->oflag |= OFLAG_GROUTE)
#define OPSetLKill(x) ((x)->oflag |= OFLAG_LKILL)
#define OPSetGKill(x) ((x)->oflag |= OFLAG_GKILL)
#define OPSetKline(x) ((x)->oflag |= OFLAG_KLINE)
#define OPSetUnKline(x) ((x)->oflag |= OFLAG_UNKLINE)
#define OPSetLNotice(x) ((x)->oflag |= OFLAG_LNOTICE)
#define OPSetGNotice(x) ((x)->oflag |= OFLAG_GNOTICE)
#define OPSSetAdmin(x) ((x)->oflag |= OFLAG_ADMIN)
#define OPSSetSAdmin(x) ((x)->oflag |= OFLAG_SADMIN)
#define OPSSetNetAdmin(x) ((x)->oflag |= OFLAG_NETADMIN)
#define OPSSetCoAdmin(x) ((x)->oflag |= OFLAG_COADMIN)
#define OPSetZLine(x) ((x)->oflag |= OFLAG_ZLINE)
#define OPClearRehash(x) ((x)->oflag &= ~OFLAG_REHASH)
#define OPClearDie(x) ((x)->oflag &= ~OFLAG_DIE)
#define OPClearTSCtl(x) ((x)->oflag &= ~OFLAG_TSCTL)
#define OPClearRestart(x) ((x)->oflag &= ~OFLAG_RESTART)
#define OPClearGlobOps(x) ((x)->oflag &= ~OFLAG_GLOBOP)
#define OPClearWallOps(x) ((x)->oflag &= ~OFLAG_WALLOP)
#define OPClearLocOps(x) ((x)->oflag &= ~OFLAG_LOCOP)
#define OPClearLRoute(x) ((x)->oflag &= ~OFLAG_LROUTE)
#define OPClearGRoute(x) ((x)->oflag &= ~OFLAG_GROUTE)
#define OPClearLKill(x) ((x)->oflag &= ~OFLAG_LKILL)
#define OPClearGKill(x) ((x)->oflag &= ~OFLAG_GKILL)
#define OPClearKline(x) ((x)->oflag &= ~OFLAG_KLINE)
#define OPClearUnKline(x) ((x)->oflag &= ~OFLAG_UNKLINE)
#define OPClearLNotice(x) ((x)->oflag &= ~OFLAG_LNOTICE)
#define OPClearGNotice(x) ((x)->oflag &= ~OFLAG_GNOTICE)
#define OPClearAdmin(x) ((x)->oflag &= ~OFLAG_ADMIN)
#define OPClearSAdmin(x) ((x)->oflag &= ~OFLAG_SADMIN)
#define OPClearNetAdmin(x) ((x)->oflag &= ~OFLAG_NETADMIN)
#define OPClearCoAdmin(x) ((x)->oflag &= ~OFLAG_COADMIN)
#define OPClearZLine(x) ((x)->oflag &= ~OFLAG_ZLINE)
/*
* defined debugging levels
*/
@@ -626,9 +502,6 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
#define DEBUG_MALLOC 9 /* malloc/free calls */
#define DEBUG_LIST 10 /* debug list use */
/* blah */
#define IsSkoAdmin(sptr) (IsAdmin(sptr) || IsNetAdmin(sptr) || IsSAdmin(sptr))
/*
* defines for curses in client
*/
@@ -917,10 +790,10 @@ extern MODVAR short Snomask_highest;
extern MODVAR Cmode *Channelmode_Table;
extern MODVAR unsigned short Channelmode_highest;
extern Umode *UmodeAdd(Module *module, char ch, int options, int (*allowed)(aClient *sptr, int what), long *mode);
extern Umode *UmodeAdd(Module *module, char ch, int options, int unset_on_deoper, int (*allowed)(aClient *sptr, int what), long *mode);
extern void UmodeDel(Umode *umode);
extern Snomask *SnomaskAdd(Module *module, char ch, int (*allowed)(aClient *sptr, int what), long *mode);
extern Snomask *SnomaskAdd(Module *module, char ch, int unset_on_deoper, int (*allowed)(aClient *sptr, int what), long *mode);
extern void SnomaskDel(Snomask *sno);
extern Cmode *CmodeAdd(Module *reserved, CmodeInfo req, Cmode_t *mode);
@@ -985,7 +858,6 @@ struct Client {
struct list_head special_node; /* for special lists (server || unknown || oper) */
#if 1
int oflag; /* oper access flags (removed from anUser for mem considerations) */
TS since; /* time they will next be allowed to send something */
TS firsttime; /* Time it was created */
TS lasttime; /* last time any message was received */
@@ -1227,16 +1099,16 @@ struct _configitem_operclass {
};
struct _configitem_oper {
ConfigItem *prev, *next;
ConfigFlag flag;
char *name, *swhois, *snomask;
anAuthStruct *auth;
ConfigItem *prev, *next;
ConfigFlag flag;
char *name, *swhois, *snomask;
anAuthStruct *auth;
char *operclass;
ConfigItem_class *class;
ConfigItem_mask *mask;
unsigned long modes, require_modes;
long oflags;
int maxlogins;
unsigned long modes, require_modes;
char *vhost;
int maxlogins;
};
struct _configitem_mask {
@@ -1723,7 +1595,6 @@ struct liststruct {
*/
#define MyConnect(x) ((x)->fd != -256)
#define MyClient(x) (MyConnect(x) && IsClient(x))
#define MyOper(x) (MyConnect(x) && IsAnOper(x))
#ifdef CLEAN_COMPILE
#define TStime() (time(NULL) + TSoffset)
+3 -2
View File
@@ -47,9 +47,10 @@
#define CONFDIR "conf"
#define MODULESDIR "modules"
#define LOGDIR "logs"
#define DATADIR "data"
#define PERMDATADIR "data"
#define CACHEDIR "cache"
#define TMPDIR "tmp"
#define PIDFILE PERMDATADIR"/unrealircd.pid"
#define NO_U_TYPES
#define NEED_U_INT32_T
#define PREFIX_AQ
@@ -82,6 +83,6 @@
/* Version suffix such as a beta marker or release candidate marker. (e.g.:
-rc2 for unrealircd-3.2.9-rc2) */
#define UNREAL_VERSION_SUFFIX "-alpha3"
#define UNREAL_VERSION_SUFFIX "-alpha4"
#endif
+41 -17
View File
@@ -167,10 +167,10 @@ DLL_FILES=SRC/MODULES/M_CHGHOST.DLL SRC/MODULES/M_SDESC.DLL SRC/MODULES/M_SETIDE
SRC/MODULES/M_SETNAME.DLL SRC/MODULES/M_SETHOST.DLL SRC/MODULES/M_CHGIDENT.DLL \
SRC/MODULES/M_SVSMOTD.DLL SRC/MODULES/M_SVSNLINE.DLL SRC/MODULES/M_WHO.DLL \
SRC/MODULES/M_SWHOIS.DLL SRC/MODULES/M_SVSMODE.DLL SRC/MODULES/M_AWAY.DLL \
SRC/MODULES/M_SVSNOOP.DLL SRC/MODULES/M_MKPASSWD.DLL SRC/MODULES/M_SVSO.DLL \
SRC/MODULES/M_SVSNICK.DLL SRC/MODULES/M_ADMINCHAT.DLL \
SRC/MODULES/M_SVSNOOP.DLL SRC/MODULES/M_MKPASSWD.DLL \
SRC/MODULES/M_SVSNICK.DLL \
SRC/MODULES/M_CHGNAME.DLL SRC/MODULES/M_GUEST.DLL \
SRC/MODULES/M_LAG.DLL SRC/MODULES/M_MESSAGE.DLL SRC/MODULES/M_NACHAT.DLL \
SRC/MODULES/M_LAG.DLL SRC/MODULES/M_MESSAGE.DLL \
SRC/MODULES/M_OPER.DLL SRC/MODULES/M_PINGPONG.DLL SRC/MODULES/M_QUIT.DLL \
SRC/MODULES/M_RPING.DLL SRC/MODULES/M_SENDUMODE.DLL \
SRC/MODULES/M_SQLINE.DLL SRC/MODULES/M_KILL.DLL SRC/MODULES/M_TSCTL.DLL \
@@ -204,7 +204,7 @@ DLL_FILES=SRC/MODULES/M_CHGHOST.DLL SRC/MODULES/M_SDESC.DLL SRC/MODULES/M_SETIDE
SRC/MODULES/M_MD.DLL \
SRC/MODULES/CERTFP.DLL \
SRC/MODULES/CLOAK.DLL \
SRC/MODULES/CHANMODES/ADMINONLY.DLL \
SRC/MODULES/WEBIRC.DLL \
SRC/MODULES/CHANMODES/CENSOR.DLL \
SRC/MODULES/CHANMODES/DELAYJOIN.DLL \
SRC/MODULES/CHANMODES/FLOODPROT.DLL \
@@ -226,13 +226,21 @@ DLL_FILES=SRC/MODULES/M_CHGHOST.DLL SRC/MODULES/M_SDESC.DLL SRC/MODULES/M_SETIDE
SRC/MODULES/CHANMODES/STRIPCOLOR.DLL \
SRC/MODULES/USERMODES/CENSOR.DLL \
SRC/MODULES/USERMODES/NOCTCP.DLL \
SRC/MODULES/USERMODES/BOT.DLL \
SRC/MODULES/USERMODES/SERVICEBOT.DLL \
SRC/MODULES/USERMODES/SHOWWHOIS.DLL \
SRC/MODULES/USERMODES/PRIVACY.DLL \
SRC/MODULES/USERMODES/NOKICK.DLL \
SRC/MODULES/USERMODES/REGONLYMSG.DLL \
SRC/MODULES/SNOMASKS/DCCREJECT.DLL \
SRC/MODULES/EXTBANS/ACCOUNT.DLL \
SRC/MODULES/EXTBANS/INCHANNEL.DLL \
SRC/MODULES/EXTBANS/JOIN.DLL \
SRC/MODULES/EXTBANS/NICKCHANGE.DLL \
SRC/MODULES/EXTBANS/QUIET.DLL \
SRC/MODULES/EXTBANS/REALNAME.DLL \
SRC/MODULES/EXTBANS/REGNICK.DLL
SRC/MODULES/EXTBANS/REGNICK.DLL \
SRC/MODULES/EXTBANS/OPERCLASS.DLL
ALL: CONF UNREAL.EXE WIRCD.EXE MODULES
@@ -245,6 +253,7 @@ CLEAN:
-@erase src\modules\*.dll >NUL
-@erase src\modules\chanmodes\*.dll >NUL
-@erase src\modules\usermodes\*.dll >NUL
-@erase src\modules\snomasks\*.dll >NUL
-@erase src\modules\extbans\*.dll >NUL
-@erase .\*.exe >NUL
-@erase wircd.lib >NUL
@@ -537,15 +546,9 @@ src/modules/m_mkpasswd.dll: src/modules/m_mkpasswd.c $(INCLUDES)
src/modules/m_svsnoop.dll: src/modules/m_svsnoop.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_svsnoop.c $(MODLFLAGS)
src/modules/m_svso.dll: src/modules/m_svso.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_svso.c $(MODLFLAGS)
src/modules/m_svsnick.dll: src/modules/m_svsnick.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_svsnick.c $(MODLFLAGS)
src/modules/m_adminchat.dll: src/modules/m_adminchat.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_adminchat.c $(MODLFLAGS)
src/modules/m_chgname.dll: src/modules/m_chgname.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_chgname.c $(MODLFLAGS)
@@ -561,9 +564,6 @@ src/modules/m_lag.dll: src/modules/m_lag.c $(INCLUDES)
src/modules/m_message.dll: src/modules/m_message.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_message.c $(MODLFLAGS)
src/modules/m_nachat.dll: src/modules/m_nachat.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_nachat.c $(MODLFLAGS)
src/modules/m_oper.dll: src/modules/m_oper.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_oper.c $(MODLFLAGS)
@@ -795,6 +795,9 @@ src/modules/certfp.dll: src/modules/certfp.c $(INCLUDES)
src/modules/cloak.dll: src/modules/cloak.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/cloak.c $(MODLFLAGS)
src/modules/webirc.dll: src/modules/webirc.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/webirc.c $(MODLFLAGS)
src/modules/m_svsnolag.dll: src/modules/m_svsnolag.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_svsnolag.c $(MODLFLAGS)
@@ -816,9 +819,6 @@ src/modules/cap_invitenotify.dll: src/modules/cap_invitenotify.c $(INCLUDES)
src/modules/ssl_antidos.dll: src/modules/ssl_antidos.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/ssl_antidos.c $(MODLFLAGS)
src/modules/chanmodes/adminonly.dll: src/modules/chanmodes/adminonly.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/chanmodes/ /Fesrc/modules/chanmodes/ src/modules/chanmodes/adminonly.c $(MODLFLAGS)
src/modules/chanmodes/censor.dll: src/modules/chanmodes/censor.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/chanmodes/ /Fesrc/modules/chanmodes/ src/modules/chanmodes/censor.c $(MODLFLAGS)
@@ -882,6 +882,27 @@ src/modules/usermodes/censor.dll: src/modules/usermodes/censor.c $(INCLUDES)
src/modules/usermodes/noctcp.dll: src/modules/usermodes/noctcp.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/noctcp.c $(MODLFLAGS)
src/modules/usermodes/bot.dll: src/modules/usermodes/bot.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/bot.c $(MODLFLAGS)
src/modules/usermodes/servicebot.dll: src/modules/usermodes/servicebot.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/servicebot.c $(MODLFLAGS)
src/modules/usermodes/showwhois.dll: src/modules/usermodes/showwhois.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/showwhois.c $(MODLFLAGS)
src/modules/usermodes/privacy.dll: src/modules/usermodes/privacy.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/privacy.c $(MODLFLAGS)
src/modules/usermodes/nokick.dll: src/modules/usermodes/nokick.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/nokick.c $(MODLFLAGS)
src/modules/usermodes/regonlymsg.dll: src/modules/usermodes/regonlymsg.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/usermodes/ /Fesrc/modules/usermodes/ src/modules/usermodes/regonlymsg.c $(MODLFLAGS)
src/modules/snomasks/dccreject.dll: src/modules/snomasks/dccreject.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/snomasks/ /Fesrc/modules/snomasks/ src/modules/snomasks/dccreject.c $(MODLFLAGS)
src/modules/extbans/account.dll: src/modules/extbans/account.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/extbans/ /Fesrc/modules/extbans/ src/modules/extbans/account.c $(MODLFLAGS)
@@ -903,4 +924,7 @@ src/modules/extbans/realname.dll: src/modules/extbans/realname.c $(INCLUDES)
src/modules/extbans/regnick.dll: src/modules/extbans/regnick.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/extbans/ /Fesrc/modules/extbans/ src/modules/extbans/regnick.c $(MODLFLAGS)
src/modules/extbans/operclass.dll: src/modules/extbans/operclass.c $(INCLUDES)
$(CC) $(MODCFLAGS) /Fosrc/modules/extbans/ /Fesrc/modules/extbans/ src/modules/extbans/operclass.c $(MODLFLAGS)
dummy:
+6 -8
View File
@@ -73,7 +73,7 @@ MODVAR char modebuf[BUFSIZE], parabuf[BUFSIZE];
#define MODESYS_LINKOK /* We do this for a TEST */
aCtab cFlagTab[] = {
{MODE_LIMIT, 'l', 0, 1},
{MODE_LIMIT, 'l', 1, 1},
{MODE_VOICE, 'v', 1, 1},
{MODE_HALFOP, 'h', 0, 1},
{MODE_CHANOP, 'o', 0, 1},
@@ -101,12 +101,10 @@ aCtab cFlagTab[] = {
char cmodestring[512];
inline int op_can_override(aClient *sptr)
inline int op_can_override(char* acl, aClient *sptr,aChannel *channel,void* extra)
{
#ifndef NO_OPEROVERRIDE
if (!IsOper(sptr))
return 0;
if (MyClient(sptr) && !OPCanOverride(sptr))
if (MyClient(sptr) && !(OperClass_evaluateACLPath(acl,sptr,NULL,channel,extra)))
return 0;
return 1;
#else
@@ -752,7 +750,7 @@ int can_send(aClient *cptr, aChannel *chptr, char *msgtext, int notice)
return (CANNOT_SEND_NOPRIVMSGS);
lp = find_membership_link(cptr->user->channel, chptr);
if (chptr->mode.mode & MODE_MODERATED && !op_can_override(cptr) &&
if (chptr->mode.mode & MODE_MODERATED && !op_can_override("override:message:moderated",cptr,chptr,NULL) &&
(!lp
|| !(lp->flags & (CHFL_CHANOP | CHFL_VOICE | CHFL_CHANOWNER |
CHFL_HALFOP | CHFL_CHANPROT))))
@@ -772,7 +770,7 @@ int can_send(aClient *cptr, aChannel *chptr, char *msgtext, int notice)
return i;
/* Makes opers able to talk thru bans -Stskeeps suggested by The_Cat */
if (IsOper(cptr) && OPCanOverride(cptr))
if (op_can_override("override:message:ban",cptr,chptr,NULL))
return 0;
if ((!lp
@@ -955,7 +953,7 @@ char *clean_ban_mask(char *mask, int what, aClient *cptr)
/* Extended ban? */
if ((*mask == '~') && mask[1] && (mask[2] == ':'))
{
if (RESTRICT_EXTENDEDBANS && MyClient(cptr) && !IsAnOper(cptr))
if (RESTRICT_EXTENDEDBANS && MyClient(cptr) && !OperClass_evaluateACLPath("channel:extbans",cptr,NULL,NULL,NULL))
{
if (!strcmp(RESTRICT_EXTENDEDBANS, "*"))
{
+1 -1
View File
@@ -205,7 +205,7 @@ int crule_directop(int numargs, void *crulearg[])
/* adapted from m_trace */
list_for_each_entry(acptr, &lclient_list, lclient_node)
{
if (!IsAnOper(acptr))
if (!IsOper(acptr))
continue;
return (1);
+1 -1
View File
@@ -54,7 +54,7 @@
#include "crypt_blowfish.h"
#ifdef __i386__
#define BF_ASM 1
#define BF_ASM 0 /* old x86 asm not included in UnrealIRCd */
#define BF_SCALE 1
#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__)
#define BF_ASM 0
+1 -1
View File
@@ -166,7 +166,7 @@ int extban_is_ok_nuh_extban(aClient* sptr, aChannel* chptr, char* para, int chec
return 0; /* Fail: more than one stacked extban */
/* We can be sure RESTRICT_EXTENDEDBANS is not *. Else this extended ban wouldn't be happening at all. */
if (what == EXBCHK_PARAM && RESTRICT_EXTENDEDBANS && !IsAnOper(sptr))
if (what == EXBCHK_PARAM && RESTRICT_EXTENDEDBANS && !OperClass_evaluateACLPath("channel:extbans",sptr,NULL,chptr,NULL))
{
if (strchr(RESTRICT_EXTENDEDBANS, mask[1]))
{
+1 -1
View File
@@ -45,7 +45,7 @@
extern char cmodestring[512];
/* Channel parameter to slot# mapping */
unsigned char param_to_slot_mapping[256];
MODVAR unsigned char param_to_slot_mapping[256];
extern void make_cmodestr(void);
+101 -113
View File
@@ -104,7 +104,7 @@ extern SERVICE_STATUS_HANDLE IRCDStatusHandle;
extern SERVICE_STATUS IRCDStatus;
#endif
unsigned char conf_debuglevel = 0;
MODVAR unsigned char conf_debuglevel = 0;
#ifdef USE_LIBCURL
extern void url_init(void);
@@ -485,7 +485,7 @@ int check_tkls(aClient *cptr)
if (bconf)
killflag++;
else if (!IsAnOper(cptr) && (bconf = Find_ban(NULL, cptr->info, CONF_BAN_REALNAME)))
else if (!OperClass_evaluateACLPath("immune",cptr,NULL,NULL,NULL) && (bconf = Find_ban(NULL, cptr->info, CONF_BAN_REALNAME)))
killflag++;
}
@@ -561,114 +561,116 @@ EVENT(check_unknowns)
}
}
/** Ping individual user, and check for ping timeout */
int check_ping(aClient *cptr)
{
char scratch[64];
int ping = 0;
ping = cptr->class ? cptr->class->pingfreq : CONNECTTIMEOUT;
Debug((DEBUG_DEBUG, "c(%s)=%d p %d a %d", cptr->name,
cptr->status, ping,
TStime() - cptr->lasttime));
/* If ping is less than or equal to the last time we received a command from them */
if (ping > (TStime() - cptr->lasttime))
return 0; /* some recent command was executed */
if (
/* If we have sent a ping */
((cptr->flags & FLAGS_PINGSENT)
/* And they had 2x ping frequency to respond */
&& ((TStime() - cptr->lasttime) >= (2 * ping)))
||
/* Or isn't registered and time spent is larger than ping .. */
(!IsRegistered(cptr) && (TStime() - cptr->since >= ping))
)
{
/* if it's registered and doing dns/auth, timeout */
if (!IsRegistered(cptr) && (DoingDNS(cptr) || DoingAuth(cptr)))
{
if (cptr->authfd >= 0) {
fd_close(cptr->authfd);
--OpenFiles;
cptr->authfd = -1;
cptr->count = 0;
*cptr->buffer = '\0';
}
if (SHOWCONNECTINFO && !cptr->serv) {
if (DoingDNS(cptr))
sendto_one(cptr, "%s", REPORT_FAIL_DNS);
else if (DoingAuth(cptr))
sendto_one(cptr, "%s", REPORT_FAIL_ID);
}
Debug((DEBUG_NOTICE,
"DNS/AUTH timeout %s",
get_client_name(cptr, TRUE)));
unrealdns_delreq_bycptr(cptr);
ClearAuth(cptr);
ClearDNS(cptr);
SetAccess(cptr);
cptr->firsttime = TStime();
cptr->lasttime = TStime();
return -5;
}
if (IsServer(cptr) || IsConnecting(cptr) ||
IsHandshake(cptr)
|| IsSSLConnectHandshake(cptr)
) {
sendto_realops
("No response from %s, closing link",
get_client_name(cptr, FALSE));
sendto_server(&me, 0, 0,
":%s GLOBOPS :No response from %s, closing link",
me.name, get_client_name(cptr,
FALSE));
}
if (IsSSLAcceptHandshake(cptr))
Debug((DEBUG_DEBUG, "ssl accept handshake timeout: %s (%li-%li > %li)", cptr->sockhost,
TStime(), cptr->since, ping));
(void)ircsnprintf(scratch, sizeof(scratch), "Ping timeout: %ld seconds",
(long) (TStime() - cptr->lasttime));
return exit_client(cptr, cptr, &me, scratch);
}
else if (IsRegistered(cptr) &&
((cptr->flags & FLAGS_PINGSENT) == 0)) {
/*
* if we havent PINGed the connection and we havent
* heard from it in a while, PING it to make sure
* it is still alive.
*/
cptr->flags |= FLAGS_PINGSENT;
/*
* not nice but does the job
*/
cptr->lasttime = TStime() - ping;
sendto_one(cptr, "PING :%s", me.name);
}
return 0;
}
/*
* Check registered connections for PING timeout.
* XXX: also does some other stuff still, need to sort this. --nenolod
* Perhaps it would be wise to ping servers as well mr nenolod, just an idea -- Syzop
*/
EVENT(check_pings)
{
aClient *cptr, *cptr2;
ConfigItem_ban *bconf = NULL;
int i = 0;
char banbuf[1024];
char scratch[64];
int ping = 0;
TS currenttime = TStime();
list_for_each_entry_safe(cptr, cptr2, &lclient_list, lclient_node)
{
// Check TKLs for this user
/* Check TKLs for this user (huh, always?) */
if (!check_tkls(cptr))
{
continue;
}
check_ping(cptr);
/* don't touch 'cptr' after this as it may have been killed */
}
ping =
IsRegistered(cptr) ? (cptr->class ? cptr->
class->pingfreq : CONNECTTIMEOUT) : CONNECTTIMEOUT;
Debug((DEBUG_DEBUG, "c(%s)=%d p %d a %d", cptr->name,
cptr->status, ping,
currenttime - cptr->lasttime));
/* If ping is less than or equal to the last time we received a command from them */
if (ping <= (currenttime - cptr->lasttime))
{
if (
/* If we have sent a ping */
((cptr->flags & FLAGS_PINGSENT)
/* And they had 2x ping frequency to respond */
&& ((currenttime - cptr->lasttime) >= (2 * ping)))
||
/* Or isn't registered and time spent is larger than ping .. */
(!IsRegistered(cptr) && (currenttime - cptr->since >= ping))
)
{
/* if it's registered and doing dns/auth, timeout */
if (!IsRegistered(cptr) && (DoingDNS(cptr) || DoingAuth(cptr)))
{
if (cptr->authfd >= 0) {
fd_close(cptr->authfd);
--OpenFiles;
cptr->authfd = -1;
cptr->count = 0;
*cptr->buffer = '\0';
}
if (SHOWCONNECTINFO && !cptr->serv) {
if (DoingDNS(cptr))
sendto_one(cptr, "%s", REPORT_FAIL_DNS);
else if (DoingAuth(cptr))
sendto_one(cptr, "%s", REPORT_FAIL_ID);
}
Debug((DEBUG_NOTICE,
"DNS/AUTH timeout %s",
get_client_name(cptr, TRUE)));
unrealdns_delreq_bycptr(cptr);
ClearAuth(cptr);
ClearDNS(cptr);
SetAccess(cptr);
cptr->firsttime = currenttime;
cptr->lasttime = currenttime;
continue;
}
if (IsServer(cptr) || IsConnecting(cptr) ||
IsHandshake(cptr)
|| IsSSLConnectHandshake(cptr)
) {
sendto_realops
("No response from %s, closing link",
get_client_name(cptr, FALSE));
sendto_server(&me, 0, 0,
":%s GLOBOPS :No response from %s, closing link",
me.name, get_client_name(cptr,
FALSE));
}
if (IsSSLAcceptHandshake(cptr))
Debug((DEBUG_DEBUG, "ssl accept handshake timeout: %s (%li-%li > %li)", cptr->sockhost,
currenttime, cptr->since, ping));
(void)ircsnprintf(scratch, sizeof(scratch), "Ping timeout: %ld seconds",
(long) (TStime() - cptr->lasttime));
exit_client(cptr, cptr, &me, scratch);
continue;
}
else if (IsRegistered(cptr) &&
((cptr->flags & FLAGS_PINGSENT) == 0)) {
/*
* if we havent PINGed the connection and we havent
* heard from it in a while, PING it to make sure
* it is still alive.
*/
cptr->flags |= FLAGS_PINGSENT;
/*
* not nice but does the job
*/
cptr->lasttime = TStime() - ping;
sendto_one(cptr, "PING :%s", me.name);
}
}
list_for_each_entry_safe(cptr, cptr2, &server_list, special_node)
{
check_ping(cptr);
}
}
@@ -1349,7 +1351,7 @@ int InitwIRCD(int argc, char *argv[])
do_version_check();
#ifndef CHROOTDIR
#if !defined(CHROOTDIR) && !defined(_WIN32)
if (chdir(CONFDIR)) {
# ifndef _WIN32
perror("chdir");
@@ -1644,21 +1646,7 @@ void SocketLoop(void *dummy)
if (IRCstats.me_clients > IRCstats.me_max)
IRCstats.me_max = IRCstats.me_clients;
/*
* ** Adjust delay to something reasonable [ad hoc values]
* ** (one might think something more clever here... --msa)
* ** We don't really need to check that often and as long
* ** as we don't delay too long, everything should be ok.
* ** waiting too long can cause things to timeout...
* ** i.e. PINGS -> a disconnection :(
* ** - avalon
*/
if (delay < 1)
delay = 1;
else
delay = MIN(delay, TIMESEC);
fd_select(delay * 1000);
fd_select(SOCKETLOOP_MAX_DELAY);
process_clients();
@@ -0,0 +1,421 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1FC660CF1B3EA90B008EFAD1 /* bat23.png in Resources */ = {isa = PBXBuildFile; fileRef = 1FC660CE1B3EA90B008EFAD1 /* bat23.png */; };
1FE784F51B3DF0DD006CB6DD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE784F41B3DF0DD006CB6DD /* AppDelegate.swift */; };
1FE784F71B3DF0DD006CB6DD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE784F61B3DF0DD006CB6DD /* ViewController.swift */; };
1FE784F91B3DF0DD006CB6DD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1FE784F81B3DF0DD006CB6DD /* Images.xcassets */; };
1FE784FC1B3DF0DD006CB6DD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1FE784FA1B3DF0DD006CB6DD /* Main.storyboard */; };
1FE785081B3DF0DD006CB6DD /* UnrealIRCdTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE785071B3DF0DD006CB6DD /* UnrealIRCdTests.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
1FE785021B3DF0DD006CB6DD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1FE784E71B3DF0DD006CB6DD /* Project object */;
proxyType = 1;
remoteGlobalIDString = 1FE784EE1B3DF0DD006CB6DD;
remoteInfo = UnrealIRCd;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1FC660CE1B3EA90B008EFAD1 /* bat23.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bat23.png; sourceTree = "<group>"; };
1FE784EF1B3DF0DD006CB6DD /* UnrealIRCd.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UnrealIRCd.app; sourceTree = BUILT_PRODUCTS_DIR; };
1FE784F31B3DF0DD006CB6DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1FE784F41B3DF0DD006CB6DD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
1FE784F61B3DF0DD006CB6DD /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
1FE784F81B3DF0DD006CB6DD /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
1FE784FB1B3DF0DD006CB6DD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
1FE785011B3DF0DD006CB6DD /* UnrealIRCdTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnrealIRCdTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1FE785061B3DF0DD006CB6DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1FE785071B3DF0DD006CB6DD /* UnrealIRCdTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnrealIRCdTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1FE784EC1B3DF0DD006CB6DD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
1FE784FE1B3DF0DD006CB6DD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1FE784E61B3DF0DD006CB6DD = {
isa = PBXGroup;
children = (
1FE784F11B3DF0DD006CB6DD /* UnrealIRCd */,
1FE785041B3DF0DD006CB6DD /* UnrealIRCdTests */,
1FE784F01B3DF0DD006CB6DD /* Products */,
);
sourceTree = "<group>";
};
1FE784F01B3DF0DD006CB6DD /* Products */ = {
isa = PBXGroup;
children = (
1FE784EF1B3DF0DD006CB6DD /* UnrealIRCd.app */,
1FE785011B3DF0DD006CB6DD /* UnrealIRCdTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
1FE784F11B3DF0DD006CB6DD /* UnrealIRCd */ = {
isa = PBXGroup;
children = (
1FE784F41B3DF0DD006CB6DD /* AppDelegate.swift */,
1FE784F61B3DF0DD006CB6DD /* ViewController.swift */,
1FE784F81B3DF0DD006CB6DD /* Images.xcassets */,
1FE784FA1B3DF0DD006CB6DD /* Main.storyboard */,
1FE784F21B3DF0DD006CB6DD /* Supporting Files */,
);
path = UnrealIRCd;
sourceTree = "<group>";
};
1FE784F21B3DF0DD006CB6DD /* Supporting Files */ = {
isa = PBXGroup;
children = (
1FC660CE1B3EA90B008EFAD1 /* bat23.png */,
1FE784F31B3DF0DD006CB6DD /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
1FE785041B3DF0DD006CB6DD /* UnrealIRCdTests */ = {
isa = PBXGroup;
children = (
1FE785071B3DF0DD006CB6DD /* UnrealIRCdTests.swift */,
1FE785051B3DF0DD006CB6DD /* Supporting Files */,
);
path = UnrealIRCdTests;
sourceTree = "<group>";
};
1FE785051B3DF0DD006CB6DD /* Supporting Files */ = {
isa = PBXGroup;
children = (
1FE785061B3DF0DD006CB6DD /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1FE784EE1B3DF0DD006CB6DD /* UnrealIRCd */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1FE7850B1B3DF0DD006CB6DD /* Build configuration list for PBXNativeTarget "UnrealIRCd" */;
buildPhases = (
1FE784EB1B3DF0DD006CB6DD /* Sources */,
1FE784EC1B3DF0DD006CB6DD /* Frameworks */,
1FE784ED1B3DF0DD006CB6DD /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = UnrealIRCd;
productName = UnrealIRCd;
productReference = 1FE784EF1B3DF0DD006CB6DD /* UnrealIRCd.app */;
productType = "com.apple.product-type.application";
};
1FE785001B3DF0DD006CB6DD /* UnrealIRCdTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1FE7850E1B3DF0DD006CB6DD /* Build configuration list for PBXNativeTarget "UnrealIRCdTests" */;
buildPhases = (
1FE784FD1B3DF0DD006CB6DD /* Sources */,
1FE784FE1B3DF0DD006CB6DD /* Frameworks */,
1FE784FF1B3DF0DD006CB6DD /* Resources */,
);
buildRules = (
);
dependencies = (
1FE785031B3DF0DD006CB6DD /* PBXTargetDependency */,
);
name = UnrealIRCdTests;
productName = UnrealIRCdTests;
productReference = 1FE785011B3DF0DD006CB6DD /* UnrealIRCdTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
1FE784E71B3DF0DD006CB6DD /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = "UnrealIRCd Team";
TargetAttributes = {
1FE784EE1B3DF0DD006CB6DD = {
CreatedOnToolsVersion = 6.3.2;
};
1FE785001B3DF0DD006CB6DD = {
CreatedOnToolsVersion = 6.3.2;
TestTargetID = 1FE784EE1B3DF0DD006CB6DD;
};
};
};
buildConfigurationList = 1FE784EA1B3DF0DD006CB6DD /* Build configuration list for PBXProject "UnrealIRCd" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 1FE784E61B3DF0DD006CB6DD;
productRefGroup = 1FE784F01B3DF0DD006CB6DD /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
1FE784EE1B3DF0DD006CB6DD /* UnrealIRCd */,
1FE785001B3DF0DD006CB6DD /* UnrealIRCdTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1FE784ED1B3DF0DD006CB6DD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1FC660CF1B3EA90B008EFAD1 /* bat23.png in Resources */,
1FE784F91B3DF0DD006CB6DD /* Images.xcassets in Resources */,
1FE784FC1B3DF0DD006CB6DD /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1FE784FF1B3DF0DD006CB6DD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1FE784EB1B3DF0DD006CB6DD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1FE784F71B3DF0DD006CB6DD /* ViewController.swift in Sources */,
1FE784F51B3DF0DD006CB6DD /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1FE784FD1B3DF0DD006CB6DD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1FE785081B3DF0DD006CB6DD /* UnrealIRCdTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
1FE785031B3DF0DD006CB6DD /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1FE784EE1B3DF0DD006CB6DD /* UnrealIRCd */;
targetProxy = 1FE785021B3DF0DD006CB6DD /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
1FE784FA1B3DF0DD006CB6DD /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
1FE784FB1B3DF0DD006CB6DD /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
1FE785091B3DF0DD006CB6DD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
1FE7850A1B3DF0DD006CB6DD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
1FE7850C1B3DF0DD006CB6DD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = UnrealIRCd/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
1FE7850D1B3DF0DD006CB6DD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = UnrealIRCd/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
1FE7850F1B3DF0DD006CB6DD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(DEVELOPER_FRAMEWORKS_DIR)",
"$(inherited)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = UnrealIRCdTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UnrealIRCd.app/Contents/MacOS/UnrealIRCd";
};
name = Debug;
};
1FE785101B3DF0DD006CB6DD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(DEVELOPER_FRAMEWORKS_DIR)",
"$(inherited)",
);
INFOPLIST_FILE = UnrealIRCdTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UnrealIRCd.app/Contents/MacOS/UnrealIRCd";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1FE784EA1B3DF0DD006CB6DD /* Build configuration list for PBXProject "UnrealIRCd" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1FE785091B3DF0DD006CB6DD /* Debug */,
1FE7850A1B3DF0DD006CB6DD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1FE7850B1B3DF0DD006CB6DD /* Build configuration list for PBXNativeTarget "UnrealIRCd" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1FE7850C1B3DF0DD006CB6DD /* Debug */,
1FE7850D1B3DF0DD006CB6DD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1FE7850E1B3DF0DD006CB6DD /* Build configuration list for PBXNativeTarget "UnrealIRCdTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1FE7850F1B3DF0DD006CB6DD /* Debug */,
1FE785101B3DF0DD006CB6DD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 1FE784E71B3DF0DD006CB6DD /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:UnrealIRCd.xcodeproj">
</FileRef>
</Workspace>
+32
View File
@@ -0,0 +1,32 @@
//
// AppDelegate.swift
// UnrealIRCd
//
// Created by Travis McArthur on 6/26/15.
// Copyright (c) 2015 UnrealIRCd Team. All rights reserved.
//
import Cocoa
import AppKit
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var menuItem : NSStatusItem!;
func applicationDidFinishLaunching(aNotification: NSNotification) {
println("App did finish launching!")
// Compiler error - hack below
menuItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1/*NSVariableStatusItemLength*/)
menuItem.image = NSImage(named: "bat23.png")
}
func applicationWillTerminate(aNotification: NSNotification) {
}
}
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
</dependencies>
<scenes>
<!--Application-->
<scene sceneID="JPo-4y-FX3">
<objects>
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="UnrealIRCd" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="UnrealIRCd" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About UnrealIRCd" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide UnrealIRCd" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit UnrealIRCd" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="dMs-cI-mzQ">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="File" id="bib-Uj-vzu">
<items>
<menuItem title="Start Daemon" keyEquivalent="n" id="Was-JA-tGl">
<connections>
<action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
<connections>
<action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="UnrealIRCd Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="UnrealIRCd" customModuleProvider="target"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
</scene>
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
</window>
<connections>
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
</connections>
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
</scene>
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="UnrealIRCd" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
</view>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="655"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
+36
View File
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.unrealircd.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 UnrealIRCd Team. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>LSUIElement</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
@@ -0,0 +1,27 @@
//
// ViewController.swift
// UnrealIRCd
//
// Created by Travis McArthur on 6/26/15.
// Copyright (c) 2015 UnrealIRCd Team. All rights reserved.
//
import Cocoa
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: AnyObject? {
didSet {
// Update the view, if already loaded.
}
}
}
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.unrealircd.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,36 @@
//
// UnrealIRCdTests.swift
// UnrealIRCdTests
//
// Created by Travis McArthur on 6/26/15.
// Copyright (c) 2015 UnrealIRCd Team. All rights reserved.
//
import Cocoa
import XCTest
class UnrealIRCdTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
+3 -3
View File
@@ -979,7 +979,7 @@ int m_module(aClient *cptr, aClient *sptr, int parc, char *parv[])
strncat(tmp, "[PERM] ", sizeof(tmp)-strlen(tmp)-1);
if (!(mi->options & MOD_OPT_OFFICIAL))
strncat(tmp, "[3RD] ", sizeof(tmp)-strlen(tmp)-1);
if (!IsOper(sptr))
if (!OperClass_evaluateACLPath("server:module",sptr,NULL,NULL,NULL))
sendto_one(sptr, ":%s NOTICE %s :*** %s (%s)%s", me.name, sptr->name,
mi->header->name, mi->header->description,
mi->options & MOD_OPT_OFFICIAL ? "" : " [3RD]");
@@ -988,7 +988,7 @@ int m_module(aClient *cptr, aClient *sptr, int parc, char *parv[])
mi->header->name, mi->header->version, mi->header->description, tmp);
}
if (!IsOper(sptr))
if (!OperClass_evaluateACLPath("server:module",sptr,NULL,NULL,NULL))
return 0;
tmp[0] = '\0';
@@ -1616,7 +1616,7 @@ int i, n, errors=0;
if (n < 1)
{
config_error("ERROR: efunction '%s' not found, you probably did not "
"load all required modules! (hint: see modules.full.conf)",
"load all required modules! (hint: see modules.default.conf)",
efunction_table[i].name);
errors++;
} else
+8 -15
View File
@@ -36,9 +36,9 @@ R_MODULES= \
m_sethost.so m_chghost.so m_chgident.so m_setname.so \
m_setident.so m_sdesc.so m_svsmode.so m_swhois.so\
m_svsmotd.so m_svsnline.so m_who.so m_mkpasswd.so \
m_away.so m_svsnoop.so m_svso.so m_svsnick.so \
m_adminchat.so m_chgname.so m_guest.so m_kill.so \
m_lag.so m_message.so m_nachat.so m_oper.so m_pingpong.so \
m_away.so m_svsnoop.so m_svsnick.so \
m_chgname.so m_guest.so m_kill.so \
m_lag.so m_message.so m_oper.so m_pingpong.so \
m_quit.so m_rping.so m_sendumode.so m_sqline.so \
m_tsctl.so m_unkline.so m_unsqline.so m_unzline.so m_whois.so \
m_tkl.so m_vhost.so m_cycle.so m_svsjoin.so m_svspart.so \
@@ -68,6 +68,7 @@ all: build
build: $(MODULES)
cd chanmodes; $(MAKE) all
cd usermodes; $(MAKE) all
cd snomasks; $(MAKE) all
cd extbans; $(MAKE) all
custommodule: $(MODULEFILE).c
@@ -78,10 +79,6 @@ custommodule: $(MODULEFILE).c
# .so's section
#############################################################################
m_adminchat.so: m_adminchat.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_adminchat.so m_adminchat.c
m_chgname.so: m_chgname.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_chgname.so m_chgname.c
@@ -102,10 +99,6 @@ m_message.so: m_message.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_message.so m_message.c
m_nachat.so: m_nachat.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_nachat.so m_nachat.c
m_oper.so: m_oper.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_oper.so m_oper.c
@@ -206,10 +199,6 @@ m_svsnoop.so: m_svsnoop.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_svsnoop.so m_svsnoop.c
m_svso.so: m_svso.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_svso.so m_svso.c
m_svsnick.so: m_svsnick.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_svsnick.so m_svsnick.c
@@ -524,3 +513,7 @@ cloak.so: cloak.c $(INCLUDES)
clean:
$(RM) -f *.o *.so *~ core
cd chanmodes; $(MAKE) clean
cd usermodes; $(MAKE) clean
cd snomasks; $(MAKE) clean
cd extbans; $(MAKE) clean
+2
View File
@@ -35,6 +35,8 @@ DLLFUNC int MOD_INIT(certfp)(ModuleInfo *modinfo)
{
ModDataInfo mreq;
MARK_AS_OFFICIAL_MODULE(modinfo);
memset(&mreq, 0, sizeof(mreq));
mreq.name = "certfp";
mreq.free = certfp_free;
+2 -6
View File
@@ -1,6 +1,6 @@
#************************************************************************
#* IRC - Internet Relay Chat, src/modules/chanmodes/Makefile
#* Copyright (C) Carsten V. Munk 2001 & The UnrealIRCd Team
#* Copyright (C) The UnrealIRCd 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
@@ -32,7 +32,7 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \
R_MODULES= \
nocolor.so stripcolor.so issecure.so permanent.so jointhrottle.so floodprot.so \
noctcp.so link.so censor.so delayjoin.so noknock.so noinvite.so operonly.so \
adminonly.so nonotice.so regonly.so nonickchange.so nokick.so regonlyspeak.so \
nonotice.so regonly.so nonickchange.so nokick.so regonlyspeak.so \
secureonly.so
MODULES=$(R_MODULES)
@@ -107,10 +107,6 @@ operonly.so: operonly.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o operonly.so operonly.c
adminonly.so: adminonly.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o adminonly.so adminonly.c
nonotice.so: nonotice.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o nonotice.so nonotice.c
-131
View File
@@ -1,131 +0,0 @@
/*
* Disallow knocks UnrealIRCd Module (Channel Mode +K)
* (C) Copyright 2014 Travis McArthur (Heero) and the UnrealIRCd 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.
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC CMD_FUNC(adminonly);
ModuleHeader MOD_HEADER(adminonly)
= {
"chanmodes/adminonly",
"$Id$",
"Channel Mode +V",
"3.2-b8-1",
NULL
};
Cmode_t EXTCMODE_ADMINONLY;
#define IsAdminOnly(chptr) (chptr->mode.extmode & EXTCMODE_ADMINONLY)
DLLFUNC int adminonly_require_admin(aClient *cptr, aChannel *chptr, char mode, char *para, int checkt, int what);
DLLFUNC int adminonly_check (aClient *cptr, aChannel *chptr, char *key, char *parv[]);
DLLFUNC int adminonly_topic_allow (aClient *sptr, aChannel *chptr);
DLLFUNC int adminonly_check_ban(aClient *cptr, aChannel *chptr);
DLLFUNC int MOD_TEST(adminonly)(ModuleInfo *modinfo)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_INIT(adminonly)(ModuleInfo *modinfo)
{
CmodeInfo req;
memset(&req, 0, sizeof(req));
req.paracount = 0;
req.flag = 'A';
req.is_ok = adminonly_require_admin;
CmodeAdd(modinfo->handle, req, &EXTCMODE_ADMINONLY);
HookAddEx(modinfo->handle, HOOKTYPE_CAN_JOIN, adminonly_check);
HookAddEx(modinfo->handle, HOOKTYPE_OPER_INVITE_BAN, adminonly_check_ban);
HookAddEx(modinfo->handle, HOOKTYPE_VIEW_TOPIC_OUTSIDE_CHANNEl, adminonly_topic_allow);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(noctcp)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(noctcp)(int module_unload)
{
return MOD_SUCCESS;
}
DLLFUNC int adminonly_check (aClient *cptr, aChannel *chptr, char *key, char *parv[])
{
if ((chptr->mode.extmode & EXTCMODE_ADMINONLY) && !IsSkoAdmin(cptr))
return ERR_ADMONLY;
return 0;
}
DLLFUNC int adminonly_check_ban(aClient *cptr, aChannel *chptr)
{
if ((chptr->mode.extmode & EXTCMODE_ADMINONLY) && IsAnOper(cptr) && !IsNetAdmin(cptr) && !IsSAdmin(cptr))
return HOOK_DENY;
return HOOK_CONTINUE;
}
DLLFUNC int adminonly_topic_allow (aClient *sptr, aChannel *chptr)
{
if (chptr->mode.extmode & EXTCMODE_ADMINONLY && !IsAdmin(sptr))
return HOOK_DENY;
return HOOK_CONTINUE;
}
DLLFUNC int adminonly_require_admin(aClient *cptr, aChannel *chptr, char mode, char *para, int checkt, int what)
{
if (!MyClient(cptr) || IsSkoAdmin(cptr))
return EX_ALLOW;
sendto_one(cptr, err_str(ERR_CANNOTCHANGECHANMODE),
me.name, cptr->name, 'A', "You are not an Admin");
return EX_DENY;
}
+1 -1
View File
@@ -133,7 +133,7 @@ DLLFUNC int censor_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *e
{
config_error("%s:%i: badword quit has been removed. We just use the bad words from "
"badword channel { } instead.",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
return 0; /* pretend unhandled.. ok not just pretend.. ;) */
}
+1 -1
View File
@@ -68,7 +68,7 @@ CmodeInfo req;
memset(&req, 0, sizeof(req));
req.paracount = 0;
req.flag = 'C';
req.is_ok = extcmode_default_requirechop;
req.is_ok = extcmode_default_requirehalfop;
CmodeAdd(modinfo->handle, req, &EXTCMODE_NOCTCP);
HookAddPCharEx(modinfo->handle, HOOKTYPE_PRE_CHANMSG, noctcp_prechanmsg);
+1 -1
View File
@@ -122,6 +122,6 @@ DLLFUNC int noknock_mode_allow(aClient *cptr, aChannel *chptr, char mode, char *
return EX_DENY;
}
return extcmode_default_requirechop(cptr,chptr,mode,para,checkt,what);
return extcmode_default_requirehalfop(cptr,chptr,mode,para,checkt,what);
}
+1 -1
View File
@@ -67,7 +67,7 @@ CmodeInfo req;
memset(&req, 0, sizeof(req));
req.paracount = 0;
req.flag = 'N';
req.is_ok = extcmode_default_requirechop;
req.is_ok = extcmode_default_requirehalfop;
CmodeAdd(modinfo->handle, req, &EXTCMODE_NONICKCHANGE);
HookAddEx(modinfo->handle, HOOKTYPE_CHAN_PERMIT_NICK_CHANGE, nonickchange_check);
+4 -6
View File
@@ -52,8 +52,6 @@ ModuleHeader MOD_HEADER(operonly)
Cmode_t EXTCMODE_OPERONLY;
#define IsOperOnly(chptr) (chptr->mode.extmode & EXTCMODE_OPERONLY)
DLLFUNC int operonly_require_oper(aClient *cptr, aChannel *chptr, char mode, char *para, int checkt, int what);
DLLFUNC int operonly_check (aClient *cptr, aChannel *chptr, char *key, char *parv[]);
DLLFUNC int operonly_topic_allow (aClient *sptr, aChannel *chptr);
@@ -95,7 +93,7 @@ DLLFUNC int MOD_UNLOAD(noctcp)(int module_unload)
DLLFUNC int operonly_check (aClient *cptr, aChannel *chptr, char *key, char *parv[])
{
if ((chptr->mode.extmode & EXTCMODE_OPERONLY) && !IsAnOper(cptr))
if ((chptr->mode.extmode & EXTCMODE_OPERONLY) && OperClass_evaluateACLPath("channel:operonly",cptr,NULL,chptr,NULL))
return ERR_OPERONLY;
return 0;
}
@@ -103,7 +101,7 @@ DLLFUNC int operonly_check (aClient *cptr, aChannel *chptr, char *key, char *par
DLLFUNC int operonly_check_ban(aClient *cptr, aChannel *chptr)
{
if ((chptr->mode.extmode & EXTCMODE_OPERONLY) &&
IsAnOper(cptr) && !IsSkoAdmin(cptr) && !IsCoAdmin(cptr))
!OperClass_evaluateACLPath("override:ban:operonly",cptr,NULL,NULL,NULL))
return HOOK_DENY;
return HOOK_CONTINUE;
@@ -111,7 +109,7 @@ DLLFUNC int operonly_check_ban(aClient *cptr, aChannel *chptr)
DLLFUNC int operonly_topic_allow (aClient *sptr, aChannel *chptr)
{
if (chptr->mode.extmode & EXTCMODE_OPERONLY && !IsAnOper(sptr))
if (chptr->mode.extmode & EXTCMODE_OPERONLY && !OperClass_evaluateACLPath("channel:operonly:topic",sptr,NULL,chptr,NULL))
return HOOK_DENY;
return HOOK_CONTINUE;
@@ -119,7 +117,7 @@ DLLFUNC int operonly_topic_allow (aClient *sptr, aChannel *chptr)
DLLFUNC int operonly_require_oper(aClient *cptr, aChannel *chptr, char mode, char *para, int checkt, int what)
{
if (!MyClient(cptr) || IsAnOper(cptr))
if (!MyClient(cptr) || OperClass_evaluateACLPath("channel:operonly",cptr,NULL,chptr,NULL))
return EX_ALLOW;
+1 -1
View File
@@ -68,7 +68,7 @@ CmodeInfo req;
memset(&req, 0, sizeof(req));
req.paracount = 0;
req.flag = 'R';
req.is_ok = extcmode_default_requirechop;
req.is_ok = extcmode_default_requirehalfop;
CmodeAdd(modinfo->handle, req, &EXTCMODE_REGONLY);
HookAddEx(modinfo->handle, HOOKTYPE_CAN_JOIN, regonly_check);
+2 -2
View File
@@ -69,7 +69,7 @@ DLLFUNC int MOD_INIT(regonlyspeak)(ModuleInfo *modinfo)
memset(&req, 0, sizeof(req));
req.paracount = 0;
req.flag = 'M';
req.is_ok = extcmode_default_requirechop;
req.is_ok = extcmode_default_requirehalfop;
CmodeAdd(modinfo->handle, req, &EXTCMODE_REGONLYSPEAK);
HookAddEx(modinfo->handle, HOOKTYPE_CAN_SEND, regonlyspeak_can_send);
@@ -102,7 +102,7 @@ DLLFUNC char * regonlyspeak_part_message (aClient* sptr, aChannel *chptr, char*
DLLFUNC int regonlyspeak_can_send (aClient* cptr, aChannel *chptr, char* message, Membership* lp, int notice)
{
if (IsRegOnlySpeak(chptr) && !op_can_override(cptr) && !IsLoggedIn(cptr) &&
if (IsRegOnlySpeak(chptr) && !op_can_override("override:message:regonlyspeak",cptr,chptr,NULL) && !IsLoggedIn(cptr) &&
(!lp
|| !(lp->flags & (CHFL_CHANOP | CHFL_VOICE | CHFL_CHANOWNER |
CHFL_HALFOP | CHFL_CHANPROT))))
+6 -1
View File
@@ -30,7 +30,8 @@ INCLUDES = ../../include/auth.h ../../include/channel.h \
../../include/version.h ../../include/whowas.h
R_MODULES= \
join.so quiet.so nickchange.so inchannel.so realname.so regnick.so account.so
join.so quiet.so nickchange.so inchannel.so realname.so regnick.so \
account.so operclass.so
MODULES=$(R_MODULES)
MODULEFLAGS=@MODULEFLAGS@
@@ -83,3 +84,7 @@ regnick.so: regnick.c $(INCLUDES)
account.so: account.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o account.so account.c
operclass.so: operclass.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o operclass.so operclass.c
+104
View File
@@ -0,0 +1,104 @@
/*
* Extended ban type: ban (or rather: exempt or invex) an operclass.
* (C) Copyright 2003-.. Bram Matthys (Syzop) and the UnrealIRCd 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.
*/
#include "unrealircd.h"
ModuleHeader MOD_HEADER(operclass)
= {
"chanmodes/extbans/operclass",
"$Id$",
"ExtBan ~O - Ban/exempt operclass",
"3.2-b8-1",
NULL
};
/* Forward declarations */
char *extban_operclass_conv_param(char *para);
int extban_operclass_is_banned(aClient *sptr, aChannel *chptr, char *banin, int type);
/** Called upon module init */
DLLFUNC int MOD_INIT(operclass)(ModuleInfo *modinfo)
{
ExtbanInfo req;
req.flag = 'O';
req.is_ok = NULL;
req.conv_param = extban_operclass_conv_param;
req.is_banned = extban_operclass_is_banned;
req.options = EXTBOPT_INVEX;
if (!ExtbanAdd(modinfo->handle, req))
{
config_error("could not register extended ban type");
return MOD_FAILED;
}
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
/** Called upon module load */
DLLFUNC int MOD_LOAD(operclass)(int module_load)
{
return MOD_SUCCESS;
}
/** Called upon unload */
DLLFUNC int MOD_UNLOAD(operclass)(int module_unload)
{
return MOD_SUCCESS;
}
#define OPERCLASSLEN 64
char *extban_operclass_conv_param(char *para)
{
static char retbuf[OPERCLASSLEN + 4];
char *p;
strlcpy(retbuf, para, sizeof(retbuf));
/* allow alpha, numeric, -, _, * and ? wildcards */
for (p = retbuf+3; *p; p++)
if (!strchr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_?*", *p))
*p = '\0';
if (retbuf[3] == '\0')
return NULL; /* just "~O:" is invalid */
return retbuf;
}
int extban_operclass_is_banned(aClient *sptr, aChannel *chptr, char *banin, int type)
{
char *ban = banin+3;
if (MyClient(sptr) && IsAnOper(sptr))
{
char *operclass = NULL;
ConfigItem_oper *oper = Find_oper(sptr->user->operlogin);
if (oper && oper->operclass)
operclass = oper->operclass;
if (operclass && !match(ban, operclass))
return 1;
}
return 0;
}
+1 -1
View File
@@ -82,7 +82,7 @@ DLLFUNC CMD_FUNC(m_addline)
char *text;
text = parc > 1 ? parv[1] : NULL;
if (!MyClient(sptr) || !IsAnOper(sptr) || !OPCanAddline(sptr))
if (!MyClient(sptr) || !IsAnOper(sptr) || OperClass_evaluateACLPath("server:addline",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -86,7 +86,7 @@ DLLFUNC CMD_FUNC(m_addmotd)
if (!MyConnect(sptr))
return 0;
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath("add:motd",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("server:addmotd",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+2 -2
View File
@@ -86,7 +86,7 @@ DLLFUNC CMD_FUNC(m_addomotd)
if (!MyConnect(sptr))
return 0;
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath("add:omotd",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("server:addomotd",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -94,7 +94,7 @@ DLLFUNC CMD_FUNC(m_addomotd)
if (parc < 2)
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, parv[0], "ADDMOTD");
me.name, parv[0], "ADDOMOTD");
return 0;
}
conf = fopen(conf_files->opermotd_file, "a");
-116
View File
@@ -1,116 +0,0 @@
/*
* Unreal Internet Relay Chat Daemon, src/modules/m_adminchat.c
* (C) 2000-2001 Carsten V. Munk and the UnrealIRCd Team
* Moved to modules by Fish (Justin Hammond)
*
* 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.
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_admins(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
#define MSG_ADMINCHAT "ADCHAT"
ModuleHeader MOD_HEADER(m_adminchat)
= {
"adminchat", /* Name of module */
"$Id$", /* Version */
"command /adchat", /* Short description of module */
"3.2-b8-1",
NULL
};
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_adminchat)(ModuleInfo *modinfo)
{
CommandAdd(modinfo->handle, MSG_ADMINCHAT, m_admins, 1, 0);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
/* Is first run when server is 100% ready */
DLLFUNC int MOD_LOAD(m_adminchat)(int module_load)
{
return MOD_SUCCESS;
}
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_adminchat)(int module_unload)
{
return MOD_SUCCESS;
}
/*
** m_admins (Admin chat only) -Potvin
** parv[0] = sender prefix
** parv[1] = message text
*/
DLLFUNC int m_admins(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
char *message;
message = parc > 1 ? parv[1] : NULL;
if (BadPtr(message))
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, parv[0], "ADCHAT");
return 0;
}
#ifdef ADMINCHAT
if (MyClient(sptr) && !IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath("chat:admin",sptr,NULL,NULL,NULL))
#else
if (MyClient(sptr))
#endif
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
}
sendto_server(IsServer(cptr) ? cptr : NULL, 0, 0, ":%s ADCHAT :%s",
parv[0], message);
#ifdef ADMINCHAT
sendto_umode(UMODE_ADMIN, "*** AdminChat -- from %s: %s",
parv[0], message);
sendto_umode(UMODE_COADMIN, "*** AdminChat -- from %s: %s",
parv[0], message);
#endif
return 0;
}
+2 -8
View File
@@ -86,19 +86,13 @@ DLLFUNC CMD_FUNC(m_connect)
aClient *acptr;
if (!IsPrivileged(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return -1;
}
if (MyClient(sptr) && !OPCanGRoute(sptr) && parc > 3)
if (!IsServer(sptr) && MyClient(sptr) && !OperClass_evaluateACLPath("route:global",sptr,NULL,NULL,NULL) && parc > 3)
{ /* Only allow LocOps to make */
/* local CONNECTS --SRB */
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
}
if (MyClient(sptr) && !OPCanLRoute(sptr) && parc <= 3)
if (!IsServer(sptr) && MyClient(sptr) && !OperClass_evaluateACLPath("route:local",sptr,NULL,NULL,NULL) && parc <= 3)
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -82,7 +82,7 @@ DLLFUNC CMD_FUNC(m_dccdeny)
if (!MyClient(sptr))
return 0;
if (!IsAnOper(sptr) || !OPCanDCCDeny(sptr))
if (!IsAnOper(sptr) || !OperClass_evaluateACLPath("client:dcc",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -88,7 +88,7 @@ DLLFUNC CMD_FUNC(m_globops)
me.name, parv[0], "GLOBOPS");
return 0;
}
if (MyClient(sptr) && !OPCanGlobOps(sptr))
if (MyClient(sptr) && !OperClass_evaluateACLPath("chat:globops",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+4 -4
View File
@@ -135,7 +135,7 @@ DLLFUNC CMD_FUNC(m_invite)
if (i == HOOK_DENY && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
if ((MyClient(sptr) ? (IsOper(sptr) && (OperClass_evaluateACLPath("override:invite:nopermissions",sptr,NULL,chptr,NULL))) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
@@ -151,7 +151,7 @@ DLLFUNC CMD_FUNC(m_invite)
if (!IsMember(sptr, chptr) && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
if ((MyClient(sptr) ? (IsOper(sptr) && (OperClass_evaluateACLPath("override:invite:notinchannel",sptr,NULL,chptr,NULL))) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
@@ -176,7 +176,7 @@ DLLFUNC CMD_FUNC(m_invite)
if (!is_chan_op(sptr, chptr) && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
if ((MyClient(sptr) ? (IsOper(sptr) && (OperClass_evaluateACLPath("override:invite:nopermissions",sptr,NULL,chptr,NULL))) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
@@ -191,7 +191,7 @@ DLLFUNC CMD_FUNC(m_invite)
else if (!IsMember(sptr, chptr) && !IsULine(sptr))
{
#ifndef NO_OPEROVERRIDE
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
if ((MyClient(sptr) ? (IsOper(sptr) && (OperClass_evaluateACLPath("override:invite:nopermissions",sptr,NULL,chptr,NULL))) :
IsOper(sptr)) && sptr == acptr)
over = 1;
else {
+2 -2
View File
@@ -536,14 +536,14 @@ DLLFUNC CMD_FUNC(_do_join)
(i = can_join(cptr, sptr, chptr, key, parv)))
{
#ifndef NO_OPEROVERRIDE
if (i != -1 && !OPCanOverride(sptr))
if (i != -1 && !OperClass_evaluateACLPath("override:join",sptr,NULL,chptr,NULL))
#else
if (i != -1)
#endif
sendto_one(sptr, err_str(i),
me.name, parv[0], name);
#ifndef NO_OPEROVERRIDE
else if (i != -1 && OPCanOverride(sptr))
else if (i != -1 && OperClass_evaluateACLPath("override:join",sptr,NULL,chptr,NULL) )
{
sendto_snomask(SNO_EYES, "*** OperOverride -- %s (%s@%s) JOIN %s",
sptr->name, sptr->user->username, sptr->user->realhost, chptr->chname);
+4 -4
View File
@@ -121,7 +121,7 @@ CMD_FUNC(m_kick)
/* Store "sptr" access flags */
if (IsPerson(sptr))
sptr_flags = get_access(sptr, chptr);
if (!IsServer(cptr) && !IsULine(sptr) && !op_can_override(sptr)
if (!IsServer(cptr) && !IsULine(sptr) && !op_can_override("override:kick",sptr,chptr,NULL)
&& !(sptr_flags & CHFL_ISOP) && !(sptr_flags & CHFL_HALFOP))
{
sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED),
@@ -177,7 +177,7 @@ CMD_FUNC(m_kick)
if (ret == EX_DENY)
{
/* If set it means 'not allowed to kick'.. now check if (s)he can override that.. */
if (op_can_override(sptr))
if (op_can_override("override:kick",sptr,chptr,NULL))
{
sendto_snomask(SNO_EYES,
"*** OperOverride -- %s (%s@%s) KICK %s %s (%s)",
@@ -200,7 +200,7 @@ CMD_FUNC(m_kick)
* we are +h but victim is +o, OR...
* we are +h and victim is +h
*/
if (op_can_override(sptr))
if (op_can_override("override:kick",sptr,chptr,NULL))
{
if ((!(sptr_flags & CHFL_ISOP) && !(sptr_flags & CHFL_HALFOP)) ||
((sptr_flags & CHFL_HALFOP) && (who_flags & CHFL_ISOP)) ||
@@ -225,7 +225,7 @@ CMD_FUNC(m_kick)
&& !(sptr_flags & CHFL_CHANOWNER)) {
if (sptr == who)
goto attack; /* kicking self == ok */
if (op_can_override(sptr)) /* (and f*ck local ops) */
if (op_can_override("override:kick:owner",sptr,chptr,NULL)) /* (and f*ck local ops) */
{ /* IRCop kicking owner/prot */
sendto_snomask(SNO_EYES,
"*** OperOverride -- %s (%s@%s) KICK %s %s (%s)",
+3 -3
View File
@@ -110,7 +110,7 @@ DLLFUNC int m_kill(aClient *cptr, aClient *sptr, int parc, char *parv[])
*s = '\0'; /* Truncate at first "." */
#endif
if (!IsPrivileged(cptr))
if (!IsServer(cptr) && !OperClass_evaluateACLPath("kill:global",sptr,NULL,NULL,NULL) && !OperClass_evaluateACLPath("kill:local",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -155,9 +155,9 @@ DLLFUNC int m_kill(aClient *cptr, aClient *sptr, int parc, char *parv[])
nick, acptr->name);
chasing = 1;
}
if ((!MyConnect(acptr) && MyClient(cptr) && !OPCanGKill(cptr))
if ((!MyConnect(acptr) && MyClient(cptr) && !OperClass_evaluateACLPath("kill:global",sptr,acptr,NULL,NULL))
|| (MyConnect(acptr) && MyClient(cptr)
&& !OPCanLKill(cptr)))
&& !OperClass_evaluateACLPath("kill:local",sptr,acptr,NULL,NULL)))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
parv[0]);
+3 -3
View File
@@ -249,7 +249,7 @@ DLLFUNC CMD_FUNC(m_list)
else /* Just a normal channel */
{
chptr = find_channel(name, NullChn);
if (chptr && (ShowChannel(sptr, chptr) || OPCanSeeSecret(sptr))) {
if (chptr && (ShowChannel(sptr, chptr) || OperClass_evaluateACLPath("override:see:list:secret",sptr,NULL,chptr,NULL))) {
#ifdef LIST_SHOW_MODES
modebuf[0] = '[';
channel_modes(sptr, modebuf+1, parabuf, sizeof(modebuf)-1, sizeof(parabuf), chptr);
@@ -344,7 +344,7 @@ void _send_list(aClient *cptr, int numsend)
{
if (SecretChannel(chptr)
&& !IsMember(cptr, chptr)
&& !OPCanSeeSecret(cptr))
&& !OperClass_evaluateACLPath("override:see:list:secret",cptr,NULL,chptr,NULL))
continue;
/* Much more readable like this -- codemastr */
@@ -385,7 +385,7 @@ void _send_list(aClient *cptr, int numsend)
else
strlcat(modebuf, "]", sizeof modebuf);
#endif
if (!OPCanSeeSecret(cptr))
if (!OperClass_evaluateACLPath("override:see:list:secret",cptr,NULL,chptr,NULL))
sendto_one(cptr,
rpl_str(RPL_LIST), me.name,
cptr->name,
+1 -1
View File
@@ -88,7 +88,7 @@ DLLFUNC CMD_FUNC(m_locops)
me.name, parv[0], "LOCOPS");
return 0;
}
if (MyClient(sptr) && !OPCanLocOps(sptr))
if (MyClient(sptr) && !OperClass_evaluateACLPath("chat:locops",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+4 -4
View File
@@ -108,7 +108,7 @@ static void dump_map(aClient *cptr, aClient *server, char *mask, int prompt_leng
list_for_each_entry(acptr, &global_server_list, client_node)
{
if (acptr->srvptr != server ||
(IsULine(acptr) && !IsOper(cptr) && HIDE_ULINES))
(IsULine(acptr) && HIDE_ULINES && !OperClass_evaluateACLPath("map:ulines",cptr,NULL,NULL,NULL)))
continue;
acptr->flags |= FLAGS_MAP;
cnt++;
@@ -116,7 +116,7 @@ static void dump_map(aClient *cptr, aClient *server, char *mask, int prompt_leng
list_for_each_entry(acptr, &global_server_list, client_node)
{
if (IsULine(acptr) && HIDE_ULINES && !IsAnOper(cptr))
if (IsULine(acptr) && HIDE_ULINES && !OperClass_evaluateACLPath("map:ulines",cptr,NULL,NULL,NULL))
continue;
if (acptr->srvptr != server)
continue;
@@ -137,7 +137,7 @@ char buf[4];
aClient *acptr;
int cnt = 0, hide_ulines;
hide_ulines = (HIDE_ULINES && !IsOper(cptr)) ? 1 : 0;
hide_ulines = (HIDE_ULINES && !OperClass_evaluateACLPath("map:ulines",cptr,NULL,NULL,NULL)) ? 1 : 0;
sendto_one(cptr, rpl_str(RPL_MAP), me.name, cptr->name, "",
length, server->name, server->serv->users);
@@ -184,7 +184,7 @@ DLLFUNC CMD_FUNC(m_map)
if (longest > 60)
longest = 60;
longest += 2;
if (FLAT_MAP && !IsAnOper(sptr))
if (FLAT_MAP && !OperClass_evaluateACLPath("map:real-map",sptr,NULL,NULL,NULL))
dump_flat_map(sptr, &me, longest);
else
dump_map(sptr, &me, "*", 0, longest);
+4 -14
View File
@@ -313,7 +313,7 @@ DLLFUNC int m_message(aClient *cptr, aClient *sptr, int parc, char *parv[], int
if (prefix)
{
if (MyClient(sptr) && !op_can_override(sptr))
if (MyClient(sptr) && !op_can_override("override:message:prefix",sptr,chptr,NULL))
{
Membership *lp = find_membership_link(sptr->user->channel, chptr);
/* Check if user is allowed to send. RULES:
@@ -665,13 +665,10 @@ int size_string, ret;
sptr->name, displayfile, target, fl->reason);
sendto_one(sptr, ":%s NOTICE %s :*** You have been blocked from sending files, reconnect to regain permission to send files",
me.name, sptr->name);
sendto_umode(UMODE_VICTIM,
"%s tried to send forbidden file %s (%s) to %s (is blocked now)",
sptr->name, displayfile, fl->reason, target);
sendto_server(NULL, 0, 0, ":%s SMO v :%s tried to send forbidden file %s (%s) to %s (is blocked now)",
me.name, sptr->name, displayfile, fl->reason, target);
sptr->flags |= FLAGS_DCCBLOCK;
RunHook5(HOOKTYPE_DCC_DENIED, sptr, target, realfile, displayfile, fl);
return 0; /* block */
}
@@ -751,13 +748,6 @@ int size_string;
"more information on using the dccallow system by typing '/DCCALLOW HELP'", from->name);
}
/* if (SHOW_ALLDENIEDDCCS) */
if (0)
{
sendto_umode(UMODE_VICTIM,
"[DCCALLOW] %s tried to send forbidden file %s (%s) to %s",
from->name, displayfile, fl->reason, to->name);
}
return 0;
}
}
+18 -62
View File
@@ -265,7 +265,7 @@ CMD_FUNC(m_mode)
#ifndef NO_OPEROVERRIDE
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
&& !is_half_op(sptr, chptr) && (MyClient(sptr) ? (IsOper(sptr) &&
OPCanOverride(sptr)) : IsOper(sptr)))
OperClass_evaluateACLPath("override:mode",sptr,NULL,chptr,NULL)) : IsOper(sptr)))
{
sendts = 0;
opermode = 1;
@@ -274,7 +274,7 @@ CMD_FUNC(m_mode)
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
&& is_half_op(sptr, chptr) && (MyClient(sptr) ? (IsOper(sptr) &&
OPCanOverride(sptr)) : IsOper(sptr)))
OperClass_evaluateACLPath("override:mode",sptr,NULL,chptr,NULL)) : IsOper(sptr)))
{
opermode = 2;
goto aftercheck;
@@ -283,7 +283,7 @@ CMD_FUNC(m_mode)
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
&& !is_half_op(sptr, chptr)
&& (cptr == sptr || !IsSAdmin(sptr) || !IsOper(sptr)))
&& (cptr == sptr || !OperClass_evaluateACLPath("override:mode",sptr,NULL,chptr,NULL) || !IsOper(sptr)))
{
if (cptr == sptr)
{
@@ -768,8 +768,6 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
u_int *pcount, char pvar[MAXMODEPARAMS][MODEBUFLEN + 3], char bounce, long my_access)
{
aCtab *tab = &cFlagTab[0];
int retval = 0;
Member *member = NULL;
Membership *membership = NULL;
@@ -777,15 +775,14 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
unsigned int tmp = 0;
char tmpbuf[512], *tmpstr;
char tc = ' '; /* */
int chasing, x;
int chasing = 0, x;
int xxi, xyi, xzi, hascolon;
char *xp;
int notsecure;
chasing = 0;
Hook *h;
if ((my_access & CHFL_HALFOP) && !is_xchanop(my_access) && !IsULine(cptr)
&& !op_can_override(cptr) && !samode_in_progress)
&& !op_can_override("override:mode",cptr,chptr,&modetype) && !samode_in_progress)
{
if (MyClient(cptr) && (modetype == MODE_HALFOP) && (what == MODE_DEL) &&
param && (find_client(param, NULL) == cptr))
@@ -857,7 +854,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
REQUIRE_PARAMETER()
if (!IsULine(cptr) && !IsServer(cptr) && !is_chanowner(cptr, chptr) && !samode_in_progress)
{
if (MyClient(cptr) && !op_can_override(cptr))
if (MyClient(cptr) && !op_can_override("override:mode",cptr,chptr,&modetype))
{
sendto_one(cptr, err_str(ERR_CHANOWNPRIVNEEDED), me.name, cptr->name, chptr->chname);
break;
@@ -874,7 +871,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
if (!IsULine(cptr) && !IsServer(cptr) && !is_chanowner(cptr, chptr) && !samode_in_progress &&
!(param && (what == MODE_DEL) && (find_client(param, NULL) == cptr)))
{
if (MyClient(cptr) && !op_can_override(cptr))
if (MyClient(cptr) && !op_can_override("override:mode",cptr,chptr,&modetype))
{
sendto_one(cptr, err_str(ERR_CHANOWNPRIVNEEDED), me.name, cptr->name, chptr->chname);
break;
@@ -943,7 +940,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
/* This probably should work but is completely untested (the operoverride stuff, I mean): */
if (ret == EX_DENY)
{
if (!op_can_override(cptr))
if (!op_can_override("override:mode:del",cptr,chptr,&modetype))
{
if (MyClient(cptr) && badmode)
sendto_one(cptr, "%s", badmode); /* send error message, if any */
@@ -970,7 +967,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
/* Need this !op_can_override() here again, even with the !opermode
* check a few lines up, all due to halfops. -- Syzop
*/
if (!op_can_override(cptr))
if (!op_can_override("override:mode:del",cptr,chptr,&modetype))
{
char errbuf[NICKLEN+30];
ircsnprintf(errbuf, sizeof(errbuf), "%s is a channel owner", member->cptr->name);
@@ -996,7 +993,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
/* Need this !op_can_override() here again, even with the !opermode
* check a few lines up, all due to halfops. -- Syzop
*/
if (!op_can_override(cptr))
if (!op_can_override("override:mode:del",cptr,chptr,&modetype))
{
char errbuf[NICKLEN+30];
ircsnprintf(errbuf, sizeof(errbuf), "%s is a channel admin", member->cptr->name);
@@ -1256,7 +1253,7 @@ char *morphed;
{
x = handler->is_ok(cptr, chptr, mode, param, EXCHK_ACCESS, what);
if ((x == EX_ALWAYS_DENY) ||
((x == EX_DENY) && !op_can_override(cptr) && !samode_in_progress))
((x == EX_DENY) && !op_can_override("override:mode:del",cptr,chptr,handler) && !samode_in_progress))
{
handler->is_ok(cptr, chptr, mode, param, EXCHK_ACCESS_ERR, what);
return paracnt; /* Denied & error msg sent */
@@ -1265,7 +1262,7 @@ char *morphed;
opermode = 1; /* override in progress... */
} else {
/* remote user: we only need to check if we need to generate an operoverride msg */
if (!IsULine(cptr) && IsPerson(cptr) && op_can_override(cptr) &&
if (!IsULine(cptr) && IsPerson(cptr) && op_can_override("override:mode:del",cptr,chptr,handler) &&
(handler->is_ok(cptr, chptr, mode, param, EXCHK_ACCESS, what) != EX_ALLOW))
opermode = 1; /* override in progress... */
}
@@ -1741,64 +1738,24 @@ DLLFUNC CMD_FUNC(_m_umode)
break;
} /* switch */
} /* for */
/*
* stop users making themselves operators too easily
*/
if (!(setflags & UMODE_OPER) && IsOper(sptr) && !IsServer(cptr))
ClearOper(sptr);
if (!(setflags & UMODE_LOCOP) && IsLocOp(sptr) && !IsServer(cptr))
sptr->umodes &= ~UMODE_LOCOP;
/*
* Let only operators set FloodF, ClientF; also
* remove those flags if they've gone -o/-O.
* FloodF sends notices about possible flooding -Cabal95
* ClientF sends notices about clients connecting or exiting
* Admin is for server admins
*/
if (!IsAnOper(sptr) && !IsServer(cptr))
/* Don't let non-ircops set ircop-only modes or snomasks */
if (MyClient(sptr) && !IsAnOper(sptr))
{
ClearAdmin(sptr);
ClearSAdmin(sptr);
ClearNetAdmin(sptr);
ClearHideOper(sptr);
ClearCoAdmin(sptr);
ClearFailops(sptr);
remove_oper_modes(sptr);
remove_oper_snomasks(sptr);
}
/*
* New oper access flags - Only let them set certian usermodes on
* themselves IF they have access to set that specific mode in their
* O:Line.
*/
/* Below can be removed after Heero is done with the new oper system and this shit is gone :D */
if (MyClient(sptr)) {
if (IsAnOper(sptr)) {
if (IsAdmin(sptr) && !OPIsAdmin(sptr))
ClearAdmin(sptr);
if (IsSAdmin(sptr) && !OPIsSAdmin(sptr))
ClearSAdmin(sptr);
if (IsNetAdmin(sptr) && !OPIsNetAdmin(sptr))
ClearNetAdmin(sptr);
if (IsCoAdmin(sptr) && !OPIsCoAdmin(sptr))
ClearCoAdmin(sptr);
if (MyClient(sptr) && (sptr->umodes & UMODE_SECURE)
&& !IsSecure(sptr))
sptr->umodes &= ~UMODE_SECURE;
}
/*
This is to remooove the kix bug.. and to protect some stuffie
-techie
*/
if (MyClient(sptr))
{
if ((sptr->umodes & UMODE_SECURE) && !IsSecure(sptr))
sptr->umodes &= ~UMODE_SECURE;
if (!(sptr->umodes & UMODE_SECURE) && IsSecure(sptr))
sptr->umodes |= UMODE_SECURE;
}
}
/* If user was +x and does MODE -x then set -t as well */
if ((setflags & UMODE_HIDE) && !IsHidden(sptr))
sptr->umodes &= ~UMODE_SETHOST;
@@ -1863,7 +1820,6 @@ DLLFUNC CMD_FUNC(_m_umode)
MyConnect(sptr))
{
list_del(&sptr->special_node);
sptr->oflag = 0;
remove_oper_snomasks(sptr);
RunHook2(HOOKTYPE_LOCAL_OPER, sptr, 0);
}
-113
View File
@@ -1,113 +0,0 @@
/*
* Unreal Internet Relay Chat Daemon, src/modules/m_nachat.c
* (C) 2000-2001 Carsten V. Munk and the UnrealIRCd Team
* Moved to modules by Fish (Justin Hammond)
*
* 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.
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_nachat(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
#define MSG_NACHAT "NACHAT" /* netadmin chat */
ModuleHeader MOD_HEADER(m_nachat)
= {
"Nachat", /* Name of module */
"$Id$", /* Version */
"command /nachat", /* Short description of module */
"3.2-b8-1",
NULL
};
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_nachat)(ModuleInfo *modinfo)
{
CommandAdd(modinfo->handle, MSG_NACHAT, m_nachat, 1, 0);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
/* Is first run when server is 100% ready */
DLLFUNC int MOD_LOAD(m_nachat)(int module_load)
{
return MOD_SUCCESS;
}
/* Called when module is unloaded */
DLLFUNC int MOD_UNLOAD(m_nachat)(int module_unload)
{
return MOD_SUCCESS;
}
/*
** m_nachat (netAdmin chat only) -Potvin - another sts cloning
** parv[0] = sender prefix
** parv[1] = message text
*/
DLLFUNC int m_nachat(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
char *message;
message = parc > 1 ? parv[1] : NULL;
if (BadPtr(message))
{
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
me.name, parv[0], "NACHAT");
return 0;
}
#ifdef ADMINCHAT
if (MyClient(sptr))
if (!IsNetAdmin(sptr))
#else
if (MyClient(sptr))
#endif
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
}
sendto_server(IsServer(cptr) ? cptr : NULL, 0, 0, ":%s NACHAT :%s",
parv[0], message);
#ifdef ADMINCHAT
sendto_umode(UMODE_NETADMIN, "*** NetAdmin.Chat -- from %s: %s",
parv[0], message);
#endif
return 0;
}
+2 -2
View File
@@ -123,7 +123,7 @@ DLLFUNC CMD_FUNC(m_names)
chptr = find_channel(para, (aChannel *)NULL);
if (!chptr || (!ShowChannel(sptr, chptr) && !OPCanSeeSecret(sptr)))
if (!chptr || (!ShowChannel(sptr, chptr) && !OperClass_evaluateACLPath("override:see:names:secret",sptr,NULL,chptr,NULL)))
{
sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name,
parv[0], para);
@@ -157,7 +157,7 @@ DLLFUNC CMD_FUNC(m_names)
for (cm = chptr->members; cm; cm = cm->next)
{
acptr = cm->cptr;
if (IsInvisible(acptr) && !member && !IsNetAdmin(sptr))
if (IsInvisible(acptr) && !member && !OperClass_evaluateACLPath("override:see:names:invisible",sptr,acptr,chptr,NULL))
continue;
for (h = Hooks[HOOKTYPE_VISIBLE_IN_CHANNEL]; h; h = h->next)
+1 -1
View File
@@ -421,7 +421,7 @@ DLLFUNC CMD_FUNC(m_nick)
else
strlcpy(nick, parv[1], NICKLEN + 1);
if (MyConnect(sptr) && sptr->user && !IsAnOper(sptr))
if (MyConnect(sptr) && sptr->user && !OperClass_evaluateACLPath("immune:limits",sptr,NULL,NULL,NULL))
{
if ((sptr->user->flood.nick_c >= NICK_COUNT) &&
(TStime() - sptr->user->flood.nick_t < NICK_PERIOD))
+135 -198
View File
@@ -47,52 +47,6 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
#define MSG_OPER "OPER" /* OPER */
typedef struct oper_oflag_ {
unsigned long oflag;
long* umode; /* you just HAD to make them variables */
char** host;
char* announce;
} oper_oflag_t;
static oper_oflag_t oper_oflags[10];
static void init_operflags()
{
oper_oflags[0].oflag = OFLAG_NETADMIN;
oper_oflags[0].umode = &UMODE_NETADMIN;
oper_oflags[0].host = &netadmin_host;
oper_oflags[0].announce = "is now a network administrator (N)";
oper_oflags[1].oflag = OFLAG_SADMIN;
oper_oflags[1].umode = &UMODE_SADMIN;
oper_oflags[1].host = &sadmin_host;
oper_oflags[1].announce = "is now a services administrator (a)";
oper_oflags[2].oflag = OFLAG_ADMIN;
oper_oflags[2].umode = &UMODE_ADMIN;
oper_oflags[2].host = &admin_host;
oper_oflags[2].announce = "is now a server admin (A)";
oper_oflags[3].oflag = OFLAG_COADMIN;
oper_oflags[3].umode = &UMODE_COADMIN;
oper_oflags[3].host = &coadmin_host;
oper_oflags[3].announce = "is now a co administrator (C)";
oper_oflags[4].oflag = OFLAG_ISGLOBAL;
oper_oflags[4].umode = &UMODE_OPER;
oper_oflags[4].host = &oper_host;
oper_oflags[4].announce = "is now an operator (O)";
oper_oflags[5].oflag= OFLAG_GLOBOP;
oper_oflags[5].umode = &UMODE_FAILOP;
oper_oflags[5].host = NULL;
oper_oflags[5].announce = NULL;
oper_oflags[6].oflag = OFLAG_WALLOP;
oper_oflags[6].umode = &UMODE_WALLOP;
oper_oflags[6].host = NULL;
oper_oflags[6].announce = NULL;
oper_oflags[7].oflag = 0;
oper_oflags[7].umode = NULL;
oper_oflags[7].host = NULL;
oper_oflags[7].announce = NULL;
}
ModuleHeader MOD_HEADER(m_oper)
= {
"oper", /* Name of module */
@@ -113,7 +67,6 @@ DLLFUNC int MOD_INIT(m_oper)(ModuleInfo *modinfo)
/* Is first run when server is 100% ready */
DLLFUNC int MOD_LOAD(m_oper)(int module_load)
{
init_operflags();
return MOD_SUCCESS;
}
@@ -149,12 +102,12 @@ void set_oper_host(aClient *sptr, char *host)
** parv[2] = oper password
*/
DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
ConfigItem_oper *aconf;
char *name, *password;
char* host = 0;
int i = 0, j = 0;
char* announce = 0;
long old; /* old user modes */
if (!MyClient(sptr))
return 0;
@@ -174,13 +127,15 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
if (IsAnOper(sptr)) {
sendto_one(sptr, rpl_str(RPL_YOUREOPER),
me.name, parv[0]);
// TODO: de-confuse this ? ;)
return 0;
}
name = parv[1];
password = (parc >= 2) ? parv[2] : "";
if (!(aconf = Find_oper(name))) {
if (!(aconf = Find_oper(name)))
{
sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]);
sendto_snomask_global
(SNO_OPER, "Failed OPER attempt by %s (%s@%s) [unknown oper]",
@@ -204,152 +159,6 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
}
i = Auth_Check(cptr, aconf->auth, password);
if (i > 1)
{
int old = (sptr->umodes & ALL_UMODES);
/* Check oper::require_modes */
if (aconf->require_modes & ~sptr->umodes)
{
sendto_one(sptr, ":%s %d %s :You are missing user modes required to OPER", me.name, ERR_NOOPERHOST, parv[0]);
sendto_snomask_global
(SNO_OPER, "Failed OPER attempt by %s (%s@%s) [lacking modes '%s' in oper::require-modes]",
parv[0], sptr->user->username, sptr->sockhost, get_modestr(aconf->require_modes & ~sptr->umodes));
ircd_log(LOG_OPER, "OPER MISSINGMODES (%s) by (%s!%s@%s), needs modes=%s",
name, parv[0], sptr->user->username, sptr->sockhost,
get_modestr(aconf->require_modes & ~sptr->umodes));
sptr->since += 7;
return 0;
}
if (aconf->maxlogins && (count_oper_sessions(aconf->name) >= aconf->maxlogins))
{
sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]);
sendto_one(sptr, ":%s NOTICE %s :Your maximum number of concurrent oper logins has been reached (%d)",
me.name, sptr->name, aconf->maxlogins);
sendto_snomask_global
(SNO_OPER, "Failed OPER attempt by %s (%s@%s) using UID %s [maxlogins reached]",
parv[0], sptr->user->username, sptr->sockhost, name);
ircd_log(LOG_OPER, "OPER TOOMANYLOGINS (%s) by (%s!%s@%s)", name, parv[0],
sptr->user->username, sptr->sockhost);
sptr->since += 4;
return 0;
}
if (sptr->user->operlogin)
MyFree(sptr->user->operlogin);
sptr->user->operlogin = strdup(aconf->name);
/* Put in the right class */
if (sptr->class)
sptr->class->clients--;
sptr->class = aconf->class;
sptr->class->clients++;
sptr->oflag = 0;
if (aconf->swhois) {
if (sptr->user->swhois)
MyFree(sptr->user->swhois);
sptr->user->swhois = strdup(aconf->swhois);
sendto_server(cptr, 0, 0, ":%s SWHOIS %s :%s",
me.name, sptr->name, aconf->swhois);
}
/* new oper code */
if (aconf->modes)
sptr->umodes |= aconf->modes;
else
sptr->umodes |= OPER_MODES;
/* handle oflags that trigger umodes */
while(oper_oflags[j].umode) {
if(aconf->oflags & oper_oflags[j].oflag) { /* we match this oflag */
if (!announce && oper_oflags[j].announce) { /* we haven't matched an oper_type yet */
host = *oper_oflags[j].host; /* set the iNAH host */
announce = oper_oflags[j].announce; /* set the announcement */
}
sptr->umodes |=
*oper_oflags[j].umode; /* add the umode for this oflag */
}
j++;
}
sptr->oflag = aconf->oflags;
if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(host)) {
set_oper_host(sptr, host);
} else
if (IsHidden(sptr) && !sptr->user->virthost) {
/* +x has just been set by modes-on-oper and iNAH is off */
sptr->user->virthost = strdup(sptr->user->cloakedhost);
}
if (!IsOper(sptr))
{
sptr->umodes |= UMODE_LOCOP;
if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(locop_host)) {
set_oper_host(sptr, locop_host);
} else
if (IsHidden(sptr) && !sptr->user->virthost) {
/* +x has just been set by modes-on-oper and iNAH is off */
sptr->user->virthost = strdup(sptr->user->cloakedhost);
}
sendto_snomask(SNO_OPER, "%s (%s@%s) is now a local operator (o)",
parv[0], sptr->user->username, sptr->sockhost);
}
if (announce != NULL)
sendto_snomask_global(SNO_OPER,
"%s (%s@%s) [%s] %s",
parv[0], sptr->user->username, sptr->sockhost,
parv[1], announce);
if (aconf->snomask)
set_snomask(sptr, aconf->snomask);
else
set_snomask(sptr, OPER_SNOMASK);
if (sptr->user->snomask)
{
sptr->user->snomask |= SNO_SNOTICE; /* set +s if needed */
sptr->umodes |= UMODE_SERVNOTICE;
}
/* This is for users who have both 'admin' and 'coadmin' in their conf */
if (IsCoAdmin(sptr) && IsAdmin(sptr))
{
sptr->umodes &= ~UMODE_COADMIN;
sptr->oflag &= ~OFLAG_COADMIN;
}
send_umode_out(cptr, sptr, old);
sendto_one(sptr, rpl_str(RPL_SNOMASK),
me.name, parv[0], get_sno_str(sptr));
list_add(&sptr->special_node, &oper_list);
RunHook2(HOOKTYPE_LOCAL_OPER, sptr, 1);
sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]);
if (IsInvisible(sptr) && !(old & UMODE_INVISIBLE))
IRCstats.invisible++;
if (IsOper(sptr) && !IsHideOper(sptr))
IRCstats.operators++;
if (SHOWOPERMOTD == 1)
do_cmd(cptr, sptr, "OPERMOTD", parc, parv);
if (!BadPtr(OPER_AUTO_JOIN_CHANS)
&& strcmp(OPER_AUTO_JOIN_CHANS, "0"))
{
char *chans[3] = {
sptr->name,
OPER_AUTO_JOIN_CHANS,
NULL
};
if (do_cmd(cptr, sptr, "JOIN", 3, chans) == FLUSH_BUFFER)
return FLUSH_BUFFER;
}
ircd_log(LOG_OPER, "OPER (%s) by (%s!%s@%s)", name, parv[0], sptr->user->username,
sptr->sockhost);
}
if (i == -1)
{
sendto_one(sptr, err_str(ERR_PASSWDMISMATCH), me.name, parv[0]);
@@ -362,7 +171,135 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
(SNO_OPER, "Failed OPER attempt by %s (%s@%s) using UID %s [FAILEDAUTH]",
parv[0], sptr->user->username, sptr->sockhost, name);
sptr->since += 7;
return 0;
}
/* Belay that order, number One. (-2) */
if (i < 2)
return 0; /* anything below 2 means 'not really authenticated' */
/* Authentication of the oper succeeded (like, password, ssl cert),
* but we still have some other restrictions to check below as well,
* like 'require-modes' and 'maxlogins'...
*/
/* Check oper::require_modes */
if (aconf->require_modes & ~sptr->umodes)
{
sendto_one(sptr, ":%s %d %s :You are missing user modes required to OPER", me.name, ERR_NOOPERHOST, parv[0]);
sendto_snomask_global
(SNO_OPER, "Failed OPER attempt by %s (%s@%s) [lacking modes '%s' in oper::require-modes]",
parv[0], sptr->user->username, sptr->sockhost, get_modestr(aconf->require_modes & ~sptr->umodes));
ircd_log(LOG_OPER, "OPER MISSINGMODES (%s) by (%s!%s@%s), needs modes=%s",
name, parv[0], sptr->user->username, sptr->sockhost,
get_modestr(aconf->require_modes & ~sptr->umodes));
sptr->since += 7;
return 0;
}
if (aconf->maxlogins && (count_oper_sessions(aconf->name) >= aconf->maxlogins))
{
sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]);
sendto_one(sptr, ":%s NOTICE %s :Your maximum number of concurrent oper logins has been reached (%d)",
me.name, sptr->name, aconf->maxlogins);
sendto_snomask_global
(SNO_OPER, "Failed OPER attempt by %s (%s@%s) using UID %s [maxlogins reached]",
parv[0], sptr->user->username, sptr->sockhost, name);
ircd_log(LOG_OPER, "OPER TOOMANYLOGINS (%s) by (%s!%s@%s)", name, parv[0],
sptr->user->username, sptr->sockhost);
sptr->since += 4;
return 0;
}
/* /OPER really succeeded now. Start processing it. */
/* Store which oper block was used to become IRCOp (for maxlogins and whois) */
safefree(sptr->user->operlogin);
sptr->user->operlogin = strdup(aconf->name);
/* Put in the right class */
if (sptr->class)
sptr->class->clients--;
sptr->class = aconf->class;
sptr->class->clients++;
/* oper::swhois */
if (aconf->swhois)
{
safefree(sptr->user->swhois);
sptr->user->swhois = strdup(aconf->swhois);
sendto_server(cptr, 0, 0, ":%s SWHOIS %s :%s",
me.name, sptr->name, aconf->swhois);
}
/* set oper user modes */
sptr->umodes |= UMODE_OPER;
if (aconf->modes)
sptr->umodes |= aconf->modes; /* oper::modes */
else
sptr->umodes |= OPER_MODES; /* set::modes-on-oper */
/* oper::vhost */
if (aconf->vhost)
{
set_oper_host(sptr, aconf->vhost);
} else
if (IsHidden(sptr) && !sptr->user->virthost)
{
/* +x has just been set by modes-on-oper and no vhost. cloak the oper! */
sptr->user->virthost = strdup(sptr->user->cloakedhost);
}
sendto_snomask_global(SNO_OPER,
"%s (%s@%s) [%s] is now an operator",
parv[0], sptr->user->username, sptr->sockhost,
parv[1]);
ircd_log(LOG_OPER, "OPER (%s) by (%s!%s@%s)", name, parv[0], sptr->user->username,
sptr->sockhost);
/* set oper snomasks */
if (aconf->snomask)
set_snomask(sptr, aconf->snomask); /* oper::snomask */
else
set_snomask(sptr, OPER_SNOMASK); /* set::snomask-on-oper */
/* some magic to set user mode +s (and snomask +s) if you have any snomasks set */
if (sptr->user->snomask)
{
sptr->user->snomask |= SNO_SNOTICE;
sptr->umodes |= UMODE_SERVNOTICE;
}
old = (sptr->umodes & ALL_UMODES);
send_umode_out(cptr, sptr, old);
sendto_one(sptr, rpl_str(RPL_SNOMASK),
me.name, parv[0], get_sno_str(sptr));
list_add(&sptr->special_node, &oper_list);
RunHook2(HOOKTYPE_LOCAL_OPER, sptr, 1);
sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]);
/* Update statistics */
if (IsInvisible(sptr) && !(old & UMODE_INVISIBLE))
IRCstats.invisible++;
if (IsOper(sptr) && !IsHideOper(sptr))
IRCstats.operators++;
if (SHOWOPERMOTD == 1)
do_cmd(cptr, sptr, "OPERMOTD", parc, parv);
if (!BadPtr(OPER_AUTO_JOIN_CHANS) && strcmp(OPER_AUTO_JOIN_CHANS, "0"))
{
char *chans[3] = {
sptr->name,
OPER_AUTO_JOIN_CHANS,
NULL
};
if (do_cmd(cptr, sptr, "JOIN", 3, chans) == FLUSH_BUFFER)
return FLUSH_BUFFER;
}
return 0;
}
+1 -1
View File
@@ -99,7 +99,7 @@ DLLFUNC int m_rping(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
aClient *acptr;
if (!IsPrivileged(sptr))
if (!IsServer(sptr) && !OperClass_evaluateACLPath("server:rping",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+2 -2
View File
@@ -98,7 +98,7 @@ DLLFUNC CMD_FUNC(m_sajoin)
}
/* Is this user disallowed from operating on this victim at all? */
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath("sajoin",sptr,acptr,NULL,NULL))
if (!IsULine(sptr) && !OperClass_evaluateACLPath("sajoin",sptr,acptr,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -139,7 +139,7 @@ DLLFUNC CMD_FUNC(m_sajoin)
chptr = get_channel(acptr, name, 0);
/* If this _specific_ channel is not permitted, skip it */
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath("sajoin",sptr,acptr,chptr,NULL))
if (!IsULine(sptr) && !OperClass_evaluateACLPath("sajoin",sptr,acptr,chptr,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
continue;
+1 -1
View File
@@ -95,7 +95,7 @@ DLLFUNC CMD_FUNC(m_samode)
return 0;
}
if ((!IsPrivileged(cptr) || !IsSAdmin(sptr)) && !OperClass_evaluateACLPath("samode",sptr,NULL,chptr,NULL))
if (!OperClass_evaluateACLPath("samode",sptr,NULL,chptr,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+2 -2
View File
@@ -105,7 +105,7 @@ DLLFUNC CMD_FUNC(m_sapart)
}
/* See if we can operate on this vicim/this command */
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath("sapart",sptr,acptr,NULL,NULL))
if (!IsULine(sptr) && !OperClass_evaluateACLPath("sapart",sptr,acptr,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -127,7 +127,7 @@ DLLFUNC CMD_FUNC(m_sapart)
}
/* Validate oper can do this on chan/victim */
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath("sapart",sptr,acptr,chptr,NULL))
if (!IsULine(sptr) && !OperClass_evaluateACLPath("sapart",sptr,acptr,chptr,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
continue;
+1 -1
View File
@@ -81,7 +81,7 @@ DLLFUNC int MOD_UNLOAD(m_sdesc)(int module_unload)
int m_sdesc(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath("add:description",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("server:description",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name);
return 0;
+1 -1
View File
@@ -670,7 +670,7 @@ int m_server_synch(aClient *cptr, ConfigItem_link *aconf)
* Yeah.. there are still other cases when non-SSL links are fine (eg: local IP
* of the same machine), we won't bother with detecting that. -- Syzop
*/
if (strcmp(cptr->sockhost, "localhost"))
if (!IsLocal(cptr))
{
sendto_realops("\002WARNING:\002 This link is unencrypted (non-SSL). We highly recommend to use "
"SSL server linking. See https://www.unrealircd.org/docs/Linking_servers");
+3 -3
View File
@@ -85,7 +85,7 @@ CMD_FUNC(m_squit)
parv[parc - 1] : cptr->name;
if (!IsPrivileged(sptr))
if (!IsServer(sptr) && !OperClass_evaluateACLPath("route:local",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -146,8 +146,8 @@ CMD_FUNC(m_squit)
me.name, parv[0], server);
return 0;
}
if (MyClient(sptr) && ((!OPCanGRoute(sptr) && !MyConnect(acptr)) ||
(!OPCanLRoute(sptr) && MyConnect(acptr))))
if (MyClient(sptr) && ((!OperClass_evaluateACLPath("route:global",sptr,NULL,NULL,NULL) && !MyConnect(acptr)) ||
(!OperClass_evaluateACLPath("route:local",sptr,NULL,NULL,NULL) && MyConnect(acptr))))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -15
View File
@@ -615,7 +615,7 @@ int stats_oper(aClient *sptr, char *para)
sendto_one(sptr, rpl_str(RPL_STATSOLINE),
me.name, sptr->name,
'O', m->mask, oper_p->name,
oflagstr(oper_p->oflags),
"-",
oper_p->class->name? oper_p->class->name : "");
}
}
@@ -1320,20 +1320,6 @@ int stats_set(aClient *sptr, char *para)
sptr->name, SPAMFILTER_EXCEPT);
sendto_one(sptr, ":%s %i %s :check-target-nick-bans: %s", me.name, RPL_TEXT,
sptr->name, CHECK_TARGET_NICK_BANS ? "yes" : "no");
sendto_one(sptr, ":%s %i %s :hosts::global: %s", me.name, RPL_TEXT,
sptr->name, oper_host);
sendto_one(sptr, ":%s %i %s :hosts::admin: %s", me.name, RPL_TEXT,
sptr->name, admin_host);
sendto_one(sptr, ":%s %i %s :hosts::local: %s", me.name, RPL_TEXT,
sptr->name, locop_host);
sendto_one(sptr, ":%s %i %s :hosts::servicesadmin: %s", me.name, RPL_TEXT,
sptr->name, sadmin_host);
sendto_one(sptr, ":%s %i %s :hosts::netadmin: %s", me.name, RPL_TEXT,
sptr->name, netadmin_host);
sendto_one(sptr, ":%s %i %s :hosts::coadmin: %s", me.name, RPL_TEXT,
sptr->name, coadmin_host);
sendto_one(sptr, ":%s %i %s :hosts::host-on-oper-up: %i", me.name, RPL_TEXT, sptr->name,
iNAH);
RunHook2(HOOKTYPE_STATS, sptr, "S");
return 1;
}
+6
View File
@@ -469,6 +469,12 @@ int what, setflags;
if (MyClient(acptr) && !list_empty(&acptr->special_node))
list_del(&acptr->special_node);
/* User is no longer oper (after the goto below, anyway)...
* so remove all oper-only modes and snomasks.
*/
remove_oper_modes(acptr);
remove_oper_snomasks(acptr);
}
goto setmodex;
case 'H':
+1 -6
View File
@@ -101,12 +101,7 @@ long oldumodes;
list_del(&acptr->special_node);
oldumodes = acptr->umodes;
acptr->umodes &= ~(UMODE_OPER | UMODE_LOCOP |
UMODE_SADMIN | UMODE_ADMIN |
UMODE_NETADMIN |
UMODE_DEAF | UMODE_HIDEOPER | UMODE_FAILOP |
UMODE_COADMIN | UMODE_VICTIM);
acptr->oflag = 0;
remove_oper_modes(acptr);
remove_oper_snomasks(acptr);
send_umode_out(acptr, acptr, oldumodes);
RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0);
-174
View File
@@ -1,174 +0,0 @@
/*
* IRC - Internet Relay Chat, src/modules/m_svso.c
* (C) 2001 The UnrealIRCd Team
*
* svso command
*
* See file AUTHORS in IRC package for additional names of
* the programmers.
*
* 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.
*/
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_svso(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_SVSO "SVSO"
#define STAR1 OFLAG_SADMIN|OFLAG_ADMIN|OFLAG_NETADMIN|OFLAG_COADMIN
#define STAR2 OFLAG_ZLINE|OFLAG_HIDE
static int oper_access[] = {
~(STAR1 | STAR2), '*',
OFLAG_LOCAL, 'o',
OFLAG_GLOBAL, 'O',
OFLAG_REHASH, 'r',
OFLAG_DIE, 'D',
OFLAG_RESTART, 'R',
OFLAG_GLOBOP, 'g',
OFLAG_WALLOP, 'w',
OFLAG_LOCOP, 'l',
OFLAG_LROUTE, 'c',
OFLAG_GROUTE, 'L',
OFLAG_LKILL, 'k',
OFLAG_GKILL, 'K',
OFLAG_KLINE, 'b',
OFLAG_UNKLINE, 'B',
OFLAG_LNOTICE, 'n',
OFLAG_GNOTICE, 'G',
OFLAG_ADMIN, 'A',
OFLAG_SADMIN, 'a',
OFLAG_NETADMIN, 'N',
OFLAG_COADMIN, 'C',
OFLAG_ZLINE, 'z',
OFLAG_HIDE, 'H',
OFLAG_TKL, 't',
OFLAG_GZL, 'Z',
OFLAG_OVERRIDE, 'v',
OFLAG_DCCDENY, 'd',
OFLAG_ADDLINE, 'X',
OFLAG_TSCTL, 'T',
0, 0
};
ModuleHeader MOD_HEADER(m_svso)
= {
"m_svso",
"$Id$",
"command /svso",
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_svso)(ModuleInfo *modinfo)
{
CommandAdd(modinfo->handle, MSG_SVSO, m_svso, MAXPARA, 0);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_svso)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_svso)(int module_unload)
{
return MOD_SUCCESS;
}
/*
** m_svso - Stskeeps
** parv[0] = sender prefix
** parv[1] = nick
** parv[2] = options
*/
int m_svso(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
aClient *acptr;
long fLag;
if (!IsULine(sptr))
return 0;
if (parc < 3)
return 0;
if (!(acptr = find_person(parv[1], (aClient *)NULL)))
return 0;
if (!MyClient(acptr))
{
sendto_one(acptr, ":%s SVSO %s %s", parv[0], parv[1], parv[2]);
return 0;
}
if (*parv[2] == '+')
{
int *i, flag;
char *m = NULL;
for (m = (parv[2] + 1); *m; m++)
{
for (i = oper_access; (flag = *i); i += 2)
{
if (*m == (char) *(i + 1))
{
acptr->oflag |= flag;
break;
}
}
}
}
if (*parv[2] == '-')
{
fLag = acptr->umodes;
if (IsOper(acptr) && !IsHideOper(acptr))
{
IRCstats.operators--;
VERIFY_OPERCOUNT(acptr, "svso");
}
if (!list_empty(&acptr->special_node))
list_del(&acptr->special_node);
acptr->umodes &= ~(UMODE_OPER | UMODE_LOCOP | UMODE_SADMIN | UMODE_ADMIN | UMODE_COADMIN);
acptr->umodes &= ~(UMODE_NETADMIN);
acptr->umodes &= ~(UMODE_DEAF | UMODE_HIDEOPER | UMODE_VICTIM);
acptr->oflag = 0;
remove_oper_snomasks(acptr);
RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0);
send_umode_out(acptr, acptr, fLag);
}
return 0;
}
+14 -14
View File
@@ -193,7 +193,7 @@ DLLFUNC int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
if (IsServer(sptr))
return 0;
if ((!OPCanTKL(sptr) || !IsOper(sptr)) && !OperClass_evaluateACLPath("gline",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("tkl:gline",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
@@ -220,7 +220,7 @@ DLLFUNC int m_gzline(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsServer(sptr))
return 0;
if ((!OPCanGZL(sptr) || !IsOper(sptr)) && !OperClass_evaluateACLPath("zline:global",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("tkl:zline:global",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
sptr->name);
@@ -246,7 +246,7 @@ DLLFUNC int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsServer(sptr))
return 0;
if ((!OPCanTKL(sptr) || !IsOper(sptr)) && !OperClass_evaluateACLPath("shun",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("tkl:shun",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
sptr->name);
@@ -273,7 +273,7 @@ char *comment = ((parc > 2) && !BadPtr(parv[2])) ? parv[2] : "no reason";
char *name;
int remove = 0;
if (MyClient(sptr) && ((!OPCanTKL(sptr) || !IsOper(sptr))) && !OperClass_evaluateACLPath("shun:temporary",sptr,NULL,NULL,NULL))
if (MyClient(sptr) && (!OperClass_evaluateACLPath("tkl:shun:temporary",sptr,NULL,NULL,NULL)))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
sptr->name);
@@ -310,9 +310,9 @@ int remove = 0;
if (IsShunned(acptr))
{
sendnotice(sptr, "User '%s' already shunned", acptr->name);
} else if (IsAnOper(acptr))
} else if (OperClass_evaluateACLPath("immune:shun",acptr,NULL,NULL,NULL))
{
sendnotice(sptr, "You cannot tempshun '%s' because (s)he is an oper", acptr->name);
sendnotice(sptr, "You cannot tempshun '%s' because (s)he is an oper with 'immune:shun' privilege", acptr->name);
} else
{
SetShunned(acptr);
@@ -344,7 +344,7 @@ DLLFUNC int m_tkline(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsServer(sptr))
return 0;
if ((!OPCanKline(sptr) || !IsAnOper(sptr)) && !OperClass_evaluateACLPath("kline:local",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("tkl:kline:local:add",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
sptr->name);
@@ -393,7 +393,7 @@ DLLFUNC int m_tkline(aClient *cptr, aClient *sptr, int parc, char *parv[])
sptr->name, sptr->user->username, GetHost(sptr));
return 0;
}
if (!OPCanUnKline(sptr) && *parv[1] == '-')
if (!OperClass_evaluateACLPath("tkl:kline:remove",sptr,NULL,NULL,NULL) && *parv[1] == '-')
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -407,7 +407,7 @@ DLLFUNC int m_tzline(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsServer(sptr))
return 0;
if ((!OPCanZline(sptr) || !IsAnOper(sptr)) && !OperClass_evaluateACLPath("zline:local",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("tkl:zline:local:add",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
sptr->name);
@@ -764,7 +764,7 @@ char *err = NULL;
if (IsServer(sptr))
return 0;
if ((!OPCanTKL(sptr) || !IsOper(sptr)) && !OperClass_evaluateACLPath("spamfilter",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("spamfilter",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name);
return 0;
@@ -1363,7 +1363,7 @@ int _find_shun(aClient *cptr)
if (IsShunned(cptr))
return 1;
if (IsAdmin(cptr))
if (OperClass_evaluateACLPath("immune:shun",cptr,NULL,NULL,NULL))
return 1;
nowtime = TStime();
@@ -1456,7 +1456,7 @@ int _find_spamfilter_user(aClient *sptr, int flags)
{
char spamfilter_user[NICKLEN + USERLEN + HOSTLEN + REALLEN + 64]; /* n!u@h:r */
if (IsAnOper(sptr))
if (OperClass_evaluateACLPath("immune:spamfilter",sptr,NULL,NULL,NULL))
return 0;
spamfilter_build_user_string(spamfilter_user, sptr->name, sptr);
@@ -2403,7 +2403,7 @@ int _m_tkl(aClient *cptr, aClient *sptr, int parc, char *parv[])
break;
case '?':
if (IsAnOper(sptr))
if (OperClass_evaluateACLPath("server:info",sptr,NULL,NULL,NULL))
tkl_stats(sptr,0,NULL);
}
return 0;
@@ -2621,7 +2621,7 @@ long ms_past;
/* (note: using sptr->user check here instead of IsPerson()
* due to SPAMF_USER where user isn't marked as client/person yet.
*/
if (!sptr->user || IsAnOper(sptr) || IsULine(sptr))
if (!sptr->user || OperClass_evaluateACLPath("immune:spamfilter",sptr,NULL,NULL,NULL) || IsULine(sptr))
return 0;
for (tk = tklines[tkl_hash('F')]; tk; tk = tk->next)
+4 -4
View File
@@ -139,7 +139,7 @@ long flags = 0; /* cache: membership flags */
if (parc > 2 || SecretChannel(chptr))
{
if (!ismember && !IsServer(sptr)
&& !OPCanSeeSecret(sptr) && !IsULine(sptr))
&& !OperClass_evaluateACLPath("override:see:list:secret",sptr,NULL,chptr,NULL) && !IsULine(sptr))
{
sendto_one(sptr, err_str(ERR_NOTONCHANNEL),
me.name, parv[0], name);
@@ -241,7 +241,7 @@ long flags = 0; /* cache: membership flags */
is_chan_op(sptr, chptr))
{
#ifndef NO_OPEROVERRIDE
if ((MyClient(sptr) ? (!IsOper(sptr) || !OPCanOverride(sptr)) : !IsOper(sptr)))
if ((MyClient(sptr) ? (!IsOper(sptr) || !OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL)) : !IsOper(sptr)))
{
#endif
sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED),
@@ -258,7 +258,7 @@ long flags = 0; /* cache: membership flags */
{
char buf[512];
if (IsOper(sptr) && OPCanOverride(sptr))
if (IsOper(sptr) && OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
{
topicoverride(sptr, chptr, topic);
} else {
@@ -271,7 +271,7 @@ long flags = 0; /* cache: membership flags */
{
char buf[512];
if (IsOper(sptr) && OPCanOverride(sptr))
if (IsOper(sptr) && OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
{
topicoverride(sptr, chptr, topic);
} else {
+8 -17
View File
@@ -96,9 +96,9 @@ DLLFUNC CMD_FUNC(m_trace)
else
tname = me.name;
if (!IsOper(sptr) && !OperClass_evaluateACLPath("trace:global",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("trace:global",sptr,NULL,NULL,NULL))
{
if (IsAnOper(sptr) || OperClass_evaluateACLPath("trace:local",sptr,NULL,NULL,NULL))
if (OperClass_evaluateACLPath("trace:local",sptr,NULL,NULL,NULL))
{
/* local opers may not /TRACE remote servers! */
if (strcasecmp(tname, me.name))
@@ -145,7 +145,7 @@ DLLFUNC CMD_FUNC(m_trace)
link_u[acptr->from->fd]++;
#else
if (IsPerson(acptr) &&
(!IsInvisible(acptr) || IsOper(sptr) || OperClass_evaluateACLPath("trace:invisible_users",sptr,acptr,NULL,NULL)))
(!IsInvisible(acptr) || OperClass_evaluateACLPath("trace:invisible-users",sptr,acptr,NULL,NULL)))
link_u[acptr->from->fd]++;
#endif
else if (IsServer(acptr))
@@ -160,11 +160,7 @@ DLLFUNC CMD_FUNC(m_trace)
char *name;
char *class;
/* More bits of code to allow oers to see all users on remote traces
* if (IsInvisible(acptr) && dow &&
* if (dow &&
* !(MyConnect(sptr) && IsOper(sptr)) && */
if (!IsOper(sptr) && !OperClass_evaluateACLPath("trace:invisible_users",sptr,acptr,NULL,NULL) && !IsAnOper(acptr) && (acptr != sptr))
if (!OperClass_evaluateACLPath("trace:invisible-users",sptr,acptr,NULL,NULL) && (acptr != sptr))
continue;
if (!doall && wilds && match(tname, acptr->name))
continue;
@@ -195,15 +191,10 @@ DLLFUNC CMD_FUNC(m_trace)
/* Only opers see users if there is a wildcard
* but anyone can see all the opers.
*/
/* if (IsOper(sptr) &&
* Allow opers to see invisible users on a remote trace or wildcard
* search ... sure as hell helps to find clonebots. --Russell
* (MyClient(sptr) || !(dow && IsInvisible(acptr)))
* || !dow || IsAnOper(acptr)) */
if (IsOper(sptr) || OperClass_evaluateACLPath("trace:invisible_users",sptr,acptr,NULL,NULL) ||
(IsAnOper(acptr) && !IsInvisible(acptr)))
if (OperClass_evaluateACLPath("trace:invisible-users",sptr,acptr,NULL,NULL) ||
(!IsInvisible(acptr) && OperClass_evaluateACLPath("trace",sptr,acptr,NULL,NULL)))
{
if (IsAnOper(acptr))
if (OperClass_evaluateACLPath("trace",sptr,acptr,NULL,NULL) || OperClass_evaluateACLPath("trace:invisible-users",sptr,acptr,NULL,NULL))
sendto_one(sptr,
rpl_str(RPL_TRACEOPERATOR),
me.name,
@@ -263,7 +254,7 @@ DLLFUNC CMD_FUNC(m_trace)
* Add these lines to summarize the above which can get rather long
* and messy when done remotely - Avalon
*/
if (!IsAnOper(sptr) || !cnt)
if (!OperClass_evaluateACLPath("trace",sptr,acptr,NULL,NULL) || !cnt)
{
if (cnt)
return 0;
+2 -2
View File
@@ -91,7 +91,7 @@ DLLFUNC int m_tsctl(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (!MyClient(sptr))
goto doit;
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath("tsctl",sptr,NULL,NULL,NULL))
if (!OperClass_evaluateACLPath("server:tsctl",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
@@ -108,7 +108,7 @@ DLLFUNC int m_tsctl(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (stricmp(parv[1], "offset") == 0)
{
if (!OPCanTSCtl(sptr))
if (!OperClass_evaluateACLPath("server:tsctl:set",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -81,7 +81,7 @@ DLLFUNC CMD_FUNC(m_undccdeny)
if (!MyClient(sptr))
return 0;
if (!IsAnOper(sptr) || !OPCanDCCDeny(sptr))
if (!IsAnOper(sptr) || !OperClass_evaluateACLPath("client:dcc",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -82,7 +82,7 @@ DLLFUNC int MOD_UNLOAD(m_unkline)(int module_unload)
DLLFUNC int m_unkline(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
if (!MyClient(sptr) || !OPCanUnKline(sptr))
if (!MyClient(sptr) || !OperClass_evaluateACLPath("tkl:kline:remove",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -83,7 +83,7 @@ DLLFUNC int MOD_UNLOAD(m_unzline)(int module_unload)
DLLFUNC int m_unzline(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
if (!MyClient(sptr) || !OPCanZline(sptr))
if (!MyClient(sptr) || !OperClass_evaluateACLPath("tkl:zline:local:remove",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+1 -1
View File
@@ -87,7 +87,7 @@ DLLFUNC CMD_FUNC(m_wallops)
me.name, parv[0], "WALLOPS");
return 0;
}
if (MyClient(sptr) && !OPCanWallOps(sptr) && !OperClass_evaluateACLPath("chat:wallops",sptr,NULL,NULL,NULL))
if (MyClient(sptr) && !OperClass_evaluateACLPath("chat:wallops",sptr,NULL,NULL,NULL))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
+4 -4
View File
@@ -356,7 +356,7 @@ int i = 1;
}
if (!IsAnOper(sptr))
*umodes = *umodes & (UMODE_OPER | UMODE_LOCOP | UMODE_SADMIN | UMODE_ADMIN | UMODE_COADMIN | UMODE_NETADMIN);
*umodes = *umodes & UMODE_OPER; /* these are usermodes regular users may search for. just oper now. */
if (*umodes == 0)
return -1;
}
@@ -614,7 +614,7 @@ char has_common_chan = 0;
static void do_channel_who(aClient *sptr, aChannel *channel, char *mask)
{
Member *cm = channel->members;
if (IsMember(sptr, channel) || IsNetAdmin(sptr))
if (IsMember(sptr, channel) || OperClass_evaluateACLPath("override:see:who:onchannel",sptr,NULL,channel,NULL))
who_flags |= WF_ONCHANNEL;
for (cm = channel->members; cm; cm = cm->next)
@@ -777,7 +777,7 @@ static void send_who_reply(aClient *sptr, aClient *acptr,
host = GetHost(acptr);
if (IsULine(acptr) && !IsOper(sptr) && !OperClass_evaluateACLPath("who:ulines",sptr,acptr,NULL,NULL) && HIDE_ULINES)
if (IsULine(acptr) && !IsOper(sptr) && !OperClass_evaluateACLPath("map:ulines",sptr,acptr,NULL,NULL) && HIDE_ULINES)
sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name,
channel, /* channel name */
acptr->user->username, /* user name */
@@ -845,7 +845,7 @@ static char *first_visible_channel(aClient *sptr, aClient *acptr, int *flg)
if (ret == EX_DENY)
showchannel = 0;
if (!showchannel && (OPCanSeeSecret(sptr) || OperClass_evaluateACLPath("override:whois",sptr,NULL,chptr,NULL)))
if (!showchannel && (OperClass_evaluateACLPath("override:see:who:secret",sptr,NULL,chptr,NULL) || OperClass_evaluateACLPath("override:see:whois",sptr,NULL,chptr,NULL)))
{
showchannel = 1; /* OperOverride */
operoverride = 1;
+10 -12
View File
@@ -217,7 +217,7 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (ret == EX_DENY)
showchannel = 0;
if (!showchannel && (OPCanSeeSecret(sptr) || OperClass_evaluateACLPath("override:whois",sptr,NULL,chptr,NULL)))
if (!showchannel && (OperClass_evaluateACLPath("override:see:whois",sptr,NULL,chptr,NULL)))
{
showchannel = 1; /* OperOverride */
operoverride = 1;
@@ -316,15 +316,7 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsAnOper(acptr) && !hideoper)
{
buf[0] = '\0';
if (IsNetAdmin(acptr))
strlcat(buf, "a Network Administrator", sizeof buf);
else if (IsSAdmin(acptr))
strlcat(buf, "a Services Administrator", sizeof buf);
else if (IsAdmin(acptr) && !IsCoAdmin(acptr))
strlcat(buf, "a Server Administrator", sizeof buf);
else if (IsCoAdmin(acptr))
strlcat(buf, "a Co Administrator", sizeof buf);
else if (IsOper(acptr))
if (IsOper(acptr))
strlcat(buf, "an IRC Operator", sizeof buf);
else
@@ -332,9 +324,15 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (buf[0])
{
if (IsOper(sptr) && MyClient(acptr))
{
char *operclass = "???";
ConfigItem_oper *oper = Find_oper(acptr->user->operlogin);
if (oper && oper->operclass)
operclass = oper->operclass;
sendto_one(sptr,
":%s 313 %s %s :is %s (%s)", me.name,
parv[0], name, buf, acptr->user->operlogin);
":%s 313 %s %s :is %s (%s) [%s]", me.name,
parv[0], name, buf, acptr->user->operlogin, operclass);
}
else
sendto_one(sptr,
rpl_str(RPL_WHOISOPERATOR), me.name,
+58
View File
@@ -0,0 +1,58 @@
#************************************************************************
#* IRC - Internet Relay Chat, src/modules/snomasks/Makefile
#* Copyright (C) The UnrealIRCd 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.
#*/
INCLUDES = ../../include/auth.h ../../include/badwords.h ../../include/channel.h \
../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \
../../include/dynconf.h ../../include/events.h ../../include/fdlist.h ../../include/h.h \
../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \
../../include/license.h ../../include/macros.h \
../../include/modules.h ../../include/modversion.h ../../include/msg.h \
../../include/numeric.h ../../include/proto.h ../../include/res.h \
../../include/resource.h ../../include/setup.h ../../include/sjoin.h \
../../include/sock.h ../../include/ssl.h ../../include/struct.h ../../include/sys.h \
../../include/threads.h ../../include/types.h ../../include/url.h \
../../include/version.h ../../include/whowas.h
R_MODULES=\
dccreject.so
MODULES=$(R_MODULES)
MODULEFLAGS=@MODULEFLAGS@
CC=@CC@
RM=@RM@
all: build
build: $(MODULES)
custommodule: $(MODULEFILE).c
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o $(MODULEFILE).so $(MODULEFILE).c $(EXLIBS)
clean:
$(RM) -f *.o *.so *~ core
#############################################################################
# .so's section
#############################################################################
dccreject.so: dccreject.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o dccreject.so dccreject.c
+70
View File
@@ -0,0 +1,70 @@
/*
* Show DCC SEND rejection notices (Snomask +D)
* (C) Copyright 2000-.. Bram Matthys (Syzop) and the UnrealIRCd 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.
*/
#include "unrealircd.h"
/* Module header */
ModuleHeader MOD_HEADER(dccreject)
= {
"snomasks/dccreject",
"$Id$",
"Snomask +D",
"3.2-b8-1",
NULL
};
/* Global variables */
long SNO_DCCREJECT = 0L;
/* Forward declarations */
int dccreject_dcc_denied(aClient *sptr, aClient *target, char *realfile, char *displayfile, ConfigItem_deny_dcc *dccdeny);
DLLFUNC int MOD_TEST(dccreject)(ModuleInfo *modinfo)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_INIT(dccreject)(ModuleInfo *modinfo)
{
SnomaskAdd(modinfo->handle, 'D', 1, umode_allow_opers, &SNO_DCCREJECT);
HookAddEx(modinfo->handle, HOOKTYPE_DCC_DENIED, dccreject_dcc_denied);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(dccreject)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(dccreject)(int module_unload)
{
return MOD_SUCCESS;
}
int dccreject_dcc_denied(aClient *sptr, aClient *target, char *realfile, char *displayfile, ConfigItem_deny_dcc *dccdeny)
{
sendto_snomask_global(SNO_DCCREJECT,
"%s tried to send forbidden file %s (%s) to %s (is blocked now)",
sptr->name, displayfile, dccdeny->reason, target->name);
return 0;
}
+2
View File
@@ -40,6 +40,8 @@ DLLFUNC int MOD_INIT(ssl_antidos)(ModuleInfo *modinfo)
{
HookAddEx(modinfo->handle, HOOKTYPE_HANDSHAKE, ssl_antidos_handshake);
MARK_AS_OFFICIAL_MODULE(modinfo);
ModuleSetOptions(modinfo->handle, MOD_OPT_PERM, 1);
/* Note that we cannot be MOD_OPT_PERM_RELOADABLE as we use OpenSSL functions to register
* an index and callback function.
+1 -1
View File
@@ -1,6 +1,6 @@
#************************************************************************
#* IRC - Internet Relay Chat, src/modules/usermodes/Makefile
#* Copyright (C) Carsten V. Munk 2001 & The UnrealIRCd team
#* Copyright (C) The UnrealIRCd 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
+1 -1
View File
@@ -48,7 +48,7 @@ DLLFUNC int MOD_TEST(bot)(ModuleInfo *modinfo)
DLLFUNC int MOD_INIT(bot)(ModuleInfo *modinfo)
{
UmodeAdd(modinfo->handle, 'B', UMODE_GLOBAL, NULL, &UMODE_BOT);
UmodeAdd(modinfo->handle, 'B', UMODE_GLOBAL, 0, NULL, &UMODE_BOT);
HookAddEx(modinfo->handle, HOOKTYPE_WHOIS, bot_whois);
HookAddEx(modinfo->handle, HOOKTYPE_WHO_STATUS, bot_who_status);
+1 -1
View File
@@ -65,7 +65,7 @@ DLLFUNC int MOD_INIT(censor)(ModuleInfo *modinfo)
MARK_AS_OFFICIAL_MODULE(modinfo);
UmodeAdd(modinfo->handle, 'G', UMODE_GLOBAL, NULL, &UMODE_CENSOR);
UmodeAdd(modinfo->handle, 'G', UMODE_GLOBAL, 0, NULL, &UMODE_CENSOR);
HookAddPCharEx(modinfo->handle, HOOKTYPE_PRE_USERMSG, censor_pre_usermsg);
+1 -1
View File
@@ -65,7 +65,7 @@ DLLFUNC int MOD_INIT(noctcp)(ModuleInfo *modinfo)
{
CmodeInfo req;
UmodeAdd(modinfo->handle, 'T', UMODE_GLOBAL, NULL, &UMODE_NOCTCP);
UmodeAdd(modinfo->handle, 'T', UMODE_GLOBAL, 0, NULL, &UMODE_NOCTCP);
HookAddPCharEx(modinfo->handle, HOOKTYPE_PRE_USERMSG, noctcp_preusermsg);
+2 -2
View File
@@ -45,7 +45,7 @@ DLLFUNC int MOD_TEST(nokick)(ModuleInfo *modinfo)
DLLFUNC int MOD_INIT(nokick)(ModuleInfo *modinfo)
{
UmodeAdd(modinfo->handle, 'q', UMODE_GLOBAL, umode_allow_opers, &UMODE_NOKICK); // TODO: limit more!!
UmodeAdd(modinfo->handle, 'q', UMODE_GLOBAL, 1, umode_allow_opers, &UMODE_NOKICK); // TODO: limit more!!
HookAddEx(modinfo->handle, HOOKTYPE_CAN_KICK, nokick_can_kick);
@@ -68,7 +68,7 @@ int nokick_can_kick(aClient *sptr, aClient *target, aChannel *chptr, char *comme
{
static char errmsg[NICKLEN+32];
if (IsNokick(target) && !IsULine(sptr) && MyClient(sptr) && !IsNetAdmin(sptr))
if (IsNokick(target) && !IsULine(sptr) && MyClient(sptr) && !OperClass_evaluateACLPath("override:kick:nokick",sptr,target,chptr,NULL))
{
ircsnprintf(errmsg, sizeof(errmsg), err_str(ERR_CANNOTDOCOMMAND),
me.name, sptr->name, "KICK",
+1 -1
View File
@@ -39,7 +39,7 @@ int privacy_see_channel_in_whois(aClient *sptr, aClient *target, aChannel *chptr
DLLFUNC int MOD_INIT(privacy)(ModuleInfo *modinfo)
{
UmodeAdd(modinfo->handle, 'p', UMODE_GLOBAL, umode_allow_all, &UMODE_PRIVACY);
UmodeAdd(modinfo->handle, 'p', UMODE_GLOBAL, 0, umode_allow_all, &UMODE_PRIVACY);
HookAddEx(modinfo->handle, HOOKTYPE_SEE_CHANNEL_IN_WHOIS, privacy_see_channel_in_whois);

Some files were not shown because too many files have changed in this diff Show More