mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 18:54:46 +02:00
3-2beta13
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@
|
||||
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
|
||||
|
||||
Configuration Program
|
||||
for Unreal3.2-Selene(beta12)
|
||||
for Unreal3.2-beta13
|
||||
|
||||
This program will help you to compile your IRC server, and ask you
|
||||
questions regarding the compile-time settings of it during the process.
|
||||
|
||||
+39
-3
@@ -1,11 +1,11 @@
|
||||
|
||||
Unreal3.2-Selene (BETA12) Release Notes
|
||||
Unreal3.2-beta13 Release Notes
|
||||
======================================
|
||||
|
||||
I M P O R T A N T R E A D I N G
|
||||
(YES, YOU WILL NEED TO READ ALL OF THIS)
|
||||
|
||||
* Unreal3.2-Selene is a lot different than Unreal3.1.1. Forget all you have
|
||||
* Unreal3.2 is a lot different than Unreal3.1.1. Forget all you have
|
||||
learned about setting up Unreal3.1.1 - this is a lot different. We have got
|
||||
a new configuration format that integrates all the former config files,
|
||||
ircd.conf, vhost.conf, chrestrict.conf, unrealircd.conf, into to one new
|
||||
@@ -164,7 +164,7 @@ Unreal3.2-Selene (BETA12) Release Notes
|
||||
kick" ban override and joining a +s channel without realizing it is +s and therefore you
|
||||
shouldn't know it exists.
|
||||
|
||||
* If you use the SSL features of Unreal, you should use OpenSSL 0.9.6e or later. This is
|
||||
* If you use the SSL features of Unreal, you should use OpenSSL 0.9.6g or later. This is
|
||||
important as the older versions may make the program exploitable. See
|
||||
http://www.openssl.org for more information
|
||||
|
||||
@@ -182,6 +182,14 @@ Unreal3.2-Selene (BETA12) Release Notes
|
||||
(http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html), and EGD
|
||||
(http://egd.sourceforge.net). Other EGD compatible programs should work as well.
|
||||
|
||||
* Added Authentication method 'sslclientcert', the "password" parameter is
|
||||
used as a filename which it loads a X509 client certificate from and
|
||||
compares with the SSL client certificate (if provided). Example in an
|
||||
oper {}:
|
||||
password "clientcertificate.stskeeps.pem" { sslclientcert; };
|
||||
In this event, the parameter of /oper login is not used, but must be
|
||||
provided anyway, so for example do OPER login *
|
||||
|
||||
* We have created a new complete set of docs! doc/unreal32docs.html is now a complete
|
||||
set of docs! It is still not finished, however it contains atleast what was already
|
||||
avail. in the other doc files.
|
||||
@@ -190,5 +198,33 @@ Unreal3.2-Selene (BETA12) Release Notes
|
||||
* We have removed ./Setup - Please read the new docs for information on configuring &
|
||||
setting up Unreal3.2
|
||||
|
||||
* Removed makeconf - Read the docs to make a config file
|
||||
|
||||
* Added set::ssl::options with the following options:
|
||||
fail-if-no-clientcert - If SSL client connects and doesn't provide a client
|
||||
certificate, abort connection immediately
|
||||
verify-certificate - Check the certificate's validity using X509 methods, check if
|
||||
we trust CA's, etc.
|
||||
It however does slip self signed certificates through UNLESS
|
||||
no-self-signed - Don't allow self-signed certificates through (requires
|
||||
verify-certificate)
|
||||
|
||||
* Added the ability specify which CA's are trusted using set::ssl::trusted-ca-file
|
||||
|
||||
* A new configuration system has been added. The system is a bit more strict (meaning it
|
||||
will complain more often) but it will never crash due to configuration errors, just
|
||||
display a message saying errors exist.
|
||||
|
||||
* SVSLUSERS was added to all U:lines to change local and global max user counts (this is
|
||||
NOT meant so you can make the max count higher than it really should be.)
|
||||
|
||||
* A new oper flag, can_override/v has been added. This is an attempt to stop oper abuse.
|
||||
All opers can no longer use oper-override, this oflag MUST be in place for oper-override
|
||||
to be allowed. Can_override is NOT assumed to be present no matter what your flags,
|
||||
meaning you could be +N but still not be allowed to use oper-override.
|
||||
|
||||
* UNKLINE and UNZLINE have been removed in favor of a system like G:lines, to remove you
|
||||
now /kline -user@host or /zline -user@host
|
||||
|
||||
* MAKE SURE YOU RERUN ./Config AND RUN make clean BEFORE USING THIS VERSION!!!
|
||||
|
||||
|
||||
@@ -4,14 +4,12 @@
|
||||
| some kind of Certification Authority (CA), so your users can check that |
|
||||
| they are really connected to the real server, so they feel secure? |
|
||||
| |
|
||||
| An initiative has been started, to help this problem, as more and more |
|
||||
| SSL-enabled IRC servers will be started in the future, and people will |
|
||||
| have trouble authenticating that they are really at the right server. |
|
||||
| This initiative is called OpenIRC CA - They offer you to sign |
|
||||
| SSL certificates for use with your IRCd for free, |
|
||||
| so your users can be sure that they can trust you and your server. |
|
||||
| To get a signed certificate from them please visit the website |
|
||||
| http://www.openirc-ca.eu.org |
|
||||
| There is an initiative at CACert.org - They offer SSL Certificates |
|
||||
| for use with your IRCd for free, so your users can be sure that they |
|
||||
| can trust you and your server. |
|
||||
| |
|
||||
| To get a free signed certificate please visit http://www.CACert.org |
|
||||
| _________________________|
|
||||
| | Press enter to continue |
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
[ Unreal3.2-Selene ]
|
||||
[ Unreal3.2 ]
|
||||
- Fixed a _serious_ bug in SERVER command, reported by Valen, Forrester,
|
||||
M0rpheus, JK, and Hiten.
|
||||
- Fixed /botserv problem
|
||||
@@ -1554,3 +1554,168 @@ seen. gmtime warning still there
|
||||
- Made so every join is a SJOIN to prevent TS0 problems. Read config.h to disable this if it causes problems
|
||||
- Added set::static-quit to unreal32docs.html
|
||||
- Updated docs to include ripemd-160 encryption option
|
||||
** beta12 released **
|
||||
- Fixed problem where SSL handshakes weren't unknown--'ed on remove reported
|
||||
by Alzirr
|
||||
- Compile fix regarding above fix
|
||||
- Added vhost::swhois requested by FrostByghte (#0000171)
|
||||
- Fixed a win32 password encryption bug when in NT service mode reported by simonbell
|
||||
(#0000285)
|
||||
- Fixed a problem with set::ssl::certificate and set::ssl::key that used
|
||||
->ce_varname instead of ->ce_vardata. Found by badSol
|
||||
- Added a newline in dynconf.h
|
||||
- SSL debugging stuff
|
||||
- Added some more debugging stuff, made check_pings a little more readable
|
||||
- More SSL debugging stuff..
|
||||
- A minor fix in SSL_is_inited stuff in s_bsd
|
||||
- Fixed a bug with installing unreal as a services under NT4 reported by peter (#0000295)
|
||||
- Added the oper login the user has /oper'ed to in the 'is now an operator'
|
||||
notice. Suggested by havlaz (#0000287)
|
||||
- Fixed a bug where aliases {} didn't use tokens reported by havlaz (#0000288)
|
||||
- Fixed a win32 editor bug when using chars with an ASCII code > 128, reported by XircNet
|
||||
(#0000298)
|
||||
- Fixed a bug in TKL found by DerAlSem where it was possible to add a line for *@* (#0000307)
|
||||
- Fixed a /who bug where /who +c #chan wouldn't display the name of the channel
|
||||
requested reported by aproxity (#0000304)
|
||||
- Fixed a bug where /who +c #chan would let you see users in a +s channel
|
||||
- Added Nugget's setuid patch
|
||||
- Made the IRC_UID stuff more proper..
|
||||
- Removed some old debug code from the win32 debugger
|
||||
- Compile warning cleanups
|
||||
- Made the win32 version default to unsigned chars, and the linux version do the same under gcc
|
||||
- Added Syzop's various zero-terminate patches and fixes for crashes when
|
||||
you send commands like JOIN from a server directly
|
||||
- Made channel keys be case sensitive
|
||||
- Fixed a bug with /who -h in some cases, found by Zer0, fixed by butter (#0000361)
|
||||
- Changed auth method sslpubkey into sslclientcert, which means it will check the X509 certificate of the
|
||||
user using X509_cmp. Also needing is some policy/conf setting to adjust if to reject invalid client certificates or whatever..
|
||||
- Added set::ssl::options, with three options:
|
||||
fail-if-no-clientcert - If SSL client connects and doesn't provide a client certificate, abort connection immediately
|
||||
verify-certificate - Check the certificate's validity using X509 methods, check if we trust CA's, etc.
|
||||
It however does slip self signed certificates through UNLESS
|
||||
no-self-signed - Don't allow self-signed certificates through (requires verify-certificate)
|
||||
- Made conf parser mention if we make a link->options with CONNECT_SSL if we don't support SSL (and remove the CONNECT_SSL flag)
|
||||
- Made conf parser mention if we make a SSL listener and we don't support SSL
|
||||
- Added set::ssl::trusted-ca-file, if enabled, it will point the SSL stuff to use that file as trusted CA's (for verify-certificate)
|
||||
- Made conf _not_ bitch that it doesn't know set::ssl
|
||||
- Removed some leftover client certificate stuff
|
||||
- Fixed bug #0000372 reported by MorPheus where Killed (<everything-but-the-first-char-in-killer-letter-got-shown> (reason))
|
||||
- Fixed bug #0000377 reported by MorPheus where IPs of servers were shown in nick collision notices
|
||||
- Fixed bug #0000371 reported by havlaz about an extra \n slipped in with the TKL notice
|
||||
- Fixed bug with all TKL commands not accepting nicks anymore (#0000370 reported by Ravage)
|
||||
- Fixed bug #0000342 reported by James LiGate about tokens leaking through from clients
|
||||
- Removed some IPv6 resolver specifics that seemed illogical (reference to Jollino's IPv6 crashes)
|
||||
- Fixed crash bug in m_tkl_line found by Keeper
|
||||
- Fixed another m_tkl_line bug found by Keeper
|
||||
- Fixed an samode bug reported by mcskaf (#0000403)
|
||||
- Added the ability to /lusers server.name to get the lusers reply of another server
|
||||
suggested by tony0man (#0000373)
|
||||
- Fixed a bug where /htm would report "no such server" when used locally, reported by
|
||||
jollino (#0000343)
|
||||
- Possibly fixed some crash bugs in scan_socks and scan_http in Win32 reported by
|
||||
UrLoverGuy13 and Xose (#0000389)
|
||||
- Documentation - Updatet sec2.0 - list of Supported OS's for Win32 Version
|
||||
- Documentation - Updated sec1.1 - Instructed to use bugs.unrealircd.org to report problems with docs
|
||||
- Documentation - Updated misc hyperlinks - doc/unreal32docs.html
|
||||
- Documentation - Updated sec3.31 - Added better description to the format we present set:: settings
|
||||
- Documentation - Updated sec3.31 - Added more details to set directives
|
||||
- Documentation - Updated sec3.25 - Added option vhost::swhois to section 3.25 Vhost block
|
||||
- Documentation - Replaced text vair {} with <> to prevent confusion.
|
||||
- Documentation - Documented that lusers now supports remote servers
|
||||
- Documentation - Corrected vhost::from example as reported by joolz (#0000329 )
|
||||
- Documentation - Corrected set::scan:messages, currently listed as set::messages - as reported by joolz (#0000329)
|
||||
- Documentation - Added channel mode t & description as reported by stfcs (#0000315)
|
||||
- example.conf - Corrected incorrect set::services-services statment in alias block - reported by mcskaf (#0000401)
|
||||
- Documentation - Corrected Spelling mistake in HTM mode - Reported by CoNfOuNd (#0000387)
|
||||
- Documentation - Added coadmin to table of oper types - Reported by FrostByghte (#0000359)
|
||||
- Documentation - Corrected several HTML formating problems
|
||||
- Commited first 20% of conf3, if anyone runs devel, DO NOT, it is BROKEN and will most likely NOT FUNCTION
|
||||
and it WILL burn, DIE, and WILL NOT WORK
|
||||
- Fixed conf3 bug with _conf_except tkl
|
||||
- /kline and /zline now use TKL
|
||||
- Removed src/win32/unrealinstssl.iss and merged it into unrealinst.iss, add #define
|
||||
USE_SSL to the file to build an SSL package
|
||||
- Added additional NT Service options to the win32 installer
|
||||
- Made CLIENT_FLOOD more customizable
|
||||
- Fixed some conf3 compile errors and block-modded _*_tld
|
||||
- Fixed stats bug reported by RaYmAn
|
||||
- Added a patch by McSkaf that will hopefully fix the win32 resolver crashes
|
||||
- Converted badword to conf3
|
||||
- Fixed some win32 problems with conf3
|
||||
- Fixed a problem in config testing with conf3
|
||||
- Modified the main conf3 searching routine to use a binary search, this should speed up
|
||||
config processing somewhat
|
||||
- Converted the config flag parsing systems to use a binary search
|
||||
- Conf3 cleanups
|
||||
- Converted help and log to conf3
|
||||
- Fixed a configure script bug involving gcc3 (#0000398, #0000412, #0000433) found and
|
||||
fixed by mister
|
||||
- Fixed alphabeticalising of named oper flags, added _conf/test_link
|
||||
- Finished up conf3, still needing some directives added but it sortof works. Rehash doesn't yet.
|
||||
- Fixed some idiotic lack of src/modules/Makefile.in changes for the sake of commands.so when
|
||||
/zline /kline etc was moved to a module
|
||||
- Converted _conf_alias to conf3, in the process changed the format to be slightly more
|
||||
stable. See aliases/aliases.conf for the format changes
|
||||
- Numerous Sts-coded-conf3-while-sick bugs
|
||||
- Added SVSLUSERS, allows changing of local/global max users. This is designed so services
|
||||
can make sure all servers report the same global max and that a local max can be adjusted
|
||||
if for example a clone flood occurs. It is NOT designed to make the max count higher than
|
||||
you actually have.
|
||||
- Fixed a bug in the win32 debugger where the contents of the core file were not written
|
||||
until ok was clicked. Reported by Simon Bell.
|
||||
- Added an operflag can_override (v) only opers with this flag are allowed to use
|
||||
oper-override.
|
||||
- Fixed a bug in SVSO where the t and Z flags could not be removed.
|
||||
- Updated .RELEASE.NOTES to include can_override
|
||||
- Fixed a bug where if set::help-channel was missing it was reported twice.
|
||||
- Made modules able to have configuration directives in conf3. The system to do this is
|
||||
completely new and works differently. All remnants of the old system have been removed.
|
||||
- Changed the module config system slightly to be able to detect more errors.
|
||||
- /rehash for conf3 (that works) :)
|
||||
- Fixed win32 compile error with default: ;
|
||||
- Fixed several conf3 errors
|
||||
- Converted deny {} to conf3, in the process added some extra crule functions to help
|
||||
report errors better
|
||||
- Fixed sendto_ routines to use slot number as index into sentalong array
|
||||
- Fixed a conf3 bug
|
||||
- Made alias {}'s get rehashed
|
||||
- Made modules correctly rehash, this involves adding a Mod_Test function to modules that
|
||||
need to perform configuration tests. This is currently only implimented for dynamic linking
|
||||
- Made the same system work under static linking. This (barring any bugs) should be the
|
||||
completion of conf3. :)
|
||||
- Fixed a bug where chmode +q users could not kick chmode +a users. (#0000459) reported by
|
||||
jollino.
|
||||
- Fixed serious bug in /who that caused the server to lock up (there's a ID
|
||||
for this, could someone find it). Beta13 SHOULD be a LOT nearer now
|
||||
- Small typo in config validation found by ins4ne
|
||||
- Changed the way return values work in conf3 to better report the number of errors that
|
||||
occurred.
|
||||
- Cleaned up some module code, also removed /module load|unload (just use /rehash)
|
||||
- Removed makeconf
|
||||
- Fixed errors in doc/example.conf and makenet
|
||||
- Fixed set::scan::bind-ip and set::scan::ban-time typos in unreal32docs.html
|
||||
- Changed set::scan:ban-time to set::scan::bantime and added set::scan::timeout in
|
||||
unreal32docs.html
|
||||
- Fixed some logical module rehash issues
|
||||
- Made config actually add listeners when rehashing (...) also you can now
|
||||
change listener flags using /rehash
|
||||
- Changed .SICI to point to cacert.org instead (patch by evilbunny)
|
||||
- Fixed an oper count bug with SVS2MODE reported by confused (#0000490)
|
||||
- Removed m_kline.c and m_zline.c these are now implimented as part of m_tkl.c
|
||||
- Implemented a patch by poisoner to log vhosts in connect/disconnect logging (#0000487)
|
||||
- Made some changes to the thread API to fix some win32 crashes
|
||||
- Changed resolver code to use IRCMutex macros.
|
||||
- Documentation updates (some reported by poisoner) (#0000493)
|
||||
- Fixed some problems with /kline when removing a K:line
|
||||
- Updated docs some more
|
||||
- Fixed a makefile.win32.ssl problem reported by WeeD
|
||||
- Changed version to beta13, updated docs
|
||||
- Check for connect() success/failure in scanners on all OSs.
|
||||
- Documentation updates
|
||||
- Added back the commands check that didn't get added in conf3 (lamers
|
||||
beware)
|
||||
- Fixed a typo in the module system
|
||||
- Fixed exception in scanner on Windows
|
||||
- Changed base version name to Unreal3.2, instead of Unreal3.2-Selene
|
||||
- Made McSkaf part of core coder team
|
||||
*** beta13 released ***
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
===============================================
|
||||
= UnrealIRCd v3.2-Selene (beta12) =
|
||||
= UnrealIRCd v3.2 (beta13) =
|
||||
===============================================
|
||||
Was brought to you by:
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
* Griever <griever@unrealircd.com>
|
||||
* Luke <luke@unrealircd.com>
|
||||
* nighthawk <nighthawk@unrealircd.com>
|
||||
* McSkaf <mcskaf@unrealircd.org>
|
||||
|
||||
Coders team:
|
||||
============
|
||||
* McSkaf <mcskaf@unrealircd.org>
|
||||
* Zogg <zogg@unrealircd.org>
|
||||
* NiQuiL <niquil@unrealircd.org>
|
||||
* assyrian <assyrian@unrealircd.org>
|
||||
@@ -65,4 +65,4 @@ latest devel:
|
||||
==============================================
|
||||
http://bugs.unrealircd.org
|
||||
|
||||
y
|
||||
|
||||
|
||||
+12
-6
@@ -2,11 +2,13 @@
|
||||
|
||||
alias identify {
|
||||
format "^#" {
|
||||
alias chanserv;
|
||||
nick chanserv;
|
||||
type services;
|
||||
parameters "IDENTIFY %1-";
|
||||
};
|
||||
format "^[^#]" {
|
||||
alias nickserv;
|
||||
nick nickserv;
|
||||
type services;
|
||||
parameters "IDENTIFY %1-";
|
||||
};
|
||||
type command;
|
||||
@@ -14,11 +16,13 @@ alias identify {
|
||||
|
||||
alias services {
|
||||
format "^#" {
|
||||
alias chanserv;
|
||||
nick chanserv;
|
||||
type services;
|
||||
parameters "%1-";
|
||||
};
|
||||
format "^[^#]" {
|
||||
alias nickserv;
|
||||
nick nickserv;
|
||||
type services;
|
||||
parameters "%1-";
|
||||
};
|
||||
type command;
|
||||
@@ -26,11 +30,13 @@ alias services {
|
||||
|
||||
alias register {
|
||||
format "^#" {
|
||||
alias chanserv;
|
||||
nick chanserv;
|
||||
type services;
|
||||
parameters "REGISTER %1-";
|
||||
};
|
||||
format "^[^#]" {
|
||||
alias nickserv;
|
||||
nick nickserv;
|
||||
type services;
|
||||
parameters "REGISTER %1-";
|
||||
};
|
||||
type command;
|
||||
|
||||
+1
-10
@@ -8,16 +8,7 @@ fi
|
||||
AC_CONFIG_HEADER(include/setup.h)
|
||||
AC_PROG_CC
|
||||
if test "$ac_cv_prog_gcc" = "yes"; then
|
||||
AC_CACHE_CHECK(if you have gcc 3.0 or higher, ac_cv_gcc3, [
|
||||
if test -z "`gcc -v 2>&1 |grep 'gcc version 3.'`"; then
|
||||
ac_cv_gcc3="no"
|
||||
else
|
||||
ac_cv_gcc3="yes"
|
||||
fi
|
||||
])
|
||||
if test "$ac_cv_gcc3" = "yes"; then
|
||||
CFLAGS="$CFLAGS -Wnone"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -funsigned-char"
|
||||
AC_CACHE_CHECK(if gcc has a working -pipe, ac_cv_pipe, [
|
||||
save_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
|
||||
@@ -1970,24 +1970,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||
echo "$as_me:$LINENO: checking if you have gcc 3.0 or higher" >&5
|
||||
echo $ECHO_N "checking if you have gcc 3.0 or higher... $ECHO_C" >&6
|
||||
if test "${ac_cv_gcc3+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
if test -z "`gcc -v 2>&1 |grep 'gcc version 3.'`"; then
|
||||
ac_cv_gcc3="no"
|
||||
else
|
||||
ac_cv_gcc3="yes"
|
||||
fi
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_gcc3" >&5
|
||||
echo "${ECHO_T}$ac_cv_gcc3" >&6
|
||||
if test "$ac_cv_gcc3" = "yes"; then
|
||||
CFLAGS="$CFLAGS -Wnone"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -funsigned-char"
|
||||
echo "$as_me:$LINENO: checking if gcc has a working -pipe" >&5
|
||||
echo $ECHO_N "checking if gcc has a working -pipe... $ECHO_C" >&6
|
||||
if test "${ac_cv_pipe+set}" = set; then
|
||||
|
||||
+21
-14
@@ -181,6 +181,7 @@ allow channel {
|
||||
W get_umodew
|
||||
^ can_stealth
|
||||
H get_host
|
||||
v can_override
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -374,7 +375,7 @@ log "ircd.log" {
|
||||
* };
|
||||
*/
|
||||
|
||||
// This points the command /nickserv to the user NickServ who is connected to the set::services-name server
|
||||
// This points the command /nickserv to the user NickServ who is connected to the set::services-server server
|
||||
/*alias NickServ {
|
||||
nick "NickServ";
|
||||
type services;
|
||||
@@ -405,7 +406,8 @@ alias StatServ { type stats; };
|
||||
* Syntax:
|
||||
* alias "name" {
|
||||
* format "format string" {
|
||||
* alias "points to";
|
||||
* nick "points to";
|
||||
* type aliastype;
|
||||
* parameters "parameters to send";
|
||||
* };
|
||||
* type command;
|
||||
@@ -417,11 +419,13 @@ alias StatServ { type stats; };
|
||||
/*
|
||||
alias "identify" {
|
||||
format "^#" {
|
||||
alias "chanserv";
|
||||
nick "chanserv";
|
||||
type services;
|
||||
parameters "IDENTIFY %1-";
|
||||
};
|
||||
format "^[^#]" {
|
||||
alias "nickserv";
|
||||
nick "nickserv";
|
||||
type services;
|
||||
parameters "IDENTIFY %1-";
|
||||
};
|
||||
type command;
|
||||
@@ -441,11 +445,13 @@ alias "identify" {
|
||||
/* Standard aliases */
|
||||
alias "services" {
|
||||
format "^#" {
|
||||
alias "chanserv";
|
||||
nick "chanserv";
|
||||
type services;
|
||||
parameters "%1-";
|
||||
};
|
||||
format "^[^#]" {
|
||||
alias "nickserv";
|
||||
nick "nickserv";
|
||||
type services;
|
||||
parameters "%1-";
|
||||
};
|
||||
type command;
|
||||
@@ -453,11 +459,13 @@ alias "services" {
|
||||
|
||||
alias "identify" {
|
||||
format "^#" {
|
||||
alias "chanserv";
|
||||
nick "chanserv";
|
||||
type services;
|
||||
parameters "IDENTIFY %1-";
|
||||
};
|
||||
format "^[^#]" {
|
||||
alias "nickserv";
|
||||
nick "nickserv";
|
||||
type services;
|
||||
parameters "IDENTIFY %1-";
|
||||
};
|
||||
type command;
|
||||
@@ -675,7 +683,6 @@ set {
|
||||
coadmin "coadmin.roxnet.org";
|
||||
admin "admin.roxnet.org";
|
||||
servicesadmin "csops.roxnet.org";
|
||||
techadmin "techadmin.roxnet.org"; /* depreciated */
|
||||
netadmin "netadmin.roxnet.org";
|
||||
host-on-oper-up "no";
|
||||
};
|
||||
@@ -694,16 +701,12 @@ set {
|
||||
retries 2s;
|
||||
};
|
||||
options {
|
||||
enable-opermotd;
|
||||
enable-chatops;
|
||||
hide-ulines;
|
||||
identd-check;
|
||||
show-connect-info;
|
||||
};
|
||||
|
||||
scan {
|
||||
ban-message "Insecure SOCKS server";
|
||||
quit-message "Insecure SOCKS server";
|
||||
/* Choose this to be some IP and some port that's always open and
|
||||
* reachable by the proxies
|
||||
*/
|
||||
@@ -716,7 +719,11 @@ set {
|
||||
* What message should we NOTICE to the users when we scan them
|
||||
*/
|
||||
message "<insert scan notice here> (admin didn't edit config correctly)";
|
||||
ban-time "4d";
|
||||
/* How long should we ban proxies for? */
|
||||
bantime 4d;
|
||||
/* How long should we wait to see if the host has a proxy? */
|
||||
timeout 15s;
|
||||
|
||||
};
|
||||
ssl {
|
||||
/* Reads entropy from the domain socket located at '~/entropy' */
|
||||
|
||||
+219
-142
@@ -1,21 +1,20 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>UnrealIRCd - 3.2-Selene - Offical Documentation</title>
|
||||
<title>UnrealIRCd - 3.2 - Offical Documentation</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div align="center"><strong><font size="7">UnrealIRCd</font></strong><br>
|
||||
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
|
||||
<font size="4">Version: 3.2-Selene</font><br>
|
||||
<strong>Complete Documentation</strong> – Rev: 1.1<br>
|
||||
<strong>Current Version:</strong> 3.2 Beta12<br>
|
||||
<strong>Released</strong>: 8/25/02 </div>
|
||||
<p><br>
|
||||
<font size="4">Version: 3.2</font><br>
|
||||
<strong>Complete Documentation</strong> – Rev: 1.1.2.10<br>
|
||||
<strong>Current Version:</strong> 3.2 Beta13<br>
|
||||
<strong>Released</strong>: 12/05/02 </div>
|
||||
<strong>Head Coders:</strong> Stskeeps / Codemastr<br>
|
||||
<strong>Coding Team</strong>: Grievre / Luke / nighthawk<br>
|
||||
<strong>Documentation:</strong> CKnight^</p>
|
||||
<strong>Documentation:</strong> CKnight^<br>
|
||||
<p>Due to the increasing complexity of UnrealIRCd3.2 We have switched to a easier
|
||||
to navigate, more inclusive documentation set. To view this documentation you
|
||||
must have a compatible browser, which are listed below. Up to date docs are
|
||||
@@ -84,14 +83,15 @@
|
||||
<p>If you have any feedback, comments, suggestions, please feel free to contact
|
||||
me with them, and I will do my best to work them in. My goal is to make Unreal3.2
|
||||
and its powerful features, easier to setup, and easier to use.</p>
|
||||
<p>If you find any part of these docs are incorrect, or typo/grammer/spelling
|
||||
errors, please goto <a href="http://bugs.unrealircd.org">http://bugs.unrealircd.org</a>
|
||||
and file a bug report, and I will be sure to get it corrected ASAP.</p>
|
||||
<p><strong>Email: </strong><a href="mailto://docs@unrealircd.com">docs@unrealircd.com</a></p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p><font size="+2"><strong>1.2 – Notes on current release</strong><a name="notesoncurrentrelease" id="notesoncurrentrelease"></a></font><br>
|
||||
</p>
|
||||
<p> <font size="-1">I M P O R T A N T R E A D I N G</font></p>
|
||||
<p><font size="-1">(YES, YOU WILL NEED TO READ ALL OF THIS)</font></p>
|
||||
<p><font size="-1">* Unreal3.2-Selene is a lot different than Unreal3.1.1. Forget
|
||||
<p><font size="-1">* Unreal3.2 is a lot different than Unreal3.1.1. Forget
|
||||
all you have learned about setting up Unreal3.1.1 - this is a lot different.
|
||||
We have got a new configuration format that integrates all the former config
|
||||
files,ircd.conf, vhost.conf, chrestrict.conf, unrealircd.conf, into to one newunrealircd.conf
|
||||
@@ -187,7 +187,8 @@
|
||||
for more info)</font></p>
|
||||
<p><font size="-1">* If you experience problems with the scanners, perhaps check
|
||||
out BOPM (http://www.blitzed.org/bopm)</font></p>
|
||||
<p><font size="-1">* log {} syslog support added (read doc/conf.doc for more info)</font></p>
|
||||
<p><font size="-1">* log {} syslog support added (read doc/unreal32docs.html for
|
||||
more info)</font></p>
|
||||
<p><font size="-1">* Added ripemd-160 password encryption support</font></p>
|
||||
<p><font size="-1">* Enabled sha1 and md5 password encryption on Win32 regardless
|
||||
of whether SSL is used.</font></p>
|
||||
@@ -238,6 +239,32 @@
|
||||
<p><font size="-1">* We have removed ./Setup - Please read the new docs for information
|
||||
on configuring &<br>
|
||||
setting up Unreal3.2</font></p>
|
||||
<p><font size="-1">* Removed makeconf - Read the docs to make a config file</font></p>
|
||||
<p><font size="-1">* Added set::ssl::options with the following options:<br>
|
||||
fail-if-no-clientcert - If SSL client connects and doesn't provide a client<br>
|
||||
certificate, abort connection immediately<br>
|
||||
verify-certificate - Check the certificate's validity using X509 methods, check if<br>
|
||||
we trust CA's, etc. <br>
|
||||
It however does slip self signed certificates through UNLESS<br>
|
||||
no-self-signed - Don't allow self-signed certificates through (requires<br>
|
||||
verify-certificate)</font></p>
|
||||
|
||||
<p><font size="-1">* Added the ability specify which CA's are trusted using set::ssl::trusted-ca-file</font></p>
|
||||
|
||||
<p><font size="-1">* A new configuration system has been added. The system is a bit more strict (meaning it
|
||||
will complain more often) but it will never crash due to configuration errors, just
|
||||
display a message saying errors exist.</font></p>
|
||||
|
||||
<p><font size="-1">* SVSLUSERS was added to all U:lines to change local and global max user counts (this is
|
||||
NOT meant so you can make the max count higher than it really should be.)</font></p>
|
||||
|
||||
<p><font size="-1">* A new oper flag, can_override/v has been added. This is an attempt to stop oper abuse.
|
||||
All opers can no longer use oper-override, this oflag MUST be in place for oper-override
|
||||
to be allowed. Can_override is NOT assumed to be present no matter what your flags,
|
||||
meaning you could be +N but still not be allowed to use oper-override.</font></p>
|
||||
|
||||
<p><font size="-1">* UNKLINE and UNZLINE have been removed in favor of a system like G:lines, to remove you
|
||||
now /kline -user@host or /zline -user@host</font></p>
|
||||
<p><font size="-1">* MAKE SURE YOU RERUN ./Config AND RUN make clean BEFORE USING
|
||||
THIS VERSION!!!</font></p>
|
||||
<p> </p>
|
||||
@@ -246,8 +273,6 @@
|
||||
</p>
|
||||
<p>Unreal 3.2 is ONLY compatible with Unreal3.1.4 and Unreal3.2 servers. DO NOT
|
||||
ATTEMPT to link to servers that it is NOT compatible with.</p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p><font size="+2"><strong>2.0 - Installation</strong></font><a name="installation" id="installation"></a><br>
|
||||
<br>
|
||||
<strong>Tested & Supported Operating Systems:</strong><br>
|
||||
@@ -263,13 +288,16 @@
|
||||
<strong>Windows version:</strong><br>
|
||||
WindowsXP Home<br>
|
||||
WindowsXP Pro<br>
|
||||
Windows 2000 Pro<br>
|
||||
Windows 2000 Server<br>
|
||||
Windows 2000 Advanced Server<br>
|
||||
<br>
|
||||
If you have Unreal3.2 working correctly under other operating systems, please
|
||||
send the details to docs@unrealircd.com<br>
|
||||
</p>
|
||||
send the details to <a href="mailto://docs@unrealircd.com">docs@unrealircd.com<br>
|
||||
</a> </p>
|
||||
<p><strong>Installation Instructions</strong><br>
|
||||
1. gunzip -d Unreal3.2-beta12.tar.gz<br>
|
||||
2. tar xvf Unreal3.2-beta12.tar <br>
|
||||
1. gunzip -d Unreal3.2-beta13.tar.gz<br>
|
||||
2. tar xvf Unreal3.2-beta13.tar <br>
|
||||
3. cd Unreal3.2 <br>
|
||||
DO NOT EDIT MAKEFILE <br>
|
||||
4. ./Config<br>
|
||||
@@ -291,7 +319,7 @@
|
||||
format has a specific format. The format works like:</p>
|
||||
<p><block-name> <block-value> {<br>
|
||||
<block-directive> <directive-value>;<br>
|
||||
};</p>
|
||||
} ;</p>
|
||||
<p><block-name> is the type of block, such as me, or admin. <block-value>
|
||||
sometimes specifies a value, such as /oper login, but other times it will be
|
||||
a sub-type such as in ban user.</p>
|
||||
@@ -336,7 +364,7 @@
|
||||
name <name-of-server>;<br>
|
||||
info <server-description>;<br>
|
||||
numeric <server-numeric>;<br>
|
||||
};</p>
|
||||
} ;</p>
|
||||
<p>These values are pretty obvious. The me::name specifies the name of the server,
|
||||
me::info specifies the server's info line, me::numeric specifies a numeric to
|
||||
identify the server. This must be a value between 1 and 255 that is unique to
|
||||
@@ -346,7 +374,7 @@
|
||||
name "irc.foonet.com";<br>
|
||||
info "FooNet Server";<br>
|
||||
numeric 1;<br>
|
||||
};</p>
|
||||
} ;</p>
|
||||
<p></p>
|
||||
<p><font size="+2"><strong>3.3 - Admin Block (Previously known as the A:Line)</strong></font><a name="adminblock">
|
||||
</a><br>
|
||||
@@ -384,9 +412,9 @@
|
||||
which is specified in the class::. The values of this block define the connection
|
||||
classes, class::pingfreq specifies the number of seconds between PINGs, class::connfreq
|
||||
is only used in server classes to specify the time in seconds between connection
|
||||
attempts, class::maxclients specifies the maximum amount of clients that may
|
||||
use this class to connect, and class::sendq specifies the amount of information
|
||||
that can remain in the send queue buffer.</p>
|
||||
attempts, class::maxclients specifies the maximum amount of clients or servers
|
||||
that may use this class to connect, and class::sendq specifies the amount of
|
||||
information that can remain in the send queue buffer.</p>
|
||||
<p>Examples:<br>
|
||||
class clients {<br>
|
||||
pingfreq 90;<br>
|
||||
@@ -458,7 +486,6 @@
|
||||
form listen <ip:port>;. Valid listen::options are clientsonly (only users
|
||||
may connect), serversonly (only servers nameconnect), java (CR javachat support),
|
||||
ssl (SSL encrypted port). A combination of any of those flags may be specified.</p>
|
||||
<p> </p>
|
||||
<p>Since IPv6 is now supported, and the IPv6 seperator is a : it makes the<br>
|
||||
ip:port format a bit difficult. To compensate, you should enclose the IP in
|
||||
brackets. For<br>
|
||||
@@ -622,6 +649,16 @@
|
||||
<td><div align="center">can_zline</div></td>
|
||||
<td>Can use /zline</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">t</div></td>
|
||||
<td><div align="center">can_gkline</div></td>
|
||||
<td>Can use /gline</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">Z</div></td>
|
||||
<td><div align="center">can_gzline</div></td>
|
||||
<td>Can use /gzline</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">W</div></td>
|
||||
<td><div align="center">get_umodew</div></td>
|
||||
@@ -637,13 +674,18 @@
|
||||
<td><div align="center">can_stealth</div></td>
|
||||
<td>Can use +I</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">v</div></td>
|
||||
<td><div align="center">can_override</div></td>
|
||||
<td>Can use OperOverride</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Certin flags give you other flags by default:</p>
|
||||
<table width="59%" border="1">
|
||||
<tr>
|
||||
<td width="19%"><strong>local</strong></td>
|
||||
<td width="17%"><strong>global</strong></td>
|
||||
<td width="19%"><strong>admin</strong></td>
|
||||
<td width="19%"><strong>admin/coadmin</strong></td>
|
||||
<td width="22%"><strong>services-admin</strong></td>
|
||||
<td width="23%"><strong>netadmin</strong></td>
|
||||
</tr>
|
||||
@@ -1147,6 +1189,7 @@
|
||||
};<br>
|
||||
login <login-name>;<br>
|
||||
password <password> { <auth-type>; };<br>
|
||||
swhois "<swhois info>";<br>
|
||||
};</p>
|
||||
<p>The vhost block allows you to specify a login/password that can be used with
|
||||
the /vhost command to obtain a fake hostname. The vhost::vhost parameter can
|
||||
@@ -1156,16 +1199,18 @@
|
||||
in the login name the user must enter and vhost::password is the password that
|
||||
must be entered. Lastly vhost::password:: allows you to specify the type of
|
||||
authentication used by this item. The currently supported authentication types
|
||||
are crypt, md5, and sha1, ripemd-160.</p>
|
||||
are crypt, md5, and sha1, ripemd-160. vhost::swhois allows you to add an extra
|
||||
line to a users whois, exactly as it does in the Oper Block oper::svhost.</p>
|
||||
<p>Example<br>
|
||||
vhost {<br>
|
||||
vhost my.own.personal.vhost.com;<br>
|
||||
from {<br>
|
||||
my@isp.com;<br>
|
||||
myother@isp.com;<br>
|
||||
userhost my@isp.com;<br>
|
||||
userhost myother@isp.com;<br>
|
||||
};<br>
|
||||
login mynick;<br>
|
||||
password mypassword;<br>
|
||||
swhois "Im Special";<br>
|
||||
};</p>
|
||||
<p></p>
|
||||
<p><font size="+2"><strong>3.26 – Bad Words Block (Previously Known As badwords.*.conf)</strong></font><a name="badwordsblock"></a><br>
|
||||
@@ -1289,7 +1334,8 @@
|
||||
<p>Syntax [command alias]:<br>
|
||||
alias <name> {<br>
|
||||
format <regex-expression> {<br>
|
||||
alias <alias-to-forward-to>;<br>
|
||||
nick <nick-to-forward-to>;<br>
|
||||
type <type-of-alias>;<br>
|
||||
parameters <parameter-string>;<br>
|
||||
};<br>
|
||||
format <regex-expression> {<br>
|
||||
@@ -1303,9 +1349,9 @@
|
||||
a regular expression that compares against the text sent to the alias command,
|
||||
when matched the sub-entries of that alias::format will be used, you may have
|
||||
multiple alias::format's to make the command do different things depending on
|
||||
the text sent to it. The alias::format::alias is the name of a preexisting (appears
|
||||
before this in the config file) alias block in the standard format that when
|
||||
that format is matched will be used. The alias::format::parameters is what will
|
||||
the text sent to it. The alias::format::nick is the nickname to forward this
|
||||
alias to. The alias::format::type specifies the type of the alias that the
|
||||
message should be forwarded to. The alias::format::parameters is what will
|
||||
be sent as the parameters to this alias. To specify one of the parameters given
|
||||
to the command alias specify % followed by a number, for example, %1 is the
|
||||
first parameter. To specify all parameters from a given parameter to the end
|
||||
@@ -1330,14 +1376,17 @@
|
||||
<p><strong><font size="+2">3.31 – Set Block (Previosuly Known As unrealircd.conf
|
||||
/ networks file)</font><a name="setblock"></a></strong></p>
|
||||
<p>The set file is what use to be our networks/unrealircd.conf and our networks
|
||||
file. On single server networks, rather than have 3 files, I recommend including
|
||||
all of the set commands in the unrealircd.conf .</p>
|
||||
<p>Now, if your server is on a network, chances are you will all basicly use the
|
||||
same Set settings. Therefore it makes more sense to have a network file, which
|
||||
is loaded with a include:: directive. Below you will find all of the set directives
|
||||
available.</p>
|
||||
<p>Also, please note, that this release was rushed a bit, in future releases;
|
||||
I will expand on all of the set settings and syntax listed below.</p>
|
||||
file. On single server networks, rather than have 3 files, on single server
|
||||
networks, you can just include the set statements in the unrealircd.conf, on
|
||||
multi-server networks, i recommend still using a networks file.</p>
|
||||
<p>Now, if your server is on a network, chances are you will all basically use
|
||||
the same Set settings. Therefore it makes more sense to have a network file,
|
||||
which is loaded with a include:: directive. Below you will find all of the set
|
||||
directives available.</p>
|
||||
<p>In this doc we refer to settings / directives in the <block-name>::<block-directive>
|
||||
format. This format is NOT the format that it can be entered into the configuration
|
||||
file. IT MUST be converted to the format listed below. It is presented in the
|
||||
format it is to make discussing it simpler.</p>
|
||||
<p>Syntax:<br>
|
||||
set {<br>
|
||||
<entry> <value>;<br>
|
||||
@@ -1346,8 +1395,27 @@
|
||||
};</p>
|
||||
<p>The set block sets options for individual server features. Each entry does
|
||||
something different and therefore each will be described below. Some directives
|
||||
have sub blocks which will also be described.</p>
|
||||
<p>set::kline-address <email-address>;<br>
|
||||
have sub blocks which will also be described. There are many set statements
|
||||
to cover, all of the directives listed below can be included under ONE set statement.
|
||||
If a directive has options, they are included within the single set statement
|
||||
as well.<br>
|
||||
Example:<br>
|
||||
Set {<br>
|
||||
kine-address my@emailaddress.com;<br>
|
||||
auto-join #welcome;<br>
|
||||
options {<br>
|
||||
hide-ulines;<br>
|
||||
no-stealth; };<br>
|
||||
hosts {<br>
|
||||
local LocalOp.MyNet.com;<br>
|
||||
global globalop.mynet.com; };<br>
|
||||
};</p>
|
||||
<p>Now if you wanted to make the set statements seperate, say you wanted to set
|
||||
your options in a single line.<br>
|
||||
Example:<br>
|
||||
set { options { hide-ulinesl; no-stealth; }; };<br>
|
||||
</p>
|
||||
<p> set::kline-address <email-address>;<br>
|
||||
The email address that K:line questions should be sent to. This value must be
|
||||
specified.</p>
|
||||
<p>set::modes-on-connect <+modes>;<br>
|
||||
@@ -1368,7 +1436,7 @@
|
||||
<p>set::prefix-quit <text-to-prefix-quit>;<br>
|
||||
Sets the text that will be used to prefix a quit message. If this value is set
|
||||
to 0 then the standard "Quit:" is used.</p>
|
||||
<p>set::static-quit {quit message};<br>
|
||||
<p>set::static-quit <quit message>;<br>
|
||||
Sets a static quit message that will be sent whenever a client logs off the
|
||||
network. This eliminates the need for anti-spam-quit-message-time, as well as
|
||||
the set::prefix-quit. It will NOT replace ERRORS with the static-quit message.</p>
|
||||
@@ -1443,12 +1511,14 @@
|
||||
<p>set::scan::endpoint <ip:port>;<br>
|
||||
Specifies the IP and port that the server will tell an incoming open proxy to
|
||||
connect to.</p>
|
||||
<p>set::bind-ip {ip};<br>
|
||||
<p>set::scan::bind-ip <ip>;<br>
|
||||
What ip should the scanner bind to before connecting</p>
|
||||
<p>set::message {message};<br>
|
||||
<p>set::scan::message <message>;<br>
|
||||
Put a message that users will see when scanner is scanning</p>
|
||||
<p>set::ban-time {time}<br>
|
||||
Sets the time of the ban (1d,2h,1w)</p>
|
||||
<p>set::scan::bantime {time}<br>
|
||||
Sets the time of the ban (4d)</p>
|
||||
<p>set::scan::timeout {time}<br>
|
||||
How long we wait to see if the host has a proxy (15s)</p>
|
||||
<p>set::ssl::egd <filename>;<br>
|
||||
Specifies that EGD (Entropy Gathering Daemon) support should be enabled. If
|
||||
you run OpenSSL 0.9.7 or higher, then /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool,
|
||||
@@ -1473,11 +1543,11 @@
|
||||
<td>Only Administrators may join</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">a {nick}</div></td>
|
||||
<td><div align="center">a <nick></div></td>
|
||||
<td>Goves protection to that user, may not be kicked</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">b {nick!user@host}<br>
|
||||
<td><div align="center">b <nick!user@host><br>
|
||||
</div></td>
|
||||
<td>Bans the givin user from the channel</td>
|
||||
</tr>
|
||||
@@ -1490,14 +1560,14 @@
|
||||
<td>No CTCP's allowed in the channel</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">e {nick!user@host}</div></td>
|
||||
<td><div align="center">e <nick!user@host></div></td>
|
||||
<td>Execption ban – If someone matches this, they can join a channel
|
||||
even if they match an existing ban</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">f * {lines:seconds}</div></td>
|
||||
<td><div align="center">f * <lines:seconds></div></td>
|
||||
<td>Flood protection, if the * is given a user will kick banned when they
|
||||
send {lines:seconds} if no * they are just kicked</td>
|
||||
send <lines:seconds> if no * they are just kicked</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">G</div></td>
|
||||
@@ -1509,7 +1579,7 @@
|
||||
<td>No +I users may join (only settable by admins)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">h {nick}</div></td>
|
||||
<td><div align="center">h <nick></div></td>
|
||||
<td>Gives half-op status to the user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1521,15 +1591,15 @@
|
||||
<td>/knock is not allowed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">k {key}</div></td>
|
||||
<td><div align="center">k <key></div></td>
|
||||
<td>Sets a key needed to join</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">l {##}</div></td>
|
||||
<td><div align="center">l <##></div></td>
|
||||
<td>Sets max number of users</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">L {Chan}</div></td>
|
||||
<td><div align="center">L <Chan></div></td>
|
||||
<td>If the amount set by +l has been reached, users will be sent to this channel</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1549,7 +1619,7 @@
|
||||
<td>Only IRCops may join</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">o {nick}</div></td>
|
||||
<td><div align="center">o <nick></div></td>
|
||||
<td>Gives a user channel operator status</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1575,6 +1645,10 @@
|
||||
<tr>
|
||||
<td><div align="center">s</div></td>
|
||||
<td>Makes channel secret</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">t</div></td>
|
||||
<td>Only chanops can set topic</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">u</div></td>
|
||||
@@ -1585,7 +1659,7 @@
|
||||
<td>/invite is not allowed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div align="center">v {nick}</div></td>
|
||||
<td><div align="center">v <nick></div></td>
|
||||
<td>Gives a voice to users. (May speak in +M Channels</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1713,62 +1787,62 @@
|
||||
<td width="10%"><div align="center"><strong>Who</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>nick {newnickname}</td>
|
||||
<td>nick <newnickname></td>
|
||||
<td>Changes your online nick name. Alerts others to the change of your nick<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>whois {nick}</td>
|
||||
<td>whois <nick></td>
|
||||
<td>Displays information of user requested. Includes Full Name, Host, Channels
|
||||
User is in, and Oper Status<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">who {mask}</td>
|
||||
<td height="39">who <mask></td>
|
||||
<td>Who allows you to search for users (who do not have mode +I set). Masks
|
||||
include: nickname, #channel, hostmask (*.attbi.com)<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">whowas {nick} {maxreplys}</td>
|
||||
<td>Displays information on a nick that has logged off. The {max replies}
|
||||
<td height="39">whowas <nick> <maxreplys></td>
|
||||
<td>Displays information on a nick that has logged off. The <max replies>
|
||||
field is optional, and limits how many records will be returned.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">ison {nick1 nick2 nick3 ...}</td>
|
||||
<td height="39">ison <nick1 nick2 nick3 ...></td>
|
||||
<td>Allows you to check the online status of a user, or a list of users. Simple
|
||||
return, best used for scripts<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">join {channel1,channel2, ...}</td>
|
||||
<td height="39">join <channel1,channel2, ...></td>
|
||||
<td>Allows you to join channels. Using the /join #channel1, #channel2, channel3
|
||||
will allow you to join more than one channel at a time. The /join 0 command
|
||||
makes you PART</td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">part {channel1, channel2, ...}</td>
|
||||
<td height="39">part <channel1, channel2, ...></td>
|
||||
<td>Allows you to part (leave) channels. Using the /part #channel1, #channel2,
|
||||
channel3 will allow you to part more than one channel at a time. </td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">motd {server}</td>
|
||||
<td height="39">motd <server></td>
|
||||
<td>Displays the servers motd. Adding a server name allows you to view motd’s
|
||||
on other servers.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">rules {server}</td>
|
||||
<td height="39">rules <server></td>
|
||||
<td>Displays the ircd.rules of a server. Adding a server name allows you to
|
||||
view rules on other servers</td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">lusers</td>
|
||||
<td>Displays current & max user loads, both global and local.<br></td>
|
||||
<td height="39">lusers <server> </td>
|
||||
<td>Displays current & max user loads, both global and local. Adding a server name allows you to view rules on other servers.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1777,19 +1851,19 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">quit {reason}</td>
|
||||
<td height="39">quit <reason></td>
|
||||
<td>Causes you to disconnect from the server. If you include a reason, it
|
||||
will be displayed on all channels as you quit</td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">ping {user}</td>
|
||||
<td height="39">ping <user></td>
|
||||
<td>Sends a PING request to a user. Used for checking connection and lag.
|
||||
Servers issue pings on a timed basis to determine if users are still connected.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">version {nick}</td>
|
||||
<td height="39">version <nick></td>
|
||||
<td>Sends a CTCP Version request to the user. If configured to do so, their
|
||||
client will respond with the client version.<br></td>
|
||||
<td>All</td>
|
||||
@@ -1800,40 +1874,40 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">Admin {server}</td>
|
||||
<td height="39">Admin <server></td>
|
||||
<td>Displays the admin info of a server. If a server name is included it will
|
||||
display the info of that server.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">userhost {nick}</td>
|
||||
<td height="39">userhost <nick></td>
|
||||
<td>Displays the userhost of the nick given. Generally used for scripts<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">topic {channel} {topic}</td>
|
||||
<td>Topic {channel} will display the current topic of the given channel. Topic
|
||||
{channel} {topic} will change the topic of the given channel.<br></td>
|
||||
<td height="39">topic <channel> <topic></td>
|
||||
<td>Topic <channel> will display the current topic of the given channel. Topic
|
||||
<channel> <topic> will change the topic of the given channel.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">invite {nick} {channel}</td>
|
||||
<td height="39">invite <nick> <channel></td>
|
||||
<td>Invites the given user to the given channel. (Must be a channel Op)<br></td>
|
||||
<td>ChanOp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">kick {channel, channel} {user, user} {reason}</td>
|
||||
<td height="39">kick <channel, channel> <user, user> <reason></td>
|
||||
<td>Kicks a user or users out of a channel, or channels. A reason may also
|
||||
be supplied. <br></td>
|
||||
<td>ChanOp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">away {reason}</td>
|
||||
<td height="39">away <reason></td>
|
||||
<td>Marks you as being away. A reason may also be supplied.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">Watch +-{nick} +-{nick}<br></td>
|
||||
<td height="39">Watch +-<nick> +-<nick><br></td>
|
||||
<td>Watch is a new notify-type system in UnrealIRCd which is both faster and
|
||||
uses less network resources than any old-style notify system. The server
|
||||
will send you a message when any nickname in your watch list logs on or
|
||||
@@ -1843,7 +1917,7 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">helpop ?{topic} or !{topic}<br></td>
|
||||
<td height="39">helpop ?<topic> or !<topic><br></td>
|
||||
<td>HelpOp is a new system of getting IRC Server help. You type either /HELPOP
|
||||
? <help system topic> or /HELPOP ! <question> The "?"
|
||||
in /HELPOP means query the help system and if you get no response you can
|
||||
@@ -1853,7 +1927,7 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">list {search string}</td>
|
||||
<td height="39">list <search string></td>
|
||||
<td>Lists all channels on the network. If a search string is supplied, it
|
||||
will apply that to the search. Wildcards are supported</td>
|
||||
<td>All</td>
|
||||
@@ -1876,7 +1950,7 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">Knock {channel} {message}<br></td>
|
||||
<td height="39">Knock <channel> <message><br></td>
|
||||
<td>Allows you to ‘knock’ on an invite only channel and ask for
|
||||
access. Will not work if channel has one of the following modes set: +K
|
||||
+I. Will also not work if you are banned<br></td>
|
||||
@@ -1888,12 +1962,12 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">vhost {login} {password}</td>
|
||||
<td height="39">vhost <login> <password></td>
|
||||
<td>Hides your host name by using a vhost provided by the server. <br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">mode {chan/nick} {mode}<br></td>
|
||||
<td height="39">mode <chan/nick> <mode><br></td>
|
||||
<td>Lets you set channel and user modes. Refer to section 4 for lists of modes<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
@@ -1908,97 +1982,97 @@
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">time {server}</td>
|
||||
<td height="39">time <server></td>
|
||||
<td>Displays the servers date and time. Including a server name allows you
|
||||
to check other servers.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">botmotd {server}<br></td>
|
||||
<td height="39">botmotd <server><br></td>
|
||||
<td>Displays the servers bot message of the day. Including a server name allows
|
||||
you to check other servers</td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">identify {password}</td>
|
||||
<td height="39">identify <password></td>
|
||||
<td>Sends your password to the services system to identify to your nick.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">identify {channel} {password}</td>
|
||||
<td height="39">identify <channel> <password></td>
|
||||
<td>Sends your password to the services system to identify as the founder
|
||||
of a channel.<br></td>
|
||||
<td>All</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">oper {userid} {password}<br></td>
|
||||
<td height="39">oper <userid> <password><br></td>
|
||||
<td>Command to give a user operator status if they match an Oper Block<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">wallop {message}</td>
|
||||
<td height="39">wallop <message></td>
|
||||
<td>Sends a message to all users with umode +w</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">globops {message}</td>
|
||||
<td height="39">globops <message></td>
|
||||
<td>Sends a message to all IRCops</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">chatops {message}</td>
|
||||
<td height="39">chatops <message></td>
|
||||
<td>Send a message to all IRCops with umode +c</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">locops {message}</td>
|
||||
<td height="39">locops <message></td>
|
||||
<td>Sends a message to all local IRCops</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">adchat {message}</td>
|
||||
<td height="39">adchat <message></td>
|
||||
<td>Sends a message to all Admins</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">nachat {message}</td>
|
||||
<td height="39">nachat <message></td>
|
||||
<td>Sends a message to all Net Admins</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">kill {nick} {reason}</td>
|
||||
<td height="39">kill <nick> <reason></td>
|
||||
<td>Kills a user from the network</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">kline {hostmask} {reason}</td>
|
||||
<td height="39">kline <hostmask> <reason></td>
|
||||
<td>Bans the hostmask from the server it is issued on. It is not a global
|
||||
ban. </td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">unkline {hostmask}</td>
|
||||
<td height="39">unkline <hostmask></td>
|
||||
<td>Removes a kline</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">zline {ip} :{reason}</td>
|
||||
<td height="39">zline <ip> :<reason></td>
|
||||
<td>Bans an IP Address from the local server it is issued on<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">unzline {ip}</td>
|
||||
<td height="39">unzline <ip></td>
|
||||
<td>Removes a zline</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">gline {user@host} {time to ban} :{reason}<br></td>
|
||||
<td height="39">gline <user@host> <time to ban> :<reason><br></td>
|
||||
<td>Adds a global ban to anyone that matches. Time to ban is in seconds, or
|
||||
u can use 1d for 1 days. To remove a gline, put a –user@host<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">shun +-{user@host} {time to shun} :{reason}<br></td>
|
||||
<td height="39">shun +-<user@host> <time to shun> :<reason><br></td>
|
||||
<td>Prevents a user from executing ANY commands on the server, and prevents
|
||||
them from speaking. Time to ban is in seconds, or u can use 1d for 1 days.
|
||||
To remove a shun, put a –user@host. Setting time to 0 makes it permanent.
|
||||
@@ -2006,36 +2080,36 @@
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">gzline {ip} {time to ban} :{reason}<br></td>
|
||||
<td height="39">gzline <ip> <time to ban> :<reason><br></td>
|
||||
<td>Adds a global zline. Time to ban is in seconds, or u can use 1d for 1
|
||||
days. To remove a gzline, put a –user@host. Setting time to 0 makes
|
||||
it permanent.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">tkline {user@host} {time to ban} :{reason}<br></td>
|
||||
<td height="39">tkline <user@host> <time to ban> :<reason><br></td>
|
||||
<td>Timed Kline. . Time to ban is in seconds, or u can use 1d for 1 days.
|
||||
To remove a tkline, put a –user@host. Setting time to 0 makes it permanent.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">tzline {ip} {time to ban} :{reason}<br></td>
|
||||
<td height="39">tzline <ip> <time to ban> :<reason><br></td>
|
||||
<td>Timed Zline. . Time to ban is in seconds, or u can use 1d for 1 days.
|
||||
To remove a tzline, put a –user@host. Setting time to 0 makes it permanent</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">akill {user@host} :{reason}<br></td>
|
||||
<td height="39">akill <user@host> :<reason><br></td>
|
||||
<td>Adds an akill (Services Admins & Network Admins ONLY)<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">rakill {user@host}<br></td>
|
||||
<td height="39">rakill <user@host><br></td>
|
||||
<td>Removes an akill<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">rehash {server} –{flags}</td>
|
||||
<td height="39">rehash <server> –<flags></td>
|
||||
<td>Rehashes the servers config file. Incluidng a server name allows you to
|
||||
rehash a remote servers config file. Several flags are also available. They
|
||||
Include <br>
|
||||
@@ -2051,18 +2125,18 @@
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">restart {server} {password}<br></td>
|
||||
<td height="39">restart <server> <password><br></td>
|
||||
<td>Restarts the IRCD Process. Password is required. You may also include
|
||||
a server name to restart a remote server.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">die {password}<br></td>
|
||||
<td height="39">die <password><br></td>
|
||||
<td>Terminates the IRCD Process. Password is required</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">lag {server} <br></td>
|
||||
<td height="39">lag <server> <br></td>
|
||||
<td>This command is like a Sonar or Traceroute for IRC server. You type in
|
||||
/LAG irc.fyremoon.net and it will reply from every server it passes with
|
||||
time and so on Useful for looking where lag is and optional TS future/past
|
||||
@@ -2070,37 +2144,37 @@
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">sethost {newhost}</td>
|
||||
<td height="39">sethost <newhost></td>
|
||||
<td>Lets you change your vhost to what ever you want it to be.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">setident {newident}<br></td>
|
||||
<td height="39">setident <newident><br></td>
|
||||
<td>Lets you set your ident to what ever you want it to be<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">chghost {nick} {newhost}<br></td>
|
||||
<td height="39">chghost <nick> <newhost><br></td>
|
||||
<td>Lets you change the host name of a user currently on the system<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">chgident {nick} {newident}<br></td>
|
||||
<td height="39">chgident <nick> <newident><br></td>
|
||||
<td>Lets you set your ident to what ever you want it to be<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">chgname {nick} {newname}<br></td>
|
||||
<td height="39">chgname <nick> <newname><br></td>
|
||||
<td>Lets you change the realname of a user currently on the system<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">squit {sever}<br></td>
|
||||
<td height="39">squit <sever><br></td>
|
||||
<td>Disconnects a server from the network<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">connect {server} {port} {server}</td>
|
||||
<td height="39">connect <server> <port> <server></td>
|
||||
<td>If only one server is givin, it will attempt to connect the server you
|
||||
are ON to the given server. If 2 servers are given, it will attempt to connect
|
||||
the 2 servers together. Put the hub server as the first, and the leaf server
|
||||
@@ -2108,40 +2182,40 @@
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">dccdeny {filemask} {reason}<br></td>
|
||||
<td height="39">dccdeny <filemask> <reason><br></td>
|
||||
<td>Adds a DCCDENY for that filemask. Preventing that file from being sent.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">undccdeny {filemask}<br></td>
|
||||
<td height="39">undccdeny <filemask><br></td>
|
||||
<td>Removes a DCCDENY</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">sajoin {nick} {channel}, {channel}<br></td>
|
||||
<td height="39">sajoin <nick> <channel>, <channel><br></td>
|
||||
<td>Forces a user to join a channel(s). Available to services & network
|
||||
admins only</td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">sapart {nick} {channel}, {channel}<br></td>
|
||||
<td height="39">sapart <nick> <channel>, <channel><br></td>
|
||||
<td>Forces a user to part a channel(s). Available to services & network
|
||||
admins only.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">samode {channel} {mode}<br></td>
|
||||
<td height="39">samode <channel> <mode><br></td>
|
||||
<td>Allows Network & Services admins to change modes of a channel without
|
||||
having ChanOps.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">rping {servermask}<br></td>
|
||||
<td height="39">rping <servermask><br></td>
|
||||
<td>Will calculate in milliseconds the lag between servers<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">trace {servermask}<br></td>
|
||||
<td height="39">trace <servermask><br></td>
|
||||
<td>Will calculate in milliseconds the lag between servers<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
@@ -2151,33 +2225,33 @@
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="39">addmotd :{text}<br></td>
|
||||
<td height="39">addmotd :<text><br></td>
|
||||
<td>Will add the given text to the end of the Motd<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">addomotd :{text}<br></td>
|
||||
<td height="36">addomotd :<text><br></td>
|
||||
<td>Will add the given text to the end of the OperMotd<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">sdesc {newdescription}<br></td>
|
||||
<td height="36">sdesc <newdescription><br></td>
|
||||
<td>Allows server admins to change the description line of their server without
|
||||
restarting.<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">addline {text}<br></td>
|
||||
<td height="36">addline <text><br></td>
|
||||
<td>Allows you to add lines to the unrealircd.conf<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">mkpasswd {password}<br></td>
|
||||
<td height="36">mkpasswd <password><br></td>
|
||||
<td>Will encrypt a clear text password to add it to the unrealircd.conf<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">tsctl offset +/- {time}<br></td>
|
||||
<td height="36">tsctl offset +/- <time><br></td>
|
||||
<td>Adjust the IRCD’s Internal clock (Do NOT use if you do not understand
|
||||
EXACTLY what it does)<br></td>
|
||||
<td>IRCop</td>
|
||||
@@ -2193,26 +2267,26 @@
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">tsctl svstime {timestamp}<br></td>
|
||||
<td height="36">tsctl svstime <timestamp><br></td>
|
||||
<td>Sets the TS time of all servers (Do NOT use if you do not understand EXACTLY
|
||||
what it does)<br></td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">htm {option}<br></td>
|
||||
<td height="36">htm <option><br></td>
|
||||
<td>Controls settings related to high traffic mode. High Traffic Mode (HTM)
|
||||
basically disables certain user commands such as: list whois who etc in
|
||||
response to extremely high traffic on the server. Options include: <br>
|
||||
-ON Forces server into HTM <br>
|
||||
-OFF Forces server out of HTM <br>
|
||||
-NOSIY Sets the server to notify users/admins when in goes in and out of
|
||||
-NOISY Sets the server to notify users/admins when in goes in and out of
|
||||
HTM<br>
|
||||
-QUITE Sets the server to NOT notify when going in and out of HTM<br>
|
||||
-TO {value} Sets Traffic rate HTM activate<br> </td>
|
||||
-TO <value> Sets Traffic rate HTM activate<br> </td>
|
||||
<td>IRCop</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">stats {option}<br></td>
|
||||
<td height="36">stats <option><br></td>
|
||||
<td>b - Send the badwords list<br>
|
||||
C - Send the link block list<br>
|
||||
d - Send the deny link (auto) block list<br>
|
||||
@@ -2243,11 +2317,14 @@
|
||||
V - Send the vhost block list<br>
|
||||
y - Send the class block list<br>
|
||||
Z - Send memory usage information</td>
|
||||
<td>Admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="36">module<br></td>
|
||||
<td>
|
||||
Lists all loaded modules
|
||||
<td>IRCop/All</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -28,13 +28,13 @@ typedef struct {
|
||||
#define AUTHTYPE_UNIXCRYPT 1
|
||||
#define AUTHTYPE_MD5 2
|
||||
#define AUTHTYPE_SHA1 3
|
||||
#define AUTHTYPE_SSL_PUBKEY 4
|
||||
#define AUTHTYPE_SSL_CLIENTCERT 4
|
||||
#define AUTHTYPE_RIPEMD160 5
|
||||
|
||||
#ifdef USE_SSL
|
||||
#define AUTHENABLE_MD5
|
||||
#define AUTHENABLE_SHA1
|
||||
#define AUTHENABLE_SSL_PUBKEY
|
||||
#define AUTHENABLE_SSL_CLIENTCERT
|
||||
#define AUTHENABLE_RIPEMD160
|
||||
/* OpenSSL provides a crypt() */
|
||||
#ifndef AUTHENABLE_UNIXCRYPT
|
||||
|
||||
+5
-25
@@ -359,28 +359,12 @@
|
||||
* If you start the server as root but wish to have it run as another user,
|
||||
* define IRC_UID to that UID. This should only be defined if you are running
|
||||
* as root and even then perhaps not.
|
||||
* use #define IRC_UID <uid>
|
||||
* and #define IRC_GID <gid>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ok this one is being changed. it is advisable never to run anything that
|
||||
* uses sockets etc. and has the potential for the outside world to connect to it
|
||||
* to run as root... Hackers do things like buffer overruns, and get dumped on
|
||||
* a shell with root access effectivley ... so DONT do it.. if a program uses a
|
||||
* port <1024 it will run as root, once the program has binded to the socket it
|
||||
* will set its uid to something OTHER than root ... you set that in unrealircd.conf
|
||||
*
|
||||
* If you _must_ insist on running as root and not wanting the program to change its
|
||||
* UID, then define BIG_SECURITY_HOLE below
|
||||
*/
|
||||
#if !defined(_WIN32)
|
||||
/* Change This Line Below \/ */
|
||||
#define BIG_SECURITY_HOLE
|
||||
/* Its the one above ^^^^^^^ */
|
||||
#ifndef BIG_SECURITY_HOLE
|
||||
#define IRC_UID un_uid
|
||||
#define IRC_GID un_gid
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef IRC_UID
|
||||
#undef IRC_GID
|
||||
|
||||
/*
|
||||
* CLIENT_FLOOD
|
||||
@@ -617,13 +601,9 @@ error You stuffed up config.h signals
|
||||
# define stricmp strcasecmp
|
||||
# define strnicmp strncasecmp
|
||||
#if defined(CLIENT_FLOOD)
|
||||
# if (CLIENT_FLOOD > 8000)
|
||||
# define CLIENT_FLOOD 8000
|
||||
# else
|
||||
# if (CLIENT_FLOOD < 512)
|
||||
error CLIENT_FLOOD needs redefining.
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
error CLIENT_FLOOD undefined
|
||||
#endif
|
||||
|
||||
+4
-1
@@ -76,6 +76,8 @@ struct zConfiguration {
|
||||
#ifdef USE_SSL
|
||||
char *x_server_cert_pem;
|
||||
char *x_server_key_pem;
|
||||
char *trusted_ca_file;
|
||||
long ssl_options;
|
||||
#endif
|
||||
aNetwork network;
|
||||
};
|
||||
@@ -129,4 +131,5 @@ extern aConfiguration iConf;
|
||||
#define CLOAK_KEY2 iConf.network.key2
|
||||
#define CLOAK_KEY3 iConf.network.key3
|
||||
#define CLOAK_KEYCRC iConf.network.keycrc
|
||||
#define STATIC_QUIT iConf.static_quit
|
||||
#define STATIC_QUIT iConf.static_quit
|
||||
|
||||
|
||||
+21
-10
@@ -93,8 +93,6 @@ extern ConfigItem_deny_link *conf_deny_link;
|
||||
extern ConfigItem_allow_channel *conf_allow_channel;
|
||||
extern ConfigItem_deny_version *conf_deny_version;
|
||||
extern ConfigItem_log *conf_log;
|
||||
extern ConfigItem_unknown *conf_unknown;
|
||||
extern ConfigItem_unknown_ext *conf_unknown_set;
|
||||
extern ConfigItem_alias *conf_alias;
|
||||
extern ConfigItem_include *conf_include;
|
||||
extern ConfigItem_help *conf_help;
|
||||
@@ -107,6 +105,7 @@ extern long set_usermode(char *umode);
|
||||
extern char *get_modestr(long umodes);
|
||||
extern void tkl_stats(aClient *cptr);
|
||||
extern void config_error(char *format, ...);
|
||||
extern int config_verbose;
|
||||
extern void config_progress(char *format, ...);
|
||||
extern void ipport_seperate(char *string, char **ip, char **port);
|
||||
ConfigItem_class *Find_class(char *name);
|
||||
@@ -271,14 +270,16 @@ extern void sendto_channels_inviso_part(aClient *user);
|
||||
extern void sendto_channels_inviso_join(aClient *user);
|
||||
extern void sendto_message_one(aClient *to, aClient *from, char *sender,
|
||||
char *cmd, char *nick, char *msg);
|
||||
#define PREFIX_ALL 0
|
||||
#define PREFIX_HALFOP 0x1
|
||||
#define PREFIX_VOICE 0x2
|
||||
#define PREFIX_OP 0x4
|
||||
extern void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
int prefix, char *pattern, ...);
|
||||
extern void sendto_channelprefix_butone_tok(aClient *one, aClient *from, aChannel *chptr,
|
||||
int prefix, char *cmd, char *tok, char *nick, char *text);
|
||||
extern void sendto_channel_butone(aClient *, aClient *, aChannel *, char *,
|
||||
...);
|
||||
extern void sendto_channelops_butone(aClient *, aClient *, aChannel *,
|
||||
char *, ...);
|
||||
extern void sendto_channelvoice_butone(aClient *, aClient *, aChannel *,
|
||||
char *, ...);
|
||||
extern void sendto_serv_butone(aClient *, char *, ...);
|
||||
extern void sendto_serv_butone_quit(aClient *, char *, ...);
|
||||
extern void sendto_serv_butone_sjoin(aClient *, char *, ...);
|
||||
@@ -467,6 +468,8 @@ extern void add_CommandX(char *cmd, char *token, int (*func)(), unsigned char
|
||||
|
||||
/* CRULE */
|
||||
char *crule_parse(char *);
|
||||
int crule_test(char *);
|
||||
char *crule_errstring(int);
|
||||
int crule_eval(char *);
|
||||
void crule_free(char **);
|
||||
|
||||
@@ -486,9 +489,11 @@ extern int b64_decode(char const *src, unsigned char *target, size_t targsize);
|
||||
|
||||
extern int Auth_FindType(char *type);
|
||||
extern anAuthStruct *Auth_ConvertConf2AuthStruct(ConfigEntry *ce);
|
||||
extern void Auth_DeleteAuthStruct(anAuthStruct *as);
|
||||
extern int Auth_Check(aClient *cptr, anAuthStruct *as, char *para);
|
||||
extern char *Auth_Make(short type, char *para);
|
||||
extern void Auth_DeleteAuthStruct(anAuthStruct *as);
|
||||
extern int Auth_Check(aClient *cptr, anAuthStruct *as, char *para);
|
||||
extern char *Auth_Make(short type, char *para);
|
||||
extern int Auth_CheckError(ConfigEntry *ce);
|
||||
|
||||
extern long xbase64dec(char *b64);
|
||||
extern aClient *find_server_b64_or_real(char *name);
|
||||
extern aClient *find_server_by_base64(char *b64);
|
||||
@@ -519,7 +524,7 @@ extern u_long cres_mem(aClient *sptr, char *nick);
|
||||
extern void flag_add(char *ch);
|
||||
extern void flag_del(char ch);
|
||||
extern void init_dynconf(void);
|
||||
extern int init_conf2(char *filename);
|
||||
extern int init_conf(char *filename, int rehash);
|
||||
extern void validate_configuration(void);
|
||||
extern void run_configuration(void);
|
||||
extern aMotd *read_file(char *filename, aMotd **list);
|
||||
@@ -532,5 +537,11 @@ extern void set_sock_opts(int fd, aClient *cptr);
|
||||
extern void iCstrip(char *line);
|
||||
extern time_t rfc2time(char *s);
|
||||
extern char *rfctime(time_t t, char *buf);
|
||||
extern void *MyMallocEx(size_t size);
|
||||
#ifdef USE_SSL
|
||||
char *ssl_get_cipher(SSL *ssl);
|
||||
#endif
|
||||
long config_checkval(char *value, unsigned short flags);
|
||||
void config_status(char *format, ...);
|
||||
#define EVENT_DRUGS BASE_VERSION
|
||||
|
||||
|
||||
+19
-3
@@ -210,7 +210,10 @@ extern Hooktype Hooktypes[MAXCUSTOMHOOKS];
|
||||
extern Hook *global_i;
|
||||
|
||||
void Module_Init(void);
|
||||
char *Module_Load(char *path, int load);
|
||||
char *Module_Create(char *path);
|
||||
void Init_all_testing_modules(void);
|
||||
void Unload_all_loaded_modules(void);
|
||||
void Unload_all_testing_modules(void);
|
||||
int Module_Unload(char *name, int unload);
|
||||
vFP Module_Sym(char *name);
|
||||
vFP Module_SymX(char *name, Module **mptr);
|
||||
@@ -248,7 +251,7 @@ void CommandDel(Command *command);
|
||||
#define HOOKTYPE_LOCAL_NICKCHANGE 2
|
||||
#define HOOKTYPE_LOCAL_CONNECT 3
|
||||
#define HOOKTYPE_SCAN_INFO 5 /* Taken care of in scan.c */
|
||||
#define HOOKTYPE_CONFIG_UNKNOWN 6
|
||||
#define HOOKTYPE_CONFIGPOSTTEST 6
|
||||
#define HOOKTYPE_REHASH 7
|
||||
#define HOOKTYPE_PRE_LOCAL_CONNECT 8
|
||||
#define HOOKTYPE_HTTPD_URL 9
|
||||
@@ -257,12 +260,25 @@ void CommandDel(Command *command);
|
||||
#define HOOKTYPE_SERVER_QUIT 12
|
||||
#define HOOKTYPE_STATS 13
|
||||
#define HOOKTYPE_LOCAL_JOIN 14
|
||||
#define HOOKTYPE_CONFIGTEST 15
|
||||
#define HOOKTYPE_CONFIGRUN 16
|
||||
/* Module flags */
|
||||
#define MODFLAG_NONE 0x0000
|
||||
#define MODFLAG_LOADED 0x0001 /* (mod_load has been called and suceeded) */
|
||||
#define MODFLAG_LOADED 0x0001 /* Fully loaded */
|
||||
#define MODFLAG_TESTING 0x0002 /* Not yet initialized */
|
||||
#define MODFLAG_INIT 0x0004 /* Initialized */
|
||||
#define MODFLAG_DELAYED 0x0008 /* Delayed unload */
|
||||
|
||||
/* Module function return values */
|
||||
#define MOD_SUCCESS 0
|
||||
#define MOD_FAILED -1
|
||||
#define MOD_DELAY 2
|
||||
|
||||
#define CONFIG_MAIN 1
|
||||
#define CONFIG_SET 2
|
||||
#define CONFIG_BAN 3
|
||||
#define CONFIG_EXCEPT 4
|
||||
#define CONFIG_DENY 5
|
||||
#define CONFIG_ALLOW 6
|
||||
|
||||
#endif
|
||||
|
||||
+11
-4
@@ -54,6 +54,7 @@
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
#endif
|
||||
#include "auth.h"
|
||||
extern int sendanyways;
|
||||
@@ -497,7 +498,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
#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_WMASTER 0x40000000
|
||||
#define OFLAG_OVERRIDE 0x40000000 /* can use oper-override */
|
||||
#define OFLAG_INVISIBLE 0x80000000
|
||||
#define OFLAG_LOCAL (OFLAG_REHASH|OFLAG_HELPOP|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)
|
||||
@@ -506,6 +507,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
#define OFLAG_ADMIN_ (OFLAG_ADMIN | OFLAG_GLOBAL)
|
||||
#define OFLAG_SADMIN_ (OFLAG_SADMIN | OFLAG_GLOBAL)
|
||||
|
||||
#define OPCanOverride(x) ((x)->oflag & OFLAG_OVERRIDE)
|
||||
#define OPCanTKL(x) ((x)->oflag & OFLAG_TKL)
|
||||
#define OPCanGZL(x) ((x)->oflag & OFLAG_GZL)
|
||||
#define OPCanZline(x) ((x)->oflag & OFLAG_ZLINE)
|
||||
@@ -732,6 +734,9 @@ extern short Usermode_highest;
|
||||
#define CONNECT_AUTO 0x000004
|
||||
#define CONNECT_QUARANTINE 0x000008
|
||||
|
||||
#define SSLFLAG_FAILIFNOCERT 0x1
|
||||
#define SSLFLAG_VERIFYCERT 0x2
|
||||
#define SSLFLAG_DONOTACCEPTSELFSIGNED 0x4
|
||||
struct Client {
|
||||
struct Client *next, *prev, *hnext;
|
||||
anUser *user; /* ...defined, if this is a User */
|
||||
@@ -959,13 +964,14 @@ struct _configitem_listen {
|
||||
char *ip;
|
||||
int port;
|
||||
long options, clients;
|
||||
aClient *listener;
|
||||
};
|
||||
|
||||
struct _configitem_vhost {
|
||||
ConfigItem *prev, *next;
|
||||
ConfigFlag flag;
|
||||
ConfigItem *from;
|
||||
char *login, *virthost, *virtuser;
|
||||
char *login, *virthost, *virtuser, *swhois;
|
||||
anAuthStruct *auth;
|
||||
};
|
||||
|
||||
@@ -1077,7 +1083,8 @@ struct _configitem_alias {
|
||||
struct _configitem_alias_format {
|
||||
ConfigItem *prev, *next;
|
||||
ConfigFlag flag;
|
||||
ConfigItem_alias *alias;
|
||||
char *nick;
|
||||
short type;
|
||||
char *format, *parameters;
|
||||
};
|
||||
|
||||
@@ -1360,7 +1367,7 @@ struct liststruct {
|
||||
#ifdef CLEAN_COMPILE
|
||||
#define TStime() (time(NULL) + TSoffset)
|
||||
#else
|
||||
#define TStime() (0, timeofday == 0 ? (timeofday = time(NULL) + TSoffset) : timeofday)
|
||||
#define TStime() (timeofday == 0 ? (timeofday = time(NULL) + TSoffset) : timeofday)
|
||||
#endif
|
||||
|
||||
/* Lifted somewhat from Undernet code --Rak */
|
||||
|
||||
+2
-5
@@ -141,11 +141,6 @@ extern char OSName[256];
|
||||
#ifdef INET6
|
||||
|
||||
# define AND16(x) ((x)[0]&(x)[1]&(x)[2]&(x)[3]&(x)[4]&(x)[5]&(x)[6]&(x)[7]&(x)[8]&(x)[9]&(x)[10]&(x)[11]&(x)[12]&(x)[13]&(x)[14]&(x)[15])
|
||||
static unsigned char minus_one[] =
|
||||
{ 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 0
|
||||
};
|
||||
|
||||
# define WHOSTENTP(x) ((x)[0]|(x)[1]|(x)[2]|(x)[3]|(x)[4]|(x)[5]|(x)[6]|(x)[7]|(x)[8]|(x)[9]|(x)[10]|(x)[11]|(x)[12]|(x)[13]|(x)[14]|(x)[15])
|
||||
|
||||
# define AFINET AF_INET6
|
||||
@@ -212,6 +207,7 @@ static const struct in6_addr in6addr_any = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
#define P_EWOULDBLOCK EWOULDBLOCK
|
||||
#define P_EAGAIN EAGAIN
|
||||
#define P_EINPROGRESS EINPROGRESS
|
||||
#define P_EWORKING EINPROGRESS
|
||||
#define P_EINTR EINTR
|
||||
#define P_ETIMEDOUT ETIMEDOUT
|
||||
#define P_ENOTSOCK ENOTSOCK
|
||||
@@ -232,6 +228,7 @@ static const struct in6_addr in6addr_any = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
#define P_EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define P_EAGAIN WSAEWOULDBLOCK
|
||||
#define P_EINPROGRESS WSAEINPROGRESS
|
||||
#define P_EWORKING WSAEWOULDBLOCK
|
||||
#define P_EINTR WSAEINTR
|
||||
#define P_ETIMEDOUT WSAETIMEDOUT
|
||||
#define P_ENOTSOCK WSAENOTSOCK
|
||||
|
||||
+8
-3
@@ -35,28 +35,33 @@
|
||||
#include <pthread.h>
|
||||
typedef pthread_t THREAD;
|
||||
typedef pthread_mutex_t MUTEX;
|
||||
#define IRCCreateThreadEx(thread, start, arg, id) TDebug(CreateThread); pthread_create(&thread, NULL, (void*)start, arg)
|
||||
#define IRCCreateThread(thread, start, arg) TDebug(CreateThread); pthread_create(&thread, NULL, (void*)start, arg)
|
||||
#define IRCMutexLock(mutex) TDebug(MutexLock); pthread_mutex_lock(&mutex)
|
||||
#define IRCMutexTryLock(mutex) TDebug(MutexTryLock); pthread_mutex_trylock(&mutex);
|
||||
#define IRCMutexUnlock(mutex) TDebug(MutexUnlcok); pthread_mutex_unlock(&mutex)
|
||||
#define IRCCreateMutex(mutex) TDebug(CreateMutex); pthread_mutex_init(&mutex, NULL)
|
||||
#define IRCMutexDestroy(mutex) TDebug(MutexDestroy); pthread_mutex_destroy(&mutex)
|
||||
#define IRCJoinThread(thread,return) TDebug(JoinThread); pthread_join(thread, return)
|
||||
#define IRCJoinThread(thread,ppvalue) TDebug(JoinThread); pthread_join(thread, (void **)ppvalue)
|
||||
#define IRCExitThreadEx(value) TDebug(ExitThread); pthread_exit(value)
|
||||
#define IRCExitThread(value) TDebug(ExitThread); pthread_exit(value)
|
||||
#define IRCDetachThread(value) TDebug(DetachThread); pthread_detach(value);
|
||||
#define IRCTerminateThread(thread, value) pthread_cancel(&thread)
|
||||
#define IRCThreadSelf() pthread_self()
|
||||
#define IRCThreadEqual(thread1, thread2) pthread_equal(thread1,thread2)
|
||||
#else
|
||||
typedef unsigned long THREAD;
|
||||
typedef HANDLE THREAD;
|
||||
typedef HANDLE MUTEX;
|
||||
typedef unsigned (__stdcall *PTHREAD_START) (void *);
|
||||
#define IRCCreateThreadEx(thread, start, arg, id) thread = (THREAD)_beginthreadex(NULL, 0, (PTHREAD_START)start, arg, 0, id)
|
||||
#define IRCCreateThread(thread, start, arg) thread = _beginthread((void *)start, 0, arg)
|
||||
#define IRCMutexLock(mutex) WaitForSingleObject(mutex, INFINITE)
|
||||
#define IRCMutexTryLock(mutex) WaitForSingleObject(mutex, 0)
|
||||
#define IRCMutexUnlock(mutex) ReleaseMutex(mutex)
|
||||
#define IRCCreateMutex(mutex) mutex = CreateMutex(NULL, FALSE, NULL)
|
||||
#define IRCMutexDestroy(mutex) CloseHandle(mutex)
|
||||
#define IRCJoinThread(thread,return) WaitForSingleObject((HANDLE)thread, INFINITE); GetExitCodeThread((HANDLE)thread, (DWORD)return);
|
||||
#define IRCJoinThread(thread,pdwRc) { WaitForSingleObject((HANDLE)thread, INFINITE); GetExitCodeThread((HANDLE)thread, pdwRc); CloseHandle((HANDLE)thread); }
|
||||
#define IRCExitThreadEx(value) _endthreadex((unsigned int)value)
|
||||
#define IRCExitThread(value) _endthread()
|
||||
#define IRCTerminateThread(thread, value) TerminateThread((HANDLE)thread, value)
|
||||
#define IRCThreadSelf() GetCurrentThread()
|
||||
|
||||
+3
-3
@@ -24,13 +24,13 @@
|
||||
/**/
|
||||
#define COMPILEINFO DEBUGMODESET DEBUGSET
|
||||
/*
|
||||
* Version Unreal3.2-Selene
|
||||
* Version Unreal3.2
|
||||
*/
|
||||
#define UnrealProtocol 2303
|
||||
#define PATCH1 "3"
|
||||
#define PATCH2 ".2"
|
||||
#define PATCH3 "-Selene"
|
||||
#define PATCH4 "[beta12]"
|
||||
#define PATCH3 "-beta13"
|
||||
#define PATCH4 ""
|
||||
#define PATCH5 ""
|
||||
#define PATCH6 ""
|
||||
#define PATCH7 ""
|
||||
|
||||
@@ -1,610 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $Id$
|
||||
# Defaults
|
||||
#
|
||||
TIME=`date +"%H:%M:%S %Z"`
|
||||
DATE=`date +"%a, %b %e %Y"`
|
||||
IRCDCONF="unrealircd.conf"
|
||||
SERVNAME="Server.IRC.net"
|
||||
COMMENT="IRC server!"
|
||||
ADMIN="Admin-name"
|
||||
ADMNICK="Admin"
|
||||
ADMADDR="admin@no.where.com"
|
||||
OPERNAME="admin"
|
||||
OPERADDR="*@*"
|
||||
OPERPASS="password"
|
||||
NUMERIC=""
|
||||
PORT="6667"
|
||||
OPRT="default"
|
||||
LINKPASS="linkpass"
|
||||
VIRTUAL="1.2.3.4"
|
||||
ENCRYPT="Yes"
|
||||
FLAGS="OAZHWe"
|
||||
RESTARTPASS="restartpass"
|
||||
DIEPASS="diepass"
|
||||
SERVICES="Services.IRC-Net.Org"
|
||||
|
||||
# these are so I can use stuff like $1 without it replacing it...like by
|
||||
# using $dlrsgn$uno for $1
|
||||
dlrsgn="$"
|
||||
uno="1"
|
||||
dos="2"
|
||||
|
||||
# remove the temp file if it exists
|
||||
rm -f mkconf.tmp
|
||||
|
||||
# make a quick script for replacing one line with another
|
||||
|
||||
cat > repl_str << __EOF__
|
||||
sed -e "s@^$dlrsgn$uno\(.*\)@$dlrsgn$dos" $IRCDCONF > mkconf.tmp
|
||||
cp mkconf.tmp $IRCDCONF
|
||||
rm mkconf.tmp
|
||||
__EOF__
|
||||
|
||||
# mark repl_str as an executable
|
||||
chmod +x repl_str
|
||||
rm -f repl_str
|
||||
# Checking out how to specify not to make a new line with the current OS
|
||||
c=''
|
||||
n=''
|
||||
2>/dev/null
|
||||
if [ "`eval echo -n 'a'`" = "-n a" ]; then
|
||||
c='\c'
|
||||
else
|
||||
n='-n'
|
||||
fi
|
||||
|
||||
# we use a modified mkpasswd credit to Nelson Minar (minar@reed.edu)
|
||||
# for creating the original mkpasswd
|
||||
if test "x$CRYPT_OPER_PASSWORD" != "x" -o "x$CRYPT_LINK_PASSWORD" != "x" -o "x$CRYPT_XLINE_PASSWORD" != "x" ; then
|
||||
cat > crypter.tmp.c << __EOF__
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
|
||||
char salt[3];
|
||||
char *plaintext;
|
||||
srandom(time(0));
|
||||
salt[0] = saltChars[random() % 64];
|
||||
salt[1] = saltChars[random() % 64];
|
||||
salt[2] = 0;
|
||||
plaintext = argv[1];
|
||||
printf("%s", crypt(plaintext, salt));
|
||||
}
|
||||
__EOF__
|
||||
cc crypter.tmp.c -o crypter.tmp -lcrypt
|
||||
rm crypter.tmp.c
|
||||
fi
|
||||
|
||||
CONF=$IRCDCONF
|
||||
|
||||
if [ -r "$CONF" ]; then
|
||||
echo "$IRCDCONF found"
|
||||
echo " "
|
||||
echo " I don't suggest running this with the conf file already"
|
||||
echo "existing, since you will lose all the data in your conf file."
|
||||
echo "This script is just for creating one. If you want to recreate"
|
||||
echo "a conf file, type 'recreate'."
|
||||
echo $n " [exit] -> $c"
|
||||
read cc
|
||||
|
||||
if [ "$cc" != "recreate" ]; then
|
||||
echo " "
|
||||
echo " OK, do you want to edit $IRCDCONF using an editor?"
|
||||
echo "If so, specify the editor you want to use. Otherwise,"
|
||||
echo "type 'exit'."
|
||||
EDITFND="not found"
|
||||
|
||||
if [ -r /usr/bin/pico ]; then
|
||||
EDITFND="pico"
|
||||
fi
|
||||
|
||||
if [ -r /usr/bin/joe ]; then
|
||||
EDITFND="joe"
|
||||
fi
|
||||
|
||||
if [ -r /usr/bin/vi ]; then
|
||||
EDITFND="vi"
|
||||
fi
|
||||
|
||||
if [ -r /usr/bin/vim ]; then
|
||||
EDITFND="vim"
|
||||
fi
|
||||
|
||||
while [ "c" = "c" ]; do
|
||||
echo $n " [$EDITFND] -> $c"
|
||||
read EDITOR
|
||||
|
||||
if [ -z "$EDITOR" ]; then
|
||||
EDITOR="$EDITFND"
|
||||
fi
|
||||
|
||||
if [ "$EDITOR" = "exit" ]; then
|
||||
echo "Have a nice day."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f $EDITOR ]; then
|
||||
$EDITOR $CONF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f /usr/bin/$EDITOR ]; then
|
||||
/usr/bin/$EDITOR $CONF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " Editor not found. Specify a valid editor or"
|
||||
echo "type 'exit' to quit this script."
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
mv $CONF "$CONF.saved"
|
||||
rm $CONF
|
||||
echo "$IRCDCONF has been renamed to ircd.conf.saved"
|
||||
else
|
||||
echo "$IRCDCONF is not found. (good)"
|
||||
fi
|
||||
|
||||
clear
|
||||
echo "|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|"
|
||||
echo "| Welcome to the $IRCDCONF generator. |"
|
||||
echo "|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|"
|
||||
echo " "
|
||||
echo "What will your server name be? (ie: $SERVNAME)"
|
||||
echo $n " [$SERVNAME] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
SERVNAME="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What is your IRC server's IP? (ie: $VIRTUAL)"
|
||||
echo "Use * to bind to all interfaces"
|
||||
echo $n " [$VIRTUAL] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
VIRTUAL="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "Server comment? (ie: Main Hub Server)"
|
||||
echo $n " [$COMMENT] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
COMMENT="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "Main port? (ie: 6667)"
|
||||
echo $n " [$PORT] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
PORT="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What server numeric does the server have (range = 1..256)"
|
||||
echo "Must NOT be the same as other servers you link with"
|
||||
echo $n " [] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
NUMERIC="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What is your real name? (ie: John Doe)"
|
||||
echo $n " [$ADMIN] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
ADMIN="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What is your IRC nickname? (ie: JD)"
|
||||
echo $n " [$ADMNICK] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
ADMNICK="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What is your e-mail address? (ie: john@doe.com)"
|
||||
echo $n " [$ADMADDR] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
ADMADDR="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
OPERNAME="$ADMNICK"
|
||||
echo "What will your opername be for your O:line? (ie: johndoe)"
|
||||
echo $n " [$OPERNAME] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
OPERNAME="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What oper flags do you want to have? (ie: OAWZ)"
|
||||
echo "Some flags to choose from:"
|
||||
echo " o = local oper"
|
||||
echo " O = global oper"
|
||||
echo " N = network administrator"
|
||||
echo " A = server administrator"
|
||||
echo " C = co administrator"
|
||||
echo " read unrealircd.doc for more info about O:line flags)"
|
||||
echo $n " [$FLAGS] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
FLAGS="$cc"
|
||||
fi
|
||||
#Don't ask if they use encrypted oper passes, we can tell if they do
|
||||
|
||||
echo " "
|
||||
echo "What will your /oper password be? (ie: snoopy67)"
|
||||
echo $n " [$OPERPASS] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
OPERPASS="$cc"
|
||||
fi
|
||||
|
||||
if [ "$CRYPT_OPER_PASSWORD" != "" ]; then
|
||||
OPERPASS=`./crypter.tmp $OPERPASS`
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What is your user@host mask on IRC? (ie: *@*.toronto.globalserve.net)"
|
||||
echo $n " [$OPERADDR] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
OPERADDR="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What do you want your die password to be?"
|
||||
echo $n " [$DIEPASS] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
DIEPASS="$cc"
|
||||
fi
|
||||
|
||||
if [ "$CRYPT_XLINE_PASSWORD" != "" ]; then
|
||||
DIEPASS=`./crypter.tmp $cc`
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What do you want your restart password to be?"
|
||||
echo $n " [$RESTARTPASS] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
RESTARTPASS="$cc"
|
||||
fi
|
||||
if [ "$CRYPT_XLINE_PASSWORD" != "" ]; then
|
||||
RESTARTPASS=`./crypter.tmp $cc`
|
||||
fi
|
||||
echo " "
|
||||
echo "If your running services, or linking to a network that has"
|
||||
echo "services, please state the services servername."
|
||||
echo "If you are running a non-services network, just type 'next'"
|
||||
echo $n " [$SERVICES] -> $c"
|
||||
read cc
|
||||
|
||||
#if [ ! -z "$cc" ]; then
|
||||
# SERVICES="$cc"
|
||||
#fi
|
||||
|
||||
if [ "$cc" = "next" ]; then
|
||||
SERVICES="No.Services.Selected"
|
||||
elif [ ! -z "$cc" ]; then
|
||||
SERVICES="$cc"
|
||||
fi
|
||||
|
||||
cat > $CONF << __EOF__
|
||||
/*
|
||||
*
|
||||
* Filename: $IRCDCONF
|
||||
* Created: $DATE - $TIME
|
||||
*
|
||||
*/
|
||||
|
||||
/* Server Info */
|
||||
me {
|
||||
name $SERVNAME;
|
||||
info "$COMMENT";
|
||||
__EOF__
|
||||
if [ $NUMERIC != "" ]; then
|
||||
echo " numeric $NUMERIC;" >> $CONF
|
||||
fi
|
||||
cat >> $CONF << __EOF__
|
||||
};
|
||||
|
||||
/* Admin Info */
|
||||
admin {
|
||||
"$ADMIN";
|
||||
"$ADMNICK";
|
||||
"$ADMADDR";
|
||||
};
|
||||
|
||||
/* Classes */
|
||||
class clients {
|
||||
pingfreq 90;
|
||||
maxclients 245;
|
||||
sendq 100000;
|
||||
};
|
||||
|
||||
class servers {
|
||||
pingfreq 300;
|
||||
connfreq 600;
|
||||
maxclients 5;
|
||||
sendq 1000000;
|
||||
};
|
||||
|
||||
/* Allow info */
|
||||
allow {
|
||||
ip "*@*";
|
||||
hostname "*@*";
|
||||
class clients;
|
||||
};
|
||||
|
||||
/* Die/Restart Password */
|
||||
drpass {
|
||||
die "$DIEPASS";
|
||||
restart "$RESTARTPASS";
|
||||
};
|
||||
|
||||
oper $OPERNAME {
|
||||
from {
|
||||
userhost $OPERADDR;
|
||||
};
|
||||
password "$OPERPASS";
|
||||
flags $FLAGS;
|
||||
class clients;
|
||||
};
|
||||
|
||||
__EOF__
|
||||
|
||||
echo "/* Links */" >> $CONF
|
||||
echo " "
|
||||
echo " Would you like to configure any servers for linking?"
|
||||
echo "Type the servername, or type 'done' when finished."
|
||||
echo $n " [done] -> $c"
|
||||
read cc
|
||||
|
||||
if [ -z "$cc" ]; then
|
||||
cc="done"
|
||||
fi
|
||||
|
||||
while [ "$cc" != "done" ]; do
|
||||
THESERV="$cc"
|
||||
|
||||
SHOST="none"
|
||||
while [ "$SHOST" = "none" ]; do
|
||||
echo " "
|
||||
echo "Hostname or ip for the other server? Must be specified."
|
||||
echo $n " [] -> $c"
|
||||
read SHOST
|
||||
done
|
||||
|
||||
echo " "
|
||||
echo "Password to send to the other server?"
|
||||
echo $n " [$LINKPASS] -> $c"
|
||||
read CLP
|
||||
if [ -z "$CLP" ]; then
|
||||
CLP="$LINKPASS"
|
||||
fi
|
||||
if [ "$CRYPT_LINK_PASSWORD" != "" ]; then
|
||||
CLP=`./crypter.tmp $cc`
|
||||
fi
|
||||
|
||||
echo " "
|
||||
AUTOPORT=""
|
||||
AUTOCONN="bad"
|
||||
while [ "$AUTOCONN" = "bad" ]; do
|
||||
echo " "
|
||||
echo "Should we autconnect to this server?"
|
||||
echo $n " [Yes] -> $c"
|
||||
read cc
|
||||
if [ -z "$cc" ]; then
|
||||
cc="Yes"
|
||||
fi
|
||||
case "$cc" in
|
||||
[Yy]*)
|
||||
AUTOCONN="yes"
|
||||
echo "What port should we autoconnect to?"
|
||||
echo $n " [$PORT] -> $c"
|
||||
read AUTOPORT
|
||||
if [ -z "$AUTOPORT" ]; then
|
||||
AUTOPORT="$PORT"
|
||||
fi
|
||||
;;
|
||||
[Nn]*)
|
||||
AUTOCONN="no"
|
||||
;;
|
||||
*)
|
||||
echo "Please specify yes or no."
|
||||
AUTOCONN="bad"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo " "
|
||||
HUB="bad"
|
||||
while [ "$HUB" = "bad" ]; do
|
||||
echo " "
|
||||
echo "Will this server be a hub?"
|
||||
echo $n " [Yes] -> $c"
|
||||
read cc
|
||||
if [ -z "$cc" ]; then
|
||||
cc="Yes"
|
||||
fi
|
||||
case "$cc" in
|
||||
[Yy]*)
|
||||
HUB="Yes"
|
||||
;;
|
||||
[Nn]*)
|
||||
HUB="no"
|
||||
;;
|
||||
*)
|
||||
echo "Please specify yes or no."
|
||||
HUB="bad"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "link $THESERV {" >> $CONF
|
||||
USER=`echo $SHOST |sed -e 's/\(.*\)@.*/\1/'`
|
||||
HOST=`echo $SHOST |sed -e 's/.*@\(.*\)/\1/'`
|
||||
if [ "$USER" = "$SHOST" ]; then
|
||||
echo " username *;" >> $CONF
|
||||
echo " hostname $SHOST;" >> $CONF
|
||||
else
|
||||
echo " username $USER;" >> $CONF
|
||||
echo " hostname $HOST;" >> $CONF
|
||||
fi
|
||||
|
||||
echo " bind-ip *;" >> $CONF
|
||||
if [ "$AUTOPORT" != "" ]; then
|
||||
echo " port $AUTOPORT;" >> $CONF
|
||||
else
|
||||
echo " port $PORT;" >> $CONF
|
||||
fi
|
||||
echo " password-connect \"$CLP\";" >> $CONF
|
||||
echo " password-receive \"$CLP\";" >> $CONF
|
||||
echo " class servers;" >> $CONF
|
||||
if [ "$HUB" = "Yes" ]; then
|
||||
echo " hub *;" >> $CONF
|
||||
else
|
||||
echo " leaf *;" >> $CONF
|
||||
fi
|
||||
if [ "$AUTOCONN" != "no" ]; then
|
||||
echo " options {" >> $CONF
|
||||
echo " autoconnect;" >> $CONF
|
||||
echo " };" >> $CONF
|
||||
fi
|
||||
echo "};" >> $CONF
|
||||
echo " " >> $CONF
|
||||
echo " "
|
||||
echo "Type the servername, or type 'done' when finished."
|
||||
echo $n " [done] -> $c"
|
||||
read cc
|
||||
if [ -z "$cc" ]; then
|
||||
cc="done"
|
||||
fi
|
||||
done
|
||||
|
||||
cat >> $CONF << __EOF__
|
||||
/* Ulines */
|
||||
ulines {
|
||||
$SERVICES;
|
||||
};
|
||||
|
||||
/* Banned nick names */
|
||||
ban nick { mask "*C*h*a*n*S*e*r*v*"; reason "Reserved for services"; };
|
||||
ban nick { mask "*N*i*c*k*S*e*r*v*"; reason "Reserved for services"; };
|
||||
ban nick { mask "*M*e*m*o*S*e*r*v*"; reason "Reserved for services"; };
|
||||
ban nick { mask "*H*e*l*p*S*e*r*v*"; reason "Reserved for services"; };
|
||||
ban nick { mask "*O*p*e*r*S*e*r*v*"; reason "Reserved for services"; };
|
||||
ban nick { mask "*I*n*f*o*S*e*r*v*"; reason "Reserved for services"; };
|
||||
ban nick { mask "*Admin*"; reason "Reserved for Administrator"; };
|
||||
ban nick { mask "*IRC*op*"; reason "Reserved for ircops"; };
|
||||
ban nick { mask "*Oper*"; reason "Reserved for ircops"; };
|
||||
ban nick { mask "Status"; reason "Bug in mIRC"; };
|
||||
|
||||
/*
|
||||
* Include files
|
||||
*/
|
||||
include "badwords.channel.conf";
|
||||
include "badwords.message.conf";
|
||||
include "help.conf";
|
||||
/*
|
||||
* Some modules;
|
||||
*/
|
||||
loadmodule "src/modules/commands.so";
|
||||
loadmodule "src/modules/scan.so";
|
||||
loadmodule "src/modules/scan_socks.so";
|
||||
loadmodule "src/modules/scan_http.so";
|
||||
/* Ports */
|
||||
listen $VIRTUAL:$PORT;
|
||||
__EOF__
|
||||
|
||||
cc="blank"
|
||||
echo " "
|
||||
echo " "
|
||||
echo " Would you like any extra ports, other than 6667? Enter them here."
|
||||
echo "Type 'done' when you are finished. Type 'default' to use 6665-6669/7000."
|
||||
while [ "$cc" != "done" ]; do
|
||||
echo $n " [$OPRT] -> $c"
|
||||
read cc
|
||||
if [ -z "$cc" ]; then
|
||||
cc="$OPRT"
|
||||
fi
|
||||
if [ "$cc" = "default" ]; then
|
||||
echo "listen $VIRTUAL:6660;" >> $CONF
|
||||
echo "listen $VIRTUAL:6661;" >> $CONF
|
||||
echo "listen $VIRTUAL:6662;" >> $CONF
|
||||
echo "listen $VIRTUAL:6663;" >> $CONF
|
||||
echo "listen $VIRTUAL:6664;" >> $CONF
|
||||
echo "listen $VIRTUAL:6665;" >> $CONF
|
||||
echo "listen $VIRTUAL:6666;" >> $CONF
|
||||
echo "listen $VIRTUAL:6668;" >> $CONF
|
||||
echo "listen $VIRTUAL:6669;" >> $CONF
|
||||
echo "listen $VIRTUAL:7000;" >> $CONF
|
||||
cc="done"
|
||||
fi
|
||||
if [ "$cc" != "done" ]; then
|
||||
if [ $cc = "$PORT" ]; then
|
||||
echo " No, $PORT is already in use"
|
||||
echo "please use a port other than $PORT."
|
||||
else
|
||||
echo "listen $VIRTUAL:$cc;" >> $CONF
|
||||
fi
|
||||
fi
|
||||
case "$OPRT" in
|
||||
6660) OPRT="done"
|
||||
;;
|
||||
6661) OPRT="6660"
|
||||
;;
|
||||
6662) OPRT="6661"
|
||||
;;
|
||||
6663) OPRT="6662"
|
||||
;;
|
||||
6664) OPRT="6663"
|
||||
;;
|
||||
6665) OPRT="6664"
|
||||
;;
|
||||
6666) OPRT="6665"
|
||||
;;
|
||||
6669) OPRT="6666"
|
||||
;;
|
||||
6668) OPRT="6669"
|
||||
;;
|
||||
6667) OPRT="6668"
|
||||
;;
|
||||
*) OPRT="done"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Make it so ONLY the one who created the conf can read or write.
|
||||
chmod 700 $IRCDCONF
|
||||
|
||||
cat << __EOF__
|
||||
|
||||
|
||||
OK, $IRCDCONF has been generated according to what you specified.
|
||||
Make sure you double check for errors in $IRCDCONF. We recommend that
|
||||
you take a look at your $IRCDCONF right now. Thanks for using UnrealIRCd
|
||||
|
||||
__EOF__
|
||||
rm -f crypter.tmp
|
||||
echo "Have a nice day."
|
||||
echo "[Press enter to continue]"
|
||||
read cc
|
||||
more .CONFIG.RANT
|
||||
echo "[Press enter when you have read all of this]"
|
||||
read cc
|
||||
echo ""
|
||||
exit 1
|
||||
+9
-11
@@ -8,11 +8,11 @@ RC=rc
|
||||
DEBUG=1
|
||||
FD_SETSIZE=/D SCAN_API=1 /D FD_SETSIZE=16384
|
||||
!IFNDEF DEBUG
|
||||
CFLAGS=/MT /O2 /G5 /I ./INCLUDE /Fosrc/ /nologo $(FD_SETSIZE) $(NS_ADDRESS) /D STATIC_LINKING /D _WIN32GUI /D NOSPOOF=1 /c
|
||||
CFLAGS=/MT /J /O2 /G5 /I ./INCLUDE /Fosrc/ /nologo $(FD_SETSIZE) $(NS_ADDRESS) /D STATIC_LINKING /D _WIN32GUI /D NOSPOOF=1 /c
|
||||
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib ws2_32.lib advapi32.lib dbghelp.lib \
|
||||
oldnames.lib libcmt.lib comctl32.lib comdlg32.lib /nodefaultlib /nologo /out:WIRCD.EXE
|
||||
!ELSE
|
||||
CFLAGS= /MTd /Zi /I ./INCLUDE /Fosrc/ /nologo $(FD_SETSIZE) $(NS_ADDRESS) /D STATIC_LINKING /D _WIN32GUI /D NOSPOOF=1 /c
|
||||
CFLAGS=/MTd /J /Zi /I ./INCLUDE /Fosrc/ /nologo $(FD_SETSIZE) $(NS_ADDRESS) /D STATIC_LINKING /D _WIN32GUI /D NOSPOOF=1 /c
|
||||
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib wsock32.lib dbghelp.lib\
|
||||
oldnames.lib libcmt.lib comctl32.lib comdlg32.lib \
|
||||
advapi32.lib /nodefaultlib /nologo /debug /debugtype:BOTH /OUT:WIRCD.EXE
|
||||
@@ -42,12 +42,13 @@ MOD_FILES=SRC/L_COMMANDS.OBJ SRC/M_CHGHOST.OBJ SRC/M_SDESC.OBJ SRC/M_SETIDENT.OB
|
||||
SRC/M_SVSNLINE.OBJ SRC/M_WHO.OBJ SRC/M_SWHOIS.OBJ SRC/M_SVSMODE.OBJ \
|
||||
SRC/M_AWAY.OBJ SRC/M_SVSNOOP.OBJ SRC/M_MKPASSWD.OBJ SRC/M_SVSO.OBJ SRC/M_SVSNICK.OBJ \
|
||||
SRC/M_ADMINCHAT.OBJ SRC/M_AKILL.OBJ SRC/M_CHGNAME.OBJ SRC/M_GUEST.OBJ SRC/M_HTM.OBJ \
|
||||
SRC/M_KLINE.OBJ SRC/M_LAG.OBJ SRC/M_MESSAGE.OBJ SRC/M_NACHAT.OBJ SRC/M_OPER.OBJ \
|
||||
SRC/M_LAG.OBJ SRC/M_MESSAGE.OBJ SRC/M_NACHAT.OBJ SRC/M_OPER.OBJ \
|
||||
SRC/M_PINGPONG.OBJ SRC/M_QUIT.OBJ SRC/M_RAKILL.OBJ SRC/M_RPING.OBJ SRC/M_SENDUMODE.OBJ \
|
||||
SRC/M_SQLINE.OBJ SRC/M_KILL.OBJ SRC/M_TSCTL.OBJ SRC/M_UNKLINE.OBJ \
|
||||
SRC/M_UNSQLINE.OBJ SRC/M_UNZLINE.OBJ SRC/M_WHOIS.OBJ SRC/M_ZLINE.OBJ \
|
||||
SRC/M_UNSQLINE.OBJ SRC/M_UNZLINE.OBJ SRC/M_WHOIS.OBJ \
|
||||
SRC/SCAN.OBJ SRC/SCAN_SOCKS.OBJ SRC/SCAN_HTTP.OBJ SRC/M_TKL.OBJ SRC/M_VHOST.OBJ \
|
||||
SRC/M_CYCLE.OBJ SRC/M_SVSJOIN.OBJ SRC/M_SVSPART.OBJ SRC/INVISIBILITY.OBJ
|
||||
SRC/M_CYCLE.OBJ SRC/M_SVSJOIN.OBJ SRC/M_SVSPART.OBJ SRC/M_SVSLUSERS.OBJ \
|
||||
SRC/INVISIBILITY.OBJ
|
||||
|
||||
ALL: CONF UNREAL.EXE WIRCD.EXE
|
||||
|
||||
@@ -302,9 +303,6 @@ src/m_htm.obj: src/modules/m_htm.c $(INCLUDES)
|
||||
src/m_kill.obj: src/modules/m_kill.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_kill.c
|
||||
|
||||
src/m_kline.obj: src/modules/m_kline.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_kline.c
|
||||
|
||||
src/m_lag.obj: src/modules/m_lag.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_lag.c
|
||||
|
||||
@@ -350,9 +348,6 @@ src/m_unzline.obj: src/modules/m_unzline.c $(INCLUDES)
|
||||
src/m_whois.obj: src/modules/m_whois.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_whois.c
|
||||
|
||||
src/m_zline.obj: src/modules/m_zline.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_zline.c
|
||||
|
||||
src/m_vhost.obj: src/modules/m_vhost.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_vhost.c
|
||||
|
||||
@@ -365,6 +360,9 @@ src/m_svsjoin.obj: src/modules/m_svsjoin.c $(INCLUDES)
|
||||
src/m_svspart.obj: src/modules/m_svspart.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_svspart.c
|
||||
|
||||
src/m_svslusers.obj: src/modules/m_svslusers.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_svslusers.c
|
||||
|
||||
src/scan.obj: src/modules/scan.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/scan.c
|
||||
|
||||
|
||||
+7
-9
@@ -45,12 +45,13 @@ MOD_FILES=SRC/L_COMMANDS.OBJ SRC/M_CHGHOST.OBJ SRC/M_SDESC.OBJ SRC/M_SETIDENT.OB
|
||||
SRC/M_SVSNLINE.OBJ SRC/M_WHO.OBJ SRC/M_SWHOIS.OBJ SRC/M_SVSMODE.OBJ \
|
||||
SRC/M_AWAY.OBJ SRC/M_SVSNOOP.OBJ SRC/M_MKPASSWD.OBJ SRC/M_SVSO.OBJ SRC/M_SVSNICK.OBJ \
|
||||
SRC/M_ADMINCHAT.OBJ SRC/M_AKILL.OBJ SRC/M_CHGNAME.OBJ SRC/M_GUEST.OBJ SRC/M_HTM.OBJ \
|
||||
SRC/M_KLINE.OBJ SRC/M_LAG.OBJ SRC/M_MESSAGE.OBJ SRC/M_NACHAT.OBJ SRC/M_OPER.OBJ \
|
||||
SRC/M_LAG.OBJ SRC/M_MESSAGE.OBJ SRC/M_NACHAT.OBJ SRC/M_OPER.OBJ \
|
||||
SRC/M_PINGPONG.OBJ SRC/M_QUIT.OBJ SRC/M_RAKILL.OBJ SRC/M_RPING.OBJ SRC/M_SENDUMODE.OBJ \
|
||||
SRC/M_SQLINE.OBJ SRC/M_KILL.OBJ SRC/M_TSCTL.OBJ SRC/M_UNKLINE.OBJ \
|
||||
SRC/M_UNSQLINE.OBJ SRC/M_UNZLINE.OBJ SRC/M_WHOIS.OBJ SRC/M_ZLINE.OBJ \
|
||||
SRC/M_UNSQLINE.OBJ SRC/M_UNZLINE.OBJ SRC/M_WHOIS.OBJ \
|
||||
SRC/SCAN.OBJ SRC/SCAN_SOCKS.OBJ SRC/SCAN_HTTP.OBJ SRC/M_TKL.OBJ SRC/M_VHOST.OBJ \
|
||||
SRC/M_CYCLE.OBJ SRC/M_SVSJOIN.OBJ SRC/M_SVSPART.OBJ SRC/INVISIBILITY.OBJ
|
||||
SRC/M_CYCLE.OBJ SRC/M_SVSJOIN.OBJ SRC/M_SVSPART.OBJ SRC/M_SVSLUSERS.OBJ \
|
||||
SRC/INVISIBILITY.OBJ
|
||||
|
||||
ALL: CONF UNREAL.EXE WIRCD.EXE
|
||||
|
||||
@@ -305,9 +306,6 @@ src/m_htm.obj: src/modules/m_htm.c $(INCLUDES)
|
||||
src/m_kill.obj: src/modules/m_kill.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_kill.c
|
||||
|
||||
src/m_kline.obj: src/modules/m_kline.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_kline.c
|
||||
|
||||
src/m_lag.obj: src/modules/m_lag.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_lag.c
|
||||
|
||||
@@ -353,9 +351,6 @@ src/m_unzline.obj: src/modules/m_unzline.c $(INCLUDES)
|
||||
src/m_whois.obj: src/modules/m_whois.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_whois.c
|
||||
|
||||
src/m_zline.obj: src/modules/m_zline.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_zline.c
|
||||
|
||||
src/m_vhost.obj: src/modules/m_vhost.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_vhost.c
|
||||
|
||||
@@ -368,6 +363,9 @@ src/m_svsjoin.obj: src/modules/m_svsjoin.c $(INCLUDES)
|
||||
src/m_svspart.obj: src/modules/m_svspart.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_svspart.c
|
||||
|
||||
src/m_svslusers.obj: src/modules/m_svslusers.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/m_svslusers.c
|
||||
|
||||
src/scan.obj: src/modules/scan.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) src/modules/scan.c
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ set {
|
||||
coadmin "coadmin.ircsystems.net";
|
||||
admin "admin.ircsystems.net";
|
||||
servicesadmin "csops.ircsystems.net";
|
||||
techadmin "techadmin.ircsystems.net";
|
||||
netadmin "netadmin.ircsystems.net";
|
||||
host-on-oper-up "off";
|
||||
};
|
||||
|
||||
@@ -21,7 +21,6 @@ ADMIN_HOST="admin.mynet.org"
|
||||
LOCOP_HOST="locop.mynet.org"
|
||||
CSOP_HOST="csop.mynet.org"
|
||||
NETADMIN_HOST="netadmin.mynet.org"
|
||||
#TECHADMIN_HOST="techadmin.mynet.org"
|
||||
COADMIN_HOST="coadmin.mynet.org"
|
||||
HIDDEN_HOST="hide"
|
||||
NETDOMAIN="mynet.org"
|
||||
@@ -156,14 +155,6 @@ if [ ! -z $cc ]; then
|
||||
COADMIN_HOST="$cc"
|
||||
fi
|
||||
|
||||
#echo ""
|
||||
#echo "What is the virtual host techadmins will get when they oper up?"
|
||||
#echo $n "[$TECHADMIN_HOST] -> $c"
|
||||
#read cc
|
||||
#if [ ! -z $cc ]; then
|
||||
# TECHADMIN_HOST="$cc"
|
||||
#fi
|
||||
|
||||
echo ""
|
||||
echo "What is the virtual host netadmins will get when they oper up?"
|
||||
echo $n "[$NETADMIN_HOST] -> $c"
|
||||
@@ -237,7 +228,6 @@ set {
|
||||
coadmin "$COADMIN_HOST";
|
||||
admin "$ADMIN_HOST";
|
||||
servicesadmin "$CSOP_HOST";
|
||||
techadmin "$TECHADMIN_HOST";
|
||||
netadmin "$NETADMIN_HOST";
|
||||
__EOF__
|
||||
if [ "$INAH" = "1" ]; then
|
||||
@@ -250,42 +240,6 @@ echo " };" >> $FILE
|
||||
echo "};" >> $FILE
|
||||
__EOF__
|
||||
|
||||
echo ""
|
||||
echo "Would you like to submit the your network file to be included with future releases of unreal?"
|
||||
echo $n "[$SUBMIT] -> $c"
|
||||
read cc
|
||||
if [ ! -z $cc ]; then
|
||||
SUBMIT="$cc"
|
||||
fi
|
||||
case "$SUBMIT" in
|
||||
[Nn]*)
|
||||
echo ""
|
||||
echo "" >> ../unrealircd.conf
|
||||
echo "// Added by makenet $DATE" >> ../unrealircd.conf
|
||||
echo "include \"networks/$FILE\";" >> ../unrealircd.conf
|
||||
echo "All done. I have added \"include \"networks/$FILE\ to your unrealircd.conf"
|
||||
echo "You might want to edit it if you have done makenet before"
|
||||
echo "Thank you for choosing UnrealIRCd"
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$NETWORK" == "My IRC Network" ] ; then
|
||||
echo ""
|
||||
echo "You may not submit a network file that uses default values"
|
||||
exit
|
||||
fi
|
||||
|
||||
cat |sendmail -t << __EOF__&
|
||||
To: unreal-networks@lists.sourceforge.net
|
||||
From: $EMAIL
|
||||
Subject: Network file submission for $NETWORK
|
||||
|
||||
`cat $FILE`
|
||||
.
|
||||
__EOF__
|
||||
echo ""
|
||||
echo "" >> ../unrealircd.conf
|
||||
echo "// Added by makenet $DATE" >> ../unrealircd.conf
|
||||
|
||||
+90
-44
@@ -52,8 +52,8 @@ anAuthStruct AuthTypes[] = {
|
||||
#ifdef AUTHENABLE_SHA1
|
||||
{"sha1", AUTHTYPE_SHA1},
|
||||
#endif
|
||||
#ifdef AUTHENABLE_SSL_PUBKEY
|
||||
{"sslpubkey", AUTHTYPE_SSL_PUBKEY},
|
||||
#ifdef AUTHENABLE_SSL_CLIENTCERT
|
||||
{"sslclientcert", AUTHTYPE_SSL_CLIENTCERT},
|
||||
#endif
|
||||
#ifdef AUTHENABLE_RIPEMD160
|
||||
{"ripemd160", AUTHTYPE_RIPEMD160},
|
||||
@@ -81,11 +81,20 @@ int Auth_FindType(char *type)
|
||||
* }
|
||||
*/
|
||||
|
||||
anAuthStruct *Auth_ConvertConf2AuthStruct(ConfigEntry *ce)
|
||||
int Auth_CheckError(ConfigEntry *ce)
|
||||
{
|
||||
short type = AUTHTYPE_PLAINTEXT;
|
||||
anAuthStruct *as = NULL;
|
||||
/* If there is a {}, use it */
|
||||
#ifdef AUTHENABLE_SSL_CLIENTCERT
|
||||
X509 *x509_filecert = NULL;
|
||||
FILE *x509_f = NULL;
|
||||
#endif
|
||||
if (!ce->ce_vardata)
|
||||
{
|
||||
config_error("%s:%i: authentication module failure: missing parameter",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
|
||||
ce->ce_entries->ce_varname);
|
||||
return -1;
|
||||
}
|
||||
if (ce->ce_entries)
|
||||
{
|
||||
if (ce->ce_entries->ce_varname)
|
||||
@@ -96,16 +105,58 @@ anAuthStruct *Auth_ConvertConf2AuthStruct(ConfigEntry *ce)
|
||||
config_error("%s:%i: authentication module failure: %s is not an implemented/enabled authentication method",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
|
||||
ce->ce_entries->ce_varname);
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
#ifdef AUTHENABLE_UNIXCRYPT
|
||||
case AUTHTYPE_UNIXCRYPT:
|
||||
/* If our data is like 1 or none, we just let em through .. */
|
||||
if (strlen(ce->ce_vardata) < 2)
|
||||
{
|
||||
config_error("%s:%i: authentication module failure: AUTHTYPE_UNIXCRYPT: no salt (crypt strings will always be >2 in length)",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef AUTHENABLE_SSL_CLIENTCERT
|
||||
case AUTHTYPE_SSL_CLIENTCERT:
|
||||
if (!(x509_f = fopen(ce->ce_vardata, "r")))
|
||||
{
|
||||
config_error("%s:%i: authentication module failure: AUTHTYPE_SSL_CLIENTCERT: error opening file %s: %s",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
x509_filecert = PEM_read_X509(x509_f, NULL, NULL, NULL);
|
||||
fclose(x509_f);
|
||||
if (!x509_filecert)
|
||||
{
|
||||
config_error("%s:%i: authentication module failure: AUTHTYPE_SSL_CLIENTCERT: PEM_read_X509 errored in file %s (format error?)",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata);
|
||||
return -1;
|
||||
}
|
||||
X509_free(x509_filecert);
|
||||
break;
|
||||
#endif
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ce->ce_vardata)
|
||||
return 1;
|
||||
}
|
||||
|
||||
anAuthStruct *Auth_ConvertConf2AuthStruct(ConfigEntry *ce)
|
||||
{
|
||||
short type = AUTHTYPE_PLAINTEXT;
|
||||
anAuthStruct *as = NULL;
|
||||
/* If there is a {}, use it */
|
||||
if (ce->ce_entries)
|
||||
{
|
||||
config_error("%s:%i: authentication module failure: missing parameter",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
|
||||
ce->ce_entries->ce_varname);
|
||||
return NULL;
|
||||
if (ce->ce_entries->ce_varname)
|
||||
{
|
||||
type = Auth_FindType(ce->ce_entries->ce_varname);
|
||||
}
|
||||
}
|
||||
as = (anAuthStruct *) MyMalloc(sizeof(anAuthStruct));
|
||||
as->data = strdup(ce->ce_vardata);
|
||||
@@ -145,11 +196,10 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
|
||||
int i;
|
||||
#endif
|
||||
|
||||
#ifdef AUTHENABLE_SSL_PUBKEY
|
||||
EVP_PKEY *evp_pkey = NULL;
|
||||
EVP_PKEY *evp_pkeyfile = NULL;
|
||||
X509 *x509_client = NULL;
|
||||
FILE *key_file = NULL;
|
||||
#ifdef AUTHENABLE_SSL_CLIENTCERT
|
||||
X509 *x509_clientcert = NULL;
|
||||
X509 *x509_filecert = NULL;
|
||||
FILE *x509_f = NULL;
|
||||
#endif
|
||||
if (!as)
|
||||
return 1;
|
||||
@@ -200,7 +250,8 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
|
||||
HCRYPTHASH hHash;
|
||||
char buf2[512];
|
||||
DWORD size = 512;
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT))
|
||||
return -1;
|
||||
if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash))
|
||||
return -1;
|
||||
@@ -243,7 +294,8 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
|
||||
HCRYPTHASH hHash;
|
||||
char buf2[512];
|
||||
DWORD size = 512;
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT))
|
||||
return -1;
|
||||
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash))
|
||||
return -1;
|
||||
@@ -279,43 +331,35 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
|
||||
return -1;
|
||||
break;
|
||||
#endif
|
||||
#ifdef AUTHENABLE_SSL_PUBKEY
|
||||
case AUTHTYPE_SSL_PUBKEY:
|
||||
#ifdef AUTHENABLE_SSL_CLIENTCERT
|
||||
case AUTHTYPE_SSL_CLIENTCERT:
|
||||
if (!para)
|
||||
return -1;
|
||||
if (!cptr->ssl)
|
||||
return -1;
|
||||
x509_client = SSL_get_peer_certificate((SSL *)cptr->ssl);
|
||||
if (!x509_client)
|
||||
x509_clientcert = SSL_get_peer_certificate((SSL *)cptr->ssl);
|
||||
if (!x509_clientcert)
|
||||
return -1;
|
||||
evp_pkey = X509_get_pubkey(x509_client);
|
||||
if (!(key_file = fopen(para, "r")))
|
||||
if (!(x509_f = fopen(as->data, "r")))
|
||||
{
|
||||
EVP_PKEY_free(evp_pkey);
|
||||
X509_free(x509_client);
|
||||
X509_free(x509_clientcert);
|
||||
return -1;
|
||||
}
|
||||
evp_pkeyfile = PEM_read_PUBKEY(key_file, NULL,
|
||||
NULL, NULL);
|
||||
if (!evp_pkeyfile)
|
||||
x509_filecert = PEM_read_X509(x509_f, NULL, NULL, NULL);
|
||||
fclose(x509_f);
|
||||
if (!x509_filecert)
|
||||
{
|
||||
fclose(key_file);
|
||||
EVP_PKEY_free(evp_pkey);
|
||||
X509_free(x509_client);
|
||||
X509_free(x509_clientcert);
|
||||
return -1;
|
||||
}
|
||||
if (!(EVP_PKEY_cmp_parameters(evp_pkeyfile, evp_pkey)))
|
||||
if (X509_cmp(x509_filecert, x509_clientcert) != 0)
|
||||
{
|
||||
fclose(key_file);
|
||||
EVP_PKEY_free(evp_pkey);
|
||||
EVP_PKEY_free(evp_pkeyfile);
|
||||
X509_free(x509_client);
|
||||
return -1;
|
||||
X509_free(x509_clientcert);
|
||||
X509_free(x509_filecert);
|
||||
break;
|
||||
}
|
||||
fclose(key_file);
|
||||
EVP_PKEY_free(evp_pkey);
|
||||
EVP_PKEY_free(evp_pkeyfile);
|
||||
X509_free(x509_client);
|
||||
X509_free(x509_clientcert);
|
||||
X509_free(x509_filecert);
|
||||
return 2;
|
||||
#endif
|
||||
}
|
||||
@@ -371,7 +415,8 @@ char *Auth_Make(short type, char *para)
|
||||
HCRYPTPROV hProv;
|
||||
HCRYPTHASH hHash;
|
||||
DWORD size = 512;
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT))
|
||||
return NULL;
|
||||
if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash))
|
||||
return NULL;
|
||||
@@ -405,7 +450,8 @@ char *Auth_Make(short type, char *para)
|
||||
HCRYPTPROV hProv;
|
||||
HCRYPTHASH hHash;
|
||||
DWORD size = 512;
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
|
||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT))
|
||||
return NULL;
|
||||
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash))
|
||||
return NULL;
|
||||
|
||||
@@ -50,7 +50,6 @@ char *stripbadwords_channel(char *str)
|
||||
char *ptr;
|
||||
int errorcode, matchlen, stringlen;
|
||||
ConfigItem_badword *this_word;
|
||||
size_t n;
|
||||
if (!conf_badword_channel)
|
||||
return str;
|
||||
|
||||
@@ -111,7 +110,6 @@ char *stripbadwords_message(char *str)
|
||||
char *ptr;
|
||||
int errorcode, matchlen, stringlen;
|
||||
ConfigItem_badword *this_word;
|
||||
size_t n;
|
||||
if (!conf_badword_message)
|
||||
return str;
|
||||
|
||||
|
||||
+63
-46
@@ -1,4 +1,4 @@
|
||||
/* Unreal Internet Relay Chat Daemon, src/channel.c
|
||||
/* Unreal Internet Relay Chat Daemon, src/channel.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
* University of Oulu, Co Center
|
||||
*
|
||||
@@ -237,27 +237,30 @@ Member *make_member(void)
|
||||
|
||||
if (freemember == NULL)
|
||||
{
|
||||
for (i = 1; i <= (4072/sizeof(Member)); i++)
|
||||
for (i = 1; i <= (4072/sizeof(Member)); ++i)
|
||||
{
|
||||
lp = (Member *)MyMalloc(sizeof(Member));
|
||||
lp->cptr = NULL;
|
||||
lp->flags = 0;
|
||||
lp->next = freemember;
|
||||
freemember = lp;
|
||||
}
|
||||
lp = freemember;
|
||||
freemember = lp->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
lp = freemember;
|
||||
freemember = freemember->next;
|
||||
}
|
||||
lp = freemember;
|
||||
freemember = freemember->next;
|
||||
lp->next = NULL;
|
||||
return lp;
|
||||
}
|
||||
|
||||
void free_member(Member *lp)
|
||||
{
|
||||
lp->next = freemember;
|
||||
freemember = lp;
|
||||
if (lp)
|
||||
{
|
||||
lp->next = freemember;
|
||||
lp->cptr = NULL;
|
||||
lp->flags = 0;
|
||||
freemember = lp;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -321,15 +324,18 @@ Membership *make_membership(int local)
|
||||
|
||||
void free_membership(Membership *lp, int local)
|
||||
{
|
||||
if (!local)
|
||||
if (lp)
|
||||
{
|
||||
lp->next = freemembership;
|
||||
freemembership = lp;
|
||||
}
|
||||
else
|
||||
{
|
||||
lp->next = (Membership *) freemembershipL;
|
||||
freemembershipL = (MembershipL *) lp;
|
||||
if (!local)
|
||||
{
|
||||
lp->next = freemembership;
|
||||
freemembership = lp;
|
||||
}
|
||||
else
|
||||
{
|
||||
lp->next = (Membership *) freemembershipL;
|
||||
freemembershipL = (MembershipL *) lp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,6 +607,7 @@ void remove_user_from_channel(aClient *sptr, aChannel *chptr)
|
||||
Member *tmp; Membership *tmp2;
|
||||
Member *lp = chptr->members;
|
||||
|
||||
/* find 1st entry in list that is not user */
|
||||
for (; lp && (lp->cptr == sptr); lp = lp->next);
|
||||
for (;;)
|
||||
{
|
||||
@@ -611,8 +618,7 @@ void remove_user_from_channel(aClient *sptr, aChannel *chptr)
|
||||
free_member(tmp);
|
||||
break;
|
||||
}
|
||||
for (curr2 = &sptr->user->channel; (tmp2 = *curr2);
|
||||
curr2 = &tmp2->next)
|
||||
for (curr2 = &sptr->user->channel; (tmp2 = *curr2); curr2 = &tmp2->next)
|
||||
if (tmp2->chptr == chptr)
|
||||
{
|
||||
*curr2 = tmp2->next;
|
||||
@@ -1222,7 +1228,8 @@ CMD_FUNC(m_mode)
|
||||
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
|
||||
&& !is_half_op(sptr, chptr) && IsOper(sptr))
|
||||
&& !is_half_op(sptr, chptr) && (MyClient(sptr) ? (IsOper(sptr) &&
|
||||
OPCanOverride(sptr)) : IsOper(sptr)))
|
||||
{
|
||||
sendts = 0;
|
||||
opermode = 1;
|
||||
@@ -1230,7 +1237,8 @@ CMD_FUNC(m_mode)
|
||||
}
|
||||
|
||||
if (IsPerson(sptr) && !IsULine(sptr) && !is_chan_op(sptr, chptr)
|
||||
&& is_half_op(sptr, chptr) && IsOper(sptr))
|
||||
&& is_half_op(sptr, chptr) && (MyClient(sptr) ? (IsOper(sptr) &&
|
||||
OPCanOverride(sptr)) : IsOper(sptr)))
|
||||
{
|
||||
opermode = 2;
|
||||
goto aftercheck;
|
||||
@@ -1395,6 +1403,9 @@ void do_mode(aChannel *chptr, aClient *cptr, aClient *sptr, int parc, char *parv
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Should stop null modes */
|
||||
if (*(modebuf + 1) == '\0')
|
||||
return;
|
||||
if (IsPerson(sptr) && samode && MyClient(sptr))
|
||||
{
|
||||
sendto_serv_butone_token(NULL, me.name, MSG_GLOBOPS,
|
||||
@@ -1406,9 +1417,7 @@ void do_mode(aChannel *chptr, aClient *cptr, aClient *sptr, int parc, char *parv
|
||||
sptr = &me;
|
||||
sendts = 0;
|
||||
}
|
||||
/* Should stop null modes */
|
||||
if (*(modebuf + 1) == '\0')
|
||||
return;
|
||||
|
||||
|
||||
sendto_channel_butserv(chptr, sptr, ":%s MODE %s %s %s",
|
||||
sptr->name, chptr->chname, modebuf, parabuf);
|
||||
@@ -2416,7 +2425,7 @@ static int can_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *key, ch
|
||||
if ((chptr->mode.mode & MODE_RGSTRONLY) && !IsARegNick(sptr))
|
||||
return (ERR_NEEDREGGEDNICK);
|
||||
|
||||
if (*chptr->mode.key && (BadPtr(key) || mycmp(chptr->mode.key, key)))
|
||||
if (*chptr->mode.key && (BadPtr(key) || strcmp(chptr->mode.key, key)))
|
||||
return (ERR_BADCHANNELKEY);
|
||||
|
||||
if ((chptr->mode.mode & MODE_INVITEONLY))
|
||||
@@ -2894,7 +2903,9 @@ CMD_FUNC(m_join)
|
||||
char *p = NULL, *p2 = NULL;
|
||||
|
||||
bouncedtimes = 0;
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
|
||||
if (parc < 2 || *parv[1] == '\0')
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
@@ -3395,7 +3406,7 @@ CMD_FUNC(m_kick)
|
||||
continue;
|
||||
if (!IsServer(cptr)
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
&& !IsOper(sptr)
|
||||
&& (!IsOper(sptr) || !(MyClient(sptr) && OPCanOverride(sptr)))
|
||||
#endif
|
||||
&& !IsULine(sptr) && !is_chan_op(sptr, chptr)
|
||||
&& !is_halfop(sptr, chptr))
|
||||
@@ -3452,9 +3463,9 @@ CMD_FUNC(m_kick)
|
||||
chptr->chname, who->name, comment);
|
||||
goto attack;
|
||||
} /* is_chan_op */
|
||||
if (is_chanprot(who, chptr)
|
||||
if ((is_chanprot(who, chptr)
|
||||
|| is_chanowner(who, chptr)
|
||||
|| IsServices(who)) {
|
||||
|| IsServices(who)) && !is_chanowner(sptr, chptr)) {
|
||||
if (IsNetAdmin(sptr))
|
||||
{ /* IRCop kicking owner/prot */
|
||||
sendto_snomask(SNO_EYES,
|
||||
@@ -3676,10 +3687,12 @@ CMD_FUNC(m_topic)
|
||||
|| IsULine(sptr) || is_halfop(sptr, chptr)) && topic)
|
||||
{
|
||||
/* setting a topic */
|
||||
if (IsOper(sptr) && !(is_halfop(sptr, chptr)
|
||||
|| IsULine(sptr)
|
||||
|| is_chan_op(sptr, chptr))
|
||||
&& (chptr->mode.mode & MODE_TOPICLIMIT))
|
||||
if ((MyClient(sptr) ? (IsOper(sptr) &&
|
||||
OPCanOverride(sptr)) : IsOper(sptr)) &&
|
||||
!(is_halfop(sptr, chptr)
|
||||
|| IsULine(sptr)
|
||||
|| is_chan_op(sptr, chptr))
|
||||
&& (chptr->mode.mode & MODE_TOPICLIMIT))
|
||||
{
|
||||
#ifdef NO_OPEROVERRIDE
|
||||
return 0;
|
||||
@@ -3779,7 +3792,8 @@ CMD_FUNC(m_invite)
|
||||
if (chptr->mode.mode & MODE_NOINVITE && !IsULine(sptr))
|
||||
{
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
if (IsOper(sptr) && sptr == acptr)
|
||||
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
|
||||
IsOper(sptr)) && sptr == acptr)
|
||||
over = 1;
|
||||
else {
|
||||
#endif
|
||||
@@ -3794,7 +3808,8 @@ CMD_FUNC(m_invite)
|
||||
if (!IsMember(sptr, chptr) && !IsULine(sptr))
|
||||
{
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
if (IsOper(sptr) && sptr == acptr)
|
||||
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
|
||||
IsOper(sptr)) && sptr == acptr)
|
||||
over = 1;
|
||||
else {
|
||||
#endif
|
||||
@@ -3818,7 +3833,8 @@ CMD_FUNC(m_invite)
|
||||
if (!is_chan_op(sptr, chptr) && !IsULine(sptr))
|
||||
{
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
if (IsOper(sptr) && sptr == acptr)
|
||||
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
|
||||
IsOper(sptr)) && sptr == acptr)
|
||||
over = 1;
|
||||
else {
|
||||
#endif
|
||||
@@ -3832,7 +3848,8 @@ CMD_FUNC(m_invite)
|
||||
else if (!IsMember(sptr, chptr) && !IsULine(sptr))
|
||||
{
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
if (IsOper(sptr) && sptr == acptr)
|
||||
if ((MyClient(sptr) ? (IsOper(sptr) && OPCanOverride(sptr)) :
|
||||
IsOper(sptr)) && sptr == acptr)
|
||||
over = 1;
|
||||
else {
|
||||
#endif
|
||||
@@ -3914,11 +3931,11 @@ CMD_FUNC(m_invite)
|
||||
#endif
|
||||
)) {
|
||||
if (over == 1)
|
||||
sendto_channelops_butone(NULL, &me, chptr,
|
||||
sendto_channelprefix_butone(NULL, &me, chptr, PREFIX_OP,
|
||||
":%s NOTICE @%s :OperOverride -- %s invited him/herself into the channel.",
|
||||
me.name, chptr->chname, sptr->name);
|
||||
else if (over == 0)
|
||||
sendto_channelops_butone(NULL, &me, chptr,
|
||||
sendto_channelprefix_butone(NULL, &me, chptr, PREFIX_OP,
|
||||
":%s NOTICE @%s :%s invited %s into the channel.",
|
||||
me.name, chptr->chname, sptr->name, acptr->name);
|
||||
|
||||
@@ -3931,9 +3948,6 @@ CMD_FUNC(m_invite)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The function which sends the actual channel list back to the user.
|
||||
* Operates by stepping through the hashtable, sending the entries back if
|
||||
@@ -4568,6 +4582,9 @@ CMD_FUNC(m_knock)
|
||||
{
|
||||
aChannel *chptr;
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
|
||||
if (parc < 2 || *parv[1] == '\0')
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
@@ -4638,7 +4655,7 @@ CMD_FUNC(m_knock)
|
||||
return 0;
|
||||
}
|
||||
|
||||
sendto_channelops_butone(NULL, &me, chptr,
|
||||
sendto_channelprefix_butone(NULL, &me, chptr, PREFIX_OP,
|
||||
":%s NOTICE @%s :[Knock] by %s!%s@%s (%s) ",
|
||||
me.name, chptr->chname, sptr->name,
|
||||
sptr->user->username,
|
||||
@@ -4765,7 +4782,7 @@ CMD_FUNC(m_sjoin)
|
||||
Member *lp;
|
||||
Membership *lp2;
|
||||
aParv *ap;
|
||||
int ts, oldts, pcount, x, y, z, i, f;
|
||||
int ts, oldts, pcount, i, f;
|
||||
unsigned short b=0,c;
|
||||
Mode oldmode;
|
||||
char *t, *bp, *tp, *p = NULL;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "struct.h"
|
||||
|
||||
#include "h.h"
|
||||
/* The following functions have been taken from Hybrid7-beta8 simply because
|
||||
* I didn't feel like writing my own when they had ones that work just fine :)
|
||||
*/
|
||||
|
||||
+33
@@ -682,6 +682,39 @@ void crule_free(char **elem)
|
||||
*elem = NULL;
|
||||
}
|
||||
|
||||
char *crule_errstring(int errcode)
|
||||
{
|
||||
return crule_errstr[errcode-1];
|
||||
}
|
||||
|
||||
int crule_test(char *rule)
|
||||
{
|
||||
char *ruleptr = rule;
|
||||
int next_tok;
|
||||
crule_treeptr ruleroot = NULL;
|
||||
int errcode = CR_NOERR;
|
||||
|
||||
if ((errcode = crule_gettoken(&next_tok, &ruleptr)) == CR_NOERR) {
|
||||
if ((errcode = crule_parseorexpr(&ruleroot, &next_tok,
|
||||
&ruleptr)) == CR_NOERR) {
|
||||
if (ruleroot != NULL) {
|
||||
if (next_tok == CR_END)
|
||||
{
|
||||
crule_free((char **)&ruleroot);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
errcode = CR_UNEXPCTTOK;
|
||||
}
|
||||
else
|
||||
errcode = CR_EXPCTOR;
|
||||
}
|
||||
}
|
||||
if (ruleroot != NULL)
|
||||
crule_free((char **)&ruleroot);
|
||||
return errcode+1;
|
||||
}
|
||||
|
||||
#ifdef CR_DEBUG
|
||||
void print_tree(crule_treeptr printelem)
|
||||
{
|
||||
|
||||
+76
-76
@@ -78,14 +78,6 @@ char *malloc_options = "h" MALLOC_FLAGS_EXTRA;
|
||||
#endif
|
||||
time_t TSoffset = 0;
|
||||
|
||||
/* Added DrBin */
|
||||
#ifndef BIG_SECURITY_HOLE
|
||||
int un_uid = 99;
|
||||
int un_gid = 99;
|
||||
#endif
|
||||
/* End */
|
||||
|
||||
|
||||
#ifndef _WIN32
|
||||
extern char unreallogo[];
|
||||
#endif
|
||||
@@ -484,7 +476,6 @@ extern TS check_pings(TS currenttime)
|
||||
int i = 0;
|
||||
char banbuf[1024];
|
||||
int ping = 0;
|
||||
TS oldest = 0;
|
||||
|
||||
for (i = 0; i <= LastSlot; i++) {
|
||||
/*
|
||||
@@ -585,15 +576,23 @@ extern TS check_pings(TS currenttime)
|
||||
Debug((DEBUG_DEBUG, "c(%s)=%d p %d k %d a %d", cptr->name,
|
||||
cptr->status, ping, killflag,
|
||||
currenttime - cptr->lasttime));
|
||||
if (ping < (currenttime - cptr->lasttime)) {
|
||||
if (((cptr->flags & FLAGS_PINGSENT)
|
||||
&& ((currenttime - cptr->lasttime) >= (2 * ping)))
|
||||
|| ((!IsRegistered(cptr)
|
||||
&& (currenttime - cptr->since) >= ping)))
|
||||
|
||||
/* 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 (!IsRegistered(cptr) &&
|
||||
(DoingDNS(cptr) || DoingAuth(cptr)
|
||||
)) {
|
||||
/* if it's registered and doing dns/auth, timeout */
|
||||
if (!IsRegistered(cptr) && (DoingDNS(cptr) || DoingAuth(cptr)))
|
||||
{
|
||||
if (cptr->authfd >= 0) {
|
||||
CLOSE_SOCK(cptr->authfd);
|
||||
--OpenFiles;
|
||||
@@ -621,7 +620,11 @@ extern TS check_pings(TS currenttime)
|
||||
continue;
|
||||
}
|
||||
if (IsServer(cptr) || IsConnecting(cptr) ||
|
||||
IsHandshake(cptr)) {
|
||||
IsHandshake(cptr)
|
||||
#ifdef USE_SSL
|
||||
|| IsSSLConnectHandshake(cptr)
|
||||
#endif
|
||||
) {
|
||||
sendto_realops
|
||||
("No response from %s, closing link",
|
||||
get_client_name(cptr, FALSE));
|
||||
@@ -630,9 +633,16 @@ extern TS check_pings(TS currenttime)
|
||||
me.name, get_client_name(cptr,
|
||||
FALSE));
|
||||
}
|
||||
#ifdef USE_SSL
|
||||
if (IsSSLAcceptHandshake(cptr))
|
||||
Debug((DEBUG_DEBUG, "ssl accept handshake timeout: %s (%li-%li > %li)", cptr->sockhost,
|
||||
currenttime, cptr->since, ping));
|
||||
#endif
|
||||
exit_client(cptr, cptr, &me, "Ping timeout");
|
||||
continue;
|
||||
} else if (IsRegistered(cptr) &&
|
||||
|
||||
}
|
||||
else if (IsRegistered(cptr) &&
|
||||
((cptr->flags & FLAGS_PINGSENT) == 0)) {
|
||||
/*
|
||||
* if we havent PINGed the connection and we havent
|
||||
@@ -658,7 +668,7 @@ extern TS check_pings(TS currenttime)
|
||||
|| (IsSSLAcceptHandshake(cptr) || IsSSLConnectHandshake(cptr))
|
||||
#endif
|
||||
)
|
||||
if (cptr->firsttime ? ((TStime() - cptr->firsttime) >
|
||||
if (cptr->firsttime ? ((currenttime - cptr->firsttime) >
|
||||
100) : 0)
|
||||
(void)exit_client(cptr, cptr, &me,
|
||||
"Connection Timed Out");
|
||||
@@ -948,7 +958,7 @@ int InitwIRCD(int argc, char *argv[])
|
||||
exit(0);
|
||||
}
|
||||
case 'C':
|
||||
conf_debuglevel = atoi(p);
|
||||
config_verbose = atoi(p);
|
||||
break;
|
||||
case 'x':
|
||||
#ifdef DEBUGMODE
|
||||
@@ -993,58 +1003,6 @@ int InitwIRCD(int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(IRC_UID) && !defined(_WIN32)
|
||||
if ((uid != euid) && !euid) {
|
||||
(void)fprintf(stderr,
|
||||
"ERROR: do not run ircd setuid root. Make it setuid a\
|
||||
normal user.\n");
|
||||
exit(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (!defined(CHROOTDIR) || (defined(IRC_UID) && defined(IRC_GID))) \
|
||||
&& !defined(_WIN32)
|
||||
# ifndef AIX
|
||||
(void)setuid((uid_t) uid);
|
||||
(void)setuid((uid_t) euid);
|
||||
# endif
|
||||
/*
|
||||
* Modified 13/2000 DrBin
|
||||
* We need to have better controll over running as root ... see config.h
|
||||
*/
|
||||
if ((int)getuid() == 0) {
|
||||
#ifndef BIG_SECURITY_HOLE
|
||||
if ((IRC_UID == 0) || (IRC_GID == 0)) {
|
||||
(void)fprintf(stderr,
|
||||
"ERROR: SETUID and SETGID have not been set properly"
|
||||
"\nPlease read your documentation\n(HINT:SETUID or SETGID can not be 0)\n");
|
||||
exit(-1);
|
||||
} else {
|
||||
/*
|
||||
* run as a specified user
|
||||
*/
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"WARNING: ircd invoked as root\n");
|
||||
(void)fprintf(stderr, " changing to uid %d\n",
|
||||
IRC_UID);
|
||||
(void)fprintf(stderr, " changing to gid %d\n",
|
||||
IRC_GID);
|
||||
(void)setgid(IRC_GID);
|
||||
(void)setuid(IRC_UID);
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* check for setuid root as usual
|
||||
*/
|
||||
(void)fprintf(stderr,
|
||||
"ERROR: do not run ircd setuid root. Make it setuid a\
|
||||
normal user.\n");
|
||||
exit(-1);
|
||||
# endif
|
||||
}
|
||||
#endif /*CHROOTDIR/UID/GID/_WIN32 */
|
||||
|
||||
#ifndef _WIN32
|
||||
/*
|
||||
* didn't set debuglevel
|
||||
@@ -1088,7 +1046,7 @@ int InitwIRCD(int argc, char *argv[])
|
||||
ModCoreInfo.size = sizeof(ModuleInfo);
|
||||
ModCoreInfo.module_load = 0;
|
||||
ModCoreInfo.handle = NULL;
|
||||
l_commands_Init(&ModCoreInfo);
|
||||
l_commands_Test(&ModCoreInfo);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
@@ -1102,12 +1060,21 @@ int InitwIRCD(int argc, char *argv[])
|
||||
default_class->sendq = MAXSENDQLENGTH;
|
||||
default_class->name = "default";
|
||||
AddListItem(default_class, conf_class);
|
||||
init_conf2(configfile);
|
||||
validate_configuration();
|
||||
if (init_conf(configfile, 0) < 0)
|
||||
{
|
||||
exit(-1);
|
||||
}
|
||||
booted = TRUE;
|
||||
load_tunefile();
|
||||
make_umodestr();
|
||||
make_cmodestr();
|
||||
if (!find_Command_simple("AWAY") || !find_Command_simple("KILL") ||
|
||||
!find_Command_simple("OPER") || !find_Command_simple("PING"))
|
||||
{
|
||||
config_error("Someone forgot to load modules with proper commands in them. READ THE DOCUMENTATION");
|
||||
exit(-4);
|
||||
}
|
||||
|
||||
#ifdef USE_SSL
|
||||
#ifndef _WIN32
|
||||
fprintf(stderr, "* Initializing SSL.\n");
|
||||
@@ -1163,6 +1130,7 @@ int InitwIRCD(int argc, char *argv[])
|
||||
exit(1);
|
||||
conf_listen->options |= LISTENER_BOUND;
|
||||
me.umodes = conf_listen->options;
|
||||
conf_listen->listener = &me;
|
||||
run_configuration();
|
||||
botmotd = (aMotd *) read_file(BPATH, &botmotd);
|
||||
rules = (aMotd *) read_rules(RPATH);
|
||||
@@ -1209,6 +1177,38 @@ int InitwIRCD(int argc, char *argv[])
|
||||
R_fin_id = strlen(REPORT_FIN_ID);
|
||||
R_fail_id = strlen(REPORT_FAIL_ID);
|
||||
write_pidfile();
|
||||
|
||||
#if !defined(IRC_UID) && !defined(_WIN32)
|
||||
if ((uid != euid) && !euid) {
|
||||
(void)fprintf(stderr,
|
||||
"ERROR: do not run ircd setuid root. Make it setuid a normal user.\n");
|
||||
exit(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(IRC_UID) && defined(IRC_GID)
|
||||
if ((int)getuid() == 0) {
|
||||
if ((IRC_UID == 0) || (IRC_GID == 0)) {
|
||||
(void)fprintf(stderr,
|
||||
"ERROR: SETUID and SETGID have not been set properly"
|
||||
"\nPlease read your documentation\n(HINT:SETUID or SETGID can not be 0)\n");
|
||||
exit(-1);
|
||||
} else {
|
||||
/*
|
||||
* run as a specified user
|
||||
*/
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"WARNING: ircd invoked as root\n");
|
||||
(void)fprintf(stderr, " changing to uid %d\n",
|
||||
IRC_UID);
|
||||
(void)fprintf(stderr, " changing to gid %d\n",
|
||||
IRC_GID);
|
||||
(void)setgid(IRC_GID);
|
||||
(void)setuid(IRC_UID);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Debug((DEBUG_NOTICE, "Server ready..."));
|
||||
SetupEvents();
|
||||
loop.do_bancheck = 0;
|
||||
|
||||
+5
-1
@@ -264,7 +264,11 @@ void remove_client_from_list(aClient *cptr)
|
||||
if (cptr->srvptr && cptr->srvptr->serv)
|
||||
cptr->srvptr->serv->users--;
|
||||
}
|
||||
if (IsUnknown(cptr) || IsConnecting(cptr) || IsHandshake(cptr))
|
||||
if (IsUnknown(cptr) || IsConnecting(cptr) || IsHandshake(cptr)
|
||||
#ifdef USE_SSL
|
||||
|| IsSSLHandshake(cptr)
|
||||
#endif
|
||||
)
|
||||
IRCstats.unknown--;
|
||||
checklist();
|
||||
if (cptr->prev)
|
||||
|
||||
+186
-126
@@ -88,6 +88,8 @@ Module *Module_Find(char *name)
|
||||
|
||||
for (p = Modules; p; p = p->next)
|
||||
{
|
||||
if (!(p->flags & MODFLAG_TESTING) || (p->flags & MODFLAG_DELAYED))
|
||||
continue;
|
||||
if (!strcmp(p->header->name, name))
|
||||
{
|
||||
return (p);
|
||||
@@ -100,7 +102,7 @@ Module *Module_Find(char *name)
|
||||
/*
|
||||
* Returns an error if insucessful .. yes NULL is OK!
|
||||
*/
|
||||
char *Module_Load (char *path_, int load)
|
||||
char *Module_Create(char *path_)
|
||||
{
|
||||
#ifndef STATIC_LINKING
|
||||
#ifdef _WIN32
|
||||
@@ -108,6 +110,7 @@ char *Module_Load (char *path_, int load)
|
||||
#else /* _WIN32 */
|
||||
void *Mod;
|
||||
#endif /* _WIN32 */
|
||||
int (*Mod_Test)();
|
||||
int (*Mod_Init)();
|
||||
int (*Mod_Load)();
|
||||
int (*Mod_Unload)();
|
||||
@@ -189,49 +192,33 @@ char *Module_Load (char *path_, int load)
|
||||
irc_dlsym(Mod, "Mod_Handle", Mod_Handle);
|
||||
if (Mod_Handle)
|
||||
*Mod_Handle = mod;
|
||||
if (betaversion >= 8) {
|
||||
modinfo.size = sizeof(ModuleInfo);
|
||||
modinfo.module_load = load;
|
||||
modinfo.handle = mod;
|
||||
if ((ret = (*Mod_Init)(&modinfo)) < MOD_SUCCESS) {
|
||||
ircsprintf(errorbuf, "Mod_Init returned %i",
|
||||
ret);
|
||||
/* We EXPECT the module to have cleaned up it's mess */
|
||||
Module_free(mod);
|
||||
return (errorbuf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((ret = (*Mod_Init)(load)) < MOD_SUCCESS)
|
||||
{
|
||||
ircsprintf(errorbuf, "Mod_Init returned %i",
|
||||
ret);
|
||||
/* We EXPECT the module to have cleaned up it's mess */
|
||||
Module_free(mod);
|
||||
return (errorbuf);
|
||||
}
|
||||
}
|
||||
|
||||
if (load)
|
||||
irc_dlsym(Mod, "Mod_Test", Mod_Test);
|
||||
if (Mod_Test)
|
||||
{
|
||||
irc_dlsym(Mod, "Mod_Load", Mod_Load);
|
||||
if (!Mod_Load)
|
||||
{
|
||||
/* We cannot do delayed unloading if this happens */
|
||||
(*Mod_Unload)();
|
||||
Module_free(mod);
|
||||
return ("Unable to locate Mod_Load");
|
||||
if (betaversion >= 8) {
|
||||
modinfo.size = sizeof(ModuleInfo);
|
||||
modinfo.module_load = 0;
|
||||
modinfo.handle = mod;
|
||||
if ((ret = (*Mod_Test)(&modinfo)) < MOD_SUCCESS) {
|
||||
ircsprintf(errorbuf, "Mod_Test returned %i",
|
||||
ret);
|
||||
/* We EXPECT the module to have cleaned up it's mess */
|
||||
Module_free(mod);
|
||||
return (errorbuf);
|
||||
}
|
||||
}
|
||||
if ((ret = (*Mod_Load)(load)) < MOD_SUCCESS)
|
||||
{
|
||||
ircsprintf(errorbuf, "Mod_Load returned %i",
|
||||
ret);
|
||||
(*Mod_Unload)();
|
||||
Module_free(mod);
|
||||
return (errorbuf);
|
||||
else {
|
||||
if ((ret = (*Mod_Test)(0)) < MOD_SUCCESS)
|
||||
{
|
||||
ircsprintf(errorbuf, "Mod_Test returned %i",
|
||||
ret);
|
||||
/* We EXPECT the module to have cleaned up it's mess */
|
||||
Module_free(mod);
|
||||
return (errorbuf);
|
||||
}
|
||||
}
|
||||
mod->flags |= MODFLAG_LOADED;
|
||||
}
|
||||
mod->flags = MODFLAG_TESTING;
|
||||
AddListItem(mod, Modules);
|
||||
return NULL;
|
||||
}
|
||||
@@ -250,6 +237,16 @@ char *Module_Load (char *path_, int load)
|
||||
|
||||
}
|
||||
|
||||
void Module_DelayChildren(Module *m)
|
||||
{
|
||||
ModuleChild *c;
|
||||
for (c = m->children; c; c = c->next)
|
||||
{
|
||||
c->child->flags |= MODFLAG_DELAYED;
|
||||
Module_DelayChildren(c->child);
|
||||
}
|
||||
}
|
||||
|
||||
Module *Module_make(ModuleHeader *header,
|
||||
#ifdef _WIN32
|
||||
HMODULE mod
|
||||
@@ -268,6 +265,136 @@ Module *Module_make(ModuleHeader *header,
|
||||
return (modp);
|
||||
}
|
||||
|
||||
void Init_all_testing_modules(void)
|
||||
{
|
||||
|
||||
Module *mi, *next;
|
||||
int betaversion, tag, ret;
|
||||
iFP Mod_Init;
|
||||
ModuleInfo modinfo;
|
||||
for (mi = Modules; mi; mi = next)
|
||||
{
|
||||
next = mi->next;
|
||||
if (!(mi->flags & MODFLAG_TESTING))
|
||||
continue;
|
||||
irc_dlsym(mi->dll, "Mod_Init", Mod_Init);
|
||||
sscanf(mi->header->modversion, "3.2-b%d-%d", &betaversion, &tag);
|
||||
if (betaversion >= 8) {
|
||||
modinfo.size = sizeof(ModuleInfo);
|
||||
modinfo.module_load = 0;
|
||||
modinfo.handle = mi;
|
||||
if ((ret = (*Mod_Init)(&modinfo)) < MOD_SUCCESS) {
|
||||
config_error("Error loading %s: Mod_Init returned %i",
|
||||
mi->header->name, ret);
|
||||
Module_free(mi);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((ret = (*Mod_Init)(0)) < MOD_SUCCESS)
|
||||
{
|
||||
config_error("Error loading %s: Mod_Init returned %i",
|
||||
mi->header->name, ret);
|
||||
Module_free(mi);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
mi->flags = MODFLAG_INIT;
|
||||
}
|
||||
}
|
||||
|
||||
void Unload_all_loaded_modules(void)
|
||||
{
|
||||
Module *mi, *next;
|
||||
ModuleChild *child, *childnext;
|
||||
ModuleObject *objs, *objnext;
|
||||
iFP Mod_Unload;
|
||||
int ret;
|
||||
|
||||
for (mi = Modules; mi; mi = next)
|
||||
{
|
||||
next = mi->next;
|
||||
if (!(mi->flags & MODFLAG_LOADED) || (mi->flags & MODFLAG_DELAYED))
|
||||
continue;
|
||||
irc_dlsym(mi->dll, "Mod_Unload", Mod_Unload);
|
||||
if (Mod_Unload)
|
||||
{
|
||||
ret = (*Mod_Unload)(0);
|
||||
if (ret == MOD_DELAY)
|
||||
{
|
||||
mi->flags |= MODFLAG_DELAYED;
|
||||
Module_DelayChildren(mi);
|
||||
}
|
||||
}
|
||||
for (objs = mi->objects; objs; objs = objnext) {
|
||||
objnext = objs->next;
|
||||
if (objs->type == MOBJ_EVENT) {
|
||||
LockEventSystem();
|
||||
EventDel(objs->object.event);
|
||||
UnlockEventSystem();
|
||||
}
|
||||
else if (objs->type == MOBJ_HOOK) {
|
||||
HookDel(objs->object.hook);
|
||||
}
|
||||
else if (objs->type == MOBJ_COMMAND) {
|
||||
CommandDel(objs->object.command);
|
||||
}
|
||||
else if (objs->type == MOBJ_HOOKTYPE) {
|
||||
HooktypeDel(objs->object.hooktype, mi);
|
||||
}
|
||||
}
|
||||
for (child = mi->children; child; child = childnext)
|
||||
{
|
||||
childnext = child->next;
|
||||
DelListItem(child,mi->children);
|
||||
MyFree(child);
|
||||
}
|
||||
DelListItem(mi,Modules);
|
||||
irc_dlclose(mi->dll);
|
||||
MyFree(mi);
|
||||
}
|
||||
}
|
||||
|
||||
void Unload_all_testing_modules(void)
|
||||
{
|
||||
Module *mi, *next;
|
||||
ModuleChild *child, *childnext;
|
||||
ModuleObject *objs, *objnext;
|
||||
|
||||
for (mi = Modules; mi; mi = next)
|
||||
{
|
||||
next = mi->next;
|
||||
if (!(mi->flags & MODFLAG_TESTING))
|
||||
continue;
|
||||
for (objs = mi->objects; objs; objs = objnext) {
|
||||
objnext = objs->next;
|
||||
if (objs->type == MOBJ_EVENT) {
|
||||
LockEventSystem();
|
||||
EventDel(objs->object.event);
|
||||
UnlockEventSystem();
|
||||
}
|
||||
else if (objs->type == MOBJ_HOOK) {
|
||||
HookDel(objs->object.hook);
|
||||
}
|
||||
else if (objs->type == MOBJ_COMMAND) {
|
||||
CommandDel(objs->object.command);
|
||||
}
|
||||
else if (objs->type == MOBJ_HOOKTYPE) {
|
||||
HooktypeDel(objs->object.hooktype, mi);
|
||||
}
|
||||
}
|
||||
for (child = mi->children; child; child = childnext)
|
||||
{
|
||||
childnext = child->next;
|
||||
DelListItem(child,mi->children);
|
||||
MyFree(child);
|
||||
}
|
||||
DelListItem(mi,Modules);
|
||||
irc_dlclose(mi->dll);
|
||||
MyFree(mi);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns -1 if you cannot unload due to children still alive
|
||||
* Returns 1 if successful
|
||||
@@ -353,6 +480,8 @@ int Module_Unload(char *name, int unload)
|
||||
ret = (*Mod_Unload)(unload);
|
||||
if (ret == MOD_DELAY)
|
||||
{
|
||||
m->flags |= MODFLAG_DELAYED;
|
||||
Module_DelayChildren(m);
|
||||
return 2;
|
||||
}
|
||||
if (ret == MOD_FAILED)
|
||||
@@ -375,18 +504,11 @@ vFP Module_SymEx(
|
||||
{
|
||||
#ifndef STATIC_LINKING
|
||||
vFP fp;
|
||||
char buf[512];
|
||||
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
ircsprintf(buf, "_%s", name);
|
||||
|
||||
/* Run through all modules and check for symbols */
|
||||
irc_dlsym(mod, name, fp);
|
||||
if (fp)
|
||||
return (fp);
|
||||
irc_dlsym(mod, buf, fp);
|
||||
if (fp)
|
||||
return (fp);
|
||||
return NULL;
|
||||
@@ -398,23 +520,19 @@ vFP Module_Sym(char *name)
|
||||
{
|
||||
#ifndef STATIC_LINKING
|
||||
vFP fp;
|
||||
char buf[512];
|
||||
Module *mi;
|
||||
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
ircsprintf(buf, "_%s", name);
|
||||
|
||||
/* Run through all modules and check for symbols */
|
||||
for (mi = Modules; mi; mi = mi->next)
|
||||
{
|
||||
if (!(mi->flags & MODFLAG_TESTING) || (mi->flags & MODFLAG_DELAYED))
|
||||
continue;
|
||||
irc_dlsym(mi->dll, name, fp);
|
||||
if (fp)
|
||||
return (fp);
|
||||
irc_dlsym(mi->dll, buf, fp);
|
||||
if (fp)
|
||||
return (fp);
|
||||
}
|
||||
return NULL;
|
||||
#endif
|
||||
@@ -424,29 +542,22 @@ vFP Module_SymX(char *name, Module **mptr)
|
||||
{
|
||||
#ifndef STATIC_LINKING
|
||||
vFP fp;
|
||||
char buf[512];
|
||||
Module *mi;
|
||||
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
ircsprintf(buf, "_%s", name);
|
||||
|
||||
/* Run through all modules and check for symbols */
|
||||
for (mi = Modules; mi; mi = mi->next)
|
||||
{
|
||||
if (!(mi->flags & MODFLAG_TESTING) || (mi->flags & MODFLAG_DELAYED))
|
||||
continue;
|
||||
irc_dlsym(mi->dll, name, fp);
|
||||
if (fp)
|
||||
{
|
||||
*mptr = mi;
|
||||
return (fp);
|
||||
}
|
||||
irc_dlsym(mi->dll, buf, fp);
|
||||
if (fp)
|
||||
{
|
||||
*mptr = mi;
|
||||
return (fp);
|
||||
}
|
||||
}
|
||||
*mptr = NULL;
|
||||
return NULL;
|
||||
@@ -488,7 +599,7 @@ void module_loadall(int module_load)
|
||||
}
|
||||
else
|
||||
{
|
||||
mi->flags |= MODFLAG_LOADED;
|
||||
mi->flags = MODFLAG_LOADED;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -537,7 +648,7 @@ int Module_Depend_Resolve(Module *p)
|
||||
if (!*(d->pointer))
|
||||
{
|
||||
config_progress("Unable to resolve symbol %s, attempting to load %s to find it", d->symbol, d->module);
|
||||
Module_Load(d->module,0);
|
||||
Module_Create(d->module);
|
||||
*(d->pointer) = Module_SymX(d->symbol, &parental);
|
||||
if (!*(d->pointer)) {
|
||||
config_progress("module dependancy error: cannot resolve symbol %s",
|
||||
@@ -572,71 +683,19 @@ int m_module(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
if (parc < 2)
|
||||
if (!Modules)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "MODULE");
|
||||
return 0;
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** No modules loaded", me.name, sptr->name);
|
||||
return 1;
|
||||
}
|
||||
if (!match(parv[1], "load"))
|
||||
for (mi = Modules; mi; mi = mi->next)
|
||||
{
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "MODULE LOAD");
|
||||
return 0;
|
||||
}
|
||||
if (!(ret = Module_Load(parv[2], 1)))
|
||||
{
|
||||
sendto_realops("Loaded module %s", parv[2]);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_realops("Module load of %s failed: %s",
|
||||
parv[2], ret);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!match(parv[1], "unload"))
|
||||
{
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "MODULE UNLOAD");
|
||||
return 0;
|
||||
}
|
||||
sendto_realops("Trying to unload module %s", parv[2]);
|
||||
i = Module_Unload(parv[2], 0);
|
||||
{
|
||||
if (i == 1)
|
||||
sendto_realops("Unloaded module %s", parv[2]);
|
||||
else if (i == 2)
|
||||
sendto_realops("Delaying module unload of %s",
|
||||
parv[2]);
|
||||
else if (i == -1)
|
||||
sendto_realops("Couldn't unload module %s",
|
||||
parv[2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!match(parv[1], "status"))
|
||||
{
|
||||
if (!Modules)
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** No modules loaded", me.name, sptr->name);
|
||||
return 1;
|
||||
}
|
||||
for (mi = Modules; mi; mi = mi->next)
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** %s - %s (%s)", me.name, sptr->name,
|
||||
mi->header->name, mi->header->version, mi->header->description);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** Syntax: /module load|unload|status",
|
||||
me.name, sptr->name);
|
||||
char delayed[32];
|
||||
if (mi->flags & MODFLAG_DELAYED)
|
||||
strcpy(delayed, "[Unloading]");
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** %s - %s (%s) %s", me.name, sptr->name,
|
||||
mi->header->name, mi->header->version, mi->header->description,
|
||||
(mi->flags & MODFLAG_DELAYED) ? delayed : "");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -796,3 +855,4 @@ void unload_all_modules(void)
|
||||
(*Mod_Unload)(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-13
@@ -29,20 +29,21 @@ R_MODULES=m_sethost.so m_chghost.so m_chgident.so m_setname.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_akill.so m_chgname.so m_guest.so m_htm.so m_kill.so \
|
||||
m_kline.so m_lag.so m_message.so m_nachat.so m_oper.so m_pingpong.so \
|
||||
m_lag.so m_message.so m_nachat.so m_oper.so m_pingpong.so \
|
||||
m_quit.so m_rakill.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_zline.so m_tkl.so m_vhost.so m_cycle.so m_svsjoin.so m_svspart.so \
|
||||
m_tkl.so m_vhost.so m_cycle.so m_svsjoin.so m_svspart.so \
|
||||
invisibility.so scan.so scan_socks.so scan_http.so web/httpd.so
|
||||
|
||||
COMMANDS=m_sethost.c m_chghost.c m_chgident.c m_setname.c m_setident.c \
|
||||
m_sdesc.c m_svsmode.c m_swhois.c m_svsmotd.c m_svsnline.c \
|
||||
m_who.c m_mkpasswd.c m_away.c m_svsnoop.c m_svso.c m_svsnick.c \
|
||||
m_adminchat.c m_akill.c m_chgname.c m_guest.c m_htm.c m_kill.c \
|
||||
m_kline.c m_lag.c m_message.c m_nachat.c m_oper.c m_pingpong.c \
|
||||
m_lag.c m_message.c m_nachat.c m_oper.c m_pingpong.c \
|
||||
m_quit.c m_rakill.c m_rping.c m_sendumode.c m_sqline.c \
|
||||
m_tsctl.c m_unkline.c m_unsqline.c m_unzline.c m_whois.c \
|
||||
m_zline.c m_tkl.c m_vhost.c m_cycle.c m_svsjoin.c m_svspart.c
|
||||
m_tkl.c m_vhost.c m_cycle.c m_svsjoin.c m_svspart.c \
|
||||
m_svslusers.c
|
||||
|
||||
|
||||
MODULES=commands.so $(R_MODULES)
|
||||
@@ -89,10 +90,6 @@ m_kill.so: m_kill.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_kill.so m_kill.c
|
||||
|
||||
m_kline.so: m_kline.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_kline.so m_kline.c
|
||||
|
||||
m_lag.so: m_lag.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_lag.so m_lag.c
|
||||
@@ -153,11 +150,6 @@ m_whois.so: m_whois.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_whois.so m_whois.c
|
||||
|
||||
m_zline.so: m_zline.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_zline.so m_zline.c
|
||||
|
||||
|
||||
m_sethost.so: m_sethost.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_sethost.so m_sethost.c
|
||||
@@ -242,6 +234,10 @@ m_svspart.so: m_svspart.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_svspart.so m_svspart.c
|
||||
|
||||
m_svslusers.so: m_svslusers.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_svslusers.so m_svslusers.c
|
||||
|
||||
scan.so: scan.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o scan.so scan.c
|
||||
|
||||
+35
-18
@@ -73,6 +73,10 @@ ModuleHeader l_commands_Header
|
||||
* want to
|
||||
*/
|
||||
|
||||
#ifdef SCAN_API
|
||||
extern int m_scan_Test(ModuleInfo *modinfo);
|
||||
#endif
|
||||
|
||||
extern int m_sethost_Init(ModuleInfo *modinfo), m_setname_Init(ModuleInfo *modinfo), m_chghost_Init(ModuleInfo *modinfo);
|
||||
extern int m_chgident_Init(ModuleInfo *modinfo), m_setident_Init(ModuleInfo *modinfo), m_sdesc_Init(ModuleInfo *modinfo);
|
||||
extern int m_svsmode_Init(ModuleInfo *modinfo), m_swhois_Init(ModuleInfo *modinfo), m_svsmotd_Init(ModuleInfo *modinfo);
|
||||
@@ -83,10 +87,11 @@ extern int m_lag_Init(ModuleInfo *modinfo), m_rping_Init(ModuleInfo *modinfo), m
|
||||
extern int m_tsctl_Init(ModuleInfo *modinfo), m_htm_Init(ModuleInfo *modinfo), m_chgname_Init(ModuleInfo *modinfo);
|
||||
extern int m_message_Init(ModuleInfo *modinfo), m_whois_Init(ModuleInfo *modinfo), m_quit_Init(ModuleInfo *modinfo);
|
||||
extern int m_kill_Init(ModuleInfo *modinfo), m_pingpong_Init(ModuleInfo *modinfo), m_oper_Init(ModuleInfo *modinfo);
|
||||
extern int m_akill_Init(ModuleInfo *modinfo), m_rakill_Init(ModuleInfo *modinfo), m_zline_Init(ModuleInfo *modinfo);
|
||||
extern int m_unzline_Init(ModuleInfo *modinfo), m_kline_Init(ModuleInfo *modinfo), m_unkline_Init(ModuleInfo *modinfo);
|
||||
extern int m_akill_Init(ModuleInfo *modinfo), m_rakill_Init(ModuleInfo *modinfo);
|
||||
extern int m_unzline_Init(ModuleInfo *modinfo), m_unkline_Init(ModuleInfo *modinfo);
|
||||
extern int m_sqline_Init(ModuleInfo *modinfo), m_unsqline_Init(ModuleInfo *modinfo), m_tkl_Init(ModuleInfo *modinfo);
|
||||
extern int m_vhost_Init(ModuleInfo *modinfo), m_cycle_Init(ModuleInfo *modinfo), m_svsjoin_Init(ModuleInfo *modinfo);
|
||||
extern int m_svspart_Init(ModuleInfo *modinfo);
|
||||
extern int m_svspart_Init(ModuleInfo *modinfo), m_svslusers_Init(ModuleInfo *modinfo);
|
||||
#ifdef GUEST
|
||||
extern int m_guest_Init(ModuleInfo *modinfo);
|
||||
#endif
|
||||
@@ -107,11 +112,11 @@ extern int m_lag_Load(int module_load), m_rping_Load(int module_load), m_sendumo
|
||||
extern int m_tsctl_Load(int module_load), m_htm_Load(int module_load), m_chgname_Load(int module_load);
|
||||
extern int m_message_Load(int module_load), m_whois_Load(int module_load), m_quit_Load(int module_load);
|
||||
extern int m_kill_Load(int module_load), m_pingpong_Load(int module_load), m_oper_Load(int module_load);
|
||||
extern int m_akill_Load(int module_load), m_rakill_Load(int module_load), m_zline_Load(int module_load);
|
||||
extern int m_unzline_Load(int module_load), m_kline_Load(int module_load), m_unkline_Load(int module_load);
|
||||
extern int m_akill_Load(int module_load), m_rakill_Load(int module_load);
|
||||
extern int m_unzline_Load(int module_load), m_unkline_Load(int module_load);
|
||||
extern int m_sqline_Load(int module_load), m_unsqline_Load(int module_load), m_tkl_Load(int module_load);
|
||||
extern int m_vhost_Load(int module_load), m_cycle_Load(int module_load), m_svsjoin_Load(int module_load);
|
||||
extern int m_svspart_Load(int module_load);
|
||||
extern int m_svspart_Load(int module_load), m_svslusers_Load(int module_load);
|
||||
#ifdef GUEST
|
||||
extern int m_guest_Load(int module_load);
|
||||
#endif
|
||||
@@ -130,9 +135,9 @@ extern int m_adminchat_Unload(), m_nachat_Unload(), m_lag_Unload(), m_rping_Unlo
|
||||
extern int m_sendumode_Unload(), m_tsctl_Unload(), m_htm_Unload(), m_chgname_Unload();
|
||||
extern int m_message_Unload(), m_whois_Unload(), m_quit_Unload(), m_kill_Unload();
|
||||
extern int m_pingpong_Unload(), m_oper_Unload(), m_akill_Unload(), m_rakill_Unload();
|
||||
extern int m_zline_Unload(), m_unzline_Unload(), m_kline_Unload(), m_unkline_Unload();
|
||||
extern int m_unzline_Unload(), m_unkline_Unload();
|
||||
extern int m_sqline_Unload(), m_unsqline_Unload(), m_tkl_Unload(), m_vhost_Unload();
|
||||
extern int m_cycle_Unload(), m_svsjoin_Unload(), m_svspart_Unload();
|
||||
extern int m_cycle_Unload(), m_svsjoin_Unload(), m_svspart_Unload(), m_svslusers_Unload();
|
||||
#ifdef GUEST
|
||||
extern int m_guest_Unload();
|
||||
#endif
|
||||
@@ -143,6 +148,25 @@ extern int m_scan_Unload(), scan_socks_Unload(), scan_http_Unload();
|
||||
extern int invisibility_Unload();
|
||||
#endif
|
||||
|
||||
#ifdef SCAN_API
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Test(ModuleInfo *modinfo)
|
||||
#else
|
||||
int l_commands_Test(ModuleInfo *modinfo)
|
||||
#endif
|
||||
{
|
||||
Module p;
|
||||
bcopy(modinfo,&ModCmdsInfo,modinfo->size);
|
||||
p.header = &scan_socks_Header;
|
||||
Module_Depend_Resolve(&p);
|
||||
p.header = &scan_http_Header;
|
||||
Module_Depend_Resolve(&p);
|
||||
m_scan_Test(modinfo);
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Init(ModuleInfo *modinfo)
|
||||
#else
|
||||
@@ -190,9 +214,7 @@ int l_commands_Init(ModuleInfo *modinfo)
|
||||
m_oper_Init(&ModCmdsInfo);
|
||||
m_akill_Init(&ModCmdsInfo);
|
||||
m_rakill_Init(&ModCmdsInfo);
|
||||
m_zline_Init(&ModCmdsInfo);
|
||||
m_unzline_Init(&ModCmdsInfo);
|
||||
m_kline_Init(&ModCmdsInfo);
|
||||
m_unkline_Init(&ModCmdsInfo);
|
||||
m_sqline_Init(&ModCmdsInfo);
|
||||
m_unsqline_Init(&ModCmdsInfo);
|
||||
@@ -201,14 +223,11 @@ int l_commands_Init(ModuleInfo *modinfo)
|
||||
m_cycle_Init(&ModCmdsInfo);
|
||||
m_svsjoin_Init(&ModCmdsInfo);
|
||||
m_svspart_Init(&ModCmdsInfo);
|
||||
m_svslusers_Init(&ModCmdsInfo);
|
||||
#ifdef GUEST
|
||||
m_guest_Init(&ModCmdsInfo);
|
||||
#endif
|
||||
#ifdef SCAN_API
|
||||
p.header = &scan_socks_Header;
|
||||
Module_Depend_Resolve(&p);
|
||||
p.header = &scan_http_Header;
|
||||
Module_Depend_Resolve(&p);
|
||||
m_scan_Init(&ModCmdsInfo);
|
||||
scan_socks_Init(&ModCmdsInfo);
|
||||
scan_http_Init(&ModCmdsInfo);
|
||||
@@ -256,9 +275,7 @@ int l_commands_Load(int module_load)
|
||||
m_oper_Load(module_load);
|
||||
m_akill_Load(module_load);
|
||||
m_rakill_Load(module_load);
|
||||
m_zline_Load(module_load);
|
||||
m_unzline_Load(module_load);
|
||||
m_kline_Load(module_load);
|
||||
m_unkline_Load(module_load);
|
||||
m_tkl_Load(module_load);
|
||||
m_sqline_Load(module_load);
|
||||
@@ -267,6 +284,7 @@ int l_commands_Load(int module_load)
|
||||
m_cycle_Load(module_load);
|
||||
m_svsjoin_Load(module_load);
|
||||
m_svspart_Load(module_load);
|
||||
m_svslusers_Load(module_load);
|
||||
#ifdef GUEST
|
||||
m_guest_Load(module_load);
|
||||
#endif
|
||||
@@ -319,9 +337,7 @@ int l_commands_Unload(int module_unload)
|
||||
m_oper_Unload();
|
||||
m_akill_Unload();
|
||||
m_rakill_Unload();
|
||||
m_zline_Unload();
|
||||
m_unzline_Unload();
|
||||
m_kline_Unload();
|
||||
m_unkline_Unload();
|
||||
m_sqline_Unload();
|
||||
m_unsqline_Unload();
|
||||
@@ -329,6 +345,7 @@ int l_commands_Unload(int module_unload)
|
||||
m_cycle_Unload();
|
||||
m_svsjoin_Unload();
|
||||
m_svspart_Unload();
|
||||
m_svslusers_Unload();
|
||||
#ifdef GUEST
|
||||
m_guest_Unload();
|
||||
#endif
|
||||
|
||||
@@ -120,7 +120,6 @@ int m_akill_Unload(int module_unload)
|
||||
DLLFUNC int m_akill(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
char *hostmask, *usermask, *comment;
|
||||
ConfigItem_ban *bconf;
|
||||
char mo[1024];
|
||||
char *tkllayer[9] = {
|
||||
me.name, /*0 server.name */
|
||||
|
||||
@@ -117,7 +117,8 @@ int m_away_Unload(int module_unload)
|
||||
int m_away(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
|
||||
char *away, *awy2 = parv[1];
|
||||
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
away = sptr->user->away;
|
||||
if (parc < 2 || !*awy2)
|
||||
{
|
||||
|
||||
@@ -119,10 +119,13 @@ CMD_FUNC(m_cycle)
|
||||
{
|
||||
char channels[1024];
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
|
||||
if (parc < 2)
|
||||
return 0;
|
||||
parv[2] = "cycling";
|
||||
strncpy(channels, parv[1], 1020);
|
||||
strncpyzt(channels, parv[1], 1020);
|
||||
(void)m_part(cptr, sptr, 3, parv);
|
||||
parv[1] = channels;
|
||||
parv[2] = NULL;
|
||||
|
||||
+3
-14
@@ -160,13 +160,13 @@ DLLFUNC int m_htm(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
x = hunt_server_token(cptr, sptr, MSG_HTM, TOK_HTM, "%s", 1, parc, parv);
|
||||
x = hunt_server_token_quiet(cptr, sptr, MSG_HTM, TOK_HTM, "%s", 1, parc, parv);
|
||||
break;
|
||||
case 3:
|
||||
x = hunt_server_token(cptr, sptr, MSG_HTM, TOK_HTM, "%s %s", 1, parc, parv);
|
||||
x = hunt_server_token_quiet(cptr, sptr, MSG_HTM, TOK_HTM, "%s %s", 1, parc, parv);
|
||||
break;
|
||||
default:
|
||||
x = hunt_server_token(cptr, sptr, MSG_HTM, TOK_HTM, "%s %s %s", 1, parc, parv);
|
||||
x = hunt_server_token_quiet(cptr, sptr, MSG_HTM, TOK_HTM, "%s %s %s", 1, parc, parv);
|
||||
}
|
||||
|
||||
switch (x) {
|
||||
@@ -211,17 +211,6 @@ DLLFUNC int m_htm(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
char *command = parv[1];
|
||||
|
||||
if (strchr(command, '.'))
|
||||
{
|
||||
if ((x =
|
||||
hunt_server_token(cptr, sptr, MSG_HTM, TOK_HTM, "%s", 1, parc,
|
||||
parv)) != HUNTED_ISME)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
if (!stricmp(command, "ON"))
|
||||
{
|
||||
EventInfo mod;
|
||||
|
||||
@@ -340,7 +340,7 @@ DLLFUNC int m_kill(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
if ((killer = index(path, ' ')))
|
||||
{
|
||||
while (*killer && *killer != '!')
|
||||
while ((killer >= path) && *killer && *killer != '!')
|
||||
killer--;
|
||||
if (!*killer)
|
||||
killer = path;
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/modules/m_kline.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 STRIPBADWORDS
|
||||
#include "badwords.h"
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#include "version.h"
|
||||
#endif
|
||||
|
||||
DLLFUNC int m_kline(aClient *cptr, aClient *sptr, int parc, char *parv[]);
|
||||
|
||||
/* Place includes here */
|
||||
#define MSG_KLINE "KLINE" /* KLINE */
|
||||
#define TOK_KLINE "W" /* 87 */
|
||||
|
||||
|
||||
|
||||
#ifndef DYNAMIC_LINKING
|
||||
ModuleHeader m_kline_Header
|
||||
#else
|
||||
#define m_kline_Header Mod_Header
|
||||
ModuleHeader Mod_Header
|
||||
#endif
|
||||
= {
|
||||
"kline", /* Name of module */
|
||||
"$Id$", /* Version */
|
||||
"command /kline", /* Short description of module */
|
||||
"3.2-b8-1",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/* The purpose of these ifdefs, are that we can "static" link the ircd if we
|
||||
* want to
|
||||
*/
|
||||
|
||||
/* This is called on module init, before Server Ready */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Init(ModuleInfo *modinfo)
|
||||
#else
|
||||
int m_kline_Init(ModuleInfo *modinfo)
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* We call our add_Command crap here
|
||||
*/
|
||||
add_Command(MSG_KLINE, TOK_KLINE, m_kline, 2);
|
||||
return MOD_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/* Is first run when server is 100% ready */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Load(int module_load)
|
||||
#else
|
||||
int m_kline_Load(int module_load)
|
||||
#endif
|
||||
{
|
||||
return MOD_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Called when module is unloaded */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Unload(int module_unload)
|
||||
#else
|
||||
int m_kline_Unload(int module_unload)
|
||||
#endif
|
||||
{
|
||||
if (del_Command(MSG_KLINE, TOK_KLINE, m_kline) < 0)
|
||||
{
|
||||
sendto_realops("Failed to delete commands when unloading %s",
|
||||
m_kline_Header.name);
|
||||
}
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
** m_kline;
|
||||
** parv[0] = sender prefix
|
||||
** parv[1] = nickname
|
||||
** parv[2] = comment or filename
|
||||
*/
|
||||
DLLFUNC int m_kline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
char *host, *tmp, *hosttemp;
|
||||
char uhost[80], name[80];
|
||||
int ip1, ip2, ip3, i;
|
||||
aClient *acptr;
|
||||
ConfigItem_ban *bconf;
|
||||
|
||||
if (!MyClient(sptr) || !OPCanKline(sptr))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (parc < 2)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "KLINE");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* This patch allows opers to quote kline by address as well as nick
|
||||
* --Russell
|
||||
*/
|
||||
if ((hosttemp = (char *)strchr((char *)parv[1], '@')))
|
||||
{
|
||||
*hosttemp = 0;
|
||||
hosttemp++;
|
||||
strlcpy(name, parv[1], sizeof name);
|
||||
strlcpy(uhost, hosttemp, sizeof uhost);
|
||||
|
||||
|
||||
if (name[0] == '\0' || uhost[0] == '\0')
|
||||
{
|
||||
Debug((DEBUG_INFO, "KLINE: Bad field!"));
|
||||
sendto_one(sptr,
|
||||
"NOTICE %s :*** If you're going to add a userhost, at LEAST specify both fields",
|
||||
parv[0]);
|
||||
return 0;
|
||||
}
|
||||
if (hosttemp)
|
||||
{
|
||||
hosttemp++;
|
||||
i = 0;
|
||||
while (*hosttemp)
|
||||
{
|
||||
if (*hosttemp != '*' && *hosttemp != '.' && *hosttemp != '?')
|
||||
i++;
|
||||
hosttemp++;
|
||||
}
|
||||
if (i < 4)
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** [K:Line error] Too broad mask",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* by nick */
|
||||
else
|
||||
{
|
||||
if (!(acptr = find_client(parv[1], NULL)))
|
||||
{
|
||||
if (!(acptr =
|
||||
get_history(parv[1], (long)KILLCHASETIMELIMIT)))
|
||||
{
|
||||
sendto_one(sptr,
|
||||
"NOTICE %s :*** Can't find user %s to add KLINE",
|
||||
parv[0], parv[1]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!acptr->user)
|
||||
return 0;
|
||||
|
||||
strlcpy(name, acptr->user->username, sizeof name);
|
||||
if (MyClient(acptr))
|
||||
host = acptr->sockhost;
|
||||
else
|
||||
host = acptr->user->realhost;
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
if (name == '\0' || host == '\0')
|
||||
{
|
||||
Debug((DEBUG_INFO, "KLINE: Bad field"));
|
||||
sendto_one(sptr, "NOTICE %s :*** Bad field!", parv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add some wildcards */
|
||||
|
||||
/*
|
||||
* sscanf is bad :/ at least make host < uhost
|
||||
*/
|
||||
if (strlen(host) > sizeof uhost)
|
||||
host[sizeof uhost - 1] = '\0';
|
||||
|
||||
strlcpy(uhost, host, sizeof uhost);
|
||||
|
||||
if (isdigit(host[strlen(host) - 1]))
|
||||
{
|
||||
if (sscanf(host, "%d.%d.%d.%*d", &ip1, &ip2, &ip3))
|
||||
ircsprintf(uhost, "%d.%d.%d.*", ip1, ip2, ip3);
|
||||
}
|
||||
else if (sscanf(host, "%*[^.].%*[^.].%s", uhost))
|
||||
{ /* Not really... */
|
||||
tmp = (char *)strchr(host, '.');
|
||||
ircsprintf(uhost, "*%s", tmp);
|
||||
}
|
||||
}
|
||||
|
||||
sendto_realops("%s added a temporary user ban for %s@%s %s", parv[0], name, uhost,
|
||||
parv[2] ? parv[2] : "");
|
||||
ircd_log(LOG_KLINE, "%s added a temporary user ban for %s@%s %s",
|
||||
parv[0], name, uhost,
|
||||
parv[2] ? parv[2] : "");
|
||||
bconf = (ConfigItem_ban *)MyMallocEx(sizeof(ConfigItem_ban));
|
||||
bconf->flag.type = CONF_BAN_USER;
|
||||
bconf->mask = strdup(make_user_host(name, uhost));
|
||||
bconf->reason = parv[2] ? strdup(parv[2]) : NULL;
|
||||
bconf->flag.type2 = CONF_BAN_TYPE_TEMPORARY;
|
||||
AddListItem(bconf, conf_ban);
|
||||
loop.do_bancheck = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -136,10 +136,6 @@ int m_message_Unload(int module_unload)
|
||||
** rev argv 6/91
|
||||
**
|
||||
*/
|
||||
#define PREFIX_HALFOP 0x1
|
||||
#define PREFIX_VOICE 0x2
|
||||
#define PREFIX_OP 0x4
|
||||
|
||||
DLLFUNC int m_message(aClient *cptr, aClient *sptr, int parc, char *parv[], int notice)
|
||||
{
|
||||
aClient *acptr;
|
||||
|
||||
@@ -158,6 +158,9 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
|
||||
int i = 0, j = 0;
|
||||
char* announce = 0;
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
|
||||
if (parc < 3) {
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "OPER");
|
||||
@@ -264,15 +267,15 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
|
||||
|
||||
if (announce != NULL) {
|
||||
sendto_ops
|
||||
("%s (%s@%s) %s",
|
||||
("%s (%s@%s) [%s] %s",
|
||||
parv[0], sptr->user->username,
|
||||
IsHidden(sptr) ? sptr->user->virthost : sptr->
|
||||
user->realhost, announce);
|
||||
user->realhost, parv[1], announce);
|
||||
sendto_serv_butone(&me,
|
||||
":%s GLOBOPS :%s (%s@%s) %s",
|
||||
":%s GLOBOPS :%s (%s@%s) [%s] %s",
|
||||
me.name, parv[0], sptr->user->username,
|
||||
IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->user->realhost, announce);
|
||||
user->virthost : sptr->user->realhost, parv[1], announce);
|
||||
|
||||
}
|
||||
if (!aconf->snomask)
|
||||
@@ -304,11 +307,6 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
|
||||
};
|
||||
(void)m_join(cptr, sptr, 3, chans);
|
||||
}
|
||||
|
||||
#if defined(USE_SYSLOG) && defined(SYSLOG_OPER)
|
||||
syslog(LOG_INFO, "OPER (%s) by (%s!%s@%s)",
|
||||
name, parv[0], sptr->user->username, sptr->sockhost);
|
||||
#endif
|
||||
ircd_log(LOG_OPER, "OPER (%s) by (%s!%s@%s)", name, parv[0], sptr->user->username,
|
||||
sptr->sockhost);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ int m_quit_Unload(int module_unload)
|
||||
DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
char *ocomment = (parc > 1 && parv[1]) ? parv[1] : parv[0];
|
||||
static char comment[TOPICLEN];
|
||||
static char comment[TOPICLEN + 1];
|
||||
|
||||
if (!IsServer(cptr))
|
||||
{
|
||||
|
||||
@@ -122,8 +122,6 @@ int m_rakill_Unload(int module_unload)
|
||||
*/
|
||||
DLLFUNC int m_rakill(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
char *hostmask, *usermask;
|
||||
char mo[1024];
|
||||
char *tkllayer[6] = {
|
||||
me.name, /*0 server.name */
|
||||
"-", /*1 - */
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* IRC - Internet Relay Chat, src/modules/m_svslusers.c
|
||||
* (C) 2002 codemastr [Dominick Meglio] (codemastr@unrealircd.com)
|
||||
*
|
||||
* SVSLUSERS command, allows remote setting of local and global max user count
|
||||
*
|
||||
* 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 STRIPBADWORDS
|
||||
#include "badwords.h"
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#include "version.h"
|
||||
#endif
|
||||
extern ircstats IRCstats;
|
||||
DLLFUNC int m_svslusers(aClient *cptr, aClient *sptr, int parc, char *parv[]);
|
||||
|
||||
#define MSG_SVSLUSERS "SVSLUSERS"
|
||||
#define TOK_SVSLUSERS "BU"
|
||||
|
||||
|
||||
#ifndef DYNAMIC_LINKING
|
||||
ModuleHeader m_svslusers_Header
|
||||
#else
|
||||
#define m_svslusers_Header Mod_Header
|
||||
ModuleHeader Mod_Header
|
||||
#endif
|
||||
= {
|
||||
"m_svslusers",
|
||||
"$Id$",
|
||||
"command /svslusers",
|
||||
"3.2-b8-1",
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Init(ModuleInfo *modinfo)
|
||||
#else
|
||||
int m_svslusers_Init(ModuleInfo *modinfo)
|
||||
#endif
|
||||
{
|
||||
add_Command(MSG_SVSLUSERS, TOK_SVSLUSERS, m_svslusers, MAXPARA);
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Load(int module_load)
|
||||
#else
|
||||
int m_svslusers_Load(int module_load)
|
||||
#endif
|
||||
{
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Unload(int module_unload)
|
||||
#else
|
||||
int m_svslusers_Unload(int module_unload)
|
||||
#endif
|
||||
{
|
||||
if (del_Command(MSG_SVSLUSERS, TOK_SVSLUSERS, m_svslusers) < 0)
|
||||
{
|
||||
sendto_realops("Failed to delete commands when unloading %s",
|
||||
m_svslusers_Header.name);
|
||||
}
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
/*
|
||||
** m_svslusers
|
||||
** parv[0] = sender
|
||||
** parv[1] = server to update
|
||||
** parv[2] = max global users
|
||||
** parv[3] = max local users
|
||||
** If -1 is specified for either number, it is ignored and the current count
|
||||
** is kept.
|
||||
*/
|
||||
int m_svslusers(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
aClient *acptr;
|
||||
|
||||
if (!IsULine(sptr) || parc < 4)
|
||||
return -1;
|
||||
if (hunt_server_token(cptr, sptr, MSG_SVSLUSERS, TOK_SVSLUSERS, "%s %s :%s", 1, parc,
|
||||
parv) == HUNTED_ISME)
|
||||
{
|
||||
int temp;
|
||||
temp = atoi(parv[2]);
|
||||
if (temp >= 0)
|
||||
IRCstats.global_max = temp;
|
||||
temp = atoi(parv[3]);
|
||||
if (temp >= 0)
|
||||
IRCstats.me_max = temp;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -480,6 +480,7 @@ int m_svs2mode(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators--;
|
||||
goto setmodey;
|
||||
case 'H':
|
||||
if (what == MODE_ADD && !(acptr->umodes & UMODE_HIDEOPER))
|
||||
IRCstats.operators--;
|
||||
|
||||
+40
-18
@@ -41,8 +41,8 @@ DLLFUNC int m_tkl_line(aClient *cptr, aClient *sptr, int parc, char *parv[], cha
|
||||
#define MSG_SHUN "SHUN"
|
||||
#define TOK_SHUN "BL"
|
||||
#define MSG_GZLINE "GZLINE"
|
||||
#define MSG_TKLINE "TKLINE"
|
||||
#define MSG_TZLINE "TZLINE"
|
||||
#define MSG_KLINE "KLINE"
|
||||
#define MSG_ZLINE "ZLINE"
|
||||
#define TOK_NONE ""
|
||||
|
||||
#ifndef DYNAMIC_LINKING
|
||||
@@ -76,8 +76,8 @@ int m_tkl_Init(ModuleInfo *modinfo)
|
||||
*/
|
||||
add_Command(MSG_GLINE, TOK_GLINE, m_gline, 3);
|
||||
add_Command(MSG_SHUN, TOK_SHUN, m_shun, 3);
|
||||
add_Command(MSG_TZLINE, TOK_NONE, m_tzline, 3);
|
||||
add_Command(MSG_TKLINE, TOK_NONE, m_tkline, 3);
|
||||
add_Command(MSG_ZLINE, TOK_NONE, m_tzline, 3);
|
||||
add_Command(MSG_KLINE, TOK_NONE, m_tkline, 3);
|
||||
add_Command(MSG_GZLINE, TOK_NONE, m_gzline, 3);
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
@@ -102,9 +102,9 @@ int m_tkl_Unload(int module_unload)
|
||||
{
|
||||
if ((del_Command(MSG_GLINE, TOK_GLINE, m_gline) < 0) ||
|
||||
(del_Command(MSG_SHUN, TOK_SHUN, m_shun) < 0 ) ||
|
||||
(del_Command(MSG_TZLINE, TOK_NONE, m_tzline) < 0) ||
|
||||
(del_Command(MSG_ZLINE, TOK_NONE, m_tzline) < 0) ||
|
||||
(del_Command(MSG_GZLINE, TOK_NONE, m_gzline) < 0) ||
|
||||
(del_Command(MSG_TKLINE, TOK_NONE, m_tkline) < 0))
|
||||
(del_Command(MSG_KLINE, TOK_NONE, m_tkline) < 0))
|
||||
|
||||
{
|
||||
sendto_realops("Failed to delete commands when unloading %s",
|
||||
@@ -206,7 +206,11 @@ DLLFUNC int m_tkline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
tkl_stats(sptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!OPCanUnKline(sptr) && *parv[1] == '-')
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
return m_tkl_line(cptr, sptr, parc, parv, "k");
|
||||
|
||||
}
|
||||
@@ -249,6 +253,7 @@ DLLFUNC int m_tkl_line(aClient *cptr, aClient *sptr, int parc, char *parv[], ch
|
||||
TS secs;
|
||||
int whattodo = 0; /* 0 = add 1 = del */
|
||||
int i;
|
||||
aClient *acptr = NULL;
|
||||
char *mask = NULL;
|
||||
char mo[1024], mo2[1024];
|
||||
char *p, *usermask, *hostmask;
|
||||
@@ -291,8 +296,34 @@ DLLFUNC int m_tkl_line(aClient *cptr, aClient *sptr, int parc, char *parv[], ch
|
||||
|
||||
/* Check if its a hostmask and legal .. */
|
||||
p = strchr(mask, '@');
|
||||
|
||||
if (p && !whattodo)
|
||||
if (p) {
|
||||
usermask = strtok(mask, "@");
|
||||
hostmask = strtok(NULL, "");
|
||||
if (BadPtr(hostmask)) {
|
||||
if (BadPtr(usermask)) {
|
||||
return 0;
|
||||
}
|
||||
hostmask = usermask;
|
||||
usermask = "*";
|
||||
}
|
||||
p = hostmask-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's seemingly a nick .. let's see if we can find the user */
|
||||
if ((acptr = find_client(mask, NULL)) && IsPerson(acptr))
|
||||
{
|
||||
usermask = "*";
|
||||
hostmask = acptr->user->realhost;
|
||||
p = hostmask - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one(sptr, rpl_str(ERR_NOSUCHNICK), me.name, sptr->name, mask);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (!whattodo)
|
||||
{
|
||||
p++;
|
||||
i = 0;
|
||||
@@ -311,15 +342,6 @@ DLLFUNC int m_tkl_line(aClient *cptr, aClient *sptr, int parc, char *parv[], ch
|
||||
}
|
||||
}
|
||||
|
||||
usermask = strtok(mask, "@");
|
||||
hostmask = strtok(NULL, "");
|
||||
if (BadPtr(hostmask)) {
|
||||
if (BadPtr(usermask)) {
|
||||
return 0;
|
||||
}
|
||||
hostmask = usermask;
|
||||
usermask = "*";
|
||||
}
|
||||
tkl_check_expire(NULL);
|
||||
|
||||
secs = 0;
|
||||
|
||||
@@ -209,7 +209,7 @@ DLLFUNC int m_tsctl(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
}
|
||||
if (strcmp(parv[1], "svstime") == 0)
|
||||
{
|
||||
if (parv[2] == '\0')
|
||||
if (!parv[2] || *parv[2] == '\0')
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-56
@@ -127,61 +127,7 @@ DLLFUNC int m_unkline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
if (parc < 2)
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** Not enough parameters", me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
if ((hosttemp = (char *)strchr((char *)parv[1], '@')))
|
||||
{
|
||||
*hosttemp = 0;
|
||||
hosttemp++;
|
||||
bzero(name, sizeof(name));
|
||||
bzero(host, sizeof(host));
|
||||
|
||||
strncpy(name, parv[1], sizeof(name) - 1);
|
||||
strncpy(host, hosttemp, sizeof(host) - 1);
|
||||
if (name[0] == '\0' || host[0] == '\0')
|
||||
{
|
||||
Debug((DEBUG_INFO, "UNKLINE: Bad field"));
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** Both user and host fields must be non-null",
|
||||
me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
if (!(bconf = Find_banEx(make_user_host(name, host), CONF_BAN_USER, CONF_BAN_TYPE_TEMPORARY)))
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** Cannot find user ban %s@%s",
|
||||
me.name, parv[0], name, host);
|
||||
return 0;
|
||||
}
|
||||
if (bconf->flag.type2 != CONF_BAN_TYPE_TEMPORARY)
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** You cannot remove permament user bans",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DelListItem(bconf, conf_ban);
|
||||
if (bconf->mask)
|
||||
MyFree(bconf->mask);
|
||||
if (bconf->reason)
|
||||
MyFree(bconf->reason);
|
||||
MyFree(bconf);
|
||||
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** Temporary user ban %s@%s is now removed.",
|
||||
me.name, parv[0], name, host);
|
||||
sendto_realops("%s removed temporary user ban %s@%s", parv[0],
|
||||
name, host);
|
||||
ircd_log(LOG_KLINE,
|
||||
"%s removed temporary user ban %s@%s",
|
||||
parv[0], name, host);
|
||||
return 0;
|
||||
}
|
||||
/* This wasn't here before -- Barubary */
|
||||
/* check_pings crap */
|
||||
/* No, and it shouldn't have been, dork. It crashes the IRCd randomly. -Stskeeps */
|
||||
loop.do_bancheck = 1;
|
||||
sendto_one(sptr, ":%s NOTICE %s :Please use /kline -user@host", me.name, parv[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+6
-105
@@ -124,112 +124,13 @@ DLLFUNC int m_unzline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
ConfigItem_ban *bconf;
|
||||
uline = IsULine(sptr) ? 1 : 0;
|
||||
|
||||
if (parc < 2)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "UNZLINE");
|
||||
return -1;
|
||||
}
|
||||
if (!MyClient(sptr) || !OPCanZline(sptr))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (parc < 3 || !uline)
|
||||
{
|
||||
mask = parv[parc - 1];
|
||||
server = NULL;
|
||||
}
|
||||
else if (parc == 3)
|
||||
{
|
||||
mask = parv[parc - 2];
|
||||
server = parv[parc - 1];
|
||||
}
|
||||
|
||||
if (!uline && (!MyConnect(sptr) || !OPCanZline(sptr) || !IsOper(sptr)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* before we even check ourselves we need to do the uline checks
|
||||
because we aren't supposed to add a z:line if the message is
|
||||
destined to be passed on... */
|
||||
|
||||
if (uline)
|
||||
{
|
||||
if (parc == 3 && server)
|
||||
{
|
||||
if (hunt_server_token(cptr, sptr, MSG_UNZLINE, TOK_UNZLINE, "%s %s", 2,
|
||||
parc, parv) != HUNTED_ISME)
|
||||
return 0;
|
||||
else;
|
||||
}
|
||||
else
|
||||
sendto_serv_butone(cptr, ":%s UNZLINE %s", parv[0],
|
||||
parv[1]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* parse the removal mask the same way so an oper can just use
|
||||
the same thing to remove it if they specified *@ or something... */
|
||||
if ((in = index(parv[1], '@')))
|
||||
{
|
||||
strlcpy(userhost, in + 1, sizeof userhost);
|
||||
in = &userhost[0];
|
||||
while (*in)
|
||||
{
|
||||
if (!isdigit(*in) && !ispunct(*in))
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** it's not possible to have a z:line that's not an ip addresss...",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(userhost, parv[1], sizeof userhost);
|
||||
in = &userhost[0];
|
||||
while (*in)
|
||||
{
|
||||
if (!isdigit(*in) && !ispunct(*in))
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** it's not possible to have a z:line that's not an ip addresss...",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
}
|
||||
|
||||
akill = 0;
|
||||
bconf = Find_ban(userhost, CONF_BAN_IP);
|
||||
if (!bconf)
|
||||
{
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** Cannot find z:line %s",
|
||||
me.name, sptr->name, userhost);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (uline == 0)
|
||||
{
|
||||
if (bconf->flag.type2 != CONF_BAN_TYPE_TEMPORARY)
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** You may not remove permanent z:lines.",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
DelListItem(bconf, conf_ban);
|
||||
sendto_realops("%s removed z:line %s", parv[0], userhost);
|
||||
if (bconf->mask)
|
||||
MyFree(bconf->mask);
|
||||
if (bconf->reason)
|
||||
MyFree(bconf->reason);
|
||||
MyFree(bconf);
|
||||
sendto_one(sptr, ":%s NOTICE %s :Please use /zline -user@host", me.name, parv[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -182,6 +182,14 @@ int m_vhost(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
"%s", vhost->virthost);
|
||||
sendto_one(sptr, ":%s MODE %s :+tx",
|
||||
sptr->name, sptr->name);
|
||||
if (vhost->swhois) {
|
||||
if (sptr->user->swhois)
|
||||
MyFree(sptr->user->swhois);
|
||||
sptr->user->swhois = MyMalloc(strlen(vhost->swhois) +1);
|
||||
strcpy(sptr->user->swhois, vhost->swhois);
|
||||
sendto_serv_butone_token(cptr, sptr->name,
|
||||
MSG_SWHOIS, TOK_SWHOIS, "%s :%s", sptr->name, vhost->swhois);
|
||||
}
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** Your vhost is now %s%s%s",
|
||||
me.name, sptr->name, vhost->virtuser ? vhost->virtuser : "",
|
||||
|
||||
+12
-9
@@ -146,9 +146,7 @@ struct {
|
||||
|
||||
DLLFUNC int m_who(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
aClient *target_client;
|
||||
aChannel *target_channel;
|
||||
int opers_only = 0;
|
||||
char *mask = parv[1];
|
||||
char star[] = "*";
|
||||
int i = 0;
|
||||
@@ -191,6 +189,12 @@ DLLFUNC int m_who(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
sendto_one(sptr, getreply(RPL_ENDOFWHO), me.name, parv[0], mask);
|
||||
return 0;
|
||||
}
|
||||
if (wfl.channel && wfl.want_channel == WHO_WANT && (target_channel =
|
||||
find_channel(wfl.channel, NULL)) != NULL) {
|
||||
do_channel_who(sptr, target_channel, mask);
|
||||
sendto_one(sptr, getreply(RPL_ENDOFWHO), me.name, parv[0], mask);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
do_other_who(sptr, mask);
|
||||
@@ -240,7 +244,7 @@ static void who_sendhelp(aClient *sptr)
|
||||
static int parse_who_options(aClient *sptr, int argc, char **argv)
|
||||
{
|
||||
char *s = argv[0];
|
||||
int what;
|
||||
int what = WHO_ADD;
|
||||
int i = 1;
|
||||
|
||||
if (*s != '-' && *s != '+')
|
||||
@@ -290,7 +294,7 @@ static int parse_who_options(aClient *sptr, int argc, char **argv)
|
||||
}
|
||||
|
||||
if (!IsAnOper(sptr))
|
||||
continue; /* oper-only */
|
||||
break; /* oper-only */
|
||||
|
||||
wfl.gecos = argv[i];
|
||||
if (what == WHO_ADD)
|
||||
@@ -447,16 +451,17 @@ static int can_see(aClient *sptr, aClient *acptr, aChannel *channel)
|
||||
if (!IsAnOper(acptr))
|
||||
return ret | WHO_CANTSEE;
|
||||
|
||||
if (IsHideOper(acptr))
|
||||
if (IsHideOper(acptr)) {
|
||||
if (IsAnOper(sptr))
|
||||
ret |= WHO_OPERSEE;
|
||||
else
|
||||
return ret | WHO_CANTSEE;
|
||||
}
|
||||
}
|
||||
|
||||
/* if they only want people who are away */
|
||||
if ((wfl.want_away == WHO_WANT && !acptr->user->away) ||
|
||||
wfl.want_away == WHO_DONTWANT && acptr->user->away)
|
||||
(wfl.want_away == WHO_DONTWANT && acptr->user->away))
|
||||
return WHO_CANTSEE;
|
||||
|
||||
/* if they only want people on a certain channel. */
|
||||
@@ -505,7 +510,7 @@ static int can_see(aClient *sptr, aClient *acptr, aChannel *channel)
|
||||
host = acptr->user->realhost;
|
||||
else
|
||||
{
|
||||
if (IsHidden(sptr))
|
||||
if (IsHidden(acptr))
|
||||
host = acptr->user->virthost;
|
||||
else
|
||||
host = acptr->user->realhost;
|
||||
@@ -746,9 +751,7 @@ static void send_who_reply(aClient *sptr, aClient *acptr,
|
||||
|
||||
static char *first_visible_channel(aClient *sptr, aClient *acptr, int *flg)
|
||||
{
|
||||
aChannel *chptr;
|
||||
Membership *lp;
|
||||
static char chbuf[CHANNELLEN + 2];
|
||||
|
||||
*flg = 0;
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
char *p = NULL;
|
||||
int found, len, mlen;
|
||||
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
|
||||
if (parc < 2)
|
||||
{
|
||||
|
||||
@@ -1,272 +0,0 @@
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/modules/m_zline.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 STRIPBADWORDS
|
||||
#include "badwords.h"
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#include "version.h"
|
||||
#endif
|
||||
|
||||
DLLFUNC int m_zline(aClient *cptr, aClient *sptr, int parc, char *parv[]);
|
||||
|
||||
/* Place includes here */
|
||||
#define MSG_ZLINE "ZLINE" /* ZLINE */
|
||||
#define TOK_ZLINE "q" /* 112 */
|
||||
|
||||
|
||||
#ifndef DYNAMIC_LINKING
|
||||
ModuleHeader m_zline_Header
|
||||
#else
|
||||
#define m_zline_Header Mod_Header
|
||||
ModuleHeader Mod_Header
|
||||
#endif
|
||||
= {
|
||||
"zline", /* Name of module */
|
||||
"$Id$", /* Version */
|
||||
"command /zline", /* Short description of module */
|
||||
"3.2-b8-1",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/* The purpose of these ifdefs, are that we can "static" link the ircd if we
|
||||
* want to
|
||||
*/
|
||||
|
||||
/* This is called on module init, before Server Ready */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Init(ModuleInfo *modinfo)
|
||||
#else
|
||||
int m_zline_Init(ModuleInfo *modinfo)
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* We call our add_Command crap here
|
||||
*/
|
||||
add_Command(MSG_ZLINE, TOK_ZLINE, m_zline, 2);
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
/* Is first run when server is 100% ready */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Load(int module_load)
|
||||
#else
|
||||
int m_zline_Load(int module_load)
|
||||
#endif
|
||||
{
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* Called when module is unloaded */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Unload(int module_unload)
|
||||
#else
|
||||
int m_zline_Unload(int module_unload)
|
||||
#endif
|
||||
{
|
||||
if (del_Command(MSG_ZLINE, TOK_ZLINE, m_zline) < 0)
|
||||
{
|
||||
sendto_realops("Failed to delete commands when unloading %s",
|
||||
m_zline_Header.name);
|
||||
}
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* m_zline add a temporary zap line
|
||||
* parv[0] = sender prefix
|
||||
* parv[1] = host
|
||||
* parv[2] = reason
|
||||
*/
|
||||
|
||||
DLLFUNC int m_zline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
char userhost[512 + 2] = "", *in;
|
||||
int uline = 0, propo = 0;
|
||||
char *reason, *mask, *server, *person;
|
||||
aClient *acptr;
|
||||
ConfigItem_ban *bconf;
|
||||
|
||||
reason = mask = server = person = NULL;
|
||||
|
||||
reason = ((parc >= 3) ? parv[parc - 1] : "Reason unspecified");
|
||||
mask = ((parc >= 2) ? parv[parc - 2] : NULL);
|
||||
server = ((parc >= 4) ? parv[parc - 1] : NULL);
|
||||
|
||||
if (parc == 4)
|
||||
{
|
||||
mask = parv[parc - 3];
|
||||
server = parv[parc - 2];
|
||||
reason = parv[parc - 1];
|
||||
}
|
||||
|
||||
uline = IsULine(sptr) ? 1 : 0;
|
||||
|
||||
if (!uline && (!MyConnect(sptr) || !OPCanZline(sptr) || !IsOper(sptr)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (uline)
|
||||
{
|
||||
if (parc >= 4 && server)
|
||||
{
|
||||
if (hunt_server_token(cptr, sptr, MSG_ZLINE, TOK_ZLINE, "%s %s :%s", 2,
|
||||
parc, parv) != HUNTED_ISME)
|
||||
return 0;
|
||||
else;
|
||||
}
|
||||
else
|
||||
propo = 1;
|
||||
}
|
||||
|
||||
if (parc < 2)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "ZLINE");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((acptr = find_client(parv[1], NULL)))
|
||||
{
|
||||
strlcpy(userhost, inetntoa((char *)&acptr->ip), sizeof userhost);
|
||||
person = &acptr->name[0];
|
||||
acptr = NULL;
|
||||
}
|
||||
/* z-lines don't support user@host format, they only
|
||||
work with ip addresses and nicks */
|
||||
else if ((in = index(parv[1], '@')) && (*(in + 1) != '\0'))
|
||||
{
|
||||
strlcpy(userhost, in + 1, sizeof userhost);
|
||||
in = &userhost[0];
|
||||
while (*in)
|
||||
{
|
||||
if (!isdigit(*in) && !ispunct(*in))
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** z:lines work only with ip addresses (you cannot specify ident either)",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
}
|
||||
else if (in && !(*(in + 1))) /* sheesh not only specifying a ident@, but
|
||||
omitting the ip...? */
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** Hey! z:lines need an ip address...",
|
||||
me.name, sptr->name);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(userhost, parv[1], sizeof userhost);
|
||||
in = &userhost[0];
|
||||
while (*in)
|
||||
{
|
||||
if (!isdigit(*in) && !ispunct(*in))
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** z:lines work only with ip addresses (you cannot specify ident either)",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
}
|
||||
|
||||
/* this'll protect against z-lining *.* or something */
|
||||
if (advanced_check(userhost, TRUE) == FALSE)
|
||||
{
|
||||
sendto_ops("Bad z:line mask from %s *@%s [%s]", parv[0],
|
||||
userhost, reason ? reason : "");
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :** *@%s is a bad z:line mask...",
|
||||
me.name, sptr->name, userhost);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(bconf = Find_ban(userhost, CONF_BAN_IP)))
|
||||
{
|
||||
if (uline == 0)
|
||||
{
|
||||
if (person)
|
||||
sendto_realops("%s added a temp z:line for %s (*@%s) [%s]",
|
||||
parv[0], person, userhost, reason ? reason : "");
|
||||
else
|
||||
sendto_realops("%s added a temp z:line *@%s [%s]", parv[0],
|
||||
userhost, reason ? reason : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (person)
|
||||
sendto_ops("%s z:lined %s (*@%s) on %s [%s]", parv[0],
|
||||
person, userhost, server ? server : ircnetwork,
|
||||
reason ? reason : "");
|
||||
else
|
||||
sendto_ops("%s z:lined *@%s on %s [%s]", parv[0],
|
||||
userhost, server ? server : ircnetwork,
|
||||
reason ? reason : "");
|
||||
|
||||
}
|
||||
bconf = (ConfigItem_ban *) MyMallocEx(sizeof(ConfigItem_ban));
|
||||
bconf->flag.type = CONF_BAN_IP;
|
||||
bconf->mask = strdup(userhost);
|
||||
bconf->reason = strdup(reason);
|
||||
bconf->flag.type2 = uline ? CONF_BAN_TYPE_AKILL : CONF_BAN_TYPE_TEMPORARY;
|
||||
}
|
||||
else
|
||||
{
|
||||
goto propo_label;
|
||||
}
|
||||
AddListItem(bconf, conf_ban);
|
||||
propo_label:
|
||||
if (propo == 1) /* propo is if a ulined server is propagating a z-line
|
||||
this should go after the above check */
|
||||
sendto_serv_butone(cptr, ":%s ZLINE %s :%s", parv[0], parv[1],
|
||||
reason ? reason : "");
|
||||
|
||||
loop.do_bancheck = 1;
|
||||
return 0;
|
||||
}
|
||||
+196
-129
@@ -60,11 +60,23 @@ int Scan_BanTime = 0, Scan_TimeOut = 0;
|
||||
static Scan_AddrStruct *Scannings = NULL;
|
||||
MUTEX Scannings_lock;
|
||||
static char *scan_message;
|
||||
|
||||
extern ConfigEntry *config_find_entry(ConfigEntry *ce, char *name);
|
||||
DLLFUNC int h_scan_connect(aClient *sptr);
|
||||
DLLFUNC int h_config_set_scan(void);
|
||||
DLLFUNC int h_config_test(ConfigFile *, ConfigEntry *, int, int *);
|
||||
DLLFUNC int h_config_run(ConfigFile *, ConfigEntry *, int);
|
||||
DLLFUNC int h_config_posttest(int *);
|
||||
DLLFUNC int h_config_rehash();
|
||||
DLLFUNC int h_stats_scan(aClient *sptr, char *stats);
|
||||
|
||||
struct requiredconfig {
|
||||
int endpoint :1;
|
||||
int timeout :1;
|
||||
int bantime :1;
|
||||
int bindip :1;
|
||||
};
|
||||
|
||||
struct requiredconfig ReqConf;
|
||||
|
||||
#ifndef DYNAMIC_LINKING
|
||||
ModuleHeader m_scan_Header
|
||||
#else
|
||||
@@ -82,10 +94,24 @@ ModuleHeader Mod_Header
|
||||
EVENT(e_scannings_clean);
|
||||
|
||||
static Event *Scannings_clean = NULL;
|
||||
static Hook *LocConnect = NULL, *ConfUnknown = NULL, *ServerStats = NULL;
|
||||
static Hook *LocConnect = NULL, *ConfTest = NULL, *ConfRun = NULL, *ServerStats = NULL;
|
||||
static Hook *ConfPostTest = NULL, *ConfRehash = NULL;
|
||||
static Hooktype *ScanHost = NULL;
|
||||
static int HOOKTYPE_SCAN_HOST;
|
||||
ModuleInfo ScanModInfo;
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Test(ModuleInfo *modinfo)
|
||||
#else
|
||||
int m_scan_Test(ModuleInfo *modinfo)
|
||||
#endif
|
||||
{
|
||||
bcopy(modinfo,&ScanModInfo,modinfo->size);
|
||||
ConfTest = HookAddEx(ScanModInfo.handle, HOOKTYPE_CONFIGTEST, h_config_test);
|
||||
ConfPostTest = HookAddEx(ScanModInfo.handle, HOOKTYPE_CONFIGPOSTTEST, h_config_posttest);
|
||||
return MOD_SUCCESS;
|
||||
}
|
||||
|
||||
/* This is called on module init, before Server Ready */
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC int Mod_Init(ModuleInfo *modinfo)
|
||||
@@ -93,12 +119,13 @@ DLLFUNC int Mod_Init(ModuleInfo *modinfo)
|
||||
int m_scan_Init(ModuleInfo *modinfo)
|
||||
#endif
|
||||
{
|
||||
int id;
|
||||
scan_message = NULL;
|
||||
bcopy(modinfo,&ScanModInfo,modinfo->size);
|
||||
bzero(&ReqConf, sizeof(ReqConf));
|
||||
ScanHost = (Hooktype *)HooktypeAdd(modinfo->handle, "HOOKTYPE_SCAN_HOST", &HOOKTYPE_SCAN_HOST);
|
||||
LocConnect = HookAddEx(ScanModInfo.handle, HOOKTYPE_LOCAL_CONNECT, h_scan_connect);
|
||||
ConfUnknown = HookAddEx(ScanModInfo.handle, HOOKTYPE_CONFIG_UNKNOWN, h_config_set_scan);
|
||||
ConfRun = HookAddEx(ScanModInfo.handle, HOOKTYPE_CONFIGRUN, h_config_run);
|
||||
ConfRehash = HookAddEx(ScanModInfo.handle, HOOKTYPE_REHASH, h_config_rehash);
|
||||
ServerStats = HookAddEx(ScanModInfo.handle, HOOKTYPE_STATS, h_stats_scan);
|
||||
bzero(&Scan_bind, sizeof(Scan_bind));
|
||||
IRCCreateMutex(Scannings_lock);
|
||||
@@ -112,36 +139,6 @@ DLLFUNC int Mod_Load(int module_load)
|
||||
int m_scan_Load(int module_load)
|
||||
#endif
|
||||
{
|
||||
if (Scan_endpoint.SIN_PORT == 0)
|
||||
{
|
||||
|
||||
if (*conf_listen->ip == '*') {
|
||||
ircd_log(LOG_ERROR, "Scan.so failed to load: set::scan::endpoint is missing");
|
||||
HooktypeDel(ScanHost,ScanModInfo.handle);
|
||||
HookDel(LocConnect);
|
||||
HookDel(ConfUnknown);
|
||||
HookDel(ServerStats);
|
||||
LockEventSystem();
|
||||
EventDel(Scannings_clean);
|
||||
UnlockEventSystem();
|
||||
IRCMutexDestroy(Scannings_lock);
|
||||
return MOD_FAILED;
|
||||
}
|
||||
|
||||
#ifndef INET6
|
||||
Scan_endpoint.SIN_ADDR.S_ADDR = inet_addr(conf_listen->ip);
|
||||
#else
|
||||
inet_pton(AFINET, conf_listen->ip, Scan_endpoint.SIN_ADDR.S_ADDR);
|
||||
#endif
|
||||
Scan_endpoint.SIN_PORT = htons(conf_listen->port);
|
||||
Scan_endpoint.SIN_FAMILY = AFINET;
|
||||
}
|
||||
|
||||
if (Scan_BanTime == 0)
|
||||
Scan_BanTime = 86400;
|
||||
|
||||
if (Scan_TimeOut == 0)
|
||||
Scan_TimeOut = 20;
|
||||
LockEventSystem();
|
||||
Scannings_clean = EventAddEx(ScanModInfo.handle, "e_scannings_clean", 0, 0, e_scannings_clean, NULL);
|
||||
UnlockEventSystem();
|
||||
@@ -175,7 +172,9 @@ int m_scan_Unload(void)
|
||||
{
|
||||
HooktypeDel(ScanHost,ScanModInfo.handle);
|
||||
HookDel(LocConnect);
|
||||
HookDel(ConfUnknown);
|
||||
HookDel(ConfTest);
|
||||
HookDel(ConfRun);
|
||||
HookDel(ConfPostTest);
|
||||
HookDel(ServerStats);
|
||||
LockEventSystem();
|
||||
EventDel(Scannings_clean);
|
||||
@@ -348,108 +347,176 @@ DLLFUNC int h_scan_connect(aClient *sptr)
|
||||
* };
|
||||
*
|
||||
*/
|
||||
DLLFUNC h_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) {
|
||||
ConfigEntry *cep;
|
||||
int errors = 0;
|
||||
|
||||
DLLFUNC int h_config_set_scan(void)
|
||||
{
|
||||
ConfigItem_unknown_ext *sets;
|
||||
ConfigEntry *ce;
|
||||
char *ip;
|
||||
char *port;
|
||||
int iport;
|
||||
for (sets = conf_unknown_set; sets;
|
||||
sets = (ConfigItem_unknown_ext *)sets->next)
|
||||
if (type != CONFIG_SET)
|
||||
return 0;
|
||||
|
||||
if (!strcmp(ce->ce_varname, "scan"))
|
||||
{
|
||||
if (!strcmp(sets->ce_varname, "scan"))
|
||||
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
|
||||
{
|
||||
for (ce = sets->ce_entries; ce; ce = (ConfigEntry *)ce->ce_next)
|
||||
if (!cep->ce_varname)
|
||||
{
|
||||
if (!strcmp(ce->ce_varname, "bantime")) {
|
||||
if (!ce->ce_vardata) {
|
||||
config_status("%s:%i: set::scan::bantime has no value",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
Scan_BanTime = config_checkval(ce->ce_vardata,CFG_TIME);
|
||||
}
|
||||
else
|
||||
if (!strcmp(ce->ce_varname, "timeout")) {
|
||||
if (!ce->ce_vardata) {
|
||||
config_status("%s:%i: set::scan::timeout has no value",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
Scan_TimeOut = config_checkval(ce->ce_vardata,CFG_TIME);
|
||||
}
|
||||
else
|
||||
if (!strcmp(ce->ce_varname, "endpoint"))
|
||||
{
|
||||
if (!ce->ce_vardata)
|
||||
{
|
||||
config_status("%s:%i: set::scan::endpoint: syntax [ip]:port",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
ipport_seperate(ce->ce_vardata, &ip, &port);
|
||||
if (!ip || !*ip)
|
||||
{
|
||||
config_status("%s:%i: set::scan::endpoint: illegal ip",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
if (!port || !*port)
|
||||
{
|
||||
config_status("%s:%i: set::scan::endpoint: missing/invalid port",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
iport = atol(port);
|
||||
if ((iport < 0) || (iport > 65535))
|
||||
{
|
||||
config_status("%s:%i: set::scan::endpoint: illegal port",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
#ifndef INET6
|
||||
Scan_endpoint.SIN_ADDR.S_ADDR = inet_addr(ip);
|
||||
#else
|
||||
inet_pton(AFINET, ip, Scan_endpoint.SIN_ADDR.S_ADDR);
|
||||
#endif
|
||||
Scan_endpoint.SIN_PORT = htons(iport);
|
||||
Scan_endpoint.SIN_FAMILY = AFINET;
|
||||
}
|
||||
else if (!strcmp(ce->ce_varname, "bind-ip"))
|
||||
{
|
||||
if (!ce->ce_vardata)
|
||||
{
|
||||
config_status("%s:%i: set::scan::bind: syntax [ip]",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
#ifndef INET6
|
||||
Scan_bind.S_ADDR = inet_addr(ce->ce_vardata);
|
||||
#else
|
||||
inet_pton(AFINET, ce->ce_vardata, Scan_bind.S_ADDR);
|
||||
#endif
|
||||
}
|
||||
else if (!strcmp(ce->ce_varname, "message"))
|
||||
{
|
||||
if (!ce->ce_vardata)
|
||||
{
|
||||
config_status("%s:%i: set::scan::message requires an argument",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
break;
|
||||
}
|
||||
if (scan_message)
|
||||
free(scan_message);
|
||||
scan_message = strdup(ce->ce_vardata);
|
||||
}
|
||||
config_error("%s:%i: blank set::scan item",
|
||||
cep->ce_fileptr->cf_filename,
|
||||
cep->ce_varlinenum);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
del_ConfigItem(sets, conf_unknown_set);
|
||||
}
|
||||
if (!cep->ce_vardata)
|
||||
{
|
||||
config_error("%s:%i: set::scan::%s item without value",
|
||||
cep->ce_fileptr->cf_filename,
|
||||
cep->ce_varlinenum, cep->ce_varname);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(cep->ce_varname, "endpoint"))
|
||||
{
|
||||
char copy[256];
|
||||
char *ip, *port;
|
||||
int iport;
|
||||
strcpy(copy, cep->ce_vardata);
|
||||
ipport_seperate(copy, &ip, &port);
|
||||
if (!ip || !*ip)
|
||||
{
|
||||
config_error("%s:%i: set::scan::endpoint: illegal ip:port mask",
|
||||
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
|
||||
errors++;
|
||||
}
|
||||
if (strchr(ip, '*'))
|
||||
{
|
||||
config_error("%s:%i: set::scan::endpoint: illegal ip",
|
||||
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
|
||||
errors++;
|
||||
}
|
||||
if (!port || !*port)
|
||||
{
|
||||
config_error("%s:%i: set::scan::endpoint: missing port in mask",
|
||||
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
|
||||
errors++;
|
||||
}
|
||||
iport = atol(port);
|
||||
if ((iport < 0) || (iport > 65535))
|
||||
{
|
||||
config_error("%s:%i: set::scan::endpoint: illegal port (must be 0..65536)",
|
||||
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
|
||||
errors++;
|
||||
}
|
||||
ReqConf.endpoint = 1;
|
||||
}
|
||||
else if (!strcmp(cep->ce_varname, "bind-ip"))
|
||||
{
|
||||
if (strchr(cep->ce_vardata, '*') && strcmp(cep->ce_vardata, "*"))
|
||||
{
|
||||
config_error("%s:%i: set::scan::bind-ip: illegal ip, (mask, and not '*')",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
errors++;
|
||||
}
|
||||
ReqConf.bindip = 1;
|
||||
}
|
||||
else if (!strcmp(cep->ce_varname, "message"));
|
||||
else if (!strcmp(cep->ce_varname, "bantime"))
|
||||
ReqConf.bantime = 1;
|
||||
else if (!strcmp(cep->ce_varname, "timeout"))
|
||||
ReqConf.timeout = 1;
|
||||
else
|
||||
{
|
||||
config_error("%s:%i: unknown directive set::scan::%s",
|
||||
cep->ce_fileptr->cf_filename, cep->ce_varlinenum,
|
||||
cep->ce_varname);
|
||||
errors++;
|
||||
}
|
||||
|
||||
}
|
||||
*errs = errors;
|
||||
return errors ? -1 : 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
DLLFUNC h_config_run(ConfigFile *cf, ConfigEntry *ce, int type) {
|
||||
ConfigEntry *cep;
|
||||
int errors = 0;
|
||||
|
||||
if (type != CONFIG_SET)
|
||||
return 0;
|
||||
if (!strcmp(ce->ce_varname, "scan"))
|
||||
{
|
||||
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
|
||||
{
|
||||
if (!strcmp(cep->ce_varname, "endpoint"))
|
||||
{
|
||||
char copy[256];
|
||||
char *ip, *port;
|
||||
int iport;
|
||||
strcpy(copy, cep->ce_vardata);
|
||||
ipport_seperate(copy, &ip, &port);
|
||||
#ifndef INET6
|
||||
Scan_endpoint.SIN_ADDR.S_ADDR = inet_addr(ip);
|
||||
#else
|
||||
inet_pton(AFINET, ip, Scan_endpoint.SIN_ADDR.S_ADDR);
|
||||
#endif
|
||||
iport = atol(port);
|
||||
Scan_endpoint.SIN_PORT = htons(iport);
|
||||
Scan_endpoint.SIN_FAMILY = AFINET;
|
||||
}
|
||||
else if (!strcmp(cep->ce_varname, "bantime"))
|
||||
Scan_BanTime = config_checkval(cep->ce_vardata,CFG_TIME);
|
||||
else if (!strcmp(cep->ce_varname, "timeout"))
|
||||
Scan_TimeOut = config_checkval(cep->ce_vardata,CFG_TIME);
|
||||
else if (!strcmp(cep->ce_varname, "bind-ip"))
|
||||
{
|
||||
#ifndef INET6
|
||||
Scan_bind.S_ADDR = inet_addr(cep->ce_vardata);
|
||||
#else
|
||||
inet_pton(AFINET, cep->ce_vardata, Scan_bind.S_ADDR);
|
||||
#endif
|
||||
}
|
||||
if (!strcmp(cep->ce_varname, "message"))
|
||||
scan_message = strdup(cep->ce_vardata);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DLLFUNC int h_config_posttest(int *errs) {
|
||||
int errors = 0;
|
||||
if (!ReqConf.endpoint)
|
||||
{
|
||||
config_error("set::scan::endpoint missing");
|
||||
errors++;
|
||||
}
|
||||
if (!ReqConf.bantime)
|
||||
{
|
||||
config_error("set::scan::bantime missing");
|
||||
errors++;
|
||||
}
|
||||
if (!ReqConf.timeout)
|
||||
{
|
||||
config_error("set::scan::timeout missing");
|
||||
errors++;
|
||||
}
|
||||
if (!ReqConf.bindip)
|
||||
{
|
||||
config_error("set::scan::bind-ip missing");
|
||||
errors++;
|
||||
}
|
||||
*errs = errors;
|
||||
return errors ? -1 : 1;
|
||||
}
|
||||
|
||||
DLLFUNC int h_config_rehash()
|
||||
{
|
||||
if (scan_message)
|
||||
MyFree(scan_message);
|
||||
}
|
||||
|
||||
DLLFUNC int h_stats_scan(aClient *sptr, char *stats) {
|
||||
if (*stats == 'S') {
|
||||
sendto_one(sptr, ":%s %i %s :scan::endpoint: %s:%d", me.name, RPL_TEXT, sptr->name,
|
||||
|
||||
+40
-17
@@ -150,36 +150,43 @@ int scan_http_Unload(int module_unload)
|
||||
void scan_http_scan(Scan_AddrStruct *h)
|
||||
{
|
||||
THREAD thread[3];
|
||||
unsigned id[3];
|
||||
/* note: on windows dwRc holds the thread return code. on unix
|
||||
** its a void pointer
|
||||
*/
|
||||
u_int32_t dwRc[3];
|
||||
HSStruct *p = NULL;
|
||||
|
||||
IRCMutexLock((h->lock));
|
||||
|
||||
/* First we take 3128 .. */
|
||||
h->refcnt++;
|
||||
p = MyMalloc(sizeof(HSStruct));
|
||||
p->hs = h;
|
||||
p->port = 3128;
|
||||
IRCCreateThread(thread[0], scan_http_scan_port, p);
|
||||
IRCCreateThreadEx(thread[0], scan_http_scan_port, p, &id[0]);
|
||||
/* Then we take 8080 .. */
|
||||
h->refcnt++;
|
||||
p = MyMalloc(sizeof(HSStruct));
|
||||
p->hs = h;
|
||||
p->port = 8080;
|
||||
IRCCreateThread(thread[1], scan_http_scan_port, p);
|
||||
IRCCreateThreadEx(thread[1], scan_http_scan_port, p, &id[1]);
|
||||
/* And then we try to infect them with Code Red .. */
|
||||
h->refcnt++;
|
||||
p = MyMalloc(sizeof(HSStruct));
|
||||
p->hs = h;
|
||||
p->port = 80;
|
||||
IRCCreateThread(thread[2], scan_http_scan_port, p);
|
||||
IRCCreateThreadEx(thread[2], scan_http_scan_port, p, &id[2]);
|
||||
|
||||
IRCMutexUnlock((h->lock));
|
||||
IRCJoinThread(thread[0], NULL);
|
||||
IRCJoinThread(thread[1], NULL);
|
||||
IRCJoinThread(thread[2], NULL);
|
||||
|
||||
IRCJoinThread(thread[0], &dwRc[0]);
|
||||
IRCJoinThread(thread[1], &dwRc[1]);
|
||||
IRCJoinThread(thread[2], &dwRc[2]);
|
||||
IRCMutexLock((h->lock));
|
||||
h->refcnt--;
|
||||
IRCMutexUnlock((h->lock));
|
||||
IRCDetachThread(IRCThreadSelf());
|
||||
IRCExitThread(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -194,9 +201,9 @@ void scan_http_scan_port(HSStruct *z)
|
||||
struct SOCKADDR_IN bin;
|
||||
SOCKET fd;
|
||||
unsigned char httpbuf[160];
|
||||
fd_set rfds;
|
||||
fd_set rfds, efds;
|
||||
int err, len = sizeof(err);
|
||||
struct timeval tv;
|
||||
int len;
|
||||
|
||||
IRCMutexLock((h->lock));
|
||||
#ifndef INET6
|
||||
@@ -251,26 +258,43 @@ void scan_http_scan_port(HSStruct *z)
|
||||
* -Zogg
|
||||
*/
|
||||
set_non_blocking(fd, NULL);
|
||||
if ((retval = connect(fd, (struct sockaddr *)&sin,
|
||||
sizeof(sin))) == -1 && !(ERRNO == P_EINPROGRESS))
|
||||
if ((retval = connect(fd, (struct sockaddr *)&sin, sizeof(sin))) == -1 && (ERRNO != P_EWORKING))
|
||||
{
|
||||
/* we have no socks server! */
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We wait for write-ready */
|
||||
/* We wait for connection to complete */
|
||||
tv.tv_sec = *xScan_TimeOut;
|
||||
tv.tv_usec = 0;
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(fd, &rfds);
|
||||
if (!select(fd + 1, NULL, &rfds, NULL, &tv))
|
||||
FD_ZERO(&efds);
|
||||
FD_SET(fd, &efds);
|
||||
if (select(fd + 1, NULL, &rfds, &efds, &tv) <= 0)
|
||||
{
|
||||
/* timeout or error */
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
|
||||
/* did connection fail on windows? */
|
||||
if (FD_ISSET(fd, &efds))
|
||||
{
|
||||
err = ERRNO;
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
#ifdef SO_ERROR
|
||||
/* did connection fail on unix? */
|
||||
if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, (OPT_TYPE *)&err, &len))
|
||||
if (err)
|
||||
{
|
||||
/* connection failed */
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
#endif
|
||||
bzero(httpbuf, sizeof(httpbuf));
|
||||
snprintf(httpbuf, sizeof httpbuf, "CONNECT %s:%i HTTP/1.1\n\n",
|
||||
Inet_ia2p(&xScan_endpoint->SIN_ADDR), ntohs(xScan_endpoint->SIN_PORT));
|
||||
@@ -279,7 +303,7 @@ void scan_http_scan_port(HSStruct *z)
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
/* Now we wait for data. 10 secs ought to be enough */
|
||||
/* Now we wait for data. Duration is set::scan::timeout */
|
||||
tv.tv_sec = *xScan_TimeOut;
|
||||
tv.tv_usec = 0;
|
||||
FD_ZERO(&rfds);
|
||||
@@ -309,6 +333,5 @@ exituniverse:
|
||||
IRCMutexLock((h->lock));
|
||||
h->refcnt--;
|
||||
IRCMutexUnlock((h->lock));
|
||||
IRCExitThread(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
+56
-22
@@ -146,19 +146,21 @@ int scan_socks_Unload(int module_unload)
|
||||
void scan_socks_scan(Scan_AddrStruct *h)
|
||||
{
|
||||
THREAD thread[2];
|
||||
unsigned id[2];
|
||||
u_int32_t dwRc[2];
|
||||
|
||||
IRCMutexLock((h->lock));
|
||||
h->refcnt++;
|
||||
IRCCreateThread(thread[0], scan_socks4_scan, h);
|
||||
IRCCreateThreadEx(thread[0], scan_socks4_scan, h, &id[0]);
|
||||
h->refcnt++;
|
||||
IRCCreateThread(thread[1], scan_socks5_scan, h);
|
||||
IRCCreateThreadEx(thread[1], scan_socks5_scan, h, &id[1]);
|
||||
IRCMutexUnlock((h->lock));
|
||||
IRCJoinThread(thread[0], NULL);
|
||||
IRCJoinThread(thread[1], NULL);
|
||||
IRCJoinThread(thread[0], &dwRc[0]);
|
||||
IRCJoinThread(thread[1], &dwRc[1]);
|
||||
IRCMutexLock((h->lock));
|
||||
h->refcnt--;
|
||||
IRCMutexUnlock((h->lock));
|
||||
IRCDetachThread(IRCThreadSelf());
|
||||
IRCExitThread(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,9 +177,9 @@ void scan_socks4_scan(Scan_AddrStruct *h)
|
||||
SOCKET fd;
|
||||
unsigned char socksbuf[10];
|
||||
unsigned long theip;
|
||||
fd_set rfds;
|
||||
fd_set rfds, efds;
|
||||
struct timeval tv;
|
||||
int len;
|
||||
int err, len = sizeof(err);
|
||||
/* Get host */
|
||||
|
||||
IRCMutexLock((h->lock));
|
||||
@@ -232,8 +234,7 @@ void scan_socks4_scan(Scan_AddrStruct *h)
|
||||
* -Zogg
|
||||
*/
|
||||
set_non_blocking(fd, NULL);
|
||||
if ((retval = connect(fd, (struct sockaddr *)&sin,
|
||||
sizeof(sin))) == -1 && !(ERRNO == P_EINPROGRESS))
|
||||
if ((retval = connect(fd, (struct sockaddr *)&sin, sizeof(sin))) == -1 && !(ERRNO == P_EWORKING))
|
||||
{
|
||||
/* we have no socks server! */
|
||||
CLOSE_SOCK(fd);
|
||||
@@ -241,16 +242,35 @@ void scan_socks4_scan(Scan_AddrStruct *h)
|
||||
return;
|
||||
}
|
||||
|
||||
/* We wait for write-ready */
|
||||
/* We wait for connection to complete */
|
||||
tv.tv_sec = *xScan_TimeOut;
|
||||
tv.tv_usec = 0;
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(fd, &rfds);
|
||||
if (!select(fd + 1, NULL, &rfds, NULL, &tv))
|
||||
FD_ZERO(&efds);
|
||||
FD_SET(fd, &efds);
|
||||
if (select(fd + 1, NULL, &rfds, &efds, &tv) <= 0)
|
||||
{
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
/* did connection fail on windows? */
|
||||
if (FD_ISSET(fd, &efds))
|
||||
{
|
||||
err = ERRNO;
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
#ifdef SO_ERROR
|
||||
/* did connection fail on unix? */
|
||||
if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, (OPT_TYPE *)&err, &len))
|
||||
if (err)
|
||||
{
|
||||
/* connection failed */
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
ia4.s_addr = inet_aton((char *)Inet_ia2p(&xScan_endpoint->SIN_ADDR));
|
||||
#else
|
||||
@@ -304,7 +324,6 @@ exituniverse:
|
||||
h->refcnt--;
|
||||
IRCMutexUnlock((h->lock));
|
||||
/* We get joined, we need no steekin Detach */
|
||||
IRCExitThread(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -317,10 +336,10 @@ void scan_socks5_scan(Scan_AddrStruct *h)
|
||||
struct SOCKADDR_IN sin;
|
||||
struct in_addr ia4;
|
||||
SOCKET fd;
|
||||
unsigned long theip;
|
||||
fd_set rfds;
|
||||
unsigned long theip;
|
||||
fd_set rfds, efds;
|
||||
struct timeval tv;
|
||||
int len;
|
||||
int err, len = sizeof(err);
|
||||
unsigned char socksbuf[10];
|
||||
/* Get host */
|
||||
IRCMutexLock((h->lock));
|
||||
@@ -368,26 +387,42 @@ void scan_socks5_scan(Scan_AddrStruct *h)
|
||||
* -Zogg
|
||||
*/
|
||||
set_non_blocking(fd, NULL);
|
||||
if ((retval = connect(fd, (struct sockaddr *)&sin,
|
||||
sizeof(sin))) == -1 &&
|
||||
!(ERRNO == P_EINPROGRESS))
|
||||
if ((retval = connect(fd, (struct sockaddr *)&sin, sizeof(sin))) == -1 && !(ERRNO == P_EWORKING))
|
||||
{
|
||||
/* we have no socks server! */
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We wait for write-ready */
|
||||
/* We wait for connection to complete */
|
||||
tv.tv_sec = *xScan_TimeOut;
|
||||
tv.tv_usec = 0;
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(fd, &rfds);
|
||||
if (!select(fd + 1, NULL, &rfds, NULL, &tv))
|
||||
FD_ZERO(&efds);
|
||||
FD_SET(fd, &efds);
|
||||
if (select(fd + 1, NULL, &rfds, &efds, &tv) <= 0)
|
||||
{
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
/* did connection fail on windows? */
|
||||
if (FD_ISSET(fd, &efds))
|
||||
{
|
||||
err = ERRNO;
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
#ifdef SO_ERROR
|
||||
/* did connection fail on unix? */
|
||||
if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, (OPT_TYPE *)&err, &len))
|
||||
if (err)
|
||||
{
|
||||
/* connection failed */
|
||||
CLOSE_SOCK(fd);
|
||||
goto exituniverse;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
ia4.s_addr = inet_aton((char *)Inet_ia2p(&xScan_endpoint->SIN_ADDR));
|
||||
#else
|
||||
@@ -467,7 +502,6 @@ exituniverse:
|
||||
h->refcnt--;
|
||||
IRCMutexUnlock(h->lock);
|
||||
/* We need no steekin detach */
|
||||
IRCExitThread(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -352,7 +352,7 @@ inline aCommand *find_Command(char *cmd, short token, int flags)
|
||||
if (!strcmp(p->cmd, cmd))
|
||||
return (p);
|
||||
}
|
||||
else
|
||||
else if (!p->token)
|
||||
if (!stricmp(p->cmd, cmd))
|
||||
return (p);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "nameser.h"
|
||||
#include "resolv.h"
|
||||
#include "inet.h"
|
||||
#include "threads.h"
|
||||
#include <string.h>
|
||||
#ifndef CLEAN_COMPILE
|
||||
static char rcsid[] = "@(#)$Id$";
|
||||
@@ -50,6 +51,13 @@ static int incache = 0;
|
||||
static CacheTable hashtable[ARES_CACSIZE];
|
||||
static aCache *cachetop = NULL;
|
||||
static ResRQ *last, *first;
|
||||
/* control access to request queue - allow only one thread at a time.
|
||||
** Currently the list is only protected on Windows because we don't use
|
||||
** threads to access it on Unix
|
||||
*/
|
||||
static MUTEX g_hResMutex;
|
||||
static int lock_request();
|
||||
static int unlock_request();
|
||||
|
||||
static void rem_cache(aCache *);
|
||||
static void rem_request(ResRQ *);
|
||||
@@ -100,6 +108,16 @@ int init_resolver(int op)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
IRCCreateMutex(g_hResMutex);
|
||||
if (g_hResMutex == NULL)
|
||||
{
|
||||
ircd_log(LOG_ERROR, "IRCCreateMutex failed: %s:%i. %s",
|
||||
__FILE__, __LINE__,strerror(GetLastError()));
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LRAND48
|
||||
srand48(TStime());
|
||||
#endif
|
||||
@@ -156,10 +174,54 @@ int init_resolver(int op)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* get access to resolver request queue */
|
||||
static int lock_request()
|
||||
{
|
||||
int iRc = 1;
|
||||
#ifdef _WIN32
|
||||
DWORD dwWaitRes;
|
||||
|
||||
if (g_hResMutex)
|
||||
{
|
||||
dwWaitRes = IRCMutexLock(g_hResMutex);
|
||||
if (dwWaitRes != WAIT_OBJECT_0)
|
||||
{
|
||||
ircd_log(LOG_ERROR, "IRCMutexLock failed with %d: %s:%i. %s",
|
||||
dwWaitRes, __FILE__, __LINE__,strerror(GetLastError()));
|
||||
iRc = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return iRc;
|
||||
}
|
||||
|
||||
/* release access to resolver request queue */
|
||||
static int unlock_request()
|
||||
{
|
||||
int iRc = 1;
|
||||
|
||||
#ifdef _WIN32
|
||||
BOOL bRc;
|
||||
|
||||
if (g_hResMutex)
|
||||
{
|
||||
bRc = IRCMutexUnlock(g_hResMutex);
|
||||
if (!bRc)
|
||||
{
|
||||
ircd_log(LOG_ERROR, "IRCMutexUnlock failed: %s:%i. %s",
|
||||
__FILE__, __LINE__,strerror(GetLastError()));
|
||||
iRc = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return iRc;
|
||||
}
|
||||
|
||||
static int add_request(ResRQ *new)
|
||||
{
|
||||
if (!new)
|
||||
return -1;
|
||||
lock_request();
|
||||
if (!first)
|
||||
first = last = new;
|
||||
else
|
||||
@@ -169,6 +231,7 @@ static int add_request(ResRQ *new)
|
||||
}
|
||||
new->next = NULL;
|
||||
reinfo.re_requests++;
|
||||
unlock_request();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -184,9 +247,19 @@ static void rem_request(ResRQ *old)
|
||||
|
||||
if (!old)
|
||||
return;
|
||||
|
||||
lock_request();
|
||||
|
||||
#ifdef _WIN32
|
||||
while (old->locked)
|
||||
Sleep(0);
|
||||
/* don't remove if async_dns() thread is running because it needs this memory
|
||||
** we should consider terminating the thread here esp.
|
||||
** if exit_client() called us
|
||||
*/
|
||||
if (old->locked)
|
||||
{
|
||||
unlock_request();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
for (rptr = &first; *rptr; r2ptr = *rptr, rptr = &(*rptr)->next)
|
||||
if (*rptr == old)
|
||||
@@ -197,8 +270,7 @@ static void rem_request(ResRQ *old)
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUGMODE
|
||||
Debug((DEBUG_INFO, "rem_request:Remove %#x at %#x %#x",
|
||||
old, *rptr, r2ptr));
|
||||
Debug((DEBUG_INFO, "rem_request:Remove %#x at %#x %#x", old, *rptr, r2ptr));
|
||||
#endif
|
||||
r2ptr = old;
|
||||
#ifndef _WIN32
|
||||
@@ -208,13 +280,13 @@ static void rem_request(ResRQ *old)
|
||||
if ((s = r2ptr->he.h_aliases[i]))
|
||||
MyFree(s);
|
||||
#else
|
||||
if (r2ptr->he)
|
||||
MyFree(r2ptr->he);
|
||||
if (r2ptr->he)
|
||||
MyFree(r2ptr->he);
|
||||
#endif
|
||||
if (r2ptr->name)
|
||||
MyFree(r2ptr->name);
|
||||
MyFree(r2ptr);
|
||||
|
||||
unlock_request();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -262,6 +334,7 @@ time_t timeout_query_list(time_t now)
|
||||
aClient *cptr;
|
||||
|
||||
Debug((DEBUG_DNS, "timeout_query_list at %s", myctime(now)));
|
||||
lock_request();
|
||||
for (rptr = first; rptr; rptr = r2ptr)
|
||||
{
|
||||
r2ptr = rptr->next;
|
||||
@@ -286,12 +359,11 @@ time_t timeout_query_list(time_t now)
|
||||
if (SHOWCONNECTINFO)
|
||||
sendto_one(cptr, REPORT_FAIL_DNS);
|
||||
ClearDNS(cptr);
|
||||
if (!DoingAuth(cptr))
|
||||
SetAccess(cptr);
|
||||
if (!DoingAuth(cptr))
|
||||
SetAccess(cptr);
|
||||
break;
|
||||
case ASYNC_CONNECT:
|
||||
sendto_ops("Host %s unknown",
|
||||
rptr->name);
|
||||
sendto_ops("Host %s unknown", rptr->name);
|
||||
break;
|
||||
}
|
||||
rem_request(rptr);
|
||||
@@ -315,6 +387,7 @@ time_t timeout_query_list(time_t now)
|
||||
if (!next || tout < next)
|
||||
next = tout;
|
||||
}
|
||||
unlock_request();
|
||||
return (next > now) ? next : (now + AR_TTL);
|
||||
}
|
||||
|
||||
@@ -326,12 +399,14 @@ void del_queries(char *cp)
|
||||
{
|
||||
ResRQ *rptr, *r2ptr;
|
||||
|
||||
lock_request();
|
||||
for (rptr = first; rptr; rptr = r2ptr)
|
||||
{
|
||||
r2ptr = rptr->next;
|
||||
if (cp == rptr->cinfo.value.cp)
|
||||
rem_request(rptr);
|
||||
}
|
||||
unlock_request();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -426,10 +501,12 @@ static ResRQ *find_id(int id)
|
||||
{
|
||||
ResRQ *rptr;
|
||||
|
||||
lock_request();
|
||||
for (rptr = first; rptr; rptr = rptr->next)
|
||||
if (rptr->id == id)
|
||||
return rptr;
|
||||
return NULL;
|
||||
break;
|
||||
unlock_request();
|
||||
return rptr;
|
||||
}
|
||||
|
||||
struct hostent *gethost_byname(char *name, Link *lp)
|
||||
@@ -441,7 +518,7 @@ struct hostent *gethost_byname(char *name, Link *lp)
|
||||
#ifndef _WIN32
|
||||
return (struct hostent *)&(cp->he);
|
||||
#else
|
||||
return (struct hostent *)cp->he;
|
||||
return (struct hostent *)cp->he;
|
||||
#endif
|
||||
if (!lp)
|
||||
return NULL;
|
||||
@@ -1950,5 +2027,6 @@ int res_copyhostent(struct hostent *from, struct hostent *to)
|
||||
|
||||
}
|
||||
to->h_addr_list[i] = NULL;
|
||||
return 1;
|
||||
}
|
||||
#endif /*_WIN32*/
|
||||
|
||||
+1
-2
@@ -103,8 +103,7 @@ void start_auth(aClient *cptr)
|
||||
sock.SIN_PORT = htons(113);
|
||||
sock.SIN_FAMILY = AFINET;
|
||||
|
||||
if (connect(cptr->authfd, (struct sockaddr *)&sock,
|
||||
sizeof(sock)) == -1 && !(ERRNO == P_EINPROGRESS))
|
||||
if (connect(cptr->authfd, (struct sockaddr *)&sock, sizeof(sock)) == -1 && !(ERRNO == P_EWORKING))
|
||||
{
|
||||
ircstp->is_abad++;
|
||||
/*
|
||||
|
||||
+23
-4
@@ -80,7 +80,12 @@ Computing Center and Jarkko Oikarinen";
|
||||
int rr;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef INET6
|
||||
static unsigned char minus_one[] =
|
||||
{ 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef IN_LOOPBACKNET
|
||||
#define IN_LOOPBACKNET 0x7f
|
||||
@@ -465,6 +470,7 @@ int add_listener2(ConfigItem_listen *conf)
|
||||
{
|
||||
cptr->umodes |= LISTENER_BOUND;
|
||||
conf->options |= LISTENER_BOUND;
|
||||
conf->listener = cptr;
|
||||
set_non_blocking(cptr->fd, cptr);
|
||||
return 1;
|
||||
}
|
||||
@@ -542,7 +548,11 @@ void init_sys(void)
|
||||
limit.rlim_cur = limit.rlim_max; /* make soft limit the max */
|
||||
if (setrlimit(RLIMIT_FD_MAX, &limit) == -1)
|
||||
{
|
||||
#ifndef LONG_LONG_RLIM_T
|
||||
(void)fprintf(stderr, "error setting max fd's to %ld\n",
|
||||
#else
|
||||
(void)fprintf(stderr, "error setting max fd's to %lld\n",
|
||||
#endif
|
||||
limit.rlim_cur);
|
||||
exit(-1);
|
||||
}
|
||||
@@ -1147,7 +1157,6 @@ void set_non_blocking(int fd, aClient *cptr)
|
||||
*/
|
||||
aClient *add_connection(aClient *cptr, int fd)
|
||||
{
|
||||
Link lin;
|
||||
aClient *acptr;
|
||||
ConfigItem_ban *bconf;
|
||||
int i, j;
|
||||
@@ -1254,6 +1263,7 @@ add_con_refuse:
|
||||
if (cptr->umodes & LISTENER_SSL)
|
||||
{
|
||||
SetSSLAcceptHandshake(acptr);
|
||||
Debug((DEBUG_DEBUG, "Starting SSL accept handshake for %s", acptr->sockhost));
|
||||
if ((acptr->ssl = SSL_new(ctx_server)) == NULL)
|
||||
{
|
||||
goto add_con_refuse;
|
||||
@@ -1262,6 +1272,7 @@ add_con_refuse:
|
||||
SSL_set_fd(acptr->ssl, fd);
|
||||
SSL_set_nonblocking(acptr->ssl);
|
||||
if (!ircd_SSL_accept(acptr, fd)) {
|
||||
Debug((DEBUG_DEBUG, "Failed SSL accept handshake in instance 1: %s", acptr->sockhost));
|
||||
SSL_set_shutdown(acptr->ssl, SSL_RECEIVED_SHUTDOWN);
|
||||
SSL_smart_shutdown(acptr->ssl);
|
||||
SSL_free(acptr->ssl);
|
||||
@@ -1804,15 +1815,17 @@ int read_message(time_t delay, fdlist *listp)
|
||||
** ...room for writing, empty some queue then...
|
||||
*/
|
||||
ClearBlocked(cptr);
|
||||
if (IsConnecting(cptr))
|
||||
if (IsConnecting(cptr)) {
|
||||
#ifdef USE_SSL
|
||||
if ((cptr->serv) && (cptr->serv->conf->options & CONNECT_SSL))
|
||||
{
|
||||
Debug((DEBUG_DEBUG, "ircd_SSL_client_handshake(%s)", cptr->name));
|
||||
write_err = ircd_SSL_client_handshake(cptr);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
write_err = completed_connection(cptr);
|
||||
}
|
||||
if (!write_err)
|
||||
{
|
||||
if (DoList(cptr) && IsSendable(cptr))
|
||||
@@ -1854,12 +1867,18 @@ deadsocket:
|
||||
length = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (SSL_is_init_finished(cptr->ssl))
|
||||
{
|
||||
if (IsSSLAcceptHandshake(cptr))
|
||||
{
|
||||
Debug((DEBUG_ERROR, "ssl: start_of_normal_client_handshake(%s)", cptr->sockhost));
|
||||
start_of_normal_client_handshake(cptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug((DEBUG_ERROR, "ssl: completed_connection", cptr->name));
|
||||
completed_connection(cptr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+4232
-2902
File diff suppressed because it is too large
Load Diff
+6
-7
@@ -536,11 +536,10 @@ int m_tkl(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
tkl_add_line(type, parv[3], parv[4], parv[8], parv[5],
|
||||
expiry_1, setat_1);
|
||||
|
||||
strncpy(gmt, asctime(gmtime((TS *)&setat_1)), sizeof(gmt));
|
||||
strncpy(gmt2, asctime(gmtime((TS *)&expiry_1)), sizeof(gmt2));
|
||||
gmt[strlen(gmt) - 1] = '\0';
|
||||
gmt2[strlen(gmt2) - 1] = '\0';
|
||||
|
||||
strncpyzt(gmt, asctime(gmtime((TS *)&setat_1)), sizeof(gmt));
|
||||
strncpyzt(gmt2, asctime(gmtime((TS *)&expiry_1)), sizeof(gmt2));
|
||||
iCstrip(gmt);
|
||||
iCstrip(gmt2);
|
||||
switch (type)
|
||||
{
|
||||
case TKL_KILL:
|
||||
@@ -637,10 +636,10 @@ int m_tkl(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
if (!strcmp(tk->hostmask, parv[4])
|
||||
&& !strcmp(tk->usermask, parv[3]))
|
||||
{
|
||||
strncpy(gmt,
|
||||
strncpyzt(gmt,
|
||||
asctime(gmtime((TS *)&tk->
|
||||
set_at)), sizeof(gmt));
|
||||
gmt[strlen(gmt) - 1] = '\0';
|
||||
iCstrip(gmt);
|
||||
sendto_snomask(SNO_TKL,
|
||||
"%s removed %s %s@%s (set at %s - reason: %s)",
|
||||
parv[5], txt, tk->usermask,
|
||||
|
||||
+9
-3
@@ -442,9 +442,15 @@ int exit_client(aClient *cptr, aClient *sptr, aClient *from, char *comment)
|
||||
MyFree(sptr->user->lopt);
|
||||
}
|
||||
on_for = TStime() - sptr->firsttime;
|
||||
ircd_log(LOG_CLIENT, "Disconnect - (%d:%d:%d) %s!%s@%s",
|
||||
on_for / 3600, (on_for % 3600) / 60, on_for % 60,
|
||||
sptr->name, sptr->user->username, sptr->user->realhost);
|
||||
if IsHidden(sptr)
|
||||
ircd_log(LOG_CLIENT, "Disconnect - (%d:%d:%d) %s!%s@%s [VHOST %s]",
|
||||
on_for / 3600, (on_for % 3600) / 60, on_for % 60,
|
||||
sptr->name, sptr->user->username,
|
||||
sptr->user->realhost, sptr->user->virthost);
|
||||
else
|
||||
ircd_log(LOG_CLIENT, "Disconnect - (%d:%d:%d) %s!%s@%s",
|
||||
on_for / 3600, (on_for % 3600) / 60, on_for % 60,
|
||||
sptr->name, sptr->user->username, sptr->user->realhost);
|
||||
}
|
||||
|
||||
if (sptr->fd >= 0 && !IsConnecting(sptr))
|
||||
|
||||
+16
-9
@@ -333,8 +333,7 @@ CMD_FUNC(m_protoctl)
|
||||
/* parv[parc - 1] */
|
||||
for (i = 1; i < parc; i++)
|
||||
{
|
||||
strncpy(proto, parv[i], 127);
|
||||
proto[127] = '\0'; /* Just to be safe... */
|
||||
strncpyzt(proto, parv[i], sizeof proto);
|
||||
s = proto;
|
||||
#ifndef PROTOCTL_MADNESS
|
||||
if (*s == '-')
|
||||
@@ -712,7 +711,7 @@ CMD_FUNC(m_server)
|
||||
get_client_name(cptr, TRUE));
|
||||
return exit_client(cptr, cptr, &me, "Invalid numeric");
|
||||
}
|
||||
(void)strncpy(info, parv[parc - 1], REALLEN + 60);
|
||||
strncpyzt(info, parv[parc - 1], REALLEN + 61);
|
||||
strncpyzt(cptr->name, servername, sizeof(cptr->name));
|
||||
cptr->hopcount = hop;
|
||||
/* Add ban server stuff */
|
||||
@@ -893,7 +892,7 @@ CMD_FUNC(m_server_remote)
|
||||
servername);
|
||||
return exit_client(cptr, cptr, &me, "Invalid remote numeric");
|
||||
}
|
||||
(void)strncpy(info, parv[parc - 1], REALLEN + 60);
|
||||
strncpyzt(info, parv[parc - 1], REALLEN + 61);
|
||||
if (!cptr->serv->conf)
|
||||
{
|
||||
sendto_realops("Lost conf for %s!!, dropping link", cptr->name);
|
||||
@@ -1461,6 +1460,8 @@ void m_info_send(aClient *sptr)
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :| * Luke <luke@unrealircd.com>",
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :| * McSkaf <mcskaf@unrealircd.com>",
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :| Coder team:", me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name);
|
||||
@@ -1472,8 +1473,6 @@ void m_info_send(aClient *sptr)
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :| * chasm <chasm@unrealircd.org>",
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :| * McSkaf <mcskaf@unrealircd.org>",
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name);
|
||||
sendto_one(sptr, ":%s %d %s :| Previous versions:",
|
||||
me.name, RPL_INFO, sptr->name);
|
||||
@@ -1915,6 +1914,8 @@ CMD_FUNC(m_stats)
|
||||
int doall = 0, wilds = 0, showports = IsAnOper(sptr), remote = 0;
|
||||
char *name;
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
if (hunt_server_token(cptr, sptr, MSG_STATS, TOK_STATS, "%s :%s", 2, parc,
|
||||
parv) != HUNTED_ISME)
|
||||
return 0;
|
||||
@@ -2666,12 +2667,13 @@ CMD_FUNC(m_help)
|
||||
|
||||
/*
|
||||
* parv[0] = sender
|
||||
* parv[1] = host/server mask.
|
||||
* parv[2] = server to query
|
||||
* parv[1] = server to query
|
||||
*/
|
||||
CMD_FUNC(m_lusers)
|
||||
{
|
||||
|
||||
if (hunt_server_token(cptr, sptr, MSG_LUSERS, TOK_LUSERS, ":%s", 1, parc,
|
||||
parv) != HUNTED_ISME)
|
||||
return 0;
|
||||
/* Just to correct results ---Stskeeps */
|
||||
if (IRCstats.clients > IRCstats.global_max)
|
||||
IRCstats.global_max = IRCstats.clients;
|
||||
@@ -3766,6 +3768,8 @@ CMD_FUNC(m_motd)
|
||||
int svsnofile = 0;
|
||||
char userhost[HOSTLEN + USERLEN + 6];
|
||||
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
if (hunt_server_token(cptr, sptr, MSG_MOTD, TOK_MOTD, ":%s", 1, parc, parv) !=
|
||||
HUNTED_ISME)
|
||||
return 0;
|
||||
@@ -4058,6 +4062,9 @@ CMD_FUNC(m_rules)
|
||||
ConfigItem_tld *ptr;
|
||||
aMotd *temp;
|
||||
char userhost[USERLEN + HOSTLEN + 6];
|
||||
if (IsServer(sptr))
|
||||
return 0;
|
||||
|
||||
if (hunt_server_token(cptr, sptr, MSG_RULES, TOK_RULES, ":%s", 1, parc,
|
||||
parv) != HUNTED_ISME)
|
||||
return 0;
|
||||
|
||||
+10
-4
@@ -80,6 +80,9 @@ int oper_access[] = {
|
||||
OFLAG_WHOIS, 'W',
|
||||
OFLAG_HIDE, 'H',
|
||||
OFLAG_INVISIBLE, '^',
|
||||
OFLAG_TKL, 't',
|
||||
OFLAG_GZL, 'Z',
|
||||
OFLAG_OVERRIDE, 'v',
|
||||
0, 0
|
||||
};
|
||||
|
||||
@@ -236,7 +239,8 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
|
||||
|
||||
if (alias->type == ALIAS_SERVICES) {
|
||||
if (SERVICES_NAME && (acptr = find_person(alias->nick, NULL)))
|
||||
sendto_one(acptr, ":%s PRIVMSG %s@%s :%s", parv[0],
|
||||
sendto_one(acptr, ":%s %s %s@%s :%s", parv[0],
|
||||
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
|
||||
alias->nick, SERVICES_NAME, parv[1]);
|
||||
else
|
||||
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
|
||||
@@ -244,7 +248,8 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
|
||||
}
|
||||
else if (alias->type == ALIAS_STATS) {
|
||||
if (STATS_SERVER && (acptr = find_person(alias->nick, NULL)))
|
||||
sendto_one(acptr, ":%s PRIVMSG %s@%s :%s", parv[0],
|
||||
sendto_one(acptr, ":%s %s %s@%s :%s", parv[0],
|
||||
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
|
||||
alias->nick, STATS_SERVER, parv[1]);
|
||||
else
|
||||
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
|
||||
@@ -257,7 +262,8 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
|
||||
sptr->user->username, IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost,
|
||||
alias->nick, parv[1]);
|
||||
else
|
||||
sendto_one(acptr, ":%s PRIVMSG %s :%s", parv[0],
|
||||
sendto_one(acptr, ":%s %s %s :%s", parv[0],
|
||||
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
|
||||
alias->nick, parv[1]);
|
||||
}
|
||||
else
|
||||
@@ -318,7 +324,7 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
|
||||
xparv[0] = parv[0];
|
||||
xparv[1] = output;
|
||||
xparv[2] = NULL;
|
||||
m_alias(cptr, sptr, 2, xparv, format->alias->alias);
|
||||
m_alias(cptr, sptr, 2, xparv, format->nick);
|
||||
regfree(&pcomp);
|
||||
free(current);
|
||||
break;
|
||||
|
||||
+74
-7
@@ -417,6 +417,69 @@ int hunt_server_token(aClient *cptr, aClient *sptr, char *command, char *token,
|
||||
return (HUNTED_NOSUCH);
|
||||
}
|
||||
|
||||
int hunt_server_token_quiet(aClient *cptr, aClient *sptr, char *command, char *token, char
|
||||
*params, int server, int parc, char *parv[])
|
||||
{
|
||||
aClient *acptr;
|
||||
|
||||
/*
|
||||
** Assume it's me, if no server
|
||||
*/
|
||||
if (parc <= server || BadPtr(parv[server]) ||
|
||||
match(me.name, parv[server]) == 0 ||
|
||||
match(parv[server], me.name) == 0)
|
||||
return (HUNTED_ISME);
|
||||
/*
|
||||
** These are to pickup matches that would cause the following
|
||||
** message to go in the wrong direction while doing quick fast
|
||||
** non-matching lookups.
|
||||
*/
|
||||
if ((acptr = find_client(parv[server], NULL)))
|
||||
if (acptr->from == sptr->from && !MyConnect(acptr))
|
||||
acptr = NULL;
|
||||
if (!acptr && (acptr = find_server_quick(parv[server])))
|
||||
if (acptr->from == sptr->from && !MyConnect(acptr))
|
||||
acptr = NULL;
|
||||
if (!acptr)
|
||||
for (acptr = client, (void)collapse(parv[server]);
|
||||
(acptr = next_client(acptr, parv[server]));
|
||||
acptr = acptr->next)
|
||||
{
|
||||
if (acptr->from == sptr->from && !MyConnect(acptr))
|
||||
continue;
|
||||
/*
|
||||
* Fix to prevent looping in case the parameter for
|
||||
* some reason happens to match someone from the from
|
||||
* link --jto
|
||||
*/
|
||||
if (IsRegistered(acptr) && (acptr != cptr))
|
||||
break;
|
||||
}
|
||||
if (acptr)
|
||||
{
|
||||
char buff[1024];
|
||||
if (IsMe(acptr) || MyClient(acptr))
|
||||
return HUNTED_ISME;
|
||||
if (match(acptr->name, parv[server]))
|
||||
parv[server] = acptr->name;
|
||||
if (IsToken(acptr->from)) {
|
||||
sprintf(buff, ":%s %s ", parv[0], token);
|
||||
strcat(buff, params);
|
||||
sendto_one(acptr, buff, parv[1], parv[2], parv[3], parv[4], parv[5], parv[6], parv[7], parv[8]);
|
||||
}
|
||||
else {
|
||||
sprintf(buff, ":%s %s ", parv[0], command);
|
||||
strcat(buff, params);
|
||||
sendto_one(acptr, buff, parv[1], parv[2],
|
||||
parv[3], parv[4], parv[5], parv[6], parv[7], parv[8]);
|
||||
}
|
||||
return (HUNTED_PASS);
|
||||
}
|
||||
return (HUNTED_NOSUCH);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** check_for_target_limit
|
||||
@@ -759,13 +822,11 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
|
||||
char temp[USERLEN + 1];
|
||||
strncpyzt(temp, username, USERLEN + 1);
|
||||
if (IDENT_CHECK == 0) {
|
||||
strncpy(user->username, temp, USERLEN);
|
||||
user->username[USERLEN] = '\0';
|
||||
strncpyzt(user->username, temp, USERLEN + 1);
|
||||
}
|
||||
else {
|
||||
*user->username = '~';
|
||||
(void)strncpy(&user->username[1], temp, USERLEN);
|
||||
user->username[USERLEN] = '\0';
|
||||
strncpyzt((user->username + 1), temp, USERLEN);
|
||||
#ifdef HOSTILENAME
|
||||
noident = 1;
|
||||
#endif
|
||||
@@ -874,7 +935,12 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
|
||||
{
|
||||
IRCstats.unknown--;
|
||||
IRCstats.me_clients++;
|
||||
ircd_log(LOG_CLIENT, "Connect - %s!%s@%s", nick, user->username, user->realhost);
|
||||
if IsHidden(sptr)
|
||||
ircd_log(LOG_CLIENT, "Connect - %s!%s@%s [VHOST %s]", nick,
|
||||
user->username, user->realhost, user->virthost);
|
||||
else
|
||||
ircd_log(LOG_CLIENT, "Connect - %s!%s@%s", nick, user->username,
|
||||
user->realhost);
|
||||
sendto_one(sptr, rpl_str(RPL_WELCOME), me.name, nick,
|
||||
ircnetwork, nick, user->username, user->realhost);
|
||||
/* This is a duplicate of the NOTICE but see below... */
|
||||
@@ -1291,7 +1357,7 @@ CMD_FUNC(m_nick)
|
||||
** is concerned (user is changing the case of his/her
|
||||
** nickname or somesuch)
|
||||
*/
|
||||
if (acptr == sptr)
|
||||
if (acptr == sptr) {
|
||||
if (strcmp(acptr->name, nick) != 0)
|
||||
/*
|
||||
** Allows change of case in his/her nick
|
||||
@@ -1306,6 +1372,7 @@ CMD_FUNC(m_nick)
|
||||
** version would treat it as nick collision.
|
||||
*/
|
||||
return 0; /* NICK Message ignored */
|
||||
}
|
||||
/*
|
||||
** Note: From this point forward it can be assumed that
|
||||
** acptr != sptr (point to different client structures).
|
||||
@@ -1361,7 +1428,7 @@ CMD_FUNC(m_nick)
|
||||
}
|
||||
sendto_failops("Nick collision on %s (%s %d <- %s %d)",
|
||||
acptr->name, acptr->from->name, acptr->lastnick,
|
||||
get_client_name(cptr, FALSE), lastnick);
|
||||
cptr->name, lastnick);
|
||||
/*
|
||||
** I'm putting the KILL handling here just to make it easier
|
||||
** to read, it's hard to follow it the way it used to be.
|
||||
|
||||
+98
-241
@@ -53,6 +53,13 @@ static char sendbuf[2048];
|
||||
static char tcmd[1024];
|
||||
static char ccmd[1024];
|
||||
|
||||
/* this array is used to ensure we send a msg only once to a remote
|
||||
** server. like, when we are sending a message to all channel members
|
||||
** send the message to those that are directly connected to us and once
|
||||
** to each server that has these members. the servers then forward the
|
||||
** message to other servers and to those channel members that are directly
|
||||
** connected to them
|
||||
*/
|
||||
static int sentalong[MAXCONNECTIONS];
|
||||
|
||||
void vsendto_prefix_one(struct Client *to, struct Client *from,
|
||||
@@ -297,13 +304,12 @@ void sendto_channel_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
/* ...was the one I should skip */
|
||||
if (acptr->from == one || (IsDeaf(acptr)
|
||||
&& !(sendanyways == 1)))
|
||||
/* skip the one and deaf clients (unless sendanyways is set) */
|
||||
if (acptr->from == one || (IsDeaf(acptr) && !(sendanyways == 1)))
|
||||
continue;
|
||||
if (MyConnect(acptr)) /* (It is always a client) */
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
else if (sentalong[(i = acptr->from->fd)] != sentalong_marker)
|
||||
else if (sentalong[(i = acptr->from->slot)] != sentalong_marker)
|
||||
{
|
||||
sentalong[i] = sentalong_marker;
|
||||
/*
|
||||
@@ -325,24 +331,24 @@ void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
int i;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i < MAXCONNECTIONS; i++)
|
||||
sentalong[i] = 0;
|
||||
|
||||
++sentalong_marker;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == one)
|
||||
continue; /* ...was the one I should skip
|
||||
or user not not a channel op */
|
||||
if ((prefix & 0x1) && (lp->flags & CHFL_HALFOP))
|
||||
goto good;
|
||||
if ((prefix & 0x2) && (lp->flags & CHFL_VOICE))
|
||||
if ((prefix & PREFIX_HALFOP) && (lp->flags & CHFL_HALFOP))
|
||||
goto good;
|
||||
if ((prefix & 0x4) && (lp->flags & CHFL_CHANOP))
|
||||
if ((prefix & PREFIX_VOICE) && (lp->flags & CHFL_VOICE))
|
||||
goto good;
|
||||
continue;
|
||||
if ((prefix & PREFIX_OP) && (lp->flags & CHFL_CHANOP))
|
||||
goto good;
|
||||
continue;
|
||||
|
||||
good:
|
||||
|
||||
i = acptr->from->fd;
|
||||
i = acptr->from->slot;
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
{
|
||||
#ifdef SECURECHANMSGSONLYGOTOSECURE
|
||||
@@ -351,22 +357,21 @@ void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
continue;
|
||||
#endif
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now check whether a message has been sent to this
|
||||
* remote link already */
|
||||
if (sentalong[i] == 0)
|
||||
if (sentalong[i] != sentalong_marker)
|
||||
{
|
||||
#ifdef SECURECHANMSGSONLYGOTOSECURE
|
||||
if (chptr->mode.mode & MODE_ONLYSECURE)
|
||||
if (!IsSecure(acptr->from))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,51 +389,45 @@ void sendto_channelprefix_butone_tok(aClient *one, aClient *from, aChannel *chpt
|
||||
|
||||
sprintf(tcmd, ":%s %s %s :%s", from->name, tok, nick, text);
|
||||
sprintf(ccmd, ":%s %s %s :%s", from->name, cmd, nick, text);
|
||||
for (i = 0; i < MAXCONNECTIONS; i++)
|
||||
sentalong[i] = 0;
|
||||
|
||||
++sentalong_marker;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == one)
|
||||
continue; /* ...was the one I should skip
|
||||
or user not not a channel op */
|
||||
if (prefix == 0)
|
||||
goto good;
|
||||
if ((prefix & 0x1) && (lp->flags & CHFL_HALFOP))
|
||||
goto good;
|
||||
if ((prefix & 0x2) && (lp->flags & CHFL_VOICE))
|
||||
if (prefix == PREFIX_ALL)
|
||||
goto good;
|
||||
if ((prefix & PREFIX_HALFOP) && (lp->flags & CHFL_HALFOP))
|
||||
goto good;
|
||||
if ((prefix & 0x4) && (lp->flags & CHFL_CHANOP))
|
||||
if ((prefix & PREFIX_VOICE) && (lp->flags & CHFL_VOICE))
|
||||
goto good;
|
||||
continue;
|
||||
if ((prefix & PREFIX_OP) && (lp->flags & CHFL_CHANOP))
|
||||
goto good;
|
||||
continue;
|
||||
|
||||
good:
|
||||
|
||||
i = acptr->from->fd;
|
||||
|
||||
i = acptr->from->slot;
|
||||
if (IsDeaf(acptr) && !sendanyways)
|
||||
continue;
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
{
|
||||
if (IsDeaf(acptr))
|
||||
if (!sendanyways)
|
||||
continue;
|
||||
sendto_prefix_one(acptr, from, ":%s %s %s :%s",
|
||||
from->name, cmd, nick, text);
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsDeaf(acptr))
|
||||
if (!sendanyways)
|
||||
continue;
|
||||
/* Now check whether a message has been sent to this
|
||||
* remote link already */
|
||||
if (sentalong[i] == 0)
|
||||
if (sentalong[i] != sentalong_marker)
|
||||
{
|
||||
|
||||
if (IsToken(acptr->from))
|
||||
sendto_one(acptr, "%s", tcmd);
|
||||
else
|
||||
sendto_one(acptr, "%s", ccmd);
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,148 +457,7 @@ void sendto_chanops_butone(aClient *one, aChannel *chptr, char *pattern, ...)
|
||||
vsendto_one(acptr, pattern, vl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sendto_channelops_butone Added 1 Sep 1996 by Cabal95.
|
||||
* Send a message to all OPs in channel chptr that
|
||||
* are directly on this server and sends the message
|
||||
* on to the next server if it has any OPs.
|
||||
*
|
||||
* All servers must have this functional ability
|
||||
* or one without will send back an error message. -- Cabal95
|
||||
*/
|
||||
void sendto_channelops_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
char *pattern, ...)
|
||||
{
|
||||
va_list vl;
|
||||
Member *lp;
|
||||
aClient *acptr;
|
||||
int i;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i < MAXCONNECTIONS; i++)
|
||||
sentalong[i] = 0;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == one || !(lp->flags & CHFL_CHANOP))
|
||||
continue; /* ...was the one I should skip
|
||||
or user not not a channel op */
|
||||
i = acptr->from->fd;
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
{
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now check whether a message has been sent to this
|
||||
* remote link already */
|
||||
if (sentalong[i] == 0)
|
||||
{
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
va_end(vl);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* sendto_channelvoice_butone
|
||||
* direct port of Cabal95's sendto_channelops_butone
|
||||
* to allow for /notice @+#channel messages
|
||||
* not exactly the most adventurous coding (made heavy use of copy-paste) <G>
|
||||
* but it's needed to avoid mass-msg trigger in script vnotices
|
||||
* -DuffJ
|
||||
*/
|
||||
|
||||
void sendto_channelvoice_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
char *pattern, ...)
|
||||
{
|
||||
va_list vl;
|
||||
Member *lp;
|
||||
aClient *acptr;
|
||||
int i;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i < MAXCONNECTIONS; i++)
|
||||
sentalong[i] = 0;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == one || !(lp->flags & CHFL_VOICE))
|
||||
continue; /* ...was the one I should skip
|
||||
or user not (a channel voice or op) */
|
||||
i = acptr->from->fd;
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
{
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now check whether a message has been sent to this
|
||||
* remote link already */
|
||||
if (sentalong[i] == 0)
|
||||
{
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
va_end(vl);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* sendto_channelhalfop_butone
|
||||
* direct port of Cabal95's sendto_channelops_butone
|
||||
* to allow for /notice @+#channel messages
|
||||
* not exactly the most adventurous coding (made heavy use of copy-paste) <G>
|
||||
* but it's needed to avoid mass-msg trigger in script hnotices
|
||||
* -Stskeeps
|
||||
*/
|
||||
|
||||
void sendto_channelhalfop_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
char *pattern, ...)
|
||||
{
|
||||
va_list vl;
|
||||
Member *lp;
|
||||
aClient *acptr;
|
||||
int i;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i < MAXCONNECTIONS; i++)
|
||||
sentalong[i] = 0;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == one || !(lp->flags & CHFL_HALFOP))
|
||||
continue; /* ...was the one I should skip
|
||||
or user not (a channel halfop or op) */
|
||||
i = acptr->from->fd;
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
{
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now check whether a message has been sent to this
|
||||
* remote link already */
|
||||
if (sentalong[i] == 0)
|
||||
{
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
va_end(vl);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1050,7 +908,7 @@ void sendto_serv_nickv2_token(aClient *one, char *pattern, char *tokpattern,
|
||||
/*
|
||||
* sendto_common_channels()
|
||||
*
|
||||
* Sends a message to all people (inclusing user) on local server who are
|
||||
* Sends a message to all people (including user) on local server who are
|
||||
* in same channel with user.
|
||||
*/
|
||||
void sendto_common_channels(aClient *user, char *pattern, ...)
|
||||
@@ -1062,19 +920,18 @@ void sendto_common_channels(aClient *user, char *pattern, ...)
|
||||
aClient *cptr;
|
||||
|
||||
va_start(vl, pattern);
|
||||
memset((char *)sentalong, '\0', sizeof(sentalong));
|
||||
|
||||
++sentalong_marker;
|
||||
if (user->fd >= 0)
|
||||
sentalong[user->fd] = 1;
|
||||
sentalong[user->slot] = sentalong_marker;
|
||||
if (user->user)
|
||||
for (channels = user->user->channel; channels;
|
||||
channels = channels->next)
|
||||
for (users = channels->chptr->members; users;
|
||||
users = users->next)
|
||||
for (channels = user->user->channel; channels; channels = channels->next)
|
||||
for (users = channels->chptr->members; users; users = users->next)
|
||||
{
|
||||
cptr = users->cptr;
|
||||
if (!MyConnect(cptr) || sentalong[cptr->fd])
|
||||
if (!MyConnect(cptr) || sentalong[cptr->slot] == sentalong_marker)
|
||||
continue;
|
||||
sentalong[cptr->fd]++;
|
||||
sentalong[cptr->slot] = sentalong_marker;
|
||||
vsendto_prefix_one(cptr, user, pattern, vl);
|
||||
}
|
||||
if (MyConnect(user))
|
||||
@@ -1455,18 +1312,18 @@ void sendto_ops_butone(aClient *one, aClient *from, char *pattern, ...)
|
||||
aClient *cptr;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i <= LastSlot; i++)
|
||||
sentalong[i] = 0;
|
||||
|
||||
++sentalong_marker;
|
||||
for (cptr = client; cptr; cptr = cptr->next)
|
||||
{
|
||||
if (!SendWallops(cptr))
|
||||
continue;
|
||||
i = cptr->from->slot; /* find connection oper is on */
|
||||
if (sentalong[i]) /* sent message along it already ? */
|
||||
if (sentalong[i] == sentalong_marker) /* sent message along it already ? */
|
||||
continue;
|
||||
if (cptr->from == one)
|
||||
continue; /* ...was the one I should skip */
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
vsendto_prefix_one(cptr->from, from, pattern, vl);
|
||||
}
|
||||
va_end(vl);
|
||||
@@ -1487,18 +1344,18 @@ void sendto_opers_butone(aClient *one, aClient *from, char *pattern, ...)
|
||||
aClient *cptr;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i <= LastSlot; i++)
|
||||
sentalong[i] = 0;
|
||||
|
||||
++sentalong_marker;
|
||||
for (cptr = client; cptr; cptr = cptr->next)
|
||||
{
|
||||
if (!IsAnOper(cptr))
|
||||
continue;
|
||||
i = cptr->from->slot; /* find connection oper is on */
|
||||
if (sentalong[i]) /* sent message along it already ? */
|
||||
if (sentalong[i] == sentalong_marker) /* sent message along it already ? */
|
||||
continue;
|
||||
if (cptr->from == one)
|
||||
continue; /* ...was the one I should skip */
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
vsendto_prefix_one(cptr->from, from, pattern, vl);
|
||||
}
|
||||
va_end(vl);
|
||||
@@ -1516,18 +1373,18 @@ void sendto_ops_butme(aClient *from, char *pattern, ...)
|
||||
aClient *cptr;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (i = 0; i <= LastSlot; i++)
|
||||
sentalong[i] = 0;
|
||||
|
||||
++sentalong_marker;
|
||||
for (cptr = client; cptr; cptr = cptr->next)
|
||||
{
|
||||
if (!SendWallops(cptr))
|
||||
continue;
|
||||
i = cptr->from->slot; /* find connection oper is on */
|
||||
if (sentalong[i]) /* sent message along it already ? */
|
||||
if (sentalong[i] == sentalong_marker) /* sent message along it already ? */
|
||||
continue;
|
||||
if (!strcmp(cptr->user->server, me.name)) /* a locop */
|
||||
continue;
|
||||
sentalong[i] = 1;
|
||||
sentalong[i] = sentalong_marker;
|
||||
vsendto_prefix_one(cptr->from, from, pattern, vl);
|
||||
}
|
||||
va_end(vl);
|
||||
@@ -1780,20 +1637,20 @@ void sendto_channels_inviso_join(aClient *user)
|
||||
Member *users;
|
||||
aClient *cptr;
|
||||
|
||||
memset((char *)sentalong, '\0', sizeof(sentalong));
|
||||
if (user->fd >= 0)
|
||||
sentalong[user->fd] = 1;
|
||||
++sentalong_marker;
|
||||
if (user->fd >= 0)
|
||||
sentalong[user->slot] = sentalong_marker;
|
||||
if (user->user)
|
||||
for (channels = user->user->channel; channels; channels = channels->next)
|
||||
for (users = channels->chptr->members; users; users = users->next)
|
||||
{
|
||||
cptr = users->cptr;
|
||||
if (!MyConnect(cptr) || IsNetAdmin(cptr) || sentalong[cptr->fd] || cptr == user)
|
||||
continue;
|
||||
sentalong[cptr->fd]++;
|
||||
sendto_one(cptr, ":%s!%s@%s JOIN :%s", user->name, user->user->username,
|
||||
(IsHidden(user) ? user->user->virthost : user->user->realhost), channels->chptr->chname);
|
||||
}
|
||||
for (channels = user->user->channel; channels; channels = channels->next)
|
||||
for (users = channels->chptr->members; users; users = users->next)
|
||||
{
|
||||
cptr = users->cptr;
|
||||
if (!MyConnect(cptr) || IsNetAdmin(cptr) || sentalong[cptr->slot] == sentalong_marker || cptr == user)
|
||||
continue;
|
||||
sentalong[cptr->slot] = sentalong_marker;
|
||||
sendto_one(cptr, ":%s!%s@%s JOIN :%s", user->name, user->user->username,
|
||||
(IsHidden(user) ? user->user->virthost : user->user->realhost), channels->chptr->chname);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1803,42 +1660,42 @@ void sendto_channels_inviso_part(aClient *user)
|
||||
Member *users;
|
||||
aClient *cptr;
|
||||
|
||||
memset((char *)sentalong, '\0', sizeof(sentalong));
|
||||
if (user->fd >= 0)
|
||||
sentalong[user->fd] = 1;
|
||||
++sentalong_marker;
|
||||
if (user->fd >= 0)
|
||||
sentalong[user->slot] = sentalong_marker;
|
||||
if (user->user)
|
||||
for (channels = user->user->channel; channels; channels = channels->next)
|
||||
for (users = channels->chptr->members; users; users = users->next)
|
||||
{
|
||||
cptr = users->cptr;
|
||||
if (!MyConnect(cptr) || IsNetAdmin(cptr) || sentalong[cptr->fd] || cptr == user)
|
||||
continue;
|
||||
sentalong[cptr->fd]++;
|
||||
sendto_one(cptr, ":%s!%s@%s PART :%s", user->name, user->user->username, (IsHidden(user) ? user->user->virthost : user->user->realhost), channels->chptr->chname);
|
||||
}
|
||||
for (channels = user->user->channel; channels; channels = channels->next)
|
||||
for (users = channels->chptr->members; users; users = users->next)
|
||||
{
|
||||
cptr = users->cptr;
|
||||
if (!MyConnect(cptr) || IsNetAdmin(cptr) || sentalong[cptr->slot] == sentalong_marker || cptr == user)
|
||||
continue;
|
||||
sentalong[cptr->slot] = sentalong_marker;
|
||||
sendto_one(cptr, ":%s!%s@%s PART :%s", user->name, user->user->username, (IsHidden(user) ? user->user->virthost : user->user->realhost), channels->chptr->chname);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void sendto_channel_ntadmins(aClient *from, aChannel *chptr, char *pattern, ...)
|
||||
{
|
||||
va_list vl;
|
||||
Member *lp;
|
||||
aClient *acptr;
|
||||
int i;
|
||||
va_list vl;
|
||||
Member *lp;
|
||||
aClient *acptr;
|
||||
int i;
|
||||
|
||||
va_start(vl, pattern);
|
||||
++sentalong_marker;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
va_start(vl, pattern);
|
||||
++sentalong_marker;
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == from || !IsNetAdmin(acptr) || (IsDeaf(acptr) && !(sendanyways == 1)))
|
||||
continue;
|
||||
if (MyConnect(acptr)) /* (It is always a client) */
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
else if (sentalong[(i = acptr->from->fd)] != sentalong_marker)
|
||||
acptr = lp->cptr;
|
||||
if (acptr->from == from || !IsNetAdmin(acptr) || (IsDeaf(acptr) && !(sendanyways == 1)))
|
||||
continue;
|
||||
if (MyConnect(acptr)) /* (It is always a client) */
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
else if (sentalong[(i = acptr->from->slot)] != sentalong_marker)
|
||||
{
|
||||
sentalong[i] = sentalong_marker;
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
sentalong[i] = sentalong_marker;
|
||||
vsendto_prefix_one(acptr, from, pattern, vl);
|
||||
}
|
||||
}
|
||||
va_end(vl);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "common.h"
|
||||
#include "struct.h"
|
||||
#include "h.h"
|
||||
#include "proto.h"
|
||||
#include "sys.h"
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
@@ -48,9 +49,9 @@ typedef struct {
|
||||
char **buffer;
|
||||
} StreamIO;
|
||||
|
||||
static StreamIO *streamp;
|
||||
#define CHK_SSL(err) if ((err)==-1) { ERR_print_errors_fp(stderr); }
|
||||
#ifdef _WIN32
|
||||
static StreamIO *streamp;
|
||||
LRESULT SSLPassDLG(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) {
|
||||
StreamIO *stream;
|
||||
switch (Message) {
|
||||
@@ -76,6 +77,40 @@ LRESULT SSLPassDLG(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
char *ssl_error_str(int err)
|
||||
{
|
||||
char *ssl_errstr = NULL;
|
||||
switch(err) {
|
||||
case SSL_ERROR_NONE:
|
||||
ssl_errstr = "SSL: No error";
|
||||
break;
|
||||
case SSL_ERROR_SSL:
|
||||
ssl_errstr = "Internal OpenSSL error or protocol error";
|
||||
break;
|
||||
case SSL_ERROR_WANT_READ:
|
||||
ssl_errstr = "OpenSSL functions requested a read()";
|
||||
break;
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
ssl_errstr = "OpenSSL functions requested a write()";
|
||||
break;
|
||||
case SSL_ERROR_WANT_X509_LOOKUP:
|
||||
ssl_errstr = "OpenSSL requested a X509 lookup which didn`t arrive";
|
||||
break;
|
||||
case SSL_ERROR_SYSCALL:
|
||||
ssl_errstr = "Underlying syscall error";
|
||||
break;
|
||||
case SSL_ERROR_ZERO_RETURN:
|
||||
ssl_errstr = "Underlying socket operation returned zero";
|
||||
break;
|
||||
case SSL_ERROR_WANT_CONNECT:
|
||||
ssl_errstr = "OpenSSL functions wanted a connect()";
|
||||
break;
|
||||
default:
|
||||
ssl_errstr = "Unknown OpenSSL error (huh?)";
|
||||
}
|
||||
return (ssl_errstr);
|
||||
}
|
||||
|
||||
|
||||
int ssl_pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
||||
@@ -90,8 +125,7 @@ int ssl_pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
||||
#endif
|
||||
if (before)
|
||||
{
|
||||
strncpy(buf, (char *)beforebuf, size);
|
||||
buf[size - 1] = '\0';
|
||||
strncpyzt(buf, (char *)beforebuf, size);
|
||||
return (strlen(buf));
|
||||
}
|
||||
#ifndef _WIN32
|
||||
@@ -105,16 +139,36 @@ int ssl_pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
||||
#endif
|
||||
if (pass)
|
||||
{
|
||||
strncpy(buf, (char *)pass, size);
|
||||
strncpy(beforebuf, (char *)pass, sizeof(beforebuf));
|
||||
beforebuf[sizeof(beforebuf) - 1] = '\0';
|
||||
buf[size - 1] = '\0';
|
||||
strncpyzt(buf, (char *)pass, size);
|
||||
strncpyzt(beforebuf, (char *)pass, sizeof(beforebuf));
|
||||
before = 1;
|
||||
return (strlen(buf));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||
{
|
||||
int verify_err = 0;
|
||||
|
||||
verify_err = X509_STORE_CTX_get_error(ctx);
|
||||
ircd_log(LOG_ERROR, "%i", verify_err);
|
||||
if (preverify_ok)
|
||||
return 1;
|
||||
if (iConf.ssl_options & SSLFLAG_VERIFYCERT)
|
||||
{
|
||||
if (verify_err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT)
|
||||
if (!(iConf.ssl_options & SSLFLAG_DONOTACCEPTSELFSIGNED))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return preverify_ok;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void init_ctx_server(void)
|
||||
{
|
||||
ctx_server = SSL_CTX_new(SSLv23_server_method());
|
||||
@@ -125,6 +179,9 @@ void init_ctx_server(void)
|
||||
}
|
||||
SSL_CTX_set_default_passwd_cb(ctx_server, ssl_pem_passwd_cb);
|
||||
SSL_CTX_set_options(ctx_server, SSL_OP_NO_SSLv2);
|
||||
SSL_CTX_set_verify(ctx_server, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE
|
||||
| (iConf.ssl_options & SSLFLAG_FAILIFNOCERT ? SSL_VERIFY_FAIL_IF_NO_PEER_CERT : 0), ssl_verify_callback);
|
||||
|
||||
if (SSL_CTX_use_certificate_file(ctx_server, SSL_SERVER_CERT_PEM, SSL_FILETYPE_PEM) <= 0)
|
||||
{
|
||||
ircd_log(LOG_ERROR, "Failed to load SSL certificate %s", SSL_SERVER_CERT_PEM);
|
||||
@@ -141,8 +198,17 @@ void init_ctx_server(void)
|
||||
ircd_log(LOG_ERROR, "Failed to check SSL private key");
|
||||
exit(5);
|
||||
}
|
||||
if (iConf.trusted_ca_file)
|
||||
{
|
||||
if (!SSL_CTX_load_verify_locations(ctx_server, iConf.trusted_ca_file, NULL))
|
||||
{
|
||||
ircd_log(LOG_ERROR, "Failed to load Trusted CA's from %s", iConf.trusted_ca_file);
|
||||
exit(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_ctx_client(void)
|
||||
{
|
||||
ctx_client = SSL_CTX_new(SSLv3_client_method());
|
||||
@@ -199,8 +265,9 @@ void init_ssl(void)
|
||||
|
||||
int ssl_handshake(aClient *cptr)
|
||||
{
|
||||
#ifdef NO_CERTCHECKING
|
||||
char *str;
|
||||
int err;
|
||||
#endif
|
||||
|
||||
cptr->ssl = SSL_new(ctx_server);
|
||||
CHK_NULL(cptr->ssl);
|
||||
@@ -220,44 +287,6 @@ int ssl_handshake(aClient *cptr)
|
||||
cptr->ssl = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Get client's certificate (note: beware of dynamic
|
||||
* allocation) - opt */
|
||||
/* We do not do this -Stskeeps */
|
||||
|
||||
#ifdef NO_CERTCHECKING
|
||||
cptr->client_cert =
|
||||
(struct X509 *)SSL_get_peer_certificate((SSL *) cptr->ssl);
|
||||
|
||||
if (cptr->client_cert != NULL)
|
||||
{
|
||||
// log (L_DEBUG,"Client certificate:\n");
|
||||
|
||||
str =
|
||||
X509_NAME_oneline(X509_get_subject_name((X509 *) cptr->
|
||||
client_cert), 0, 0);
|
||||
CHK_NULL(str);
|
||||
// log (L_DEBUG, "\t subject: %s\n", str);
|
||||
free(str);
|
||||
|
||||
str =
|
||||
X509_NAME_oneline(X509_get_issuer_name((X509 *) cptr->
|
||||
client_cert), 0, 0);
|
||||
CHK_NULL(str);
|
||||
// log (L_DEBUG, "\t issuer: %s\n", str);
|
||||
free(str);
|
||||
|
||||
/* We could do all sorts of certificate
|
||||
* verification stuff here before
|
||||
* deallocating the certificate. */
|
||||
|
||||
X509_free((X509 *) cptr->client_cert);
|
||||
}
|
||||
else
|
||||
{
|
||||
// log (L_DEBUG, "Client does not have certificate.\n");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -401,16 +430,16 @@ int ircd_SSL_write(aClient *acptr, const void *buf, int sz)
|
||||
if(ERRNO == EAGAIN)
|
||||
return -1;
|
||||
default:
|
||||
Debug((DEBUG_ERROR, "ircd_SSL_write: returning fatal_ssl_error for %s", acptr->name));
|
||||
return fatal_ssl_error(ssl_err, SAFE_SSL_WRITE, acptr);
|
||||
}
|
||||
}
|
||||
Debug((DEBUG_ERROR, "ircd_SSL_write for %s (%p, %i): success", acptr->name, buf, sz));
|
||||
return len;
|
||||
}
|
||||
|
||||
int ircd_SSL_client_handshake(aClient *acptr)
|
||||
{
|
||||
int ssl_err;
|
||||
|
||||
acptr->ssl = SSL_new(ctx_client);
|
||||
if (!acptr->ssl)
|
||||
{
|
||||
@@ -438,9 +467,11 @@ int ircd_SSL_client_handshake(aClient *acptr)
|
||||
case -1:
|
||||
return -1;
|
||||
case 0:
|
||||
Debug((DEBUG_DEBUG, "SetSSLConnectHandshake(%s)", get_client_name(acptr, TRUE)));
|
||||
SetSSLConnectHandshake(acptr);
|
||||
return 0;
|
||||
case 1:
|
||||
Debug((DEBUG_DEBUG, "SSL_init_finished should finish this job (%s)", get_client_name(acptr, TRUE)));
|
||||
/* SSL_init_finished in s_bsd will finish the job */
|
||||
return 1;
|
||||
default:
|
||||
@@ -460,6 +491,7 @@ int ircd_SSL_accept(aClient *acptr, int fd) {
|
||||
|| ERRNO == P_EAGAIN)
|
||||
case SSL_ERROR_WANT_READ:
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
Debug((DEBUG_DEBUG, "ircd_SSL_accept(%s), - %s", get_client_name(acptr, TRUE), ssl_error_str(ssl_err)));
|
||||
/* handshake will be completed later . . */
|
||||
return 1;
|
||||
default:
|
||||
@@ -482,8 +514,11 @@ int ircd_SSL_connect(aClient *acptr) {
|
||||
|| ERRNO == P_EAGAIN)
|
||||
case SSL_ERROR_WANT_READ:
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
{
|
||||
Debug((DEBUG_DEBUG, "ircd_SSL_connect(%s), - %s", get_client_name(acptr, TRUE), ssl_error_str(ssl_err)));
|
||||
/* handshake will be completed later . . */
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return fatal_ssl_error(ssl_err, SAFE_SSL_CONNECT, acptr);
|
||||
|
||||
@@ -510,7 +545,6 @@ static int fatal_ssl_error(int ssl_error, int where, aClient *sptr)
|
||||
{
|
||||
/* don`t alter ERRNO */
|
||||
int errtmp = ERRNO;
|
||||
char *errstr = (char *)strerror(errtmp);
|
||||
char *ssl_errstr, *ssl_func;
|
||||
|
||||
switch(where) {
|
||||
|
||||
@@ -1671,3 +1671,12 @@ int b64_decode(char const *src, unsigned char *target, size_t targsize)
|
||||
|
||||
return (tarindex);
|
||||
}
|
||||
|
||||
void *MyMallocEx(size_t size)
|
||||
{
|
||||
void *p = MyMalloc(size);
|
||||
|
||||
bzero(p, size);
|
||||
return (p);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -107,8 +107,8 @@ char *unrealcredits[] =
|
||||
"value your donations. ",
|
||||
"",
|
||||
"Stskeeps would primarily like to thank Julie for her",
|
||||
"support through the years. See the page for a more extensive",
|
||||
"list of all the coders' credits.",
|
||||
"support through the years. See the page for a more extensive",
|
||||
"list of all the coders' credits. ",
|
||||
"",
|
||||
"This IRCd is dedicated to those who have kept us rocking and",
|
||||
"in good mood all through the years we've struggled with this"
|
||||
|
||||
+59
-50
@@ -73,18 +73,18 @@ LRESULT CALLBACK HelpDLG(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK StatusDLG(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK ConfigErrorDLG(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK ColorDLG(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK FromVarDLG(HWND, UINT, WPARAM, LPARAM, char *, char **);
|
||||
LRESULT CALLBACK FromVarDLG(HWND, UINT, WPARAM, LPARAM, unsigned char *, unsigned char **);
|
||||
LRESULT CALLBACK FromFileReadDLG(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK FromFileDLG(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
typedef struct {
|
||||
int *size;
|
||||
char **buffer;
|
||||
unsigned char **buffer;
|
||||
} StreamIO;
|
||||
|
||||
extern void SocketLoop(void *dummy);
|
||||
int CountRTFSize(char *);
|
||||
void IRCToRTF(char *, char *);
|
||||
int CountRTFSize(unsigned char *);
|
||||
void IRCToRTF(unsigned char *, unsigned char *);
|
||||
HINSTANCE hInst;
|
||||
NOTIFYICONDATA SysTray;
|
||||
void CleanUp(void);
|
||||
@@ -92,7 +92,7 @@ HTREEITEM AddItemToTree(HWND, LPSTR, int, short);
|
||||
void win_map(aClient *, HWND, short);
|
||||
extern Link *Servers;
|
||||
extern ircstats IRCstats;
|
||||
char *errors = NULL, *RTFBuf = NULL;
|
||||
unsigned char *errors = NULL, *RTFBuf = NULL;
|
||||
extern aMotd *botmotd, *opermotd, *motd, *rules;
|
||||
extern VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv);
|
||||
extern BOOL IsService;
|
||||
@@ -143,7 +143,7 @@ LRESULT RESubClassFunc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) {
|
||||
POINT p;
|
||||
RECT r;
|
||||
DWORD start, end;
|
||||
char string[500];
|
||||
unsigned char string[500];
|
||||
|
||||
if (Message == WM_GETDLGCODE)
|
||||
return DLGC_WANTALLKEYS;
|
||||
@@ -191,11 +191,11 @@ LRESULT RESubClassFunc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) {
|
||||
*/
|
||||
typedef struct colorlist {
|
||||
struct colorlist *prev,*next;
|
||||
char *color;
|
||||
unsigned char *color;
|
||||
} ColorList;
|
||||
|
||||
ColorList *TextColors = NULL;
|
||||
void AddColor(char *color) {
|
||||
void AddColor(unsigned char *color) {
|
||||
ColorList *clist;
|
||||
|
||||
clist = MyMallocEx(sizeof(ColorList));
|
||||
@@ -248,7 +248,7 @@ DWORD CALLBACK SplitIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) {
|
||||
}
|
||||
|
||||
DWORD CALLBACK BufferIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) {
|
||||
char *buf2;
|
||||
unsigned char *buf2;
|
||||
static long size = 0;
|
||||
if (!RTFBuf)
|
||||
size = 0;
|
||||
@@ -270,12 +270,12 @@ DWORD CALLBACK BufferIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD CALLBACK RTFToIRC(int fd, char *pbBuff, long cb) {
|
||||
char *buffer = (char *)malloc(cb);
|
||||
DWORD CALLBACK RTFToIRC(int fd, unsigned char *pbBuff, long cb) {
|
||||
unsigned char *buffer = malloc(cb);
|
||||
int i = 0, j = 0, k = 0, start = 0, end = 0;
|
||||
int incolor = 0, bold = 0, uline = 0;
|
||||
char cmd[15], value[500], color[25], colorbuf[4];
|
||||
char colors[16];
|
||||
unsigned char cmd[15], value[500], color[25], colorbuf[4];
|
||||
unsigned char colors[16];
|
||||
pbBuff++;
|
||||
TextColors = NULL;
|
||||
bzero(buffer, cb);
|
||||
@@ -301,7 +301,16 @@ DWORD CALLBACK RTFToIRC(int fd, char *pbBuff, long cb) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*pbBuff == '\'') {
|
||||
unsigned char ltr, ultr[3];
|
||||
ultr[0] = *++pbBuff;
|
||||
ultr[1] = *++pbBuff;
|
||||
ultr[2] = 0;
|
||||
ltr = strtoul(ultr,NULL,16);
|
||||
buffer[i] = ltr;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
value[0] = cmd[0] = 0;
|
||||
for (j = k = start = end = 0;
|
||||
*pbBuff && *pbBuff != '\\' && *pbBuff != '\r' && *pbBuff != '\n';
|
||||
@@ -432,7 +441,7 @@ DWORD CALLBACK RTFToIRC(int fd, char *pbBuff, long cb) {
|
||||
DelNewestColor();
|
||||
}
|
||||
else if (!strncmp(cmd, "cf", 2)) {
|
||||
char number[3];
|
||||
unsigned char number[3];
|
||||
int num = 0;
|
||||
incolor = 1;
|
||||
strcpy(number, &cmd[2]);
|
||||
@@ -460,7 +469,7 @@ DWORD CALLBACK RTFToIRC(int fd, char *pbBuff, long cb) {
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
MSG msg;
|
||||
char *s;
|
||||
unsigned char *s;
|
||||
HWND hWnd;
|
||||
WSADATA WSAData;
|
||||
HICON hIcon;
|
||||
@@ -559,9 +568,9 @@ LRESULT CALLBACK MainDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
static HCURSOR hCursor;
|
||||
static HMENU hRehash, hAbout, hConfig, hTray, hLogs;
|
||||
|
||||
char *argv[3];
|
||||
unsigned char *argv[3];
|
||||
aClient *paClient;
|
||||
char *msg;
|
||||
unsigned char *msg;
|
||||
POINT p;
|
||||
|
||||
if (message == WM_TASKBARCREATED){
|
||||
@@ -761,7 +770,7 @@ static HMENU hRehash, hAbout, hConfig, hTray, hLogs;
|
||||
}
|
||||
case WM_COMMAND: {
|
||||
if (LOWORD(wParam) >= 60000 && HIWORD(wParam) == 0 && !lParam) {
|
||||
char path[MAX_PATH];
|
||||
unsigned char path[MAX_PATH];
|
||||
if (GetMenuString(hLogs, LOWORD(wParam), path, MAX_PATH, MF_BYCOMMAND))
|
||||
DialogBoxParam(hInst, "FromVar", hDlg,
|
||||
(DLGPROC)FromFileReadDLG, (LPARAM)path);
|
||||
@@ -896,14 +905,14 @@ LRESULT CALLBACK DalDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
return FromVarDLG(hDlg, message, wParam, lParam, "UnrealIRCd DALnet Credits", dalinfotext);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK FromVarDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam, char
|
||||
*title, char **s) {
|
||||
LRESULT CALLBACK FromVarDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam,
|
||||
unsigned char *title, unsigned char **s) {
|
||||
HWND hWnd;
|
||||
switch (message) {
|
||||
case WM_INITDIALOG: {
|
||||
char String[16384];
|
||||
unsigned char String[16384];
|
||||
int size;
|
||||
char *RTFString;
|
||||
unsigned char *RTFString;
|
||||
StreamIO *stream = malloc(sizeof(StreamIO));
|
||||
EDITSTREAM edit;
|
||||
SetWindowText(hDlg, title);
|
||||
@@ -978,24 +987,24 @@ LRESULT CALLBACK FromFileReadDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM
|
||||
switch (message) {
|
||||
case WM_INITDIALOG: {
|
||||
int fd,len;
|
||||
char *buffer = '\0', *string = '\0';
|
||||
unsigned char *buffer = '\0', *string = '\0';
|
||||
EDITSTREAM edit;
|
||||
StreamIO *stream = malloc(sizeof(StreamIO));
|
||||
char szText[256];
|
||||
unsigned char szText[256];
|
||||
struct stat sb;
|
||||
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT), hTip;
|
||||
wsprintf(szText, "UnrealIRCd Viewer - %s", (char *)lParam);
|
||||
wsprintf(szText, "UnrealIRCd Viewer - %s", (unsigned char *)lParam);
|
||||
SetWindowText(hDlg, szText);
|
||||
lpfnOldWndProc = (FARPROC)SetWindowLong(hWnd, GWL_WNDPROC, (DWORD)RESubClassFunc);
|
||||
if ((fd = open((char *)lParam, _O_RDONLY|_O_BINARY)) != -1) {
|
||||
if ((fd = open((unsigned char *)lParam, _O_RDONLY|_O_BINARY)) != -1) {
|
||||
fstat(fd,&sb);
|
||||
/* Only allocate the amount we need */
|
||||
buffer = (char *)malloc(sb.st_size+1);
|
||||
buffer = malloc(sb.st_size+1);
|
||||
buffer[0] = 0;
|
||||
len = read(fd, buffer, sb.st_size);
|
||||
buffer[len] = 0;
|
||||
len = CountRTFSize(buffer)+1;
|
||||
string = (char *)malloc(len);
|
||||
string = malloc(len);
|
||||
bzero(string,len);
|
||||
IRCToRTF(buffer,string);
|
||||
RTFBuf = string;
|
||||
@@ -1071,7 +1080,7 @@ LRESULT CALLBACK HelpDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case WM_DRAWITEM: {
|
||||
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
|
||||
char text[500];
|
||||
unsigned char text[500];
|
||||
COLORREF oldtext;
|
||||
RECT focus;
|
||||
GetWindowText(lpdis->hwndItem, text, 500);
|
||||
@@ -1191,19 +1200,19 @@ LRESULT CALLBACK GotoDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
HWND hWnd;
|
||||
static FINDREPLACE find;
|
||||
static char *file;
|
||||
static unsigned char *file;
|
||||
static HWND hTool, hClip, hStatus;
|
||||
CHARFORMAT2 chars;
|
||||
switch (message) {
|
||||
case WM_INITDIALOG: {
|
||||
int fd,len;
|
||||
char *buffer = '\0', *string = '\0';
|
||||
unsigned char *buffer = '\0', *string = '\0';
|
||||
EDITSTREAM edit;
|
||||
StreamIO *stream = malloc(sizeof(StreamIO));
|
||||
char szText[256];
|
||||
unsigned char szText[256];
|
||||
struct stat sb;
|
||||
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT), hTip;
|
||||
file = (char *)lParam;
|
||||
file = (unsigned char *)lParam;
|
||||
if (file)
|
||||
wsprintf(szText, "UnrealIRCd Editor - %s", file);
|
||||
else
|
||||
@@ -1220,12 +1229,12 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
if ((fd = open(file, _O_RDONLY|_O_BINARY)) != -1) {
|
||||
fstat(fd,&sb);
|
||||
/* Only allocate the amount we need */
|
||||
buffer = (char *)malloc(sb.st_size+1);
|
||||
buffer = malloc(sb.st_size+1);
|
||||
buffer[0] = 0;
|
||||
len = read(fd, buffer, sb.st_size);
|
||||
buffer[len] = 0;
|
||||
len = CountRTFSize(buffer)+1;
|
||||
string = (char *)malloc(len);
|
||||
string = malloc(len);
|
||||
bzero(string,len);
|
||||
IRCToRTF(buffer,string);
|
||||
RTFBuf = string;
|
||||
@@ -1260,7 +1269,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT);
|
||||
DWORD start, end, currline;
|
||||
static DWORD prevline = 0;
|
||||
char buffer[512];
|
||||
unsigned char buffer[512];
|
||||
chars.cbSize = sizeof(CHARFORMAT2);
|
||||
SendMessage(hWnd, EM_GETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
|
||||
if (chars.dwMask & CFM_BOLD && chars.dwEffects & CFE_BOLD)
|
||||
@@ -1418,7 +1427,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
EDITSTREAM edit;
|
||||
OPENFILENAME lpopen;
|
||||
if (!file) {
|
||||
char path[MAX_PATH];
|
||||
unsigned char path[MAX_PATH];
|
||||
path[0] = '\0';
|
||||
bzero(&lpopen, sizeof(OPENFILENAME));
|
||||
lpopen.lStructSize = sizeof(OPENFILENAME);
|
||||
@@ -1450,7 +1459,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
return 0;
|
||||
}
|
||||
if (LOWORD(wParam) == IDM_NEW) {
|
||||
char text[1024];
|
||||
unsigned char text[1024];
|
||||
BOOL newfile = FALSE;
|
||||
int ans;
|
||||
if (SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_GETMODIFY, 0, 0) != 0) {
|
||||
@@ -1468,7 +1477,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
else
|
||||
newfile = TRUE;
|
||||
if (newfile == TRUE) {
|
||||
char szText[256];
|
||||
unsigned char szText[256];
|
||||
file = NULL;
|
||||
strcpy(szText, "UnrealIRCd Editor - New File");
|
||||
SetWindowText(hDlg, szText);
|
||||
@@ -1503,7 +1512,7 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
SendMessage(hClip, WM_DRAWCLIPBOARD, wParam, lParam);
|
||||
break;
|
||||
case WM_CLOSE: {
|
||||
char text[256];
|
||||
unsigned char text[256];
|
||||
int ans;
|
||||
if (SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_GETMODIFY, 0, 0) != 0) {
|
||||
sprintf(text, "The text in the %s file has changed.\r\n\r\nDo you want to save the changes?", file ? file : "new");
|
||||
@@ -1728,10 +1737,10 @@ LRESULT CALLBACK ColorDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
|
||||
/* find how big a buffer expansion we need for RTF transformation */
|
||||
int CountRTFSize(char *buffer) {
|
||||
int CountRTFSize(unsigned char *buffer) {
|
||||
int size = 0;
|
||||
short bold = 0, uline = 0, reverse = 0;
|
||||
char *buf = buffer;
|
||||
unsigned char *buf = buffer;
|
||||
|
||||
for (; *buf; buf++, size++) {
|
||||
if (*buf == '{' || *buf == '}' || *buf == '\\') {
|
||||
@@ -1751,7 +1760,7 @@ int CountRTFSize(char *buffer) {
|
||||
bold = ~bold;
|
||||
}
|
||||
if (*buf == '\3') {
|
||||
char color[3];
|
||||
unsigned char color[3];
|
||||
int number;
|
||||
size += 3;
|
||||
if (!isdigit(*(buf+1)))
|
||||
@@ -1790,8 +1799,8 @@ int CountRTFSize(char *buffer) {
|
||||
return (size+494);
|
||||
}
|
||||
|
||||
void IRCToRTF(char *buffer, char *string) {
|
||||
char *tmp = buffer;
|
||||
void IRCToRTF(unsigned char *buffer, unsigned char *string) {
|
||||
unsigned char *tmp = buffer;
|
||||
int i = 0;
|
||||
short bold = 0, uline = 0;
|
||||
sprintf(string, "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fmodern\\fprq1\\"
|
||||
@@ -1836,7 +1845,7 @@ void IRCToRTF(char *buffer, char *string) {
|
||||
continue;
|
||||
}
|
||||
if (*tmp == '\3') {
|
||||
char color[3];
|
||||
unsigned char color[3];
|
||||
int number;
|
||||
strcat(string, "\\cf");
|
||||
i += 3;
|
||||
@@ -1955,10 +1964,10 @@ void win_map(aClient *server, HWND hwTreeView, short remap)
|
||||
}
|
||||
|
||||
/* ugly stuff, but hey it works -- codemastr */
|
||||
void win_log(char *format, ...) {
|
||||
void win_log(unsigned char *format, ...) {
|
||||
va_list ap;
|
||||
char buf[2048];
|
||||
char *buf2;
|
||||
unsigned char buf[2048];
|
||||
unsigned char *buf2;
|
||||
va_start(ap, format);
|
||||
ircvsprintf(buf, format, ap);
|
||||
if (!IsService) {
|
||||
|
||||
+2
-5
@@ -198,6 +198,7 @@ LONG __stdcall ExceptionFilter(EXCEPTION_POINTERS *e) {
|
||||
sprintf(text, "UnrealIRCd has encountered a fatal error. Debugging information has"
|
||||
" been dumped to wircd.%d.core, please email this file to coders@lists.unrealircd.org.",
|
||||
getpid());
|
||||
fclose(fd);
|
||||
if (!IsService)
|
||||
MessageBox(NULL, text, "Fatal Error", MB_OK);
|
||||
else {
|
||||
@@ -207,7 +208,6 @@ LONG __stdcall ExceptionFilter(EXCEPTION_POINTERS *e) {
|
||||
fclose(fd);
|
||||
}
|
||||
CleanUp();
|
||||
fclose(fd);
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,4 @@ void InitDebug(void) {
|
||||
SetUnhandledExceptionFilter(&ExceptionFilter);
|
||||
}
|
||||
|
||||
void Crash() {
|
||||
int o = 0;
|
||||
o = 1/o;
|
||||
}
|
||||
|
||||
|
||||
+8
-5
@@ -21,7 +21,8 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
static OSVERSIONINFO VerInfo;
|
||||
|
||||
HMODULE hAdvapi;
|
||||
BOOL (*uChangeServiceConfig2)();
|
||||
#define IRCD_SERVICE_CONTROL_REHASH 128
|
||||
void show_usage() {
|
||||
fprintf(stderr, "unreal start|stop|rehash|restart|install|uninstall|config <option> <value>");
|
||||
@@ -44,7 +45,9 @@ int main(int argc, char *argv[]) {
|
||||
if (argc < 2) {
|
||||
show_usage();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
hAdvapi = LoadLibrary("advapi32.dll");
|
||||
(FARPROC)uChangeServiceConfig2 = GetProcAddress(hAdvapi, "ChangeServiceConfig2A");
|
||||
if (!stricmp(argv[1], "install")) {
|
||||
SC_HANDLE hService, hSCManager;
|
||||
char path[MAX_PATH+1];
|
||||
@@ -71,7 +74,7 @@ int main(int argc, char *argv[]) {
|
||||
if (VerInfo.dwMajorVersion == 5) {
|
||||
SERVICE_DESCRIPTION info;
|
||||
info.lpDescription = "Internet Relay Chat Server. Allows users to chat with eachother via an IRC client.";
|
||||
ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &info);
|
||||
uChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &info);
|
||||
}
|
||||
CloseServiceHandle(hService);
|
||||
CloseServiceHandle(hSCManager);
|
||||
@@ -155,7 +158,7 @@ int main(int argc, char *argv[]) {
|
||||
hAction.Type = SC_ACTION_RESTART;
|
||||
hAction.Delay = atoi(argv[3])*60000;
|
||||
hFailActions.lpsaActions = &hAction;
|
||||
if (ChangeServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS,
|
||||
if (uChangeServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS,
|
||||
&hFailActions))
|
||||
printf("UnrealIRCd NT Service configuration changed");
|
||||
else
|
||||
@@ -166,7 +169,7 @@ int main(int argc, char *argv[]) {
|
||||
hFailActions.cActions = 0;
|
||||
hAction.Type = SC_ACTION_NONE;
|
||||
hFailActions.lpsaActions = &hAction;
|
||||
if (ChangeServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS,
|
||||
if (uChangeServiceConfig2(hService, SERVICE_CONFIG_FAILURE_ACTIONS,
|
||||
&hFailActions))
|
||||
printf("UnrealIRCd NT Service configuration changed");
|
||||
else
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
; UnrealIRCd Win32 Installation Script for My Inno Setup Extensions
|
||||
; Requires ISX 3.0.4 to work
|
||||
|
||||
; #define USE_SSL
|
||||
; Uncomment the above line to package an SSL build
|
||||
|
||||
|
||||
[Setup]
|
||||
AppName=UnrealIRCd
|
||||
AppVerName=UnrealIRCd3.2-beta12
|
||||
AppVerName=UnrealIRCd3.2-beta13
|
||||
AppPublisher=UnrealIRCd Team
|
||||
AppPublisherURL=http://www.unrealircd.com
|
||||
AppSupportURL=http://www.unrealircd.com
|
||||
AppUpdatesURL=http://www.unrealircd.com
|
||||
AppMutex=UnrealMutex
|
||||
AppMutex=UnrealMutex,Global\UnrealMutex
|
||||
DefaultDirName={pf}\Unreal3.2
|
||||
DefaultGroupName=UnrealIRCd
|
||||
AllowNoIcons=yes
|
||||
#ifndef USE_SSL
|
||||
LicenseFile=.\gpl.rtf
|
||||
#else
|
||||
LicenseFile=.\gplplusssl.rtf
|
||||
#endif
|
||||
Compression=bzip/9
|
||||
MinVersion=4.0.1111,4.0.1381
|
||||
OutputDir=../../
|
||||
@@ -19,7 +28,14 @@ OutputDir=../../
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
|
||||
Name: "quicklaunchicon"; Description: "Create a &Quick Launch icon"; GroupDescription: "Additional icons:"; Flags: unchecked
|
||||
Name: "installservice"; Description: "Install &Service"; GroupDescription: "Service support:"; MinVersion: 0,4.0
|
||||
Name: "installservice"; Description: "Install as a &service"; GroupDescription: "Service support:"; MinVersion: 0,4.0
|
||||
Name: "installservice/startboot"; Description: "S&tart UnrealIRCd when Windows starts"; GroupDescription: "Service support:"; MinVersion: 0,4.0; Flags: exclusive
|
||||
Name: "installservice/startdemand"; Description: "Start UnrealIRCd on &request"; GroupDescription: "Service support:"; MinVersion: 0,4.0; Flags: exclusive
|
||||
Name: "installservice/crashrestart"; Description: "Restart UnrealIRCd if it &crashes"; GroupDescription: "Service support:"; MinVersion: 0,5.0;
|
||||
#ifdef USE_SSL
|
||||
Name: "makecert"; Description: "&Create certificate"; GroupDescription: "SSL options:";
|
||||
Name: "enccert"; Description: "&Encrypt certificate"; GroupDescription: "SSL options:";
|
||||
#endif
|
||||
|
||||
[Files]
|
||||
Source: "..\..\wircd.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
@@ -30,9 +46,9 @@ Source: "..\..\.RELEASE.NOTES"; DestDir: "{app}"; DestName: "RELEASE.NOTES.txt";
|
||||
Source: "..\..\.SICI"; DestDir: "{app}"; DestName: "SICI.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\badwords.channel.conf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\badwords.message.conf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Changes"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Changes.old"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Donation"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Changes"; DestDir: "{app}"; DestName: "Changes.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Changes.old"; DestDir: "{app}"; DestName: "Changes.old.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Donation"; DestDir: "{app}"; DestName: "Donation.txt"; CopyMode: alwaysoverwrite
|
||||
Source: ".\gnu_regex.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\help.conf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\LICENSE"; DestDir: "{app}"; DestName: "LICENSE.txt"; CopyMode: alwaysoverwrite
|
||||
@@ -41,6 +57,14 @@ Source: "..\..\doc\*.*"; DestDir: "{app}\doc"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\aliases\*"; DestDir: "{app}\aliases"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\networks\*"; DestDir: "{app}\networks"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\unreal.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite; MinVersion: 0,4.0
|
||||
#ifdef USE_SSL
|
||||
Source: "c:\openssl\bin\openssl.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "c:\openssl\bin\ssleay32.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "c:\openssl\bin\libeay32.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: ".\makecert.bat"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: ".\encpem.bat"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\ssl.cnf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
#endif
|
||||
Source: isxdl.dll; DestDir: {tmp}; CopyMode: dontcopy
|
||||
|
||||
[UninstallDelete]
|
||||
@@ -52,7 +76,6 @@ external 'isxdl_Download@files:isxdl.dll stdcall';
|
||||
function isxdl_SetOption(Option, Value: PChar): Integer;
|
||||
external 'isxdl_SetOption@files:isxdl.dll stdcall';
|
||||
const url = 'http://www.unrealircd.com/downloads/DbgHelp.Dll';
|
||||
|
||||
function NextButtonClick(CurPage: Integer): Boolean;
|
||||
var
|
||||
dbghelp,tmp,output: String;
|
||||
@@ -79,6 +102,7 @@ begin
|
||||
end;
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
procedure DeInitializeSetup();
|
||||
var
|
||||
input,output: String;
|
||||
@@ -91,6 +115,10 @@ end;
|
||||
[Icons]
|
||||
Name: "{group}\UnrealIRCd"; Filename: "{app}\wircd.exe"; WorkingDir: "{app}"
|
||||
Name: "{group}\Uninstall UnrealIRCd"; Filename: "{uninstallexe}"; WorkingDir: "{app}"
|
||||
#ifdef USE_SSL
|
||||
Name: "{group}\Make Certificate"; Filename: "{app}\makecert.bat"; WorkingDir: "{app}"
|
||||
Name: "{group}\Encrypt Certificate"; Filename: "{app}\encpem.bat"; WorkingDir: "{app}"
|
||||
#endif
|
||||
Name: "{group}\Documentation"; Filename: "{app}\doc\unreal32docs.html"; WorkingDir: "{app}"
|
||||
Name: "{userdesktop}\UnrealIRCd"; Filename: "{app}\wircd.exe"; WorkingDir: "{app}"; Tasks: desktopicon
|
||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\UnrealIRCd"; Filename: "{app}\wircd.exe"; WorkingDir: "{app}"; Tasks: quicklaunchicon
|
||||
@@ -99,8 +127,15 @@ Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\UnrealIRCd"; Filen
|
||||
Filename: "notepad"; Description: "View example.conf"; Parameters: "{app}\doc\example.conf"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "{app}\doc\unreal32docs.html"; Description: "View UnrealIRCd documentation"; Parameters: ""; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "notepad"; Description: "View Release Notes"; Parameters: "{app}\RELEASE.NOTES.txt"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "notepad"; Description: "View Changes"; Parameters: "{app}\Changes"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "notepad"; Description: "View Changes"; Parameters: "{app}\Changes.txt"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "{app}\unreal.exe"; Parameters: "install"; Flags: runminimized nowait; Tasks: installservice
|
||||
Filename: "{app}\unreal.exe"; Parameters: "config startup manual"; Flags: runminimized nowait; Tasks: installservice/startdemand
|
||||
Filename: "{app}\unreal.exe"; Parameters: "config startup auto"; Flags: runminimized nowait; Tasks: installservice/startboot
|
||||
Filename: "{app}\unreal.exe"; Parameters: "config crashrestart 2"; Flags: runminimized nowait; Tasks: installservice/crashrestart
|
||||
#ifdef USE_SSL
|
||||
Filename: "{app}\makecert.bat"; Tasks: makecert
|
||||
Filename: "{app}\encpem.bat"; WorkingDir: "{app}"; Tasks: enccert
|
||||
#endif
|
||||
|
||||
[UninstallRun]
|
||||
Filename: "{app}\unreal.exe"; Parameters: "uninstall"; Flags: runminimized; RunOnceID: "DelService"; Tasks: installservice
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
; UnrealIRCd Win32 Installation Script for My Inno Setup Extensions
|
||||
|
||||
[Setup]
|
||||
AppName=UnrealIRCd
|
||||
AppVerName=UnrealIRCd3.2-beta12
|
||||
AppPublisher=UnrealIRCd Team
|
||||
AppPublisherURL=http://www.unrealircd.com
|
||||
AppSupportURL=http://www.unrealircd.com
|
||||
AppUpdatesURL=http://www.unrealircd.com
|
||||
AppMutex=UnrealMutex
|
||||
DefaultDirName={pf}\Unreal3.2
|
||||
DefaultGroupName=UnrealIRCd
|
||||
AllowNoIcons=yes
|
||||
LicenseFile=.\gplplusssl.rtf
|
||||
Compression=bzip/9
|
||||
MinVersion=4.0.1111,4.0.1381
|
||||
OutputDir=../../
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
|
||||
Name: "quicklaunchicon"; Description: "Create a &Quick Launch icon"; GroupDescription: "Additional icons:"; Flags: unchecked
|
||||
Name: "installservice"; Description: "Install &Service"; GroupDescription: "Service support:"; MinVersion: 0,4.0
|
||||
Name: "makecert"; Description: "Create &Certificate"; GroupDescription: "SSL options:";
|
||||
|
||||
[Files]
|
||||
Source: "..\..\wircd.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\WIRCD.pdb"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\.CHANGES.NEW"; DestDir: "{app}"; DestName: "CHANGES.NEW.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\.CONFIG.RANT"; DestDir: "{app}"; DestName: "CONFIG.RANT.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\.RELEASE.NOTES"; DestDir: "{app}"; DestName: "RELEASE.NOTES.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\.SICI"; DestDir: "{app}"; DestName: "SICI.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\badwords.channel.conf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\badwords.message.conf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Changes"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Changes.old"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Donation"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: ".\gnu_regex.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\help.conf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\LICENSE"; DestDir: "{app}"; DestName: "LICENSE.txt"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\Unreal.nfo"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\doc\*.*"; DestDir: "{app}\doc"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\aliases\*"; DestDir: "{app}\aliases"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\networks\*"; DestDir: "{app}\networks"; CopyMode: alwaysoverwrite
|
||||
Source: "..\..\unreal.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite; MinVersion: 0,4.0
|
||||
Source: "c:\openssl\bin\openssl.exe"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "c:\openssl\bin\ssleay32.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "c:\openssl\bin\libeay32.dll"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: ".\makecert.bat"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: ".\encpem.bat"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: "..\ssl.cnf"; DestDir: "{app}"; CopyMode: alwaysoverwrite
|
||||
Source: isxdl.dll; DestDir: {tmp}; CopyMode: dontcopy
|
||||
|
||||
[UninstallDelete]
|
||||
Type: files; Name: "{app}\DbgHelp.Dll"
|
||||
|
||||
[Code]
|
||||
function isxdl_Download(hWnd: Integer; URL, Filename: PChar): Integer;
|
||||
external 'isxdl_Download@files:isxdl.dll stdcall';
|
||||
function isxdl_SetOption(Option, Value: PChar): Integer;
|
||||
external 'isxdl_SetOption@files:isxdl.dll stdcall';
|
||||
const url = 'http://www.unrealircd.com/downloads/DbgHelp.Dll';
|
||||
|
||||
function NextButtonClick(CurPage: Integer): Boolean;
|
||||
var
|
||||
dbghelp,tmp,output: String;
|
||||
m: String;
|
||||
hWnd,answer: Integer;
|
||||
begin
|
||||
dbghelp := ExpandConstant('{sys}\DbgHelp.Dll');
|
||||
output := ExpandConstant('{app}\DbgHelp.Dll');
|
||||
GetVersionNumbersString(dbghelp,m);
|
||||
if ((CurPage = wpReady) AND NOT FileExists(output)) then begin
|
||||
if (NOT FileExists(dbghelp)) then
|
||||
m := StringOfChar('0',1);
|
||||
if (StrToInt(m[1]) < 5) then begin
|
||||
answer := MsgBox('DbgHelp.dll version 5.0 or higher is required to install Unreal, do you wish to install it now?', mbConfirmation, MB_YESNO);
|
||||
if answer = IDYES then begin
|
||||
tmp := ExpandConstant('{tmp}\dbghelp.dll');
|
||||
isxdl_SetOption('title', 'Downloading DbgHelp.dll');
|
||||
hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
|
||||
if isxdl_Download(hWnd, url, tmp) = 0 then
|
||||
MsgBox('Download and installation of DbgHelp.Dll failed, the file must be manually installed. The file can be downloaded at http://www.unrealircd.com/downloads/DbgHelp.Dll', mbInformation, MB_OK);
|
||||
end else
|
||||
MsgBox('In order for Unreal to properly function you must manually install this dll. The dll can be downloaded from http://www.unrealircd.com/downloads/DbgHelp.Dll', mbInformation, MB_OK);
|
||||
end;
|
||||
end;
|
||||
Result := true;
|
||||
end;
|
||||
procedure DeInitializeSetup();
|
||||
var
|
||||
input,output: String;
|
||||
begin
|
||||
input := ExpandConstant('{tmp}\dbghelp.dll');
|
||||
output := ExpandConstant('{app}\dbghelp.dll');
|
||||
FileCopy(input, output, true);
|
||||
end;
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\UnrealIRCd"; Filename: "{app}\wircd.exe"; WorkingDir: "{app}"
|
||||
Name: "{group}\Uninstall UnrealIRCd"; Filename: "{uninstallexe}"; WorkingDir: "{app}"
|
||||
Name: "{group}\Makecert"; Filename: "{app}\makecert.bat"; WorkingDir: "{app}"
|
||||
Name: "{group}\Encpem"; Filename: "{app}\encpem.bat"; WorkingDir: "{app}"
|
||||
Name: "{group}\Documentation"; Filename: "{app}\doc\unreal32docs.html"; WorkingDir: "{app}"
|
||||
Name: "{userdesktop}\UnrealIRCd"; Filename: "{app}\wircd.exe"; WorkingDir: "{app}"; Tasks: desktopicon
|
||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\UnrealIRCd"; Filename: "{app}\wircd.exe"; WorkingDir: "{app}"; Tasks: quicklaunchicon
|
||||
|
||||
[Run]
|
||||
Filename: "notepad"; Description: "View example.conf"; Parameters: "{app}\doc\example.conf"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "{app}\doc\unreal32docs.html"; Description: "View UnrealIRCd documentation"; Parameters: ""; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "notepad"; Description: "View Release Notes"; Parameters: "{app}\RELEASE.NOTES.txt"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "notepad"; Description: "View Changes"; Parameters: "{app}\Changes"; Flags: postinstall skipifsilent shellexec runmaximized
|
||||
Filename: "{app}\unreal.exe"; Parameters: "install"; Flags: runminimized nowait; Tasks: installservice
|
||||
Filename: "{app}\makecert.bat"; Tasks: makecert
|
||||
|
||||
[UninstallRun]
|
||||
Filename: "{app}\unreal.exe"; Parameters: "uninstall"; Flags: runminimized; RunOnceID: "DelService"; Tasks: installservice
|
||||
Reference in New Issue
Block a user