1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 01:23:12 +02:00

Unreal3.2.2

This commit is contained in:
Bram Matthys
2004-10-27 18:45:56 +00:00
parent 7c1de2fbc8
commit 0d6cd21fde
101 changed files with 12746 additions and 7044 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
Configuration Program
for Unreal3.2.1
for Unreal3.2.2
This program will help you to compile your IRC server, and ask you
questions regarding the compile-time settings of it during the process.
+71 -93
View File
@@ -1,113 +1,91 @@
Unreal3.2.1 Release Notes
Unreal3.2.2 Release Notes
==========================
Please READ this document carefully, otherwise your ircd won't boot!
This is a RECOMMENDED RELEASE due to the fact that the previous
cloaking algorithm has been cracked. Besides that, this version
also brings quite some exciting new features (win32 module support,
and a _lot_ more).
==[ GENERAL INFORMATION ]==
- If you are upgrading on *NIX, make sure you run make clean and ./Config before doing make
- If you are upgrading on *NIX, make sure you run 'make clean' and './Config'
first before doing 'make'
- The official UnrealIRCd documentation is doc/unreal32docs.html
online version at: http://www.vulnscan.org/UnrealIrcd/unreal32docs.html
FAQ: http://www.vulnscan.org/UnrealIrcd/faq/
Read them before asking for help.
- Report bugs at http://bugs.unrealircd.org/
- When upgrading a network, we assume you are upgrading from the previous
version (3.2.1). If you got a net running with servers that are several
versions behind (eg: 3.2) then you might experience (desynch) problems.
Also, if you try to use the new features, some might not work properly
until all your servers are upgraded. It is therefore recommended to
upgrade all servers in a 'short' timespan (x day[s], not weeks).
== [ NEW ]==
- [!] Cloaking has been modulized.
- This means you now MUST load a cloaking module in order to boot.
Example: loadmodule "src/modules/cloak.so";
- 2 cloaking modules are provided: 'cloak' and 'oldcloak':
- 'cloak' is the new, RECOMMENDED, and much more secure cloaking algorithm that uses
md5 internally. It requires 3 keys of 5-100 characters (10-20 is fine) consisting
of mixed lowercase (a-z), uppercase (A-Z) and digits (0-9). So for example:
set { cloak-keys { "AHsHS6ds2sQGAkish"; "qF5D3orm6Evba26hjf"; "f6oaO2hhd6sIHSfs"; };
- 'oldcloak' is the <=3.2 cloaking algorithm, it is ONLY meant for use during the
upgrade process (it will give a warning if you use it), you should switch to the
much more secure 'cloak' module AS SOON AS POSSIBLE. As mentioned earlier, the old
cloaking algorithm has been cracked so it makes no sense to keep using it.
- 3rd party cloak modules are also possible.
- [!] Windows now also supports modules
- This means you MUST load commands.dll and a cloaking module on windows too, eg:
loadmodule "modules/commands.dll";
loadmodule "modules/cloak.dll";
- 3rd party modules are now easy to install too... developers can put .dll files
online which you just need to put in your modules\ directory (or, that could
even be done by an installer), after that you just add a loadmodule line for it,
like: loadmodule "modules/leetmod.dll";
NOTE: Just as on *NIX, you'll have to upgrade your modules every release.
- set::spamfilter::virus-help-channel-deny: blocks any normal joins to the
virus-help-channel (only people force-joined by spamfilter and opers can join).
- set::options::flat-map: Makes all server appear as directly-linked in /links,
/map, etc. Thus, link info (which server is linked to which) is hidden from users.
- NickIP was added, this means IP's of users are now known by all servers:
- IP is now shown in the 'is connecting from' line in /whois (if selfwhois or oper)
- "Far connects" (+s +F) together with HCN (Hybrid Connect Notice) can now see
IP's as well. This allows you to use for example 1 central BOPM.
- New /who options:
- /who +i <ip/mask> allows you to search by IP (eg: /who +i 10.*)
- /who +I will show IP's of everyone (bit like /who +R)
- Added DCCALLOW system (taken from bahamut). With this system you can block certain
(or all) DCC SENDs and then allow the user to 'override' this limit for every user
he/she trusts via '/DCCALLOW +User'. This is an attempt to stop (or at least limit)
the spreading of viruses and other malware.
- added deny dcc::soft option, if 'soft' is set to yes in a deny dcc block it means
users can override it via DCCALLOW.
- set::maxdccallow controls the max. number of items on the DCCALLOW list (default:10)
- Added allow dcc { } by which you can make certain exceptions over deny dcc { }
- Added extended ban type ~n (nickchange ban). if a user matches this (s)he can not
change nicks unless (s)he has voice or higher (ex: +b ~n:*!*@*.aol.com).
- Added set::restrict-extendedbans by which you can disallow normal users to use any
extended bans ("*") or disallow only certain ones (eg: "qc").
You could also use this if you are on a mixed-version-network and are (very) concerned
about desynchs, then you could restrict 'n' till all servers are upgraded.
- Added CIDR support (eg: 192.168.0.0/16). Now implemented for: ban ip, ban user,
allow, except ban/tkl/throttle, and TKL (*lines).
- '/dns c' will clear the DNS cache
- Added new logtype 'spamfilter' to log spamfilter matches.
- Added 'can_addline' operflag, this is now required in order to use /addline.
- Spanish and Hungarian translations of unreal32docs were added.
- Readded support for the T (topic time) and C (creation time) flags for /list.
- Added support for the ELIST 005 token (ELIST=MNUCT)
- set::hosts now supports the user@host format (ident)
- oper::modes: set individual modes on oper-up, overrides set::modes-on-oper
- SAPART and SVSPART reasons
- USERIP command: works just like USERHOST but displays (cloaked) IPs instead.
- Salted passwords: md5/sha1/ripemd160 passwords generated by mkpasswd are
now 'salted' which makes some cracking techniques a lot harder.
Additionally, 'md5' password encryption is now always available on *NIX.
- Channel aliases: Ability for alias { } blocks to send to a channel,
useful for example for a /SPAMREPORT command.
- Added spamfilter 'user' ('u') target, this gets matched against the
nick!user@host:realname mask of every user.
Ex: /spamfilter add u gzline 86400 Please_go_away Drone[0-9]+!.+@.+:Drone[0-9]
This would gzline any users that have both a nick and realname with 'Drone'
followed by digits.
- Added spamfilter 'away' ('a') target.
- Oper-up notices moved to a new snomask 'o'
- Win32: can now handle (near) 4096 connections instead of 1024.
- French docs
- Module coders: HOOKTYPE_REMOTE_JOIN, HOOKTYPE_REMOTE_PART, HOOKTYPE_REMOTE_KICK
==[ MAJOR BUGS FIXED ]==
- win32: crash bugs in TRE on /rehash are probably fixed.
- qlines (banned nicks) could cause crashes
- Memory corruption bug in qlines
- Crash on first connect if compiled with SSL enabled on: Mac OS X, Sun
Solaris, Opteron w/Linux, and perhaps others (non-i386).
- (quickly) rehashing + autoconnect link blocks could cause a crash
- The previous cloaking algorithm had some serious flaws by which the cloak keys
could be discovered. Thus, enabling an attacker to 'uncloak' any hosts (especially
unresolved IP's but probably also normal hosts with some more effort).
- Win32: using 100% cpu on startup in some cases [*]
- Win32: crash on windows 2003 when installing [*]
- IPv6: various nameserver fixes: hosts in link::hostname are now working,
also resolving of hostnames of clients should now work as expected (this
mainly affected non-BIND nameservers).
- new TRE version v0.7.0 fixes (invalid) regex crash
- Too broad regex in badword::word caused the ircd to hang
- Win32: remote include bug could cause a crash [*]
==[ MINOR BUGS FIXED ]==
- GUEST support wasn't working
- empty set::ssl::options would cause a crash
- compiles fine with SSL support on OpenBSD 3.5 now.
- Local opers can now join +O (operonly) channels
- Permanent modules: custom allow/except/ban/deny types were lost after /rehash
- Fixed an SVSNICK bug that could lead to duplicate users in very rare circumstances
- Win32: error msg producing garbage upon a module load error [*]
- bans were also affecting halfops in some cases (eg: changing of nick) which
was incorrect. Also +b ~n also affected voiced users, this is also fixed.
- ident in vhost { } was never sent out to other servers
- Modules: HOOKTYPE_SERVER_QUIT was called twice, could have caused crashes
- Win32: Spamfilters only added on notices might not have worked all the time
- Bans on blah@IP were not always applied
- except tkl { } did not validate the ident@
- local TKLs (klines, zlines) were accidently distributed to other servers
if someone tried to add an already-existing TKL.
- Numeric conflict of SVSWATCH and SVSJOIN
- chanmode +mu: <IRC> messages were not always properly relayed
- Resolver not working in FreeBSD jail
- Chinese/Japanese (gbk) nick code
==[ CHANGED ]==
- spamfilter.conf updates
- usage of CHG* commands are now no longer logged from U:lines
- services admins are now shown as 'Services Administrator' in /whois again.
- Changed the way MSG/NOTICE <prefix>#chan works:
- It now goes to <prefix> and higher, so '/notice +#chan hi!' goes to +vhoaq
- You need at least voice in order to be able to msg/notice +#chan, %#chan or @#chan
- You need at least ops in order to be able to msg/notice &#chan or ~#chan
- Any multi-prefix targets will be converted automatically (eg: ~&@#chan to @#chan)
- SVSJOIN now also supports channel keys
- Docs, help.conf and other text updates
- Added zlib+SSL+curl version check on boot to protect against crashes
- Win32: socket errors are now more clear (less 'Unknown error <code>' now).
- Win32: now using dynamically linked libc to get rid of some crashbugs. The dll,
msvcr70d.dll, will be downloaded automatically if needed.
- Made the 'negative TS' warning a bit more annoying since a lot of people don't
understand how critical correct time for IRC is.
- Several servernotices were turned into numerics
- allow-userhost-change force-rejoin is now also applied to opers that oper
up and receive a vhost.
- Removed * and ^ flags from /whois if PREFIX_AQ is disabled
- Using a new Makefile on *NIX so it requires less memory to compile unreal
- *NIX: 'md5' password encryption is now always available.
- Win32: 'Install as a service' is now unchecked by default
- Win32: zip/non-zip modules are now binary compatible (just like ssl/non-ssl)
- Made /whois show the usermodes to opers regardless of the eyes snomask
- Snomasks are now shown in the /whois umode output
- 005 tokens heavily updated, also modulized.
- Docs, help.conf, spamfilter.conf and other text updates
- Win32: Now using the release library msvcr70.dll [*]
- Module coders: HOOKTYPE_REMOTE_CONNECT now also gets called upon netsynch.
- Slowed down qline floods
- You can now specify multiple types in an except tkl { } block
[*]: fix was also in the 3.2.1b win32 release
==[ ADDITIONAL INFO ]==
* See Changelog
* See Changelog for more details
+167
View File
@@ -244,3 +244,170 @@
- Changed version to 3.2.1
- Moved the 3.2 changes to Changes.old
** 3.2.1 release **
- Fixed a win32 module problem where file not found errors would display random characters,
reported by STING
- Fixed a bug where the allow-userhost-change force-rejoin setting was not applied to users
who /oper and receive an oper-host (#0001901) reported by hypnetric.
- Removed the /hs alias pointing to HelpServ for Anope since this conflicts with HostServ
(#0001709) reported by DukePyrolator
- Fixed ban bug: halfops were also prevented from doing nickchanges if banned, plus..
+b ~n:*!*@* also made nickchanges impossible for voiced(&halfop'ed) people (so like half
of the purpose of it was defeated @$#&@#). Reported by Rocko.
- Fixed a bug where an ident in a vhost {} was never sent out to other servers and added
user@host support for set::hosts (#0001834) reported/suggested by bleepy.
- Fixed defizzer module. Reported by Rocko and netrixtardis.
- Removed the * and ^ flags from /whois if PREFIX_AQ is not enabled (requested by many people)
- Updated the /who docs to use correct English
- Added documentation for the /who and /whois flags (#0001881) reported by AngryWolf and Bugz.
- Added src/win32/win32.c for generic win32 helper functions
- Renamed src/win32/win32gui.c to src/win32/gui.c
- Reorganized much of the Windows code
- Fixed a whois bug when PREFIX_AQ is undefined, reported by Shaun
- Moved the RTF win32 code to a seperate file
- More win32 code cleanups
- Added src/win32/editor.c (woops), (#0001932) reported by Troco
- Fixed a problem with /who incorrectly showing the ? flag to opers even when the user should
be visible (#0001888) reported by Bugz and aquanight
- Added SAPART and SVSPART reasons. Note, to fully work it requires all servers to upgrade,
and due to a bug in older versions, it could cause problems if linked to 3.2 or earlier
(#0001859) suggested by Bugz
- Fixed a minor issue where Unreal registered itself as an NT service incorrectly
(#0001950) reported by rocafella
- Possibly fixed a bug that could cause Unreal to eat 100% CPU at startup on Windows.
(#0001635) reported by eggburt. Thanks to STING for helping to debug this.
- Implemented a new modules Makefile written by fez (#0001930).
- Added oper::modes to specify modes to be set for a particular oper (overrides
set::modes-on-oper), suggested by parker182 (#0001899).
- doc/example.conf now simply refers to unreal32docs.html for oper flags (#0001973)
reported by vonitsanet and AngryWolf.
- Fixed crash-on-first-connect if SSL was enabled. This seemed to happen on Mac OS X,
Sun Solaris, Opteron@Linux and perhaps others (#1982, #1984, #2110), reported by bit,
lion and liverbugg.
- Fixed a bug if me::info was set to "".
- Added a missing error message for ModuleGetErrorStr. Additionally added error checking to
ensure NULL is returned when an invalid error code is specified (#0001986) reported by
AngryWolf.
- Applied patch from slePP for bug #0001252: if IPv6 was enabled then in some cases names
were not properly resolved. Original bug reported by kormat.
- Fixed bugs regarding HOOKTYPE_SERVER_QUIT: was sometimes called twice and could cause
crashes due read-after-free. Reported by SET (#0001988).
- Fixed possible crash if /rehash'ing and a servername was just resolving (due to
/connect or autoconnect) and was not present in the cache. Reported and traced by sh0
(#0001976).
- Fixed compile bug at *NIX caused by ModuleGetErrorStr fix.
- Improved doc/compiling_win32.txt a lot: now VC7 only, and has instructions on:
compiling modules and their (binary) compatability, zip links (zlib), ssl (OpenSSL)...
Remote includes (curl and c-ares) instructions still need to be added.
- Made 'Install as a service' unchecked by default, this should help beginners a lot.
- Updated doc/compiling_win32.txt again with curl build instructions.
Also linked to a page with an unreal dev package which contains zlib+ssl+curl
precompiled. This basically means many people no longer need to compile zlib/ssl/curl
anymore themselves (which is a pain to do and takes a lot of time).
- Windows: the 'notice' parameter in the usermsg callback was always 0 due some windows/vc
weirdness, this also affected spamfilter (so any spamfilters added only at notice
and not at msg on windows would not work). Now using the real 'notice' parameter.
- unbroke spamfilter not working for msgs/notices (oops..).
- Made zip/non-zip modules on win32 binary compatible. Since it was nowhere documented
that you should pass the ZIP_LINKS etc options to 'nmake -f makefile.win32 custommodule'
many people didn't do this which caused odd problems when reading certain clientstructs.
Module coders: in the meantime, for 3.2.1 mods, use something like:
nmake -f makefile.win32 USE_ZIPLINKS=1 ZLIB_INC_DIR="c:\dev\zlib"
ZLIB_LIB_DIR="c:\dev\zlib\dll32" custommodule MODULEFILE=m_mymodule
For 3.2.2+ these additional parameters will no longer be needed (but wouldn't harm either).
- Some doc/example.conf clarifications, mainly for modules @ win32.
- Made /whois show the user's modes to opers regardless of +e
- Added snomask to the /whois umode output
- Added a patch by rocafella to fix a crash when installing Unreal on Win2003 (#0001949).
- Moved the Command API functions to a separate file.
- Redesigned the 005 token:
- Now renamed to RPL_ISUPPORT.
- Replaced KNOCK and MAP tokens with new CMDS token (see doc/technical/005.txt)
- Implemented most tokens from the isupport draft (STATUSMSG, EXCEPTS, CHANLIMIT,
CHANNELLEN, MAXLIST).
- Removed MAXBANS.
- Made the isupport system dynamic and provide an API for modules to add tokens, may need
testing.
- Added an M_ANNOUNCE flag for CommandAdd to add the command to the CMDS token, may need
testing.
- Fixed some compile warnings.
- Fixed a bug where bans were not matched against IPs in all circumstances (#0002045)
reported by heper.
- Fixed a bug with IP based except tkl {} lines did not validate the ident portion of the mask
(#0002049) reported by Rocko.
- Fixed a problem where a local TKL could be sent to remote servers when it is being changed
(#0002048) reported by AngryWolf.
- Added documentation for link::ciphers to unreal32docs.html (#0002019) reported by Bugz.
- Updated documentation to reflect that cmode +M allows voiced users to talk, not just
registered users (#0002020) reported by crazy.
- Made it so WATCH will not respond with an erroneous reply if the parameter was simply + or -
(#0002017) reported by GouraudShading.
- SVSO now removes +v (#0002023) reported by w00t and aquanight.
- Exported the isupport functions for use in Windows modules.
- Added a new snomask, +o to show oper-up notices (oper only), (#0001965) suggested by
vonitsanet.
- Added a /userip command that works just like ircu's.
- Fixed a typo in the *nix Makefile reported by Troco (#0002059)
- Added french docs, translated by Kolibot & Babass.
- Changed some stuff to use the release version of MS libraries.
- Updated installer for msvcr70.dll
- Fixed prefix bug caused by previous 'fix'/behavior change. Reported by aquanight (#0002067).
- Updated doc/technical/token.txt and resolved 2 token conflicts. SVSWATCH is now Sw and
SVSJOIN is now BX (#0002073) reported by trystanscott.
- Fixed a bug regarding chanmode +mu where the <IRC> messages were not properly relayed
to all servers. Reported by Aenox (#0002079).
- Added salted passwords. Salts are useful because it "protects" against stored-plaintext
attacks (eg: rainbow) and prevents cracking of several passwords at once.
This change means /MKPASSWD will now just generate a different string than before.
Do note however, that the old syntax/encrypted passwords will still work and _will continue
to work_ in the future, for at least the whole 3.2* series.
If you are concerned with security and have some time, then converting your passwords
is probably a good idea... Just in case your configuration file gets stolen one day ;).
- MD5 password encryption is now always available on *NIX, even if SSL is disabled.
- Temporary fix for ircsprintf %lu 1..6 issue.
- Fixed a problem with +u for some clients that have a strict interpretation of the RFC.
- Added TRE 0.7.0, fixes #0001952 reported by Praetorian
- Fixed an (unimportant) cloak typo / made it a few nanosec faster. Reported by Martin Brulisauer.
- Fixed resolver not working in FreeBSD jail, reported & patch provided by urkel (#0002097).
- Added a %n specifier to command aliases that is replaced by the user's nickname,
requested by many people.
- Added the ability for an alias {} to send to a channel (#0001686) requested by JasonTik
- As a result, alias[::format]::nick is now called alias[::format]::target to avoid
confusion. ::nick is maintained for backwards compatibility.
- Fixed a problem where IsupportAdd did not return a value.
- Module coders: Added HOOKTYPE_REMOTE_JOIN, HOOKTYPE_REMOTE_PART, HOOKTYPE_REMOTE_KICK (all
work just the same as the HOOKTYPE_LOCAL_* variants).
- Module coders: HOOKTYPE_REMOTE_CONNECT is now also called during net-merge. You can use
IsSynched(sptr->srvptr) to find out if it's called due to a net merge (0) or a connect (1).
- Added spamfiler 'user' (u) target. This regex is checked against nick!user@host:realname
when a user connects. This makes it easy to ban drones with simple patterns.
For example: '/spamfilter add u gzline 86400 Drone[0-9]+!.+@.+:Drone[0-9]'
would kill any drones that have both a nick and realname with 'Drone' followed by digits.
- If a nick is qlined, the user is now lagged up to limit qline floods a bit (#0001335).
- Made docs a bit more clear on spamfilter targettypes.
- Fix for too broad regex in badword::word causing the IRCd to hang, reported by Flop
(#0002101).
- IPv6: Fixed hostnames in link::hostname not working, reported by Jasmin (#0001990).
- Fixed OOB read/write on user quit (did no harm on Linux&FreeBSD).
- Fixed some tiny memory leaks (~100 bytes) on rehash.
- Updated chinese&japanese GBK nick code, fix supplied by Xuefer (#0002051).
- Added release notes (unfinished).
- Added file: include/macros.h and a new macro, ARRAY_SIZEOF.
- Added the ability to specify multiple types in a tkl except, suggested by Bugz (#0002085).
- Added spamfilter 'away' ('a') target (#0002057).
- Fixed a qline duplicate msg bug I think
- Windows version can now hold ~4096 connections instead of ~1024
- help.conf: clarified MKPASSWD documentation, reported by hypnetric (#0001926).
- Some modeskip handling for future versions
- Fixed serious heap corruption bug if remote users were using qlined nicks, thanks to
Gilou and Trankill for making me able to trace this issue down (#0002032).
- Fixed qline notices again: now gives msg #1 for local qlined-nick attempts, and
another msg in case of a remote client (eg: oper) using a qlined nick.
- Added some future SJOIN skip stuff.
- Updated version to 3.2.2-pre1 already.
** internal 3.2.2-pre1 release **
- Fixed some doc & release notes typos. Reported by Rocko, HiT.
- French doc updates, hopefully synched now.
- (revert of badsyntax fix)
- Forgot to mention away spamfilter target in helpop, reported by Rocko.
- Changed version to 3.2.2
** 3.2.2 release **
+1 -1
View File
@@ -1,5 +1,5 @@
===============================================
= UnrealIRCd v3.2.1 =
= UnrealIRCd v3.2.2 =
===============================================
Was brought to you by:
+6 -6
View File
@@ -2,12 +2,12 @@
alias identify {
format "^#" {
nick chanserv;
target chanserv;
type services;
parameters "IDENTIFY %1-";
};
format "^[^#]" {
nick nickserv;
target nickserv;
type services;
parameters "IDENTIFY %1-";
};
@@ -16,12 +16,12 @@ alias identify {
alias services {
format "^#" {
nick chanserv;
target chanserv;
type services;
parameters "%1-";
};
format "^[^#]" {
nick nickserv;
target nickserv;
type services;
parameters "%1-";
};
@@ -30,12 +30,12 @@ alias services {
alias register {
format "^#" {
nick chanserv;
target chanserv;
type services;
parameters "REGISTER %1-";
};
format "^[^#]" {
nick nickserv;
target nickserv;
type services;
parameters "REGISTER %1-";
};
+6 -7
View File
@@ -1,19 +1,18 @@
/* Anope Aliases */
alias nickserv { type services; };
alias ns { nick nickserv; type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { nick chanserv; type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; };
alias ms { nick memoserv; type services; };
alias ms { target memoserv; type services; };
alias operserv { type services; };
alias os { nick operserv; type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { nick helpserv; type services; };
alias botserv { type services; };
alias bs { nick botserv; type services; };
alias bs { target botserv; type services; };
alias hostserv { type services; };
alias hs { nick hostserv; type services; };
alias hs { target hostserv; type services; };
include "aliases/aliases.conf";
+6 -6
View File
@@ -1,16 +1,16 @@
/* Auspice Aliases */
alias nickserv { type services; };
alias ns { nick nickserv; type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { nick chanserv; type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; };
alias ms { nick memoserv; type services; };
alias ms { target memoserv; type services; };
alias helpserv { type services; };
alias hs { nick helpserv; type services; };
alias hs { target helpserv; type services; };
alias operserv { type services; };
alias os { nick operserv; type services; };
alias os { target operserv; type services; };
alias rootserv { type services; };
alias rs { nick rootserv; type services; };
alias rs { target rootserv; type services; };
include "aliases/aliases.conf";
+4 -4
View File
@@ -1,12 +1,12 @@
/* Cygnus Aliases */
alias nickserv { type services; };
alias ns { nick nickserv; type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { nick chanserv; type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; };
alias ms { nick memoserv; type services; };
alias ms { target memoserv; type services; };
alias rootserv { type services; };
alias rs { nick rootserv; type services; };
alias rs { target rootserv; type services; };
include "aliases/aliases.conf";
+6 -6
View File
@@ -1,16 +1,16 @@
/* Epona Aliases */
alias nickserv { type services; };
alias ns { nick nickserv; type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { nick chanserv; type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; };
alias ms { nick memoserv; type services; };
alias ms { target memoserv; type services; };
alias operserv { type services; };
alias os { nick operserv; type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { nick helpserv; type services; };
alias hs { target helpserv; type services; };
alias botserv { type services; };
alias bs { nick botserv; type services; };
alias bs { target botserv; type services; };
include "aliases/aliases.conf";
+5 -5
View File
@@ -1,14 +1,14 @@
/* Generic Aliases */
alias nickserv { type services; };
alias ns { nick nickserv; type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { nick chanserv; type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; };
alias ms { nick memoserv; type services; };
alias ms { target memoserv; type services; };
alias operserv { type services; };
alias os { nick operserv; type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { nick helpserv; type services; };
alias hs { target helpserv; type services; };
include "aliases/aliases.conf";
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generic StatServ Aliases */
alias statserv { type stats; };
alias ss { nick statserv; type stats; };
alias ss { target statserv; type stats; };
+6 -6
View File
@@ -1,17 +1,17 @@
/* IRCServices Aliases */
alias nickserv { type services; };
alias ns { nick nickserv; type services; };
alias ns { target nickserv; type services; };
alias chanserv { type services; };
alias cs { nick chanserv; type services; };
alias cs { target chanserv; type services; };
alias memoserv { type services; };
alias ms { nick memoserv; type services; };
alias ms { target memoserv; type services; };
alias operserv { type services; };
alias os { nick operserv; type services; };
alias os { target operserv; type services; };
alias helpserv { type services; };
alias hs { nick helpserv; type services; };
alias hs { target helpserv; type services; };
alias irciihelp { type services; };
alias statserv { type services; };
alias ss { nick statserv; type services; };
alias ss { target statserv; type services; };
include "aliases/aliases.conf";
+2 -2
View File
@@ -1,6 +1,6 @@
/* OperStats Aliases */
alias operserv { type stats; };
alias os { nick operserv; type stats; };
alias os { target operserv; type stats; };
alias statserv { type stats; };
alias ss { nick statserv; type stats; };
alias ss { target statserv; type stats; };
+1 -1
View File
@@ -372,7 +372,7 @@ IRCDLIBS="$IRCDLIBS -lresolv "
esac
dnl REMEMBER TO CHANGE WITH A NEW RELEASE!
tre_version="0.6.8"
tre_version="0.7.0"
AC_MSG_RESULT(extracting TRE regex library)
cur_dir=`pwd`
cd extras
Vendored
+1 -1
View File
@@ -10184,7 +10184,7 @@ IRCDLIBS="$IRCDLIBS -lresolv "
;;
esac
tre_version="0.6.8"
tre_version="0.7.0"
echo "$as_me:$LINENO: result: extracting TRE regex library" >&5
echo "${ECHO_T}extracting TRE regex library" >&6
cur_dir=`pwd`
+135 -25
View File
@@ -1,30 +1,20 @@
==[ IMPORTANT MESSAGE ABOUT DISABLING NOSPOOF ]==
Disabling NOSPOOF at windows (w9x, nt, w2k, xp) is NOT recommended since this
will allow users to use "spoofed hosts" (like the IP of someone you trust).
WILL allow users to use "spoofed hosts" (like the IP of someone you trust).
If you got problems with NOSPOOF fix your client (bot?) instead (you should
PONG back to the initial PING at connect).
==[ HOW TO COMPILE UNREALIRCD WITHOUT SSL AT WINDOWS ]==
==[ GENERAL GUIDELINES ]==
First of all you need Microsoft Visual C++, compiling with cygwin
is not supported.
== "old" VC++ 6.0 ==
1. You need the Platform SDK (PSDK)
Grab it at: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ ->
core sdk -> install this sdk.
Note that this can take some time to download because it's >200Mb
(450mb installed) [!].
2. To compile:
start -> programs -> platform sdk blabla -> open build env. -> (choose os) ->
set blabla build env (debug). This will launch a DOS window.
3. Go to your UnrealIrcd dir (like: cd \dev\unreal3.2) and then compile with:
nmake -f makefile.win32
This will generate a wircd.exe and unreal.exe
4. Copy the src\win32\tre.dll to your UnrealIrcd main dir.
5. Done!
VC++ 7.x (.NET) is highly recommended. VC 6 might work but it requires
the Platform SDK (PSDK), it also has quite some bugs (there are 5 servicepacks!).
Basically VC7 is just much easier and known to work, therefore we'll assume
in this text that you are using it.
== VC++ 7.x (.NET) ==
== Simple compile (no SSL/ZIP/Remote includes) ==
1. Start the Visual Studio .NET Command Prompt
2. Go to your UnrealIrcd dir (like: cd \dev\unreal3.2) and then compile with:
nmake -f makefile.win32
@@ -32,12 +22,132 @@ is not supported.
3. Copy the src\win32\tre.dll to your UnrealIrcd main dir.
4. Done!
==[ HOW TO COMPILE UNREALIRCD WITH SSL AT WINDOWS ]==
Ouch, that's much work ;).
You need to compile openssl yourself.
Then have a look at makefile.win32 for instruction on how
to enable / specify path / etc...
DO NOT ask us for help with compiling openssl!
== Compiling modules ==
1. Put your module (the .c file) in src\modules (eg: c:\dev\unreal3.2\src\modules).
2. Start the Visual Studio .NET Command Prompt
3. Go to your UnrealIrcd dir (like: cd \dev\unreal3.2).
4. Compile the module with:
nmake -f makefile.win32 custommodule MODULEFILE=<name>
<name> is the name of the module WITHOUT the .c suffix, so if your
module has the filename 'm_crappymod.c', then you use:
nmake -f makefile.win32 custommodule MODULEFILE=m_crappymod
5. Done. A .dll file should have been created.
==[ AND ZIP LINKS SUPPORT? ]==
See makefile.win32 for instructions.
If you compiled with VC7 and used the official source (not a CVS version,
but for example 3.2.1 source) then the module should work on all these
versions (binary compatible) and you could for example put them on
your website so users can download them.
Such a module will work on both SSL and non-SSL, there should be no need
for separate versions... unless, of course, you use SSL-specific code in your mod.
DO NOT download a CVS version & compile your mod and then start
distributing the .dll for use at another (non-CVS) version!!
Every time we change a struct (and in some other cases) it makes the
binary/module binary incompatible which practically means your module
will CRASH or cause memory corruption and other subtle errors.
== COMPILING WITH ZIP LINKS / SSL / REMOTE INCLUDES SUPPORT ==
First of all, DO NOT use any precompiled libs from the official
zlib/openssl/curl sites. We require certain compile parameters.
Versions downloaded from such sites will often CRASH.
The easiest is to download the UnrealIRCd development package
which contains zlib, openssl and curl precompiled for you.
See: www.vulnscan.org/unrealwin32dev/
Just extract it somewhere (eg: to c:\dev).
Then, use compile flags to enable the features + specify where to look.
Here are examples if you used c:\dev:
ZIP: nmake -f makefile.win32 USE_ZIPLINKS=1 ZLIB_INC_DIR="c:\dev\zlib" ZLIB_LIB_DIR="c:\dev\zlib\dll32"
SSL: nmake -f makefile.win32 USE_SSL=1 OPENSSL_INC_DIR="c:\dev\openssl\include" OPENSSL_LIB_DIR="c:\dev\openssl\lib"
CURL: nmake -f makefile.win32 USE_REMOTEINC=1 LIBCURL_INC_DIR="c:\dev\curl\include" LIBCURL_LIB_DIR="c:\dev\curl\lib"
Obviously you can (and probably will) combine all these options, like
to build a zip+ssl+curl version (all in 1 line):
nmake -f makefile.win32 USE_ZIPLINKS=1 ZLIB_INC_DIR="c:\dev\zlib" ZLIB_LIB_DIR="c:\dev\zlib\dll32"
USE_SSL=1 OPENSSL_INC_DIR="c:\dev\openssl\include" OPENSSL_LIB_DIR="c:\dev\openssl\lib" USE_REMOTEINC=1
LIBCURL_INC_DIR="c:\dev\curl\include" LIBCURL_LIB_DIR="c:\dev\curl\lib"
== COMPILING ZLIB/SSL/CURL YOURSELF ==
This is quite some work.. With the precomiled method shown above it
just takes like 5-10 minutes to have a zlib+ssl+curl Unreal version.
But if you want to compile each of these libs manually then it will
probably take an hour or so.
** THE INFORMATION BELOW IS OUTDATED, WE GOT RID OF MDd, USE MD INSTEAD
AND DONT COMPILE OPENSSL W/DEBUG ***
== ZIP LINKS (zlib) ==
[NOTE: precompiled dlls should NOT be used because they will cause a crash
(this is due to different compile parameters / api call systems]
To compile with ziplinks support you need to do the following:
Download the SOURCE from http://www.winimage.com/zLibDll/
(at the time of writing, http://www.winimage.com/zLibDll/zlib121.zip)
and extract it to somewhere, for example c:\dev\zlib-1.2.1
Then, edit win32\makefile.msc:
- Change -MD to -MDd
- Add -D ZLIB_WINAPI to CFLAGS
- so the result will be like:
CFLAGS = -nologo -MDd -O2 $(LOC) -D ZLIB_WINAPI
- Then compile: nmake -f win32\Makefile.msc
- Assuming the above step went fine, your zlib is now ready.
- Now, to compile UnrealIRCd with ziplinks you do something like this:
nmake -f makefile.win32 USE_ZIPLINKS=1 ZLIB_INC_DIR="c:\dev\zlib-1.2.1" ZLIB_LIB_DIR="c:\dev\zlib-1.2.1"
Obviously, change the paths if needed [1st = *.h files, 2nd=*.dll/*.lib]
== SSL (OpenSSL) ==
[note: openssl requires perl to configure/compile!]
- Download latest openssl (eg: openssl-0.9.7d.tar.gz) and extract it somewhere
(we'll use c:\dev\openssl-0.9.7d in this example)
- Open util\do_masm.bat, add 'debug' to the lines with 'mk1mf.pl' BUT be careful
since it should NOT be the last word, so add it somewhere before that.
For example: perl util\mk1mf.pl dll debug VC-W31-32 >ms\w31dll.mak
- Start the
- Now we go build openssl, run:
ms\do_masm
nmake -f ms\ntdll.mak
- Assuming the above step went fine, your OpenSSL is now ready.
- Now, to compile UnrealIRCd with ziplinks you do something like this:
nmake -f makefile.win32 USE_SSL=1 OPENSSL_INC_DIR="c:\openssl\inc32\openssl" OPENSSL_LIB_DIR="C:\Dev\openssl\out32dll.dbg"
Obviously, change the paths if needed [1st=*.h files, 2nd=*.dll/*.lib]
== REMOTE INCLUDES (curl, c-ares) ==
- Download latest c-ares source from http://daniel.haxx.se/projects/c-ares/
Download latest curl source from http://curl.haxx.se/download.html
Extract both somewhere (eg: c:\dev\c-ares-1.2.0 and c:\dev\curl-7.12.0)
- Open vc\vc.dsw from your ares directory. Assuming you have VC7 it will ask
whether it should convert the project, choose 'Yes to all'.
- (solution explorer) areslib -> properties
C/C++ -> code generation -> runtime library: Change to
'Multi-threaded Debug DLL (/MDd)'
- at the time of writing 'ares_free_errmem.c' should be removed from the
project file (solution explorer -> source files -> find the file + press
delete). Also 'ares_version.c' and 'ares_cancel.c' should be added
(solution explorer -> source files -> rightclick -> add -> add existing ->
go down a few directories if needed and choose the file).
- right click at 'areslib' in the solution explorer and select 'Build'.
Assuming it compiled fine, we are done with c-ares.
- Now go to the curl directory and open lib\curllib.dsw. Choose 'Yes to all'
again when asked about converting.
- Open config-win32.h (@header files in solution explorer) and add:
#define USE_ARES 1
- Open include\curl\multi.h and change the line with:
#include <winsock2.h>
to:
#include <winsock.h>
- (solution explorer) curllib -> properties
- C/C++ -> code generation -> runtime library: Change to
'Multi-threaded Debug DLL (/MDd)'
- C/C++ -> general -> additional include directories:
add the path to your <c-ares-directory> (eg: C:\Dev\c-ares-1.2.0).
- linker -> general -> additional library directories:
add the path to your <c-ares-directory>\vc\areslib\Debug,
for example C:\Dev\c-ares-1.2.0\vc\areslib\Debug.
- linker -> input -> additional dependencies:
add: areslib.lib
- linker -> input -> Module defenition file:
set to: libcurl.def
Done with editting properties.
- Now: Build -> rebuild solution, everything should compile fine.
- Now, to compile UnrealIRCd with remote includes you do something like this:
nmake -f makefile.win32 USE_REMOTEINC=1 LIBCURL_INC_DIR="C:\Dev\curl-7.12.0\include" LIBCURL_LIB_DIR="C:\Dev\curl-7.12.0\lib\Debug"
+41 -49
View File
@@ -26,12 +26,17 @@
#those lines are ignored by the ircd.
/*
* At *NIX UnrealIrcd supports modules.
* Loading the commands module and a cloaking module is required:
* UnrealIRCd supports modules, loading some of them is required.
* You need at least the commands module and a cloaking module.
*/
loadmodule "src/modules/commands.so";
loadmodule "src/modules/cloak.so";
/* FOR *NIX, uncomment the following 2lines: */
//loadmodule "src/modules/commands.so";
//loadmodule "src/modules/cloak.so";
/* FOR Windows, uncomment the following 2 lines: */
//loadmodule "modules/commands.dll";
//loadmodule "modules/cloak.dll";
/*
* You can also include other configuration files.
@@ -182,39 +187,10 @@ allow channel {
* };
*/
/* OLD OPER FLAG | NEW FLAG NAME
O global
o local
a services-admin
A admin
r can_rehash
D can_die
R can_restart
h helpop
w can_wallops
g can_globops
c can_localroute
L can_globalroute
k can_localkill
K can_globalkill
b can_kline
Z can_gzline
t can_gkline
B can_unkline
n can_localnotice
G can_globalnotice
N netadmin
C coadmin
z can_zline
W get_umodew
H get_host
v can_override
*/
/*
Note: netadmin gives you OaAN
admin and services-admin give you o as well
*/
/* For a list of oper flags, see doc/unreal32docs.html#operblock
* [HIGHLY recommended to read]
*/
oper bobsmith {
class clients;
@@ -225,9 +201,13 @@ oper bobsmith {
flags
{
netadmin;
can_zline;
can_gzline;
can_gkline;
global;
};
};
/*
* NEW: listen {}
* OLD: P:Line
@@ -279,6 +259,14 @@ listen *:6697
listen *:8067;
listen *:6667;
/* NOTE: If you are on an IRCd shell with multiple IP's you are
* likely to get 'Address already in use' errors in your log
* and the ircd won't start. This means you MUST bind
* to a specific IP instead of '*', so for example:
* listen 1.2.3.4:6667;
* Obviously, replace the IP with the IP that was assigned to you.
*/
/*
* NEW: link {}
* OLD: C/N:Lines
@@ -329,9 +317,7 @@ link hub.mynet.com
password-receive "LiNk";
class servers;
options {
/* Note: You should not use autoconnect when linking
* services
*/
/* Note: You should not use autoconnect when linking services */
autoconnect;
ssl;
zip;
@@ -414,7 +400,7 @@ log "ircd.log" {
*
* Syntax:
* alias "name" {
* nick "points to";
* target "points to";
* type aliastype;
* };
*
@@ -423,7 +409,7 @@ log "ircd.log" {
// This points the command /nickserv to the user NickServ who is connected to the set::services-server server
/*alias NickServ {
nick "NickServ";
target "NickServ";
type services;
};*/
@@ -452,7 +438,7 @@ alias StatServ { type stats; };
* Syntax:
* alias "name" {
* format "format string" {
* nick "points to";
* target "points to";
* type aliastype;
* parameters "parameters to send";
* };
@@ -465,12 +451,12 @@ alias StatServ { type stats; };
/*
alias "identify" {
format "^#" {
nick "chanserv";
target "chanserv";
type services;
parameters "IDENTIFY %1-";
};
format "^[^#]" {
nick "nickserv";
target "nickserv";
type services;
parameters "IDENTIFY %1-";
};
@@ -485,18 +471,19 @@ alias "identify" {
/* The alias::format::parameters is similar to scripting languages. %N (where N is a number) represents a
* parameter sent to the command (in this case /identify). If you specify %N- it means all parameters from
* N until the last parameter in the string.
* N until the last parameter in the string. You may also specify %n which is replaced by
* the user's nickname.
*/
/* Standard aliases */
alias "services" {
format "^#" {
nick "chanserv";
target "chanserv";
type services;
parameters "%1-";
};
format "^[^#]" {
nick "nickserv";
target "nickserv";
type services;
parameters "%1-";
};
@@ -505,12 +492,12 @@ alias "services" {
alias "identify" {
format "^#" {
nick "chanserv";
target "chanserv";
type services;
parameters "IDENTIFY %1-";
};
format "^[^#]" {
nick "nickserv";
target "nickserv";
type services;
parameters "IDENTIFY %1-";
};
@@ -537,6 +524,11 @@ tld {
rules "ircd.rules.fr";
};
/* note: you can just delete the example block above,
* in which case the defaults motd/rules files (ircd.motd, ircd.rules)
* will be used for everyone.
*/
/*
* NEW: ban nick {}
* OLD: Q:Line
+49 -6
View File
@@ -1,5 +1,5 @@
Numeric 005 Documentation (c) 2002 codemastr (Dominick Meglio) [codemastr@unrealircd.com]
(As of Unreal3.2-beta11)
Numeric 005 Documentation (c) 2002-2004 codemastr (Dominick Meglio) [codemastr@unrealircd.com]
(As of Unreal3.2.1)
Numeric 005 allows the server to inform the client of any protocol specific features in the
IRCd. The numeric is sent at connection time immediately after numeric 004. Additionally
@@ -17,13 +17,23 @@ by this server"
Currently UnrealIRCd supports several tokens that are included in numeric 005. A list of
all tokens, their respective value and a brief description are listed below.
Unreal attempts to follow the proposed ISupport standard as much as possible. Unreal only
ignores the standard in one regard, the TARGMAX token. This token is believed to be
impractical and technically impossible to correctly implement due to existing limitations
in the standard. Therefore, this token is not currently supported.
Unreal does additionally provide a few tokens which are not specified in the standard, these
include: HCN, AWAYLEN, WATCH, SILENCE, EXTBAN, ELIST, and CMDS. Unreal also maintains a few
legacy tokens such as MAXCHANNELS and WALLCHOPS to ensure compatibility until the ISupport
standard is more widely accepted by clients.
Token Value Default Value Description
------------------------------------------------------------------------------------------------
MAP none none Informs the client that the /map
command is present.
command is present. [Obsolete]
KNOCK none none Informs the client that the /knock
command is present.
command is present. [Obsolete]
SAFELIST none none The LIST command is sent in
multiple iterations so that the
@@ -34,10 +44,11 @@ HCN none none The server supports t
(Hybrid Connect Notice) protocol.
MAXCHANNELS number 10 The maximum number of channels a
user may join.
user may join. [Deprecated]
MAXBANS number 60 The maximum number of bans that
may be placed for a channel.
[Obsolete]
NICKLEN number 30 Maximum length of a user's
nickname.
@@ -55,6 +66,7 @@ AWAYLEN number 307 Maximum length of an
WALLCHOPS none none Indicates that you may use
NOTICE/PRIVMSG to send to +ohv by
using PRIVMSG/NOTICE [@|%|+]#channel.
[Deprecated]
WATCH number 128 Indicates the presence of the
WATCH command and specifies the
@@ -106,8 +118,39 @@ ELIST flags MNUCT Specifies the set of
indicates mask based searching,
the N flag indicates negative
mask based searching. The U flag
meaning support for user count
means support for user count
searching. The C flag allows channel
creation time searching, and the T
flag allows topic set time
searching.
CMDS commands MAP,KNOCK,DCCALLOW,USERIP Specifies a series of commands that
can be useful for the client to know
exist as they may provide a more
efficient means for the client to
accomplish a specific task. This
token replaces the MAP and KNOCK
tokens.
STATUSMSG flags ~&@%+ Specifies the mode flags that may
prefix a channel name in a PRIVMSG
or NOTICE to limit who receives the
message to only those with a certain
level of access. This token will
replace the WALLCHOPS token.
EXCEPTS none none Indicates that channel ban exceptions
(+e) are supported by the server.
MAXLIST mode:num,... b:60,e:60 Specifies the maximum number of
entries that may be added to a
particular mode list (type A modes).
This token replaces MAXBANS.
CHANLIMIT pfx:num,... #:10 Specifies the maximum number of
channels with the specified prefix
that a user may join at one time.
This token will replace MAXCHANNELS.
CHANNELLEN number 32 Provides the maximum length of a
channel name that a user can create.
+62 -89
View File
@@ -1,85 +1,8 @@
Token List (c) 2002 codemastr (Dominick Meglio) [codemastr@unrealircd.com]
(As of Unreal3.2-beta11)
Token List (c) 2002-2004 codemastr (Dominick Meglio) [codemastr@unrealircd.com]
(As of Unreal3.2.2)
Command Token
------------------------------------------------------------------------------------------------
PRIVMSG !
WHO \
WHOIS #
WHOWAS $
USER %
NICK &
SERVER '
LIST (
TOPIC )
INVITE *
VERSION +
QUIT ,
SQUIT -
KILL .
INFO /
LINKS 0
SUMMON 1
STATS 2
USERS 3
HELP 4
HELPOP 4
ERROR 5
AWAY 6
CONNECT 7
PING 8
PONG 9
OPER ;
PASS <
WALLOPS =
TIME >
NAMES ?
ADMIN @
NOTICE B
JOIN C
PART D
LUSERS E
MOTD F
MODE G
KICK H
USERHOST J
ISON K
REHASH O
RESTART P
CLOSE Q
DIE R
HASH S
DNS T
SILENCE U
AKILL V
KLINE W
UNKLINE X
RAKILL Y
GNOTICE Z
GOPER [
GLOBOPS ]
LOCOPS ^
PROTOCTL _
WATCH `
TRACE b
SQLINE c
UNSQLINE d
SVSNICK e
SVSNOOP f
SVSKILL h
SVSMODE n
SAMODE o
CHATOPS p
ZLINE q
UNZLINE r
RULES t
MAP u
SVS2MODE v
DALINFO w
ADCHAT x
MKPASSWD y
ADDLINE z
GLINE }
SETHOST AA
NACHAT AC
SETIDENT AD
@@ -94,15 +17,16 @@ RPING AM
RPONG AN
NETINFO AO
SENDUMODE AP
ADDMODE AQ
ADDOMODE AR
SVSMODE AS
ADDMOTD AQ
ADDOMOTD AR
SVSMOTD AS
SMO AU
OPERMOTD AV
TSCTL AW
SAJOIN AX
SAPART AY
CHGIDENT AZ
NOTICE B
SWHOIS BA
SVSO BB
SVSFLINE BC
@@ -110,13 +34,62 @@ TKL BD
VHOST BE
BOTMOTD BF
HTM BH
DCCDENY BI
UNDCCDENY BJ
CHGNAME BK
SHUN BL
SVSJOIN BR
CYCLE BP
MODULE BQ
SVSNLINE BR
SVSPART BT
SJOIN ~
SVSLUSERS BU
SVSSNO BV
SVS2SNO BW
SVSJOIN BX
SVSSILENCE Bs
SVSWATCH Bw
JOIN C
NEWJOIN C
PART D
LUSERS E
EOS ES
MOTD F
MODE G
KICK H
USERHOST J
ISON K
REHASH O
RESTART P
CLOSE Q
DIE R
SENDSNO Ss
DNS T
TEMPSHUN Tz
SILENCE U
AKILL V
UNKLINE X
RAKILL Y
GLOBOPS ]
LOCOPS ^
PROTOCTL _
WATCH `
TRACE b
SQLINE c
UNSQLINE d
SVSNICK e
SVSNOOP f
SVSKILL h
SVSMODE n
SAMODE o
CHATOPS p
UNZLINE r
RULES t
MAP u
SVS2MODE v
DALINFO w
ADCHAT x
MKPASSWD y
ADDLINE z
UMODE2 |
GLINE }
SJOIN ~
+1
View File
@@ -3,6 +3,7 @@ VL Information (c) 2002 codemastr (Dominick Meglio) [codemastr@unrealircd.com]
Protocol Version
------------------------------------------------------------------------------------------------
2305 3.2.2
2304 3.2.1
2303 3.2-beta*, 3.2-RC*, 3.2
2302 3.1.1-Darkshades, 3.1.2-Darkshades, 3.1.3-Komara, 3.1.4-Meadows
+3
View File
@@ -10,6 +10,9 @@ There a few requirements however:
unreal32docs.html (www.vulnscan.org/UnrealIrcd/unreal32docs.html).
- Of course the translation should be correct.. So also 'technically',
it's therefore recommended that have some real experience with Unreal ;)
- If you are accepted and start working on it, it would be nice if you
could put your docs-in-progress online somewhere so we can see how
progress is going a bit.
- Someone (usually the person who translated it) needs to be willing
to actively maintain the docs. This is very important! If docs are
out of date (out-of-synch) there will be confusion among users.
+160 -88
View File
@@ -19,13 +19,15 @@
<body>
<a href="unreal32docs.html">English</a> | German |
<a href="unreal32docs.es.html">Spanish</a> |
<a href="unreal32docs.hu.html">Hungarian</a><br><br>
<a href="unreal32docs.hu.html">Hungarian</a> |
<a href="unreal32docs.fr.html">French</a>
<br><br>
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
<font size="4">Version: 3.2.1 </font><br>
<b>Aktuelle Version:</b> 3.2.1<br>
<b>Letztes Dokumentation Update:</b> 2004-07-03</div>
<font size="4">Version: 3.2.2 </font><br>
<b>Aktuelle Version:</b> 3.2.2<br>
<b>Letztes Dokumentation Update:</b> 2004-10-11</div>
<b>Head Coders:</b> Stskeeps / codemastr / Syzop / Luke<br>
<b>Contributors:</b> McSkaf / Zogg / NiQuiL / assyrian / chasm / DrBin / llthangel / Griever / nighthawk<br>
<b>Dokumentation</b><b>:</b> CKnight^ / Syzop<br>
@@ -208,8 +210,8 @@ Bug gemeldet wird!</p></div>
</a> senden. <p><b>Installationsanleitungen</b><br>
Linux:<br>
<ol>
<li>gunzip -d Unreal3.2.tar.gz
<li>tar xvf Unreal3.2.tar
<li>gunzip -d Unreal3.2.2.tar.gz
<li>tar xvf Unreal3.2.2.tar
<li>cd Unreal3.2
<li>./Config
<li>Die hierbei angezeigten Fragen nach bestem Wissen beantworten. Allgemein ist
@@ -306,6 +308,7 @@ N - globale nick
Nicks<br>
s - Server Nachrichten anzeigen [*]<br>
S - Spamfilter Nachrichten anzeigen<br>
o - Oper-up Meldungen anzeigen<br>
[*: Diese snomask ist auch für Nicht-IrcOps möglich]<br>
</p>
<p>Es kann eingestellt werden, welche snomasks man automatisch erhält (set::snomask-on-connect)
@@ -734,87 +737,152 @@ Ebenso k
Spamfilter ist ein neues System gegen Spam, Belästigungen, Würmer etc. Es
arbeitet ein wenig ähnlich wie 'badwords', hat aber einige Erweiterungen..<br>
<br>
Spamfilter werden durch den&nbsp; /spamfilter Befehl gesetzt, der die folgende
Syntax hat:<br>
Spamfilter werden durch den&nbsp; /spamfilter Befehl mit der folgenden Syntax
gesetzt:<br>
<b>/spamfilter [add|del|remove|+|-] [type] [action] [tkltime] [reason] [regex]<br>
</b>
<table border="0" cellspacing="1" width="959">
<tr>
<td width="74" valign="top"><b>[type]&nbsp;</b></td>
<td colspan="2" width="871"> gibt den Zieltyp an, also welche Art von Nachrichten. Man kann
verschiedene angeben. es gilt: 'c' für Channel Nachrichten, 'p' für private
Nachrichten, 'n' für private Notice, 'N' für Channel Notice, 'P' Part Meldung, 'q'
für Quit Meldung und&nbsp; 'd' für dcc</td>
<td colspan="4" width="871"> gibt an, auf welchen Nachrichtentyp reagiert
werden soll;</td>
</tr>
<tr>
<td width="74"></td>
<td width="123"><b>Zeichen:</b></td>
<td colspan="2" width="127"><b>Config Eintrag</b></td>
<td width="621"><b>Bedeutung</b></td>
</tr>
<tr>
<td width="74"></td>
<td width="123">c</td>
<td colspan="2" width="127">channel</td>
<td width="621">Nachricht im Channel (öffentlich)</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">p</td>
<td colspan="2" width="127">privat</td>
<td width="621">Private Nachricht (von User --&gt; User)</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">n</td>
<td colspan="2" width="127">private-notice</td>
<td width="621">Private Notiz</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">N</td>
<td colspan="2" width="127">channel-notice</td>
<td width="621">Channel Notiz</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">P</td>
<td colspan="2" width="127">part</td>
<td width="621">Grund Angabe beim Verlassen des Channels</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">q</td>
<td colspan="2" width="127">quit</td>
<td width="621">Grund Angabe beim Beenden des Chats</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">d</td>
<td colspan="2" width="127">dcc</td>
<td width="621">DCC Dateiname</td>
</tr>
<tr>
<td width="74"></td>
<td width="123">u</td>
<td colspan="2" width="127">user</td>
<td width="621">bannt User, geprüft wird auf nick!user@host:realname</td>
</tr>
<tr>
<td width="74"></td>
<td colspan="4" width="871">Es ist möglich, mehrere Ziele anzugeben, wie
z.B.: cpNn</td>
</tr>
<tr>
<td width="74"></td>
<td colspan="4" width="871"></td>
</tr>
<tr>
<td width="74"><b>[action]</b></td>
<td colspan="2" width="871"><i>[action]</i> gibt an, welche Aktion erfolgen soll (es kann nur 1 Aktion
<td colspan="4" width="871">gibt an, welche Aktion erfolgen soll (es kann nur 1 Aktion
angegeben werden)</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">kill</td>
<td width="789">Killt den User</td>
<td colspan="4" width="871"></td>
</tr>
<tr>
<td width="74"></td>
<td width="76">tempshun</td>
<td width="789">setzt für die laufende Verbindung einen Shun auf den User
<td width="1" colspan="2">kill</td>
<td width="915" colspan="2">Killt den User</td>
</tr>
<tr>
<td width="74"></td>
<td width="1" colspan="2">tempshun</td>
<td width="915" colspan="2">setzt für die laufende Verbindung einen Shun auf den User
(bei Reconnect ist der Shun aufgehoben</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">shun</td>
<td width="789">Setzt einen Shun auf den Host</td>
<td width="1" colspan="2">shun</td>
<td width="915" colspan="2">Setzt einen Shun auf den Host</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">kline</td>
<td width="789">Setzt eine kline auf den Host</td>
<td width="1" colspan="2">kline</td>
<td width="915" colspan="2">Setzt eine kline auf den Host</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">gline</td>
<td width="789">Setzt eine gline auf den Host</td>
<td width="1" colspan="2">gline</td>
<td width="915" colspan="2">Setzt eine gline auf den Host</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">zline</td>
<td width="789">Setzt eine zline auf den Host</td>
<td width="1" colspan="2">zline</td>
<td width="915" colspan="2">Setzt eine zline auf den Host</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">gzline</td>
<td width="789">Setzt eine gzline (globale zline) auf den Host</td>
<td width="1" colspan="2">gzline</td>
<td width="915" colspan="2">Setzt eine gzline (globale zline) auf den Host</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">block</td>
<td width="789">Blockiert lediglich die Nachricht</td>
<td width="1" colspan="2">block</td>
<td width="915" colspan="2">Blockiert lediglich die Nachricht</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">dccblock</td>
<td width="789">markiert den User derart, dass er nicht in der Lage ist,
<td width="1" colspan="2">dccblock</td>
<td width="915" colspan="2">markiert den User derart, dass er nicht in der Lage ist,
irgend welche DCCs zu senden</td>
</tr>
<tr>
<td width="74"></td>
<td width="76">viruschan</td>
<td width="789">User wird aus allen Channels entfernt, wird in den unter <b>set::spamfilter::virus-help-channel</b>
<td width="1" colspan="2">viruschan</td>
<td width="915" colspan="2">User wird aus allen Channels entfernt, wird in den unter <b>set::spamfilter::virus-help-channel</b>
eingetragenen Channel geforwardet, alle Befehle außer PONG und ADMIN
werden deaktiviert und msg/notices werden zum Channel aus <b>set::spamfilter::virus-help-channel</b>
geleitet</td>
geleitet.</td>
</tr>
<tr>
<td width="74" valign="top"><b>[tkltime]</b></td>
<td colspan="2" width="871">Die Zeitdauer, die für eine durch den Filter
<td colspan="4" width="871">Die Zeitdauer, die für eine durch den Filter
gesetzte Line gilt. Um den Default zu benutzen oder zum Übergehen (z.B. wenn action = 'block'),
lediglich ein '-' eintragen,</td>
</tr>
<tr>
<td width="74" valign="top"><b>[reason]</b></td>
<td colspan="2" width="871">Der anzuzeigende Grund für Block- oder *lines
<td colspan="4" width="871">Der anzuzeigende Grund für Block- oder *lines
Befehle. Man kann hier KEINE Leerzeichen eintragen, aber Unterstriche
('_') werden zur Laufzeit in Leerzeichen umgesetzt. Ein doppelter
Underscore ('__') erzeugt einen Underscore ('_') in der Ausgabe. Auch hier
@@ -822,7 +890,7 @@ angegeben werden)</td>
</tr>
<tr>
<td width="74" valign="top"><b>[regex]</b></td>
<td colspan="2" width="871">&nbsp;gibt den Ausdruck oder das 'bad word' an, welches geblockt werden
<td colspan="4" width="871">&nbsp;gibt den Ausdruck oder das 'bad word' an, welches geblockt werden
soll, oder worauf die Aktion erfolgen soll</td>
</tr>
</table>
@@ -854,6 +922,15 @@ g
Die Syntax dieser spamfilter { } Blöcke wird <a href="#spamfilter">hier</a>
erklärt:<br>
<br>
Beispiel:
<p><font face="Courier New" size="2">spamfilter {<br>
regex "//write \$decode\(.+\|.+load -rs";<br>
target { private; channel; };<br>
reason "Generic $decode exploit";<br>
action block;<br>
};</font>
<p>
<br>
<b>
set::spamfilter::ban-time</b> ermöglicht die Festlegung einer Default Bann
Dauer für *lines die durch den Spamfilter gesetzt wurden (default: 1 Tag)<br>
@@ -1203,6 +1280,7 @@ bekannt als O:Line)</font><div class="desc">
};
swhois &lt;whois info&gt;;
snomask &lt;snomask&gt;;
modes &lt;modes&gt;;
maxlogins &lt;num&gt;;
};</pre>
<p>Mit dem Oper Block können für den Server IRC Operatoren festgelegt werden.&nbsp;<br>
@@ -1514,9 +1592,12 @@ Form (wie z.B.: &quot;services-admin&quot;) verwenden m
Information eines Opers gesetzt werden. <font color="#0000FF">[optional]</font></p>
<p>Mit der <b> oper::snomask</b> Anweisung kann eine server notice Mask für einen Oper
voreingestellt werden, so dass man beim oper Befehl bestimmte Flags automatisch
voreingestellt bekommt. Siehe <a href="#feature_snomasks">Abschnitt 3.3</a>&nbsp;
voreingestellt sind. Siehe <a href="#feature_snomasks">Abschnitt 3.3</a>&nbsp;
für
Infos über snomasks. <font color="#0000FF">[optional]</font>
<p>Mit der <b> oper::modes</b> Anweisung können Modi für Opers voreingestellt
werden, so dass man beim oper Befehl bestimmte Flags automatisch
voreingestellt sind. <font color="#0000FF"> [optional]</font>
<p>Mit der <b> oper::maxlogins</b> Anweisung kann man die
die Anzahl gleichzeitiger Oper Logins einschränken. Wenn hier z.B. der Wert 1
eingestellt wird, kann immer nur eine Person über diesen Oper Block eingeloggt
@@ -1792,7 +1873,7 @@ setzen, bislang ist hier aber nur&nbsp; tld::options::ssl m
<p>TLD Einträge werden von unten nach oben abgearbeitet.</p>
<p>Beispiel:
<pre>tld {
mask *@*.fr;&lt;
mask *@*.fr;
motd &quot;ircd.motd.fr&quot;;
rules &quot;ircd.rules.fr&quot;;
};</pre>
@@ -1965,19 +2046,25 @@ connecten d
<font class="block_optional">OPTIONAL </font><font class="block_old">(Früher
nicht vorhanden)</font><div class="desc">
<p>Syntax:
<pre>except tkl {
<pre><font face="Courier New">except tkl {
mask &lt;hostmask&gt;;
type &lt;type&gt;;
};</pre>
type {
&lt;type&gt;;
&lt;type&gt;;
...
};
};</font></pre>
<p>Mit dem &quot;except tkl Block&quot; kann man <a href="mailto:user@host">user@host</a>
Masken angeben, die von den gesetzten Banns tkl Banns (also G-Lines, Shuns, GZ
Lines) ausgenommen werden sollen. So etwas kann verwendet werden, falls man z.B.
Masken angeben, die von den gesetzten tkl Banns (also G-Lines, Shuns, GZ
Lines) auf breitere Hosts ausgenommen werden sollen. So etwas kann verwendet werden, falls man z.B.
ganze ISP bannen möchte, aber einzelnen Usern trotzdem die Verbindung erlauben
möchte. Dazu bei <b> except::mask</b> den oder die Hosts eintragen (als user@host
Mask) die trotz globalem Bann connecten dürfen. Bei <b>except::type</b> wird
angegeben, welcher Bann Typ ausgenommen werden soll. Gültige Typen sind hier:
gline, gzline, qline, gqline und shun, für Ausnahmen von Glines, Global Zlines,
Qlines, Global Qlines und Shuns.</p>
Qlines, Global Qlines und Shuns. Wenn das {} Format benutzt wird, können
unterschiedliche Typen angegeben werden.</p>
<p>Beispiel:
<pre>except tkl {
mask myident@my.isp.com;
@@ -2181,9 +2268,6 @@ normale ('harte') dcc Banns.</p>
filename &quot;*.jpg&quot;; /* Bilder sind üblicherweise sicher */
soft yes;
};</pre>
<pre>allow channel {
channel &quot;#smart_*&quot;;
};</pre>
</div>
<p><font class="block_section"><a name="vhostblock">4.28 - </a> </font><a name="vhostblock"><font class="block_name">Vhost Block</font>
@@ -2296,6 +2380,7 @@ bekannt als C/N/H:Lines)</font>
leaf &lt;leaf-mask&gt;;
leafdepth &lt;depth&gt;;
class &lt;class-name&gt;;
ciphers &lt;ssl-ciphers&gt;
options {
&lt;option&gt;;
&lt;option&gt;;
@@ -2370,6 +2455,12 @@ definiert.
Gibt den Kompressions Level (1-9) für diesen Link an. Wird nur verwendet, wenn
auch &quot;link::options::zip&quot; gesetzt ist.
</p>
<p><b>ciphers</b> (optional)<br>
Gibt die SSL Verschlüsselung an, die für diesen Link benutzt wird. Um eine
Liste der verfügbaren Verschlüsselungscodes zu erhalten, kann man den 'openssl
ciphers' Befehl benutzen. ciphers ist als eine durch ':' getrennte Liste
anzugeben.&nbsp;
</p>
<p><b>options block</b><br>
Eine oder mehrere Optionen für eine Verbindung zu diesem Server. Wird manchmal
nicht benötigt.<br>
@@ -2410,17 +2501,17 @@ nicht vorhanden)</font>
</p><div class="desc">
<p>Syntax [standard alias]:<br>
<pre>alias &lt;name&gt; {
nick &lt;nick-to-forward-to&gt;;
target &lt;nick-to-forward-to&gt;;
type &lt;type-of-alias&gt;;
};</pre>
<p>(Hinweis: siehe auch <a href="#includedirective">hier</a> , welche Standard
Alias Dateien bei UnrealIRCd mitgeliefert werden.)</p>
<p>Mit dem &quot;alias block [standard alias]&quot; kann festgelegt werden, daß
<p>Mit dem &quot;alias block [standard alias]&quot; kann festgelegt werden, dass
ein Befehl an einen User geleitet wird. So wird z.B. durch /chanserv eine
Nachricht an den &quot;User&quot; chanserv weitergeleitet. <b> alias::</b> legt
den Namen des Befehls fest, der das Alias wird, z.B. 'chanserv'. <b>alias::nick</b> ist
den Namen des Befehls fest, der das Alias wird, z.B. 'chanserv'. <b>alias::target</b> ist
der Nickname, an den weitergeleitet wird. Wenn &quot;alias::&quot; identisch mit
dem Nick ist, an den weitergeleitet wird, kann &quot;alias::nick&quot;
dem Nick ist, an den weitergeleitet wird, kann &quot;alias::target&quot;
weggelassen werden. <b> alias::type</b> gibt den Typ des Alias an, gültige
Typen sind hier &quot;services&quot; (der User ist auf dem Services Server),
&quot;stats&quot; (der User ist auf dem Stats Server), und &quot;normal&quot; (der
@@ -2429,7 +2520,7 @@ auch einen weiteren Zweck, der nachfolgend erkl
<p>Syntax [Befehl alias]:
<pre>alias &lt;name&gt; {
format &lt;regex-expression&gt; {
nick &lt;nick-to-forward-to&gt;;
target &lt;nick-to-forward-to&gt;;
type &lt;type-of-alias&gt;;
parameters &lt;parameter-string&gt;;
};
@@ -2445,7 +2536,7 @@ erstellen. <b> alias::</b>
einen regulären Ausdruck fest, der mit dem Text verglichen wird, der als Alias
Befehl gesandt wurde. Es können mehrere &quot;alias::format&quot; angegeben
werden, um unterschiedliche Dinge in Abhängigkeit vom gesandten Text
durchführen zu lassen. <b> alias::format::nick</b> ist der Nickname, an den der
durchführen zu lassen. <b>alias::format::target</b> ist das Ziel (der Name), an den der
Alias weitergeleitet wird. <b> alias::format::type</b> definiert den Typ des
Alias, zu dem die Nachricht geleitet wird. <b> alias::format::parameters</b>
ist, was als Parameter an den Alias geschickt wird. Um Parameter für einen
@@ -2453,32 +2544,10 @@ Befehl an den Alias anzugeben, wird ein &quot;%&quot; gefolgt von einer Nummer
angegeben. So ist z.B. %1 der erste Parameter, %2 der zweite Parameter usw.&nbsp;
Man kann auch festlegen, dass ab einem Parameter alle bis zum Ende gelten
sollen, dann gibt man z.B. an:&nbsp; %1- (das Minuszeichen bedeutet: &quot;alle
weiteren&quot;)</p>
<p>Beispiele:</p><font SIZE="2">
<p><font face="Courier New">alias &quot;identify&quot; {<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Courier New"><font SIZE="2">format &quot;^#&quot; {<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Courier New"><font SIZE="2">nick &quot;chanserv&quot;;<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Courier New"><font SIZE="2">type services;<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Courier New"><font SIZE="2">parameters &quot;IDENTIFY %1-&quot;;<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Courier New"><font SIZE="2">};<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Courier New"><font SIZE="2">format &quot;^[^#]&quot; {<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font SIZE="2"><font face="Courier New">nick &quot;nickserv&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font face="Courier New">type
services;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font face="Courier New">parameters
&quot;IDENTIFY %1-&quot;;<br>
</font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font SIZE="2"><font face="Courier New">};<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type command;<br>
};</font></p>
</font>
weiteren&quot;) Zusätzlich kann man %n angeben, was durch den Nicknamen des
Users ersetzt wird, der den befehl ausgeführt hat. Um Beispiele zum Alias Block
zu sehen, schaue man in doc/example.conf.</p>
<p>&nbsp;</p>
</div>
<p><font class="block_section"><a name="helpblock">4.33 - </a> </font><a name="helpblock"><font class="block_name">Help Block</font>
</a>
@@ -2539,10 +2608,9 @@ Syntax:<br>
};<br>
</font><br>
<b>regex</b> ist der Ausdruck, auf den geprüft wird.<br>
<b>target</b> gibt die Art der Nachrichten an.&nbsp; Möglich ist hier: channel,
private, private-notice, channel-notice, part, quit, dcc.<br>
<b>target</b> gibt die Ziele an. Eine Liste möglicher Ausdrücke (z.B.: 'channel') kann <a href="#feature_spamfilter">hier</a> nachgelesen werden..<br>
<b>action</b> gibt die Aktion an, die erfolgen soll. Eine Liste möglicher
Aktionen kann <a href="#feature_spamfilter">hier</a> nachgelesen werden.<br>
Aktionen (z.B.: 'gline') kann <a href="#feature_spamfilter">hier</a> nachgelesen werden.<br>
<b>reason</b> ist optional und legt den Grund für die Aktion fest, der dem User
angezeigt wird. Der Text ist in Anführungszeichen anzugeben und sollte - anders
als beim /spamfilter Befehl - keinerlei Undersores &quot;_&quot; zwischen den
@@ -2784,18 +2852,22 @@ Legt die ersten Zeichen eines verdeckten Hosts (+x) fest.
man hier 3 oder 4 Buchstaben, die den Netzwerksnamen bezeichnen.</p>
<p><font class="set">set::hosts::local &lt;locop-host-name&gt;;</font><br>
Legt den Hostnamen fest, der lokalen Operatoren zugewiesen wird, wenn sie +x
setzen.</p>
setzen. Optional kann für diesen Wert ein username@host angegeben werden.</p>
<p><font class="set">set::hosts::global &lt;globop-host-name&gt;;</font><br>
Legt den Hostnamen fest, der globalen Operatoren zugewiesen wird, wenn sie +x
setzen.</p>
setzen.Optional kann für diesen Wert ein username@host angegeben werden.</p>
<p><font class="set">set::hosts::coadmin &lt;coadmin-host-name&gt;;</font><br>
Legt den Hostnamen fest, der co-admins zugewiesen wird, wenn sie +x setzen.</p>
Legt den Hostnamen fest, der co-admins zugewiesen wird, wenn sie +x setzen.Optional
kann für diesen Wert ein username@host angegeben werden.</p>
<p><font class="set">set::hosts::admin &lt;admin-host-name&gt;;</font><br>
Legt den Hostnamen fest, der Admins zugewiesen wird, wenn sie +x setzen.</p>
Legt den Hostnamen fest, der Admins zugewiesen wird, wenn sie +x setzen.Optional
kann für diesen Wert ein username@host angegeben werden.</p>
<p><font class="set">set::hosts::servicesadmin &lt;servicesadmin-host-name&gt;;</font><br>
Legt den Hostnamen fest, der Service-Admins zugewiesen wird, wenn sie +x setzen.</p>
Legt den Hostnamen fest, der Service-Admins zugewiesen wird, wenn sie +x setzen.Optional
kann für diesen Wert ein username@host angegeben werden.</p>
<p><font class="set">set::hosts::netadmin &lt;netadmin-host-name&gt;;</font><br>
Legt den Hostnamen fest, der Netadmins zugewiesen wird, wenn sie +x setzen.</p>
Legt den Hostnamen fest, der Netadmins zugewiesen wird, wenn sie +x setzen.Optional
kann für diesen Wert ein username@host angegeben werden.</p>
<p><font class="set">set::hosts::host-on-oper-up &lt;yes/no&gt;;</font><br>
Falls auf 'yes' eingestellt, wird das H/get_host Flag akzeptiert und&nbsp; +x
wird automatisch bei /oper gesetzt.. Falls 'no', muss sich der User manuell +x
+2978 -2928
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+73 -32
View File
@@ -21,12 +21,14 @@
<body>
English | <a href="unreal32docs.de.html">German</a> |
<a href="unreal32docs.es.html">Spanish</a> |
<a href="unreal32docs.hu.html">Hungarian</a><br><br>
<a href="unreal32docs.hu.html">Hungarian</a> |
<a href="unreal32docs.fr.html">French</a>
<br><br>
<div align="center"><b><font size="7">UnrealIRCd</font></b><br>
<font size="4"><a href="http://www.unrealircd.com">http://www.unrealircd.com</a></font><br>
<font size="4">Version: 3.2.1</font><br>
<b>Current Version:</b> 3.2.1<br>
<b>Last doc update:</b> 2004-07-03</div>
<font size="4">Version: 3.2.2</font><br>
<b>Current Version:</b> 3.2.2<br>
<b>Last doc update:</b> 2004-10-11</div>
<br>
<b>Head Coders:</b> Stskeeps / codemastr / Syzop / Luke<br>
<b>Contributors:</b> McSkaf / Zogg / NiQuiL / assyrian / chasm / DrBin / llthangel / Griever / nighthawk<br>
@@ -164,7 +166,7 @@ Windows:<br>
<p><font size="+2"><b>2.0 - Installation</b></font><a name="installation" id="installation"></a><br><div class="desc">
<br>
<b>Tested & Supported Operating Systems:</b><br>
<b>Tested &amp; Supported Operating Systems:</b><br>
<ul>
<li><b>*NIX versions:</b>
<ul>
@@ -192,8 +194,8 @@ Windows:<br>
<p><b>Installation Instructions</b><br>
Linux:<br>
<ol>
<li>gunzip -d Unreal3.2.tar.gz
<li>tar xvf Unreal3.2.tar
<li>gunzip -d Unreal3.2.2.tar.gz
<li>tar xvf Unreal3.2.2.tar
<li>cd Unreal3.2
<li>./Config
<li>Answer these questions to the best of your knowledge. Generally if your not
@@ -262,6 +264,7 @@ Windows:<br>
q - deny nick (Q:line) rejection notices<br>
s - receives server notices [*]<br>
S - receives spamfilter notices<br>
o - receives oper-up notices<br>
[*: this snomask is also allowed to non-ircops]<br>
</p>
<p>You can control which snomasks you automatically get (set::snomask-on-connect) and which you get
@@ -302,7 +305,7 @@ Windows:<br>
that understands the SSL protocol.</p>
<p>Clients that support SSL: <A HREF="http://www.xchat.org/" TARGET="_blank">XChat</a>,
<A HREF="http://www.irssi.org/" TARGET="_blank">irssi</a>,
<A HREF="http://www.irssi.org/" TARGET="_blank">mIRC</a> (6.14 and up,
<A HREF="http://www.mirc.com/" TARGET="_blank">mIRC</a> (6.14 and up,
also requires some <a href="http://www.mirc.co.uk/ssl.html" target="_blank">additional steps</a>)</p>
<p>For clients which do not support SSL you can use a tunnel like
<A HREF="http://www.stunnel.org/" TARGET="_blank">stunnel</A>, here's a stunnel.conf example (for stunnel 4.x):<br>
@@ -466,8 +469,19 @@ Modules can also add other extended ban types.<br>
<p>Spamfilters are added via the /spamfilter command which uses the following syntax:<br>
<b>/spamfilter [add|del|remove|+|-] [type] [action] [tkltime] [reason] [regex]</b><br>
<table border=0>
<tr valign="top"><td><b>[type]</b></td><td> specifies the target type, you can specify multiple targets:
'c' channel msg, 'p' private msg, 'n' private notice, 'N' channel notice, 'P' part msg, 'q' quit msg, 'd' dcc</td></tr>
<tr valign="top"><td><b>[type]</b></td><td> specifies the target type:<br>
<table>
<tr><td><b>Char:</b></td><td><b>Config item:</b></td><td><b>Description:</b></td></tr>
<tr><td>c</td><td>channel</td><td>Channel message</td></tr>
<tr><td>p</td><td>private</td><td>Private message (from user-&gt;user)</td></tr>
<tr><td>n</td><td>private-notice</td><td>Private notice</td></tr>
<tr><td>N</td><td>channel-notice</td><td>Channel notice</td></tr>
<tr><td>P</td><td>part</td><td>Part reason</td></tr>
<tr><td>q</td><td>quit</td><td>Quit reason</td></tr>
<tr><td>d</td><td>dcc</td><td>DCC filename</td></tr>
<tr><td>u</td><td>user</td><td>User ban, will be matched against nick!user@host:realname</td></tr>
</table>
You can specify multiple targets, like: cpNn</td></tr>
<tr valign="top"><td><b>[action]</b></td><td> specifies the action to be taken (only 1 action can be specified)<br>
<table>
<tr><td>kill</td><td>kills the user</td></tr>
@@ -479,7 +493,7 @@ Modules can also add other extended ban types.<br>
<tr><td>gzline</td><td>puts a gzline (global zline) on the host</td></tr>
<tr><td>block</td><td>block the message only</td></tr>
<tr><td>dccblock</td><td>mark the user so (s)he's unable to send any DCCs</td></tr>
<tr><td>viruschan</td><td>part all channels, join set::spamfilter::virus-help-channel, disables all commands
<tr valign="top"><td>viruschan</td><td>part all channels, join set::spamfilter::virus-help-channel, disables all commands
except PONG, ADMIN, and msg/notices to set::spamfilter::virus-help-channel</td></tr>
</table></tr></td>
<tr valign="top"><td><b>[tkltime]</b></td><td> The duration of the *line added by the filter, use '-' to use the default or to skip
@@ -505,7 +519,14 @@ into spaces at runtime. And double underscore ('__') gets an underscore ('_'). A
<p>You can also add spamfilters in the config file but these will be local spamfilters (not
network-wide, though you could use remote includes for this).
The syntax of these spamfilter { } blocks are explained <a href="#spamfilter">here</a><br>
</p>
Example:<br>
<pre>spamfilter {
regex "//write \$decode\(.+\|.+load -rs";
target { private; channel; };
reason "Generic $decode exploit";
action block;
};</pre></p>
<p><b>set::spamfilter::ban-time</b> allows you to modify the default ban time for *lines added by spamfilter (default: 1 day)<br>
<b>set::spamfilter::ban-reason</b> allows you to specify a default reason for the *lines (default: 'Spam/advertising')<br>
<b>set::spamfilter::virus-help-channel</b> allows you to specify the channel to join for action 'viruschan' (default: #help)<br>
@@ -805,6 +826,7 @@ listen *:6601 {
};
swhois &lt;whois info&gt;;
snomask &lt;snomask&gt;;
modes &lt;modes&gt;;
maxlogins &lt;num&gt;;
};
</pre></p>
@@ -1108,6 +1130,8 @@ listen *:6601 {
<p>The <b>oper::snomask</b> directive allows you to preset an oper's server notice mask
on oper up. For a list of available SNOMASKs, see <a href="#feature_snomasks">Section 3.3</a>
<font color=blue>[optional]</font></p>
<p>The <b>oper::modes</b> directive allows you to preset an oper's modes on oper up.
<font color=blue>[optional]</font></p>
<p>The <b>oper::maxlogins</b> allows you to restrict the number of concurrent oper logins from this host,
for example if you set it to 1 then only 1 person can be oper'ed via this block at any time.
<font color=blue>[optional]</font></p>
@@ -1460,6 +1484,11 @@ except ban {
except tkl {
mask &lt;hostmask&gt;;
type &lt;type&gt;;
type {
&lt;type&gt;;
&lt;type&gt;;
...
};
};</pre></p>
<p>The except tkl block allows you to specify a user@host that will override a
tkl ban placed on a broader host. This is useful when you want an ISP banned, but
@@ -1467,7 +1496,8 @@ except tkl {
specifies the user@host mask of the client who will be allowed to connect. The
except::type specifies which type of ban this should override. Valid types are
gline, gzline, qline, gqline, and shun, which make an exception from Glines,
Global Zlines, Qlines, Global Qlines, and shuns.</p>
Global Zlines, Qlines, Global Qlines, and shuns. If the type {} format is used,
multiple types may be specified.</p>
<p>Example:<br>
<pre>
except tkl {
@@ -1757,6 +1787,7 @@ link &lt;server-name&gt; {
leaf &lt;leaf-mask&gt;;
leafdepth &lt;depth&gt;;
class &lt;class-name&gt;;
ciphers &lt;ssl-ciphers&gt;;
options {
&lt;option&gt;;
&lt;option&gt;;
@@ -1816,6 +1847,10 @@ link &lt;server-name&gt; {
<p><b>compression-level</b> (optional)<br>
Specifies the compression level (1-9) for this link. Only used if link::options::zip is set.
</p>
<p><b>ciphers</b> (optional)<br>
Specifies the SSL ciphers to use for this link. To obtain a list of available ciphers, use
the `openssl ciphers` command. Ciphers should be specified as a : separated list.
</p>
<p><b>options block</b><br>
One or more options used for connecting to the server. Sometimes not needed.<br>
<table border="0">
@@ -1854,23 +1889,24 @@ link hub.mynet.com {
<p>Syntax [standard alias]:<br>
<pre>
alias &lt;name&gt; {
nick &lt;nick-to-forward-to&gt;;
target &lt;nick-to-forward-to&gt;;
type &lt;type-of-alias&gt;;
};</pre></p>
<p>(Note: also see <a href="#includedirective">here</a> about the standard alias files UnrealIRCd has)</p>
<p>The alias block [standard alias] allows you to forward a command to a user,
for example /chanserv sends a message to the user chanserv. The alias:: specifies
the name of the command that will be the alias (eg: chanserv), alias::nick is
the nickname it will forward to, if the alias:: is the same as the nick it will
forward to, alias::nick can be left out. The alias::type specifies the type
the name of the command that will be the alias (eg: chanserv), alias::target is
the nickname or channel it will forward to, if the alias:: is the same as the target, it will
forward to, alias::target can be left out. The alias::type specifies the type
of alias, valid types are services (the user is on the services server), stats
(the user is on the stats server), and normal (the user is a normal user on
any server). The alias block also has another purpose which is explained below.</p>
(the user is on the stats server), normal (the user is a normal user on
any server), and channel (the target is a channel name). The alias block also has another
purpose which is explained below.</p>
<p>Syntax [command alias]:<br>
<pre>
alias &lt;name&gt; {
format &lt;regex-expression&gt; {
nick &lt;nick-to-forward-to&gt;;
target &lt;nick-to-forward-to&gt;;
type &lt;type-of-alias&gt;;
parameters &lt;parameter-string&gt;;
};
@@ -1885,15 +1921,16 @@ alias &lt;name&gt; {
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::nick is the nickname to forward this
the text sent to it. The alias::format::target is the target 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
do % followed by the number and a -, for example %2- returns all parameters
from the second till the last. For examples of using the alias block in the
command format, consult doc/example.conf.</p>
from the second till the last. Additionally, you may specify %n which will be replaced
by the nickname of the user who executed the command. For examples of using the alias
block in the command format, consult doc/example.conf.</p>
<p></p></div>
<p><font class="block_section">4.33 - </font><font class="block_name">Help Block</font>
<font class="block_optional">OPTIONAL</font><a name="helpblock"></a>
@@ -1951,9 +1988,8 @@ spamfilter {
ban-time &lt;time&gt;;
};</pre></p>
<p><b>regex</b> is the regex to be matched.<br>
<b>target</b> specifies the targets, possible targets are: channel, private, private-notice, channel-notice,
part, quit, dcc.<br>
<b>action</b> specifies the action to be taken, see <a href="#feature_spamfilter">here</a> for a list of possible actions.<br>
<b>target</b> specifies the targets, see <a href="#feature_spamfilter">here</a> for a list of possible types (eg: 'channel').<br>
<b>action</b> specifies the action to be taken, see <a href="#feature_spamfilter">here</a> for a list of possible actions (eg: 'gline').<br>
<b>reason</b> optional: specifies the ban or block reason, else the default is used.<br>
<b>ban-time</b> optional: specifies the duration of a *line ban, else the default is used (1 day).<br>
</p>
@@ -2160,18 +2196,23 @@ set {
Defines the prefix that will be used on hiddenhosts (+x). This is usually three
or four letters representing the network name.</p>
<p><font class="set">set::hosts::local &lt;locop-host-name&gt;;</font><br>
Defines the hostname that will be assigned to local opers when they set +x.</p>
Defines the hostname that will be assigned to local opers when they set +x. You may
optionally specify a username@host for this value.</p>
<p><font class="set">set::hosts::global &lt;globop-host-name&gt;;</font><br>
Defines the hostname that will be assigned to global operators when they set
+x.</p>
+x. You may optionally specify a username@host for this value.</p>
<p><font class="set">set::hosts::coadmin &lt;coadmin-host-name&gt;;</font><br>
Sets the hostname that will be assigned to co-admins when they set +x.</p>
Sets the hostname that will be assigned to co-admins when they set +x. You may
optionally specify a username@host for this value.</p>
<p><font class="set">set::hosts::admin &lt;admin-host-name&gt;;</font><br>
Defines the hostname that will be set for admins when they set +x.</p>
Defines the hostname that will be set for admins when they set +x. You may
optionally specify a username@host for this value.</p>
<p><font class="set">set::hosts::servicesadmin &lt;servicesadmin-host-name&gt;;</font><br>
Sets the hostname that will be given to services-admins when they set +x.</p>
Sets the hostname that will be given to services-admins when they set +x. You may
optionally specify a username@host for this value.</p>
<p><font class="set">set::hosts::netadmin &lt;netadmin-host-name&gt;;</font><br>
Sets the hostname that will be given to netadmins when they set +x.</p>
Sets the hostname that will be given to netadmins when they set +x. You may
optionally specify a username@host for this value.</p>
<p><font class="set">set::hosts::host-on-oper-up &lt;yes/no&gt;;</font><br>
If set to yes, the H/get_host flag will be honored and +x will be automatically
set at /oper. If set to no, the user must set +x manually to receive the oper
+245 -202
View File
File diff suppressed because it is too large Load Diff
+7 -30
View File
@@ -35,12 +35,7 @@ DLLFUNC int h_defizzer_connect(aClient *sptr);
static Hook *LocConnect = NULL;
ModuleInfo DefizzerModInfo;
#ifndef DYNAMIC_LINKING
ModuleHeader defizzer_Header
#else
#define defizzer_Header Mod_Header
ModuleHeader Mod_Header
#endif
ModuleHeader MOD_HEADER(defizzer)
= {
"defizzer", /* Name of module */
"$Id$", /* Version */
@@ -49,43 +44,25 @@ ModuleHeader Mod_Header
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 defizzer_Init(ModuleInfo *modinfo)
#endif
DLLFUNC int MOD_INIT(defizzer)(ModuleInfo *modinfo)
{
bcopy(modinfo,&DefizzerModInfo,modinfo->size);
LocConnect = HookAddEx(DefizzerModInfo.handle, HOOKTYPE_PRE_LOCAL_CONNECT, h_defizzer_connect);
return MOD_SUCCESS;
}
/* Is first run when server is 100% ready */
#ifdef DYNAMIC_LINKING
DLLFUNC int Mod_Load(int module_load)
#else
int defizzer_Load(int module_load)
#endif
DLLFUNC int MOD_LOAD(defizzer)(int module_load)
{
return MOD_SUCCESS;
}
/* Called when module is unloaded */
#ifdef DYNAMIC_LINKING
DLLFUNC int Mod_Unload(int module_unload)
#else
int defizzer_Unload(int module_unload)
#endif
DLLFUNC int MOD_UNLOAD(defizzer)(int module_unload)
{
HookDel(LocConnect);
return MOD_SUCCESS;
}
static void ban_fizzer(aClient *cptr)
{
int i;
@@ -148,4 +125,4 @@ DLLFUNC int h_defizzer_connect(aClient *sptr)
return exit_client(sptr, sptr, &me, "Fizzer client");
}
return 0;
}
}
BIN
View File
Binary file not shown.
+62 -17
View File
@@ -37,7 +37,7 @@ help Usercmds {
" CYCLE LINKS NOTICE SILENCE WHO";
" DALINFO LIST PART STATS WHOIS";
" INVITE LUSERS PING TIME WHOWAS";
" ISON MAP PONG TOPIC";
" ISON MAP PONG TOPIC USERIP";
" JOIN MODE PRIVMSG USERHOST";
" ==-----------------oOo-----------------==";
};
@@ -130,7 +130,9 @@ help Snomasks {
" k = View KILL notices";
" n = View nick changes on local server";
" N = View nick changes on remote servers";
" o = View oper-up notices";
" q = View rejected nick changes due to Q:lines";
" s = View general notices";
" S = View spamfilter matches";
" v = View usage of /VHOST command";
" ==-------------------------oOo------------------------==";
@@ -164,7 +166,7 @@ help Chmodes {
" A = Server/Net Admin only channel (settable by Admins)";
" C = No CTCPs allowed in the channel [o]";
" G = Filters out all Bad words in messages with <censored> [o]";
" M = Must be using a registered nick (+r) to talk [o]";
" M = Must be using a registered nick (+r), or have voice access to talk [o]";
" K = /KNOCK is not allowed [o]";
" L <chan2> = Channel link (If +l is full, the next user will auto-join <chan2>) [q]";
" N = No Nickname changes are permitted in the channel [o]";
@@ -232,31 +234,60 @@ help Whois {
" -";
" Syntax: WHOIS <user>";
" Example: WHOIS hAtbLaDe";
" -";
" Status flags:";
" The list of channels shown in the WHOIS reply can include one or more";
" status flags to indicate information about the channel. These flags are";
" described below:";
" ~ - User is a Channel Owner (+q)";
" & - User is a Channel Admin (+a)";
" @ - User is a Channel Operator (+o)";
" % - User is a Halfop (+h)";
" + - User is Voiced (+v)";
" ! - User has channels hidden in whois (+p) and you are an IRC Operator";
" ? - The channel is secret (+s) and you are an IRC Operator";
};
help Who {
" Retrieves information about users";
" -";
" Syntax:";
" /WHO [+|-][acghmnsuCM] [args]";
" /WHO [+|-][acghimnsuMRI] [args]";
" Flags are specified like channel modes, the flags cgmnsu all have arguments";
" Flags are set to a positive check by +, a negative check by -";
" The flags available:";
" Flag a: user is away";
" Flag c <channel>: user is on <channel>, no wildcards accepted";
" Flag g <gcos/realname>: user has string <gcos> in their GCOS,";
" Flag g <gcos/realname>: user has string <gcos> in his/her GCOS,";
" wildcards accepted, oper only";
" Flag h <host>: user has string <host> in their hostname, wildcards are accepted";
" Flag m <usermodes>: user has <usermodes> set on them, only o/A/a for nonopers";
" Flag n <nick>: user has string <nick> in their nickname, wildcards accepted";
" Flag h <host>: user has string <host> in his/her hostname, wildcards are accepted";
" Flag i <ip>: user has string <ip> in his/her IP address";
" Flag m <usermodes>: user has <usermodes> set, only o/C/A/a/N for nonopers";
" Flag n <nick>: user has string <nick> in his/her nickname, wildcards accepted";
" Flag s <server>: user is on server <server>, wildcards not accepted";
" Flag u <user>: user has string <user> in their username, wildcards accepted";
" Flag u <user>: user has string <user> in his/her username, wildcards accepted";
" Behavior flags:";
" Flag C: show first visible channel user is in";
" Flag M: check for user in channels I am a member of";
" Flag R: show users' real hostnames";
" Flag I: show users' IP addresses";
" -";
" For backwards compatibility, /who 0 o still shows +o users";
" Example: WHO +m o";
" -";
" Status flags:";
" The who command shows several flags in the returned result to indicate";
" different information about the user. These flags are explained below:";
" G - User is /away (gone)";
" H - User is not /away (here)";
" r - User is using a registered nickname";
" * - User is an IRC Operator";
" ~ - User is a Channel Owner (+q)";
" & - User is a Channel Admin (+a)";
" @ - User is a Channel Operator (+o)";
" % - User is a Halfop (+h)";
" + - User is Voiced (+v)";
" ! - User is +H and you are an IRC Operator";
" ? - User is only visible because you are an IRC Operator";
};
help Whowas {
@@ -427,6 +458,14 @@ help Userhost {
" Example: USERHOST hAtbLaDe";
};
help Userip {
" Returns the userip of the user in question.";
" Usually used by scripts or bots.";
" -";
" Syntax: USERIP <nickname>";
" Example: USERIP codemastr";
};
help Topic {
" Sets/Changes the topic of the channel in question,";
" or just display the current Topic.";
@@ -907,9 +946,10 @@ help Sapart {
" Forces a user to part a channel.";
" Services Admin Command";
" -";
" Syntax: SAPART <nick> <channel>,[<channel2>..]";
" Syntax: SAPART <nick> <channel>,[<channel2>..] [<comment>]";
" Example: SAPART hAtbLaDe #OperHelp";
" SAPART hAtbLaDe #Support,#IRCHelp";
" SAPART hAtbLaDe #Support,#IRCHelp Go away";
};
help Samode {
@@ -955,13 +995,16 @@ help Sdesc {
};
help Mkpasswd {
" This command will Encrypt the string it has been given";
" So you can add it directly to the unrealircd.conf if you use";
" Encrypted passwords. Type can be crypt, sha1, or md5. Sha1";
" and md5 are only available when compiled with SSL support.";
" This command will return a 'hash' of the string that has been specified,"
" you can use this hash for any encrypted passwords in your configuration file:";
" eg: for oper::password, vhost::password, etc.";
" Available types (in order of 'secureness'):";
" *NIX: crypt, md5, sha1 [*], ripemd160 [*]";
" Windows: crypt [*], md5, sha1, ripemd160 [*]";
" [*: only available if compiled with SSL support]";
" -";
" Syntax: MKPASSWD <method> <password>";
" Example: MKPASSWD crypt mpsare";
" Example: MKPASSWD md5 IamTeh1337";
};
help Module {
@@ -1066,9 +1109,10 @@ help Svspart {
" Forces a user to leave a channel.";
" Must be sent through an U:Lined server.";
" -";
" Syntax: SVSPART <nick> <channel>[,<channel2>..]";
" Syntax: SVSPART <nick> <channel>[,<channel2>..] [<comment>]";
" Example: SVSPART hAtbLaDe #Hanson";
" SVSPART hAtbLaDe #Hanson,#AOL";
" SVSPART hAtbLaDe #Hanson,#AOL You must leave";
};
help Svso {
@@ -1195,7 +1239,8 @@ help Spamfilter {
" Use: /spamfilter [add|del|remove|+|-] [type] [action] [tkltime] [reason] [regex]";
" [type] specifies the target type, you can specify multiple targets:";
" 'c' channel msg, 'p' private msg, 'n' private notice,";
" 'N' channel notice, 'P' part msg, 'q' quit msg, 'd' dcc";
" 'N' channel notice, 'P' part msg, 'q' quit msg, 'd' dcc,";
" 'a' away, 'u' user (nick!user@host:realname ban)";
" [action] specifies the action to be taken (only 1 action can be specified):";
" 'kill', 'tempshun' (only shun current session), 'shun',";
" 'kline', 'gline', 'zline', 'gzline', 'block' (blocks the msg),";
+2 -5
View File
@@ -31,8 +31,9 @@ typedef struct {
#define AUTHTYPE_SSL_CLIENTCERT 4
#define AUTHTYPE_RIPEMD160 5
#ifdef USE_SSL
/* md5 is always available and enabled as of Unreal3.2.1 */
#define AUTHENABLE_MD5
#ifdef USE_SSL
#define AUTHENABLE_SHA1
#define AUTHENABLE_SSL_CLIENTCERT
#define AUTHENABLE_RIPEMD160
@@ -47,11 +48,7 @@ typedef struct {
#endif
#endif
#ifdef _WIN32
#ifndef AUTHENABLE_MD5
#define AUTHENABLE_MD5
#endif
#ifndef AUTHENABLE_SHA1
#define AUTHENABLE_SHA1
#endif
+9 -57
View File
@@ -150,8 +150,9 @@ extern char *strtoken(char **, char *, char *);
extern MODVAR u_char tolowertab[], touppertab[];
#if defined(CHINESE_NICK) || defined(JAPANESE_NICK)
#if defined(NICK_GB2312) || defined(NICK_GBK) || defined(NICK_GBK_JAP)
#define USE_LOCALE
#include <ctype.h>
#endif
#ifndef USE_LOCALE
@@ -248,67 +249,18 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
#define EXPAR4 ""
#endif /* EXTCMODE */
#define PROTOCTL_CLIENT_1 \
"MAP" \
" KNOCK" \
" SAFELIST" \
" HCN" \
" MAXCHANNELS=%i" \
" MAXBANS=%i" \
" NICKLEN=%i" \
" TOPICLEN=%i" \
" KICKLEN=%i" \
" MAXTARGETS=%i" \
" AWAYLEN=%i" \
" :are supported by this server"
#define PROTOCTL_PARAMETERS_1 \
MAXCHANNELSPERUSER, \
MAXBANS, \
NICKLEN, \
TOPICLEN, \
TOPICLEN, \
MAXTARGETS, \
TOPICLEN
#ifdef PREFIX_AQ
#define CHPFIX "(qaohv)~&@%+"
#define CHPAR1 "be"
#define CHPFIX "(qaohv)~&@%+"
#define CHPAR1 "be"
#else
#define CHPFIX "(ohv)@%+"
#define CHPAR1 "beqa"
#define CHPFIX "(ohv)@%+"
#define CHPAR1 "beqa"
#endif /* PREFIX_AQ */
#define CHPAR2 "kfL"
#define CHPAR3 "l"
#define CHPAR4 "psmntirRcOAQKVGCuzNSM"
#define CHPAR2 "kfL"
#define CHPAR3 "l"
#define CHPAR4 "psmntirRcOAQKVGCuzNSM"
#define PROTOCTL_CLIENT_2 \
"WALLCHOPS" \
" WATCH=%i" \
" SILENCE=%i" \
" MODES=%i" \
" CHANTYPES=%s" \
" PREFIX=%s" \
" CHANMODES=%s%s,%s%s,%s%s,%s%s" \
" NETWORK=%s" \
" CASEMAPPING=%s" \
" EXTBAN=~,%s" \
" ELIST=MNUCT" \
" :are supported by this server"
#define PROTOCTL_PARAMETERS_2 \
MAXWATCH, \
SILENCE_LIMIT, \
MAXMODEPARAMS, \
"#", \
CHPFIX, \
CHPAR1, EXPAR1, \
CHPAR2, EXPAR2, \
CHPAR3, EXPAR3, \
"psmntirRcOAQKVGCuzNSM", EXPAR4, \
ircnet005, \
"ascii", \
extbanstr
/* Server-Server PROTOCTL -Stskeeps
* Please check send_proto() for more. -- Syzop
+8 -27
View File
@@ -92,14 +92,6 @@
*/
#undef SECURECHANMSGSONLYGOTOSECURE
/*
* be compatible with older cloak keys? If you link to servers beta4 and
* earlier without this the cloak keys will produce diff results
* Not recommended, however, as beta4 and earlier 3.2 has an insecure
* cloak algo -griever
*/
#undef COMPAT_BETA4_KEYS
/*
If you want SHUN_NOTICES, define this
*/
@@ -108,8 +100,9 @@
/*
If you want to support chinese and/or japanese nicks
*/
#undef CHINESE_NICK
#undef JAPANESE_NICK
#undef NICK_GB2312
#undef NICK_GBK
#undef NICK_GBK_JAP
/*
Remote rehash
@@ -377,25 +370,13 @@
#define PORTNUM 6667 /* 6667 is default */
/*
* Maximum number of network connections your server will allow. This should
* never exceed max. number of open file descrpitors and wont increase this.
* Should remain LOW as possible. Most sites will usually have under 30 or so
* connections. A busy hub or server may need this to be as high as 50 or 60.
* Making it over 100 decreases any performance boost gained from it being low.
* if you have a lot of server connections, it may be worth splitting the load
* over 2 or more servers.
* 1 server = 1 connection, 1 user = 1 connection.
* This should be at *least* 3: 1 listen port, 1 dns port + 1 client
*
* Note: this figure will be too high for most systems. If you get an
* fd-related error on compile, change this to 256.
*
* Windows users: This should be a fairly high number. Some operations
* will slow down because of this, but it is _required_ because of the way
* windows NT(and possibly 95) allocate fd handles. A good number is 16384.
* Maximum number of network connections your server will allow.
* This is usually configured via ./Config on *NIX,
* the setting mentioned below is the default for Windows.
* 2004-10-13: 1024 -> 4096
*/
#ifndef MAXCONNECTIONS
#define MAXCONNECTIONS 1024
#define MAXCONNECTIONS 4096
#endif
/*
+5
View File
@@ -457,6 +457,7 @@ extern MODVAR long SNO_FNICKCHANGE;
extern MODVAR long SNO_QLINE;
extern MODVAR long SNO_SNOTICE;
extern MODVAR long SNO_SPAMF;
extern MODVAR long SNO_OPER;
#ifdef EXTCMODE
/* Extended chanmodes... */
@@ -703,3 +704,7 @@ extern int add_dccallow(aClient *sptr, aClient *optr);
extern int del_dccallow(aClient *sptr, aClient *optr);
extern void delete_linkblock(ConfigItem_link *link_ptr);
extern void delete_classblock(ConfigItem_class *class_ptr);
extern void del_async_connects(void);
extern int find_spamfilter_user(aClient *sptr);
extern void make_extbanstr(void);
extern void isupport_init(void);
+23
View File
@@ -0,0 +1,23 @@
/************************************************************************
* Unreal Internet Relay Chat Daemon, include/macros.h
* Copyright (c) 2004 Dominick Meglio & The UnrealIRCd Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
/* Calculate the size of an array */
#define ARRAY_SIZEOF(x) (sizeof((x))/sizeof((x)[0]))
+17
View File
@@ -99,6 +99,7 @@ typedef struct {
#define MOBJ_CMDOVERRIDE 0x0080
#define MOBJ_EXTBAN 0x0100
#define MOBJ_CALLBACK 0x0200
#define MOBJ_ISUPPORT 0x0400
typedef struct {
long mode;
@@ -294,6 +295,13 @@ typedef struct _versionflag {
ModuleChild *parents;
} Versionflag;
typedef struct _isupport {
struct _isupport *prev, *next;
char *token;
char *value;
Module *owner;
} Isupport;
typedef struct _ModuleObject {
struct _ModuleObject *prev, *next;
short type;
@@ -308,6 +316,7 @@ typedef struct _ModuleObject {
Cmdoverride *cmdoverride;
Extban *extban;
Callback *callback;
Isupport *isupport;
} object;
} ModuleObject;
@@ -461,6 +470,11 @@ void *obsd_dlsym(void *handle, char *symbol);
Versionflag *VersionflagAdd(Module *module, char flag);
void VersionflagDel(Versionflag *vflag, Module *module);
Isupport *IsupportAdd(Module *module, const char *token, const char *value);
void IsupportSetValue(Isupport *isupport, const char *value);
void IsupportDel(Isupport *isupport);
Isupport *IsupportFind(const char *token);
#define add_Hook(hooktype, func) HookAddMain(NULL, hooktype, func, NULL, NULL)
#define HookAdd(hooktype, func) HookAddMain(NULL, hooktype, func, NULL, NULL)
#define HookAddEx(module, hooktype, func) HookAddMain(module, hooktype, func, NULL, NULL)
@@ -569,6 +583,9 @@ int CallCmdoverride(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, ch
#define HOOKTYPE_TKL_DEL 40
#define HOOKTYPE_LOCAL_KILL 41
#define HOOKTYPE_LOG 42
#define HOOKTYPE_REMOTE_JOIN 43
#define HOOKTYPE_REMOTE_PART 44
#define HOOKTYPE_REMOTE_KICK 45
/* Hook return values */
#define HOOK_CONTINUE 0
-1
View File
@@ -239,7 +239,6 @@
#define MSG_TSCTL "TSCTL"
#define TOK_TSCTL "AW"
#define MSG_SVSJOIN "SVSJOIN"
#define TOK_SVSJOIN "BR"
#define MSG_SAJOIN "SAJOIN"
#define TOK_SAJOIN "AX"
#define MSG_SVSPART "SVSPART"
+3 -2
View File
@@ -33,11 +33,11 @@
#define RPL_YOURHOST 002
#define RPL_CREATED 003
#define RPL_MYINFO 004
#define RPL_PROTOCTL 005
#define RPL_ISUPPORT 005
#define RPL_REDIR 10
#define RPL_REMOTEPROTOCTL 105
#define RPL_REMOTEISUPPORT 105
/*
* Errors are in the range from 400-599 currently and are grouped by what
@@ -184,6 +184,7 @@
#define RPL_LISTSYNTAX 334
#define RPL_WHOISBOT 335
#define RPL_USERIP 340
#define RPL_INVITING 341
#define RPL_SUMMONING 342
+19 -9
View File
@@ -263,6 +263,8 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define SetClient(x) ((x)->status = STAT_CLIENT)
#define SetLog(x) ((x)->status = STAT_LOG)
#define IsSynched(x) (x->serv->flags.synced)
/* opt.. */
#define OPT_SJOIN 0x0001
#define OPT_NOT_SJOIN 0x0002
@@ -327,7 +329,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
* -DuffJ
*/
#define SNO_DEFOPER "+kscfvGq"
#define SNO_DEFOPER "+kscfvGqo"
#define SNO_DEFUSER "+ks"
#define SEND_UMODES (SendUmodes)
@@ -684,7 +686,9 @@ struct MotdItem {
struct aloopStruct {
unsigned do_garbage_collect : 1;
unsigned ircd_booted : 1;
unsigned do_bancheck : 1;
unsigned do_bancheck : 1; /* perform *line bancheck? */
unsigned do_bancheck_spamf_user : 1; /* perform 'user' spamfilter bancheck */
unsigned do_bancheck_spamf_away : 1; /* perform 'away' spamfilter bancheck */
unsigned ircd_rehashing : 1;
unsigned tainted : 1;
aClient *rehash_save_cptr, *rehash_save_sptr;
@@ -768,6 +772,7 @@ struct Server {
#define M_ALIAS 0x0020
#define M_RESETIDLE 0x0040
#define M_VIRUS 0x0080
#define M_ANNOUNCE 0x0100
/* tkl:
@@ -791,6 +796,8 @@ struct Server {
#define SPAMF_PART 0x0010 /* P */
#define SPAMF_QUIT 0x0020 /* q */
#define SPAMF_DCC 0x0040 /* d */
#define SPAMF_USER 0x0080 /* u */
#define SPAMF_AWAY 0x0100 /* a */
struct _spamfilter {
unsigned short action; /* see BAN_ACT* */
@@ -921,11 +928,13 @@ struct Client {
long receiveM; /* Statistics: protocol messages received */
#ifdef ZIP_LINKS
struct Zdata *zip; /* zip data */
#elif defined(_WIN32)
void *zip_NOTUSED; /* (win32 binary compatability) */
#endif
#ifdef USE_SSL
SSL *ssl;
#elif defined(_WIN32)
void *ssl_NOTUSED;
void *ssl_NOTUSED; /* (win32 binary compatability) */
#endif
#ifndef NO_FDLIST
long lastrecvM; /* to check for activity --Mika */
@@ -1091,6 +1100,7 @@ struct _configitem_oper {
anAuthStruct *auth;
ConfigItem_class *class;
ConfigItem *from;
unsigned long modes;
long oflags;
int maxlogins;
};
@@ -1260,24 +1270,24 @@ struct _configitem_unknown_ext {
ConfigEntry *ce_entries;
};
#define ALIAS_SERVICES 1
#define ALIAS_STATS 2
#define ALIAS_NORMAL 3
#define ALIAS_COMMAND 4
typedef enum {
ALIAS_SERVICES=1, ALIAS_STATS, ALIAS_NORMAL, ALIAS_COMMAND, ALIAS_CHANNEL
} AliasType;
struct _configitem_alias {
ConfigItem *prev, *next;
ConfigFlag flag;
ConfigItem_alias_format *format;
char *alias, *nick;
short type;
AliasType type;
};
struct _configitem_alias_format {
ConfigItem *prev, *next;
ConfigFlag flag;
char *nick;
short type;
AliasType type;
char *format, *parameters;
regex_t expr;
};
+3 -3
View File
@@ -24,12 +24,12 @@
/**/
#define COMPILEINFO DEBUGMODESET DEBUGSET
/*
* Version Unreal3.2.1
* Version Unreal3.2.2
*/
#define UnrealProtocol 2304
#define UnrealProtocol 2305
#define PATCH1 "3"
#define PATCH2 ".2"
#define PATCH3 ".1"
#define PATCH3 ".2"
#define PATCH4 ""
#define PATCH5 ""
#define PATCH6 ""
+72 -33
View File
@@ -51,6 +51,14 @@ extern "C" {
typedef int reg_errcode_t;
#endif /* !HAVE_REG_ERRCODE_T */
/* Extra regcomp() flags. */
#define REG_LITERAL 0x1000
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
/* Extra regexec() flags. */
#define REG_APPROX_MATCHER 0x1000
#define REG_BACKTRACKING_MATCHER (REG_APPROX_MATCHER << 1)
#else /* !TRE_USE_SYSTEM_REGEX_H */
/* If the we're not using system regex.h, we need to define the
@@ -59,7 +67,7 @@ typedef int reg_errcode_t;
typedef int regoff_t;
typedef struct {
size_t re_nsub; /* Number of parenthesized subexpressions. */
void *value; /* For internal use only. */
void *value; /* For internal use only. */
} regex_t;
typedef struct {
@@ -69,45 +77,50 @@ typedef struct {
typedef enum {
REG_OK = 0, /* No error. */
REG_OK = 0, /* No error. */
/* POSIX regcomp() return error codes. (In the order listed in the
standard.) */
REG_NOMATCH, /* No match. */
REG_BADPAT, /* Invalid regexp. */
REG_ECOLLATE, /* Unknown collating element. */
REG_ECTYPE, /* Unknown character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* "[]" imbalance */
REG_EPAREN, /* "\(\)" or "()" imbalance */
REG_EBRACE, /* "\{\}" or "{}" imbalance */
REG_BADBR, /* Invalid content of {} */
REG_ERANGE, /* Invalid use of range operator */
REG_ESPACE, /* Out of memory. */
standard.) */
REG_NOMATCH, /* No match. */
REG_BADPAT, /* Invalid regexp. */
REG_ECOLLATE, /* Unknown collating element. */
REG_ECTYPE, /* Unknown character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* "[]" imbalance */
REG_EPAREN, /* "\(\)" or "()" imbalance */
REG_EBRACE, /* "\{\}" or "{}" imbalance */
REG_BADBR, /* Invalid content of {} */
REG_ERANGE, /* Invalid use of range operator */
REG_ESPACE, /* Out of memory. */
REG_BADRPT
} reg_errcode_t;
/* POSIX regcomp() flags. */
#define REG_EXTENDED 1
#define REG_ICASE (REG_EXTENDED << 1)
#define REG_NEWLINE (REG_ICASE << 1)
#define REG_NOSUB (REG_NEWLINE << 1)
#define REG_EXTENDED 1
#define REG_ICASE (REG_EXTENDED << 1)
#define REG_NEWLINE (REG_ICASE << 1)
#define REG_NOSUB (REG_NEWLINE << 1)
/* Extra regcomp() flags. */
#define REG_BASIC 0
#define REG_LITERAL (REG_NOSUB << 1)
#define REG_BASIC 0
#define REG_LITERAL (REG_NOSUB << 1)
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
/* POSIX regexec() flags. */
#define REG_NOTBOL 1
#define REG_NOTEOL (REG_NOTBOL << 1)
/* Extra regexec() flags. */
#define REG_APPROX_MATCHER (REG_NOTEOL << 1)
#define REG_BACKTRACKING_MATCHER (REG_APPROX_MATCHER << 1)
#endif /* !TRE_USE_SYSTEM_REGEX_H */
/* REG_NOSPEC and REG_LITERAL mean the same thing. */
#if defined(REG_LITERAL)
#define REG_NOSPEC REG_LITERAL
#define REG_NOSPEC REG_LITERAL
#elif defined(REG_NOSPEC)
#define REG_LITERAL REG_NOSPEC
#define REG_LITERAL REG_NOSPEC
#endif /* defined(REG_NOSPEC) */
/* The maximum number of iterations in a bound expression. */
@@ -148,24 +161,24 @@ int regwnexec(const regex_t *preg, const wchar_t *string, size_t len,
/* Approximate matching parameter struct. */
typedef struct {
int cost_ins; /* Default cost of an inserted character. */
int cost_del; /* Default cost of a deleted character. */
int cost_ins; /* Default cost of an inserted character. */
int cost_del; /* Default cost of a deleted character. */
int cost_subst; /* Default cost of a substituted character. */
int max_cost; /* Maximum allowed cost of a match. */
int max_cost; /* Maximum allowed cost of a match. */
int max_ins; /* Maximum allowed number of inserts. */
int max_del; /* Maximum allowed number of deletes. */
int max_ins; /* Maximum allowed number of inserts. */
int max_del; /* Maximum allowed number of deletes. */
int max_subst; /* Maximum allowed number of substitutes. */
int max_err; /* Maximum allowed number of errors total. */
int max_err; /* Maximum allowed number of errors total. */
} regaparams_t;
/* Approximate matching result struct. */
typedef struct {
size_t nmatch; /* Length of pmatch[] array. */
regmatch_t *pmatch; /* Submatch data. */
int cost; /* Cost of the match. */
int num_ins; /* Number of inserts in the match. */
int num_del; /* Number of deletes in the match. */
int cost; /* Cost of the match. */
int num_ins; /* Number of inserts in the match. */
int num_del; /* Number of deletes in the match. */
int num_subst; /* Number of substitutes in the match. */
} regamatch_t;
@@ -187,9 +200,28 @@ int regawnexec(const regex_t *preg, const wchar_t *string, size_t len,
void regaparams_default(regaparams_t *params);
#endif /* TRE_APPROX */
/* Returns the version string. The returned string is static. */
#ifdef TRE_WCHAR
typedef wchar_t tre_char_t;
#else /* !TRE_WCHAR */
typedef unsigned char tre_char_t;
#endif /* !TRE_WCHAR */
typedef struct {
int (*get_next_char)(tre_char_t *c, unsigned int *pos_add, void *context);
void (*rewind)(size_t pos, void *context);
int (*compare)(size_t pos1, size_t pos2, size_t len, void *context);
void *context;
} tre_str_source;
int reguexec(const regex_t *preg, const tre_str_source *string,
size_t nmatch, regmatch_t pmatch[], int eflags);
/* Returns the version string. The returned string is static. */
char *tre_version(void);
/* Returns the value for a config parameter. The type to which `result'
must point to depends of the value of `query', see documentation for
more details. */
int tre_config(int query, void *result);
enum {
@@ -200,6 +232,13 @@ enum {
TRE_CONFIG_VERSION
};
/* Returns 1 if the compiled pattern has back references, 0 if not. */
int tre_have_backrefs(const regex_t *preg);
/* Returns 1 if the compiled pattern uses approximate matching features,
0 if not. */
int tre_have_approx(const regex_t *preg);
#ifdef __cplusplus
}
#endif
+29 -3
View File
@@ -1,6 +1,16 @@
/* tre-config.h. This file defines all compile time definitions
that are needed in `regex.h' for Win32. */
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#define HAVE_ALLOCA_H 1
/* Define to 1 if you have the <libutf8.h> header file. */
/* #undef HAVE_LIBUTF8_H */
/* Define to 1 if the system has the type `reg_errcode_t'. */
/* #undef HAVE_REG_ERRCODE_T */
@@ -16,11 +26,27 @@
/* Define to enable multibyte character set support. */
#undef TRE_MULTIBYTE
/* Define to include the system regex.h from TRE regex.h */
/* #undef TRE_USE_SYSTEM_REGEX_H */
/* Define to the absolute path to the system regex.h */
/* #undef TRE_SYSTEM_REGEX_H_PATH */
/* Define if you want TRE to use alloca() instead of malloc() when allocating
memory needed for regexec operations. */
#define TRE_USE_ALLOCA 1
/* Define to include the system regex.h from TRE regex.h */
/* #undef TRE_USE_SYSTEM_REGEX_H */
/* Define to enable wide character (wchar_t) support. */
#undef TRE_WCHAR
/* TRE version string. */
#define TRE_VERSION "0.7.0"
/* TRE version level 1. */
#define TRE_VERSION_1 0
/* TRE version level 2. */
#define TRE_VERSION_2 7
/* TRE version level 3. */
#define TRE_VERSION_3 0
+30 -11
View File
@@ -101,9 +101,9 @@ OPENSSL_LIB=/LIBPATH:"$(OPENSSL_LIB_DIR)"
!ENDIF
!IFDEF DEBUG
DBGCFLAG=/MDd /Zi
DBGCFLAG=/MD /Zi
DBGLFLAG=/debug /debugtype:BOTH
MODDBGCFLAG=/LDd /MDd /Zi
MODDBGCFLAG=/LDd /MD /Zi
!ELSE
DBGCFLAG=/MD /O2 /G5
MODDBGCFLAG=/LD /MD
@@ -138,10 +138,11 @@ EXP_OBJ_FILES=SRC/CHANNEL.OBJ SRC/SEND.OBJ SRC/SOCKET.OBJ \
SRC/S_KLINE.OBJ SRC/S_EXTRA.OBJ SRC/IRCSPRINTF.OBJ SRC/LUSERS.OBJ \
SRC/SCACHE.OBJ SRC/ALN.OBJ SRC/BADWORDS.OBJ SRC/WEBTV.OBJ SRC/RES.OBJ SRC/MODULES.OBJ \
SRC/S_SVS.OBJ SRC/EVENTS.OBJ SRC/UMODES.OBJ SRC/AUTH.OBJ SRC/CIDR.OBJ SRC/SSL.OBJ \
SRC/RANDOM.OBJ SRC/EXTCMODES.OBJ SRC/MD5.OBJ \
SRC/RANDOM.OBJ SRC/EXTCMODES.OBJ SRC/MD5.OBJ SRC/API-ISUPPORT.OBJ SRC/API-COMMAND.OBJ \
SRC/EXTBANS.OBJ $(ZIPOBJ) $(CURLOBJ)
OBJ_FILES=$(EXP_OBJ_FILES) SRC/WIN32GUI.OBJ SRC/SERVICE.OBJ SRC/DEBUG.OBJ
OBJ_FILES=$(EXP_OBJ_FILES) SRC/GUI.OBJ SRC/SERVICE.OBJ SRC/DEBUG.OBJ SRC/RTF.OBJ \
SRC/EDITOR.OBJ SRC/WIN32.OBJ
MOD_FILES=SRC/MODULES/L_COMMANDS.C SRC/MODULES/M_CHGHOST.C SRC/MODULES/M_SDESC.C \
SRC/MODULES/M_SETIDENT.C SRC/MODULES/M_SETNAME.C SRC/MODULES/M_SETHOST.C \
@@ -170,7 +171,7 @@ MOD_FILES=SRC/MODULES/L_COMMANDS.C SRC/MODULES/M_CHGHOST.C SRC/MODULES/M_SDESC.C
SRC/MODULES/M_RULES.C SRC/MODULES/M_CLOSE.C SRC/MODULES/M_MAP.C SRC/MODULES/M_EOS.C \
SRC/MODULES/M_SERVER.C SRC/MODULES/M_STATS.C SRC/MODULES/M_SVSFLINE.C \
SRC/MODULES/M_DCCDENY.C SRC/MODULES/M_UNDCCDENY.C SRC/MODULES/M_WHOWAS.C \
SRC/MODULES/M_CONNECT.C SRC/MODULES/M_DCCALLOW.C
SRC/MODULES/M_CONNECT.C SRC/MODULES/M_DCCALLOW.C SRC/MODULES/M_USERIP.C
DLL_FILES=SRC/MODULES/M_CHGHOST.DLL SRC/MODULES/M_SDESC.DLL SRC/MODULES/M_SETIDENT.DLL \
SRC/MODULES/M_SETNAME.DLL SRC/MODULES/M_SETHOST.DLL SRC/MODULES/M_CHGIDENT.DLL \
@@ -201,7 +202,7 @@ DLL_FILES=SRC/MODULES/M_CHGHOST.DLL SRC/MODULES/M_SDESC.DLL SRC/MODULES/M_SETIDE
SRC/MODULES/M_CLOSE.DLL SRC/MODULES/M_MAP.DLL SRC/MODULES/M_EOS.DLL \
SRC/MODULES/M_SERVER.DLL SRC/MODULES/M_STATS.DLL SRC/MODULES/M_SVSFLINE.DLL \
SRC/MODULES/M_DCCDENY.DLL SRC/MODULES/M_UNDCCDENY.DLL SRC/MODULES/M_WHOWAS.DLL \
SRC/MODULES/M_CONNECT.DLL SRC/MODULES/M_DCCALLOW.DLL \
SRC/MODULES/M_CONNECT.DLL SRC/MODULES/M_DCCALLOW.DLL SRC/MODULES/M_USERIP.DLL \
SRC/MODULES/CLOAK.DLL SRC/MODULES/OLDCLOAK.DLL
@@ -362,18 +363,27 @@ src/hash.obj: src/hash.c $(INCLUDES) ./include/hash.h
src/crule.obj: src/crule.c $(INCLUDES)
$(CC) $(CFLAGS) src/crule.c
src/win32gui.obj: src/win32/win32gui.c $(INCLUDES) ./include/resource.h
$(CC) $(CFLAGS) src/win32/win32gui.c
src/gui.obj: src/win32/gui.c $(INCLUDES) ./include/resource.h
$(CC) $(CFLAGS) src/win32/gui.c
src/rtf.obj: src/win32/rtf.c $(INCLUDES) ./src/win32/win32.h
$(CC) $(CFLAGS) src/win32/rtf.c
src/editor.obj: src/win32/editor.c $(INCLUDES) ./include/resource.h ./src/win32/win32.h
$(CC) $(CFLAGS) src/win32/editor.c
src/service.obj: src/win32/service.c $(INCLUDES)
$(CC) $(CFLAGS) src/win32/service.c
src/unreal.obj: src/win32/unreal.c $(INCLUDES)
$(CC) $(CFLAGS) src/win32/unreal.c
src/debug.obj: src/win32/debug.c $(INCLUDES)
$(CC) $(CFLAGS) src/win32/debug.c
src/win32.obj: src/win32/win32.c $(INCLUDES)
$(CC) $(CFLAGS) src/win32/win32.c
src/unreal.obj: src/win32/unreal.c $(INCLUDES)
$(CC) $(CFLAGS) src/win32/unreal.c
src/res_comp.obj: src/res_comp.c $(INCLUDES)
$(CC) $(CFLAGS) src/res_comp.c
@@ -413,6 +423,12 @@ src/url.obj: src/url.c $(INCLUDES) ./include/url.h
src/extbans.obj: src/extbans.c $(INCLUDES)
$(CC) $(CFLAGS) src/extbans.c
src/api-isupport.obj: src/api-isupport.c $(INCLUDES)
$(CC) $(CFLAGS) src/api-isupport.c
src/api-command.obj: src/api-command.c $(INCLUDES)
$(CC) $(CFLAGS) src/api-command.c
src/zip.obj: src/zip.c $(INCLUDES)
$(CC) $(CFLAGS) src/zip.c
@@ -713,6 +729,9 @@ src/modules/m_connect.dll: src/modules/m_connect.c $(INCLUDES)
src/modules/m_dccallow.dll: src/modules/m_dccallow.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_dccallow.c $(MODLFLAGS)
src/modules/m_userip.dll: src/modules/m_userip.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/m_userip.c $(MODLFLAGS)
src/modules/cloak.dll: src/modules/cloak.c $(INCLUDES)
$(CC) $(MODCFLAGS) src/modules/cloak.c $(MODLFLAGS)
+7 -1
View File
@@ -29,7 +29,7 @@ OBJS=auth.o aln.o badwords.o channel.o cloak.o crule.o dbuf.o \
s_misc.o s_numeric.o s_serv.o s_svs.o $(STRTOUL) socket.o \
ssl.o s_user.o scache.o send.o support.o umodes.o \
version.o webtv.o whowas.o zip.o cidr.o random.o extcmodes.o \
extbans.o md5.o $(URL)
extbans.o md5.o api-isupport.o api-command.o $(URL)
SRC=$(OBJS:%.o=%.c)
@@ -250,6 +250,12 @@ extbans.o: extbans.c $(INCLUDES)
md5.o: md5.c $(INCLUDES)
$(CC) $(CFLAGS) -c md5.c
api-command.o: api-command.c $(INCLUDES)
$(CC) $(CFLAGS) -c api-command.c
api-isupport.o: api-isupport.c $(INCLUDES)
$(CC) $(CFLAGS) -c api-isupport.c
url.o: url.c $(INCLUDES) ../include/url.h
$(CC) $(CFLAGS) -c url.c
+149
View File
@@ -0,0 +1,149 @@
/************************************************************************
* Unreal Internet Relay Chat Daemon, src/api-command.c
* Copyright (C) 2004 Dominick Meglio and The UnrealIRCd Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "msg.h"
#include "h.h"
#include <string.h>
char *cmdstr = NULL;
int CommandExists(char *name)
{
aCommand *p;
for (p = CommandHash[toupper(*name)]; p; p = p->next)
{
if (!stricmp(p->cmd, name))
return 1;
}
for (p = TokenHash[*name]; p; p = p->next)
{
if (!strcmp(p->cmd, name))
return 1;
}
return 0;
}
Command *CommandAdd(Module *module, char *cmd, char *tok, int (*func)(), unsigned char params, int flags) {
Command *command;
if (find_Command_simple(cmd) || (tok && find_Command_simple(tok)))
{
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
command = MyMallocEx(sizeof(Command));
command->cmd = add_Command_backend(cmd,func,params, 0, flags);
command->tok = NULL;
command->cmd->owner = module;
if (tok) {
command->tok = add_Command_backend(tok,func,params,1,flags);
command->cmd->friend = command->tok;
command->tok->friend = command->cmd;
command->tok->owner = module;
}
else
command->cmd->friend = NULL;
if (module) {
ModuleObject *cmdobj = (ModuleObject *)MyMallocEx(sizeof(ModuleObject));
cmdobj->object.command = command;
cmdobj->type = MOBJ_COMMAND;
AddListItem(cmdobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
if (flags & M_ANNOUNCE)
{
char *tmp;
if (cmdstr)
tmp = MyMallocEx(strlen(cmdstr)+strlen(cmd)+2);
else
tmp = MyMallocEx(strlen(cmd)+2);
if (cmdstr)
{
strcpy(tmp, cmdstr);
strcat(tmp, ",");
}
strcat(tmp, cmd);
if (cmdstr)
{
IsupportSetValue(IsupportFind("CMDS"), tmp);
free(cmdstr);
}
else
IsupportAdd(NULL, "CMDS", tmp);
cmdstr = tmp;
}
return command;
}
void CommandDel(Command *command) {
Cmdoverride *ovr, *ovrnext;
if (command->cmd->flags & M_ANNOUNCE)
{
char *tmp = MyMallocEx(strlen(cmdstr)+1);
char *tok;
for (tok = strtok(cmdstr, ","); tok; tok = strtok(NULL, ","))
{
if (!stricmp(tok, command->cmd->cmd))
continue;
if (tmp)
strcat(tmp, ",");
strcat(tmp, tok);
}
free(cmdstr);
if (!*tmp)
{
IsupportDel(IsupportFind("CMDS"));
cmdstr = NULL;
}
else
cmdstr = tmp;
}
DelListItem(command->cmd, CommandHash[toupper(*command->cmd->cmd)]);
if (command->tok)
DelListItem(command->tok, TokenHash[*command->tok->cmd]);
if (command->cmd->owner) {
ModuleObject *cmdobj;
for (cmdobj = command->cmd->owner->objects; cmdobj; cmdobj = (ModuleObject *)cmdobj->next) {
if (cmdobj->type == MOBJ_COMMAND && cmdobj->object.command == command) {
DelListItem(cmdobj,command->cmd->owner->objects);
MyFree(cmdobj);
break;
}
}
}
for (ovr = command->cmd->overriders; ovr; ovr = ovrnext)
{
ovrnext = ovr->next;
CmdoverrideDel(ovr);
}
MyFree(command->cmd->cmd);
MyFree(command->cmd);
if (command->tok) {
MyFree(command->tok->cmd);
MyFree(command->tok);
}
MyFree(command);
}
+271
View File
@@ -0,0 +1,271 @@
/************************************************************************
* UnrealIRCd - Unreal Internet Relay Chat Daemon - src/api-isupport.c
* (c) 2004 Dominick Meglio and the UnrealIRCd Team
*
* 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.
*
* $Id$
*/
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include "version.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <fcntl.h>
#include "h.h"
#include "proto.h"
Isupport *Isupports; /* List of ISUPPORT (005) tokens */
char *IsupportStrings[5] = {0,0,0,0,0}; /* If we get more than 5 strings, God help us! */
extern char *cmdstr;
/**
* Builds isupport token strings.
* Respects both the 13 token limit and the 512 buffer limit.
*/
void make_isupportstrings(void)
{
int i;
int bufsize = BUFSIZE-HOSTLEN-NICKLEN-39;
int tokcnt = 0, len = 0;
Isupport *isupport;
/* Clear out the old junk */
for (i = 0; IsupportStrings[i]; i++)
{
free(IsupportStrings[i]);
IsupportStrings[i] = NULL;
}
i = 0;
IsupportStrings[i] = MyMallocEx(bufsize);
for (isupport = Isupports; isupport; isupport = isupport->next)
{
int toklen;
/* Just a token */
if (!isupport->value)
{
toklen = strlen(isupport->token);
if (tokcnt == 13 || bufsize < len+toklen+1)
{
tokcnt = 0;
len = 0;
IsupportStrings[++i] = MyMallocEx(bufsize);
}
if (IsupportStrings[i][0])
{
strcat(IsupportStrings[i], " ");
toklen++;
}
strcat(IsupportStrings[i], isupport->token);
len += toklen;
tokcnt++;
}
else
{
toklen = strlen(isupport->token)+strlen(isupport->value)+1;
if (tokcnt == 13 || bufsize < len+toklen+1)
{
tokcnt = 0;
len = 0;
IsupportStrings[++i] = MyMallocEx(bufsize);
}
if (IsupportStrings[i][0])
{
strcat(IsupportStrings[i], " ");
toklen++;
}
strcat(IsupportStrings[i], isupport->token);
strcat(IsupportStrings[i], "=");
strcat(IsupportStrings[i], isupport->value);
len += toklen;
tokcnt++;
}
}
}
/**
* Initializes the builtin isupport tokens.
*/
void isupport_init(void)
{
char tmpbuf[512];
IsupportAdd(NULL, "EXCEPTS", NULL);
#ifdef PREFIX_AQ
IsupportAdd(NULL, "STATUSMSG", "~&@%+");
#else
IsupportAdd(NULL, "STATUSMSG", "@%+");
#endif
IsupportAdd(NULL, "ELIST", "MNUCT");
ircsprintf(tmpbuf, "~,%s", extbanstr);
IsupportAdd(NULL, "EXTBAN", tmpbuf);
IsupportAdd(NULL, "CASEMAPPING", "ascii");
IsupportAdd(NULL, "NETWORK", ircnet005);
ircsprintf(tmpbuf, CHPAR1 "%s," CHPAR2 "%s," CHPAR3 "%s," CHPAR4 "%s",
EXPAR1, EXPAR2, EXPAR3, EXPAR4);
IsupportAdd(NULL, "CHANMODES", tmpbuf);
IsupportAdd(NULL, "PREFIX", CHPFIX);
IsupportAdd(NULL, "CHANTYPES", "#");
IsupportAdd(NULL, "MODES", my_itoa(MAXMODEPARAMS));
IsupportAdd(NULL, "SILENCE", my_itoa(SILENCE_LIMIT));
IsupportAdd(NULL, "WATCH", my_itoa(MAXWATCH));
IsupportAdd(NULL, "WALLCHOPS", NULL);
IsupportAdd(NULL, "MAXTARGETS", my_itoa(MAXTARGETS));
IsupportAdd(NULL, "AWAYLEN", my_itoa(TOPICLEN));
IsupportAdd(NULL, "KICKLEN", my_itoa(TOPICLEN));
IsupportAdd(NULL, "TOPICLEN", my_itoa(TOPICLEN));
IsupportAdd(NULL, "CHANNELLEN", my_itoa(CHANNELLEN));
IsupportAdd(NULL, "NICKLEN", my_itoa(NICKLEN));
ircsprintf(tmpbuf, "b:%d,e:%d", MAXBANS, MAXBANS);
IsupportAdd(NULL, "MAXLIST", tmpbuf);
ircsprintf(tmpbuf, "#:%d", MAXCHANNELSPERUSER);
IsupportAdd(NULL, "CHANLIMIT", tmpbuf);
IsupportAdd(NULL, "MAXCHANNELS", my_itoa(MAXCHANNELSPERUSER));
IsupportAdd(NULL, "HCN", NULL);
IsupportAdd(NULL, "SAFELIST", NULL);
if (cmdstr)
IsupportAdd(NULL, "CMDS", cmdstr);
}
/**
* Sets or changes the value of an existing isupport token.
*
* @param isupport The pointer to the isupport handle.
* @param value The new value of the token (NULL indicates no value).
*/
void IsupportSetValue(Isupport *isupport, const char *value)
{
if (isupport->value)
free(isupport->value);
if (value)
isupport->value = strdup(value);
else
isupport->value = NULL;
make_isupportstrings();
}
/**
* Returns an isupport handle based on the given token name.
*
* @param token The isupport token to search for.
* @return Returns the handle to the isupport token if it was found,
* otherwise NULL is returned.
*/
Isupport *IsupportFind(const char *token)
{
Isupport *isupport;
for (isupport = Isupports; isupport; isupport = isupport->next)
{
if (!stricmp(token, isupport->token))
return isupport;
}
return NULL;
}
/**
* Adds a new isupport token.
*
* @param module The module which owns this token.
* @param token The name of the token to create.
* @param value The value of the token (NULL indicates no value).
* @return Returns the handle to the new token if successful, otherwise NULL.
* The module's error code contains specific information about the
* error.
*/
Isupport *IsupportAdd(Module *module, const char *token, const char *value)
{
Isupport *isupport;
char *c;
if (IsupportFind(token))
{
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
/* draft-brocklesby-irc-isupport:
* token = a-zA-Z0-9 and 20 or less characters
* value = ASCII 0x21 - 0x7E
*/
for (c = (char *)token; c && *c; c++)
{
if (!isalnum(*c))
{
if (module)
module->errorcode = MODERR_INVALID;
return NULL;
}
}
if (!token || !*token || c-token > 20)
{
if (module)
module->errorcode = MODERR_INVALID;
return NULL;
}
for (c = (char *)value; c && *c; c++)
{
if (*c < '!' || *c > '~')
{
if (module)
module->errorcode = MODERR_INVALID;
return NULL;
}
}
isupport = MyMallocEx(sizeof(Isupport));
isupport->owner = module;
isupport->token = strdup(token);
if (value)
isupport->value = strdup(value);
AddListItem(isupport, Isupports);
make_isupportstrings();
if (module)
{
ModuleObject *isupportobj = MyMallocEx(sizeof(ModuleObject));
isupportobj->object.isupport = isupport;
isupportobj->type = MOBJ_ISUPPORT;
AddListItem(isupportobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
return isupport;
}
/**
* Removes the specified isupport token.
*
* @param isupport The token to remove.
*/
void IsupportDel(Isupport *isupport)
{
DelListItem(isupport, Isupports);
free(isupport->token);
if (isupport->value)
free(isupport->value);
free(isupport);
make_isupportstrings();
}
+472 -185
View File
@@ -46,9 +46,7 @@ anAuthStruct MODVAR AuthTypes[] = {
{"crypt", AUTHTYPE_UNIXCRYPT},
{"unixcrypt", AUTHTYPE_UNIXCRYPT},
#endif
#ifdef AUTHENABLE_MD5
{"md5", AUTHTYPE_MD5},
#endif
#ifdef AUTHENABLE_SHA1
{"sha1", AUTHTYPE_SHA1},
#endif
@@ -174,6 +172,278 @@ void Auth_DeleteAuthStruct(anAuthStruct *as)
MyFree(as);
}
/* Both values are pretty insane as of 2004, but... just in case. */
#define MAXSALTLEN 127
#define MAXHASHLEN 255
/* RAW salt length (before b64_encode) to use in /MKPASSWD
* and REAL salt length (after b64_encode, including terminating nul),
* used for reserving memory.
*/
#define RAWSALTLEN 6
#define REALSALTLEN 12
/** Parses a password.
* This routine can parse a pass that has a salt (new as of unreal 3.2.1)
* and will set the 'salt' pointer and 'hash' accordingly.
* RETURN VALUES:
* 1 If succeeded, salt and hash can be used.
* 0 If it's a password without a salt ('old'), salt and hash are not touched.
*/
static int parsepass(char *str, char **salt, char **hash)
{
static char saltbuf[MAXSALTLEN+1], hashbuf[MAXHASHLEN+1];
char *p;
int max;
/* Syntax: $<salt>$<hash> */
if (*str != '$')
return 0;
p = strchr(str+1, '$');
if (!p || (p == str+1) || !p[1])
return 0;
max = p - str;
if (max > sizeof(saltbuf))
max = sizeof(saltbuf);
strlcpy(saltbuf, str+1, max);
strlcpy(hashbuf, p+1, sizeof(hashbuf));
*salt = saltbuf;
*hash = hashbuf;
return 1;
}
static int authcheck_md5(aClient *cptr, anAuthStruct *as, char *para)
{
static char buf[512];
int i, r;
char *saltstr, *hashstr;
if (!para)
return -1;
r = parsepass(as->data, &saltstr, &hashstr);
if (r == 0) /* Old method without salt: b64(MD5(<pass>)) */
{
char result[16];
MD5_CTX hash;
MD5_Init(&hash);
MD5_Update(&hash, para, strlen(para));
MD5_Final(result, &hash);
if ((i = b64_encode(result, sizeof(result), buf, sizeof(buf))))
{
if (!strcmp(buf, as->data))
return 2;
else
return -1;
} else
return -1;
} else {
/* New method with salt: b64(MD5(MD5(<pass>)+salt)) */
char result1[MAXSALTLEN+16+1];
char result2[16];
char rsalt[MAXSALTLEN+1];
MD5_CTX hash;
int rsaltlen;
/* First, decode the salt to something real... */
rsaltlen = b64_decode(saltstr, rsalt, sizeof(rsalt));
if (rsaltlen <= 0)
return -1;
/* Then hash the password (1st round)... */
MD5_Init(&hash);
MD5_Update(&hash, para, strlen(para));
MD5_Final(result1, &hash);
/* Add salt to result */
memcpy(result1+16, rsalt, rsaltlen); /* b64_decode already made sure bounds are ok */
/* Then hash it all together again (2nd round)... */
MD5_Init(&hash);
MD5_Update(&hash, result1, rsaltlen+16);
MD5_Final(result2, &hash);
/* Then base64 encode it all and we are done... */
if ((i = b64_encode(result2, sizeof(result2), buf, sizeof(buf))))
{
if (!strcmp(buf, hashstr))
return 2;
else
return -1;
} else
return -1;
}
return -1; /* NOTREACHED */
}
#ifdef AUTHENABLE_SHA1
static int authcheck_sha1(aClient *cptr, anAuthStruct *as, char *para)
{
char buf[512];
int i, r;
char *saltstr, *hashstr;
if (!para)
return -1;
r = parsepass(as->data, &saltstr, &hashstr);
if (r)
{
/* New method with salt: b64(SHA1(SHA1(<pass>)+salt)) */
char result1[MAXSALTLEN+20+1];
char result2[20];
char rsalt[MAXSALTLEN+1];
int rsaltlen;
#ifndef _WIN32
SHA_CTX hash;
#else
HCRYPTPROV hProv;
HCRYPTHASH hHash;
DWORD size = 20;
#endif
/* First, decode the salt to something real... */
rsaltlen = b64_decode(saltstr, rsalt, sizeof(rsalt));
if (rsaltlen <= 0)
return -1;
#ifdef _WIN32
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
return -1;
#endif
/* Then hash the password (1st round)... */
#ifndef _WIN32
SHA1_Init(&hash);
SHA1_Update(&hash, para, strlen(para));
SHA1_Final(result1, &hash);
#else
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash)) return NULL;
if (!CryptHashData(hHash, para, strlen(para), 0)) return NULL;
if (!CryptGetHashParam(hHash, HP_HASHVAL, result1, &size, 0)) return NULL;
CryptDestroyHash(hHash);
#endif
/* Add salt to result */
memcpy(result1+20, rsalt, rsaltlen); /* b64_decode already made sure bounds are ok */
/* Then hash it all together again (2nd round)... */
#ifndef _WIN32
SHA1_Init(&hash);
SHA1_Update(&hash, result1, rsaltlen+20);
SHA1_Final(result2, &hash);
#else
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash)) return NULL;
if (!CryptHashData(hHash, result1, 20+rsaltlen, 0)) return NULL;
if (!CryptGetHashParam(hHash, HP_HASHVAL, result2, &size, 0)) return NULL;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
#endif
/* Then base64 encode it all and we are done... */
if ((i = b64_encode(result2, sizeof(result2), buf, sizeof(buf))))
{
if (!strcmp(buf, hashstr))
return 2;
else
return -1;
} else
return -1;
} else {
/* OLD auth */
#ifndef _WIN32
if ((i = b64_encode(SHA1(para, strlen(para), NULL), 20, buf, sizeof(buf))))
{
if (!strcmp(buf, as->data))
return 2;
else
return -1;
} else
return -1;
#else
HCRYPTPROV hProv;
HCRYPTHASH hHash;
char buf2[512];
DWORD size = 512;
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
return -1;
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash))
return -1;
if (!CryptHashData(hHash, para, strlen(para), 0))
return -1;
if (!CryptGetHashParam(hHash, HP_HASHVAL, buf, &size, 0))
return -1;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
b64_encode(buf, 20, buf2, sizeof(buf2));
if (!strcmp(buf2, as->data))
return 2;
else
return -1;
#endif
}
}
#endif /* AUTHENABLE_SHA1 */
#ifdef AUTHENABLE_RIPEMD160
static int authcheck_ripemd160(aClient *cptr, anAuthStruct *as, char *para)
{
char buf[512];
int i, r;
char *saltstr, *hashstr;
if (!para)
return -1;
r = parsepass(as->data, &saltstr, &hashstr);
if (r)
{
/* New method with salt: b64(RIPEMD160(RIPEMD160(<pass>)+salt)) */
char result1[MAXSALTLEN+20+1];
char result2[20];
char rsalt[MAXSALTLEN+1];
int rsaltlen;
RIPEMD160_CTX hash;
/* First, decode the salt to something real... */
rsaltlen = b64_decode(saltstr, rsalt, sizeof(rsalt));
if (rsaltlen <= 0)
return -1;
/* Then hash the password (1st round)... */
RIPEMD160_Init(&hash);
RIPEMD160_Update(&hash, para, strlen(para));
RIPEMD160_Final(result1, &hash);
/* Add salt to result */
memcpy(result1+20, rsalt, rsaltlen); /* b64_decode already made sure bounds are ok */
/* Then hash it all together again (2nd round)... */
RIPEMD160_Init(&hash);
RIPEMD160_Update(&hash, result1, rsaltlen+20);
RIPEMD160_Final(result2, &hash);
/* Then base64 encode it all and we are done... */
if ((i = b64_encode(result2, sizeof(result2), buf, sizeof(buf))))
{
if (!strcmp(buf, hashstr))
return 2;
else
return -1;
} else
return -1;
} else {
/* OLD auth */
if ((i = b64_encode(RIPEMD160(para, strlen(para), NULL), 20, buf, sizeof(buf))))
{
if (!strcmp(buf, as->data))
return 2;
else
return -1;
} else
return -1;
}
}
#endif /* AUTHENABLE_RIPEMD160 */
/*
* cptr MUST be a local client
* as is what it will be compared with
@@ -192,16 +462,13 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
#ifdef AUTHENABLE_UNIXCRYPT
extern char *crypt();
#endif
#if defined(AUTHENABLE_MD5) || defined(AUTHENABLE_SHA1) || defined(AUTHENABLE_RIPEMD160)
static char buf[512];
int i;
#endif
#ifdef AUTHENABLE_SSL_CLIENTCERT
X509 *x509_clientcert = NULL;
X509 *x509_filecert = NULL;
FILE *x509_f = NULL;
#endif
if (!as)
return 1;
@@ -229,108 +496,17 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
return -1;
break;
#endif
#ifdef AUTHENABLE_MD5
case AUTHTYPE_MD5:
if (!para)
return -1;
#ifndef _WIN32
if ((i = b64_encode(MD5(para, strlen(para), NULL),
MD5_DIGEST_LENGTH, buf, sizeof(buf))))
{
if (!strcmp(buf, as->data))
return 2;
else
return -1;
}
else
return -1;
break;
#else
{
HCRYPTPROV hProv;
HCRYPTHASH hHash;
char buf2[512];
DWORD size = 512;
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
return -1;
if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash))
return -1;
if (!CryptHashData(hHash, para, strlen(para), 0))
return -1;
if (!CryptGetHashParam(hHash, HP_HASHVAL, buf, &size, 0))
return -1;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
b64_encode(buf, 16, buf2, sizeof(buf2));
if (!strcmp(buf2, as->data))
return 2;
else
return -1;
}
return authcheck_md5(cptr, as, para);
break;
#endif
#endif
#ifdef AUTHENABLE_SHA1
case AUTHTYPE_SHA1:
if (!para)
return -1;
#ifndef _WIN32
if ((i = b64_encode(SHA1(para, strlen(para), NULL),
SHA_DIGEST_LENGTH, buf, sizeof(buf))))
{
if (!strcmp(buf, as->data))
return 2;
else
return -1;
}
else
return -1;
break;
#else
{
HCRYPTPROV hProv;
HCRYPTHASH hHash;
char buf2[512];
DWORD size = 512;
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
return -1;
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash))
return -1;
if (!CryptHashData(hHash, para, strlen(para), 0))
return -1;
if (!CryptGetHashParam(hHash, HP_HASHVAL, buf, &size, 0))
return -1;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
b64_encode(buf, 20, buf2, sizeof(buf2));
if (!strcmp(buf2, as->data))
return 2;
else
return -1;
}
return authcheck_sha1(cptr, as, para);
break;
#endif
#endif
#ifdef AUTHENABLE_RIPEMD160
case AUTHTYPE_RIPEMD160:
if (!para)
return -1;
if ((i = b64_encode(RIPEMD160(para, strlen(para), NULL),
RIPEMD160_DIGEST_LENGTH, buf, sizeof(buf))))
{
if (!strcmp(buf, as->data))
return 2;
else
return -1;
}
else
return -1;
break;
return authcheck_ripemd160(cptr, as, para);
#endif
#ifdef AUTHENABLE_SSL_CLIENTCERT
case AUTHTYPE_SSL_CLIENTCERT:
@@ -367,19 +543,202 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para)
return -1;
}
static char *mkpass_md5(char *para)
{
static char buf[128];
char result1[16+REALSALTLEN];
char result2[16];
char saltstr[REALSALTLEN]; /* b64 encoded printable string*/
char saltraw[RAWSALTLEN]; /* raw binary */
char xresult[64];
MD5_CTX hash;
int i;
if (!para) return NULL;
/* generate a random salt... */
for (i=0; i < RAWSALTLEN; i++)
saltraw[i] = getrandom8();
i = b64_encode(saltraw, RAWSALTLEN, saltstr, REALSALTLEN);
if (!i) return NULL;
/* b64(MD5(MD5(<pass>)+salt))
* ^^^^^^^^^^^
* step 1
* ^^^^^^^^^^^^^^^^^^^^^
* step 2
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* step 3
*/
/* STEP 1 */
MD5_Init(&hash);
MD5_Update(&hash, para, strlen(para));
MD5_Final(result1, &hash);
/* STEP 2 */
/* add salt to result */
memcpy(result1+16, saltraw, RAWSALTLEN);
/* Then hash it all together */
MD5_Init(&hash);
MD5_Update(&hash, result1, RAWSALTLEN+16);
MD5_Final(result2, &hash);
/* STEP 3 */
/* Then base64 encode it all together.. */
i = b64_encode(result2, sizeof(result2), xresult, sizeof(xresult));
if (!i) return NULL;
/* Good.. now create the whole string:
* $<saltb64d>$<totalhashb64d>
*/
ircsprintf(buf, "$%s$%s", saltstr, xresult);
return buf;
}
#ifdef AUTHENABLE_SHA1
static char *mkpass_sha1(char *para)
{
static char buf[128];
char result1[20+REALSALTLEN];
char result2[20];
char saltstr[REALSALTLEN]; /* b64 encoded printable string*/
char saltraw[RAWSALTLEN]; /* raw binary */
char xresult[64];
#ifndef _WIN32
SHA_CTX hash;
#else
HCRYPTPROV hProv;
HCRYPTHASH hHash;
DWORD size = 20;
#endif
int i;
if (!para) return NULL;
/* generate a random salt... */
for (i=0; i < RAWSALTLEN; i++)
saltraw[i] = getrandom8();
i = b64_encode(saltraw, RAWSALTLEN, saltstr, REALSALTLEN);
if (!i) return NULL;
#ifdef _WIN32
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
return NULL;
#endif
/* b64(SHA1(SHA1(<pass>)+salt))
* ^^^^^^^^^^^
* step 1
* ^^^^^^^^^^^^^^^^^^^^^
* step 2
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* step 3
*/
/* STEP 1 */
#ifndef _WIN32
SHA1_Init(&hash);
SHA1_Update(&hash, para, strlen(para));
SHA1_Final(result1, &hash);
#else
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash)) return NULL;
if (!CryptHashData(hHash, para, strlen(para), 0)) return NULL;
if (!CryptGetHashParam(hHash, HP_HASHVAL, result1, &size, 0)) return NULL;
CryptDestroyHash(hHash);
#endif
/* STEP 2 */
/* add salt to result */
memcpy(result1+20, saltraw, RAWSALTLEN);
/* Then hash it all together */
#ifndef _WIN32
SHA1_Init(&hash);
SHA1_Update(&hash, result1, RAWSALTLEN+20);
SHA1_Final(result2, &hash);
#else
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash)) return NULL;
if (!CryptHashData(hHash, result1, RAWSALTLEN+20, 0)) return NULL;
if (!CryptGetHashParam(hHash, HP_HASHVAL, result2, &size, 0)) return NULL;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
#endif
/* STEP 3 */
/* Then base64 encode it all together.. */
i = b64_encode(result2, sizeof(result2), xresult, sizeof(xresult));
if (!i) return NULL;
/* Good.. now create the whole string:
* $<saltb64d>$<totalhashb64d>
*/
ircsprintf(buf, "$%s$%s", saltstr, xresult);
return buf;
}
#endif /* AUTHENABLE_SHA1 */
#ifdef AUTHENABLE_RIPEMD160
static char *mkpass_ripemd160(char *para)
{
static char buf[128];
char result1[20+REALSALTLEN];
char result2[20];
char saltstr[REALSALTLEN]; /* b64 encoded printable string*/
char saltraw[RAWSALTLEN]; /* raw binary */
char xresult[64];
RIPEMD160_CTX hash;
int i;
if (!para) return NULL;
/* generate a random salt... */
for (i=0; i < RAWSALTLEN; i++)
saltraw[i] = getrandom8();
i = b64_encode(saltraw, RAWSALTLEN, saltstr, REALSALTLEN);
if (!i) return NULL;
/* b64(RIPEMD160(RIPEMD160(<pass>)+salt))
* ^^^^^^^^^^^
* step 1
* ^^^^^^^^^^^^^^^^^^^^^
* step 2
* ^^^^^^^^^^^^^^^^^^^^^^^^^^
* step 3
*/
/* STEP 1 */
RIPEMD160_Init(&hash);
RIPEMD160_Update(&hash, para, strlen(para));
RIPEMD160_Final(result1, &hash);
/* STEP 2 */
/* add salt to result */
memcpy(result1+20, saltraw, RAWSALTLEN);
/* Then hash it all together */
RIPEMD160_Init(&hash);
RIPEMD160_Update(&hash, result1, RAWSALTLEN+20);
RIPEMD160_Final(result2, &hash);
/* STEP 3 */
/* Then base64 encode it all together.. */
i = b64_encode(result2, sizeof(result2), xresult, sizeof(xresult));
if (!i) return NULL;
/* Good.. now create the whole string:
* $<saltb64d>$<totalhashb64d>
*/
ircsprintf(buf, "$%s$%s", saltstr, xresult);
return buf;
}
#endif /* AUTHENABLE_RIPEMD160 */
char *Auth_Make(short type, char *para)
{
#ifdef AUTHENABLE_UNIXCRYPT
char salt[3];
extern char *crypt();
#endif
#if defined(AUTHENABLE_MD5) || defined(AUTHENABLE_SHA1) || defined(AUTHENABLE_RIPEMD160)
static char buf[512];
int i;
#endif
#ifdef _WIN32
static char buf2[512];
#endif
switch (type)
{
@@ -397,92 +756,20 @@ char *Auth_Make(short type, char *para)
return(crypt(para, salt));
break;
#endif
#ifdef AUTHENABLE_MD5
case AUTHTYPE_MD5:
if (!para)
return NULL;
#ifndef _WIN32
if ((i = b64_encode(MD5(para, strlen(para), NULL),
MD5_DIGEST_LENGTH, buf, sizeof(buf))))
{
return (buf);
}
else
return NULL;
break;
#else
{
HCRYPTPROV hProv;
HCRYPTHASH hHash;
DWORD size = 512;
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
return NULL;
if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash))
return NULL;
if (!CryptHashData(hHash, para, strlen(para), 0))
return NULL;
if (!CryptGetHashParam(hHash, HP_HASHVAL, buf, &size, 0))
return NULL;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
b64_encode(buf, 16, buf2, sizeof(buf2));
return (buf2);
}
break;
#endif
#endif
return mkpass_md5(para);
#ifdef AUTHENABLE_SHA1
case AUTHTYPE_SHA1:
if (!para)
return NULL;
#ifndef _WIN32
if ((i = b64_encode(SHA1(para, strlen(para), NULL),
SHA_DIGEST_LENGTH, buf, sizeof(buf))))
{
return (buf);
}
else
return NULL;
break;
#else
{
HCRYPTPROV hProv;
HCRYPTHASH hHash;
DWORD size = 512;
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
return NULL;
if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash))
return NULL;
if (!CryptHashData(hHash, para, strlen(para), 0))
return NULL;
if (!CryptGetHashParam(hHash, HP_HASHVAL, buf, &size, 0))
return NULL;
CryptDestroyHash(hHash);
CryptReleaseContext(hProv, 0);
b64_encode(buf, 20, buf2, sizeof(buf2));
return (buf2);
}
break;
return mkpass_sha1(para);
#endif
#endif
#ifdef AUTHENABLE_RIPEMD160
case AUTHTYPE_RIPEMD160:
if (!para)
return NULL;
if ((i = b64_encode(RIPEMD160(para, strlen(para), NULL),
RIPEMD160_DIGEST_LENGTH, buf, sizeof(buf))))
{
return (buf);
}
else
return NULL;
break;
return mkpass_ripemd160(para);
#endif
default:
return (NULL);
}
+5 -2
View File
@@ -185,7 +185,7 @@ char *stripbadwords(char *str, ConfigItem_badword *start_bw, int *blocked)
static char cleanstr[4096];
char buf[4096];
char *ptr;
int matchlen, stringlen, cleaned;
int matchlen, m, stringlen, cleaned;
ConfigItem_badword *this_word;
*blocked = 0;
@@ -244,8 +244,11 @@ char *stripbadwords(char *str, ConfigItem_badword *start_bw, int *blocked)
{
if (pmatch[0].rm_so == -1)
break;
m = pmatch[0].rm_eo - pmatch[0].rm_so;
if (m == 0)
break; /* anti-loop */
cleaned = 1;
matchlen += pmatch[0].rm_eo - pmatch[0].rm_so;
matchlen += m;
strlncat(buf, ptr, sizeof buf, pmatch[0].rm_so);
if (this_word->replace)
strlcat(buf, this_word->replace, sizeof buf);
+16 -10
View File
@@ -582,7 +582,7 @@ Ban *is_banned(aClient *sptr, aChannel *chptr, int type)
if (MyConnect(sptr)) {
mine = 1;
s = make_nick_user_host(sptr->name, sptr->user->username, sptr->sockhost);
s = make_nick_user_host(sptr->name, sptr->user->username, GetIP(sptr));
strlcpy(nuip, s, sizeof nuip);
ban_ip = nuip;
}
@@ -864,8 +864,7 @@ int can_send(aClient *cptr, aChannel *chptr, char *msgtext, int notice)
(!lp || !(lp->flags & (CHFL_CHANOP|CHFL_VOICE|CHFL_CHANOWNER|CHFL_HALFOP|CHFL_CHANPROT))) &&
!is_irc_banned(chptr))
{
sendto_chanops_butone(cptr, chptr, ":IRC PRIVMSG %s :%s: %s",
chptr->chname, cptr->name, msgtext);
sendto_chmodemucrap(cptr, chptr, msgtext);
return (CANNOT_SEND_MODERATED);
}
}
@@ -2975,14 +2974,17 @@ void set_mode(aChannel *chptr, aClient *cptr, int parc, char *parv[], u_int *pco
}
#endif
}
if (found == 0)
if (found == 0) /* Mode char unknown */
{
if (!MyClient(cptr))
break;
/* don't flood other servers */
sendto_one(cptr,
err_str(ERR_UNKNOWNMODE),
me.name, cptr->name, *curchr);
/* temporary hack: eat parameters of certain future chanmodes.. */
if (*curchr == 'I')
paracount++;
if ((*curchr == 'j') && (what == MODE_ADD))
paracount++;
if (MyClient(cptr))
sendto_one(cptr, err_str(ERR_UNKNOWNMODE),
me.name, cptr->name, *curchr);
break;
}
@@ -3703,6 +3705,8 @@ void join_channel(aChannel *chptr, aClient *cptr, aClient *sptr, int flags)
parv[1] = chptr->chname;
(void)m_names(cptr, sptr, 2, parv);
RunHook4(HOOKTYPE_LOCAL_JOIN, cptr, sptr,chptr,parv);
} else {
RunHook4(HOOKTYPE_REMOTE_JOIN, cptr, sptr, chptr, parv); /* (rarely used) */
}
#ifdef NEWCHFLOODPROT
@@ -4130,6 +4134,8 @@ CMD_FUNC(m_part)
}
if (MyClient(sptr))
RunHook4(HOOKTYPE_LOCAL_PART, cptr, sptr, chptr, comment);
else
RunHook4(HOOKTYPE_REMOTE_PART, cptr, sptr, chptr, comment);
remove_user_from_channel(sptr, chptr);
}
+2 -2
View File
@@ -157,8 +157,8 @@ char host[256], *mask, *x, *p, *q;
if (!curr)
return NULL;
strlcpy(host, curr, sizeof(curr));
for (p = curr, q = host; *p; p++, q++)
/* Convert host to lowercase and cut off at 255 bytes just to be sure */
for (p = curr, q = host; *p && (q < host+sizeof(host)-1); p++, q++)
*q = tolower(*p);
*q = '\0';
+13 -1
View File
@@ -76,6 +76,7 @@ Extban *ExtbanAdd(Module *module, ExtbanInfo req)
{
Extban *tmp;
int slot;
char tmpbuf[512];
if (findmod_by_bantype(req.flag))
{
@@ -108,12 +109,18 @@ int slot;
module->errorcode = MODERR_NOERROR;
}
ExtBan_highest = slot;
make_extbanstr();
if (loop.ircd_booted)
{
make_extbanstr();
ircsprintf(tmpbuf, "~,%s", extbanstr);
IsupportSetValue(IsupportFind("EXTBAN"), tmpbuf);
}
return &ExtBan_Table[slot];
}
void ExtbanDel(Extban *eb)
{
char tmpbuf[512];
/* Just zero it all away.. */
if (eb->owner)
@@ -131,6 +138,8 @@ void ExtbanDel(Extban *eb)
}
memset(eb, 0, sizeof(Extban));
make_extbanstr();
ircsprintf(tmpbuf, "~,%s", extbanstr);
IsupportSetValue(IsupportFind("EXTBAN"), tmpbuf);
/* Hmm do we want to go trough all chans and remove the bans?
* I would say 'no' because perhaps we are just reloading,
* and else.. well... screw them?
@@ -195,6 +204,9 @@ char *ban = banin + 3;
if (type != BANCHK_NICK)
return 0;
if (has_voice(sptr, chptr))
return 0;
if ((ban_realhost && !match(ban, ban_realhost)) ||
(ban_virthost && !match(ban, ban_virthost)) ||
+13 -2
View File
@@ -115,6 +115,7 @@ void extcmode_init(void)
Cmode *CmodeAdd(Module *reserved, CmodeInfo req, Cmode_t *mode)
{
short i = 0, j = 0;
char tmpbuf[512];
while (i < EXTCMODETABLESZ)
{
@@ -150,21 +151,31 @@ Cmode *CmodeAdd(Module *reserved, CmodeInfo req, Cmode_t *mode)
if (Channelmode_Table[j].flag)
if (j > Channelmode_highest)
Channelmode_highest = j;
make_cmodestr();
make_extcmodestr();
if (reserved)
reserved->errorcode = MODERR_NOERROR;
if (loop.ircd_booted)
{
make_cmodestr();
make_extcmodestr();
ircsprintf(tmpbuf, CHPAR1 "%s," CHPAR2 "%s," CHPAR3 "%s," CHPAR4 "%s",
EXPAR1, EXPAR2, EXPAR3, EXPAR4);
IsupportSetValue(IsupportFind("CHANMODES"), tmpbuf);
}
return &(Channelmode_Table[i]);
}
void CmodeDel(Cmode *cmode)
{
char tmpbuf[512];
/* TODO: remove from all channel */
if (cmode)
cmode->flag = '\0';
make_cmodestr();
make_extcmodestr();
/* Not unloadable, so module object support is not needed (yet) */
ircsprintf(tmpbuf, CHPAR1 "%s," CHPAR2 "%s," CHPAR3 "%s," CHPAR4 "%s",
EXPAR1, EXPAR2, EXPAR3, EXPAR4);
IsupportSetValue(IsupportFind("CHANMODES"), tmpbuf);
}
/** searches in chptr extmode parameters and returns entry or NULL. */
+14 -2
View File
@@ -604,6 +604,17 @@ extern TS check_pings(TS currenttime)
}
}
/* Do spamfilter 'user' banchecks.. */
if (loop.do_bancheck_spamf_user && IsPerson(cptr))
{
if (find_spamfilter_user(cptr) == FLUSH_BUFFER)
continue;
}
if (loop.do_bancheck_spamf_away && IsPerson(cptr) && cptr->user->away)
{
if (dospamfilter(cptr, cptr->user->away, SPAMF_AWAY, NULL) == FLUSH_BUFFER)
continue;
}
/*
* We go into ping phase
*/
@@ -725,8 +736,7 @@ extern TS check_pings(TS currenttime)
* * - lucas
* *
*/
if (loop.do_bancheck)
loop.do_bancheck = 0;
loop.do_bancheck = loop.do_bancheck_spamf_user = loop.do_bancheck_spamf_away = 0;
Debug((DEBUG_NOTICE, "Next check_ping() call at: %s, %d %d %d",
myctime(currenttime+9), ping, currenttime+9, currenttime));
@@ -1253,6 +1263,8 @@ int InitwIRCD(int argc, char *argv[])
#ifdef EXTCMODE
make_extcmodestr();
#endif
make_extbanstr();
isupport_init();
if (!find_Command_simple("AWAY") /*|| !find_Command_simple("KILL") ||
!find_Command_simple("OPER") || !find_Command_simple("PING")*/)
{
-22
View File
@@ -305,28 +305,6 @@ char *ircvsprintf(char *str, const char *format, va_list vl)
*str++ = '0';
continue;
}
if (v1 < 6L)
switch (v1)
{
case 0L:
*str++ = '0';
continue;
case 1L:
*str++ = '1';
continue;
case 2L:
*str++ = '1';
continue;
case 3L:
*str++ = '1';
continue;
case 4L:
*str++ = '1';
continue;
case 5L:
*str++ = '1';
continue;
}
if (v1 > 999999999L)
{
v2 = v1 / 1000000000;
+1
View File
@@ -15,6 +15,7 @@
* and avoid compile-time configuration.
*/
#include "config.h"
#if !defined(USE_SSL)
#include <string.h>
+16 -1
View File
@@ -61,6 +61,7 @@ Callback *Callbacks[MAXCALLBACKS]; /* Callback objects for modules, used for reh
Callback *RCallbacks[MAXCALLBACKS]; /* 'Real' callback function, used for callback function calls */
MODVAR Module *Modules = NULL;
MODVAR Versionflag *Versionflags = NULL;
int Module_Depend_Resolve(Module *p);
Module *Module_make(ModuleHeader *header,
#ifdef _WIN32
@@ -459,6 +460,9 @@ void Unload_all_loaded_modules(void)
else if (objs->type == MOBJ_CALLBACK) {
CallbackDel(objs->object.callback);
}
else if (objs->type == MOBJ_ISUPPORT) {
IsupportDel(objs->object.isupport);
}
}
for (child = mi->children; child; child = childnext)
{
@@ -519,6 +523,9 @@ void Unload_all_testing_modules(void)
else if (objs->type == MOBJ_CALLBACK) {
CallbackDel(objs->object.callback);
}
else if (objs->type == MOBJ_ISUPPORT) {
IsupportDel(objs->object.isupport);
}
}
for (child = mi->children; child; child = childnext)
{
@@ -585,6 +592,10 @@ int Module_free(Module *mod)
else if (objs->type == MOBJ_CALLBACK) {
CallbackDel(objs->object.callback);
}
else if (objs->type == MOBJ_ISUPPORT) {
IsupportDel(objs->object.isupport);
}
}
for (p = Modules; p; p = p->next)
{
@@ -1317,11 +1328,15 @@ static const char *module_error_str[] = {
"No error",
"Object already exists",
"No space available",
"Invalid parameter(s)"
"Invalid parameter(s)",
"Object was not found"
};
const char *ModuleGetErrorStr(Module *module)
{
if (module->errorcode >= sizeof(module_error_str)/sizeof(module_error_str[0]))
return NULL;
return module_error_str[module->errorcode];
}
+316 -24
View File
@@ -18,18 +18,22 @@
#*
#* $Id$
#*/
# major edit from fez - to compile objects individually...
INCLUDES = ../include/struct.h ../include/config.h \
../include/sys.h ../include/common.h ../include/version.h \
../include/h.h ../include/numeric.h ../include/msg.h \
../include/dynconf.h ../include/modules.h ../include/setup.h
R_MODULES=m_sethost.so m_chghost.so m_chgident.so m_setname.so \
m_setident.so m_sdesc.so m_svsmode.so m_swhois.so\
m_svsmotd.so m_svsnline.so m_who.so m_mkpasswd.so \
m_away.so m_svsnoop.so m_svso.so m_svsnick.so \
#just changing this to cloak.so oldcloak.so could be a ./Config option...
#R_MODULES=cloak.so oldcloak.so
R_MODULES= \
m_sethost.so m_chghost.so m_chgident.so m_setname.so \
m_setident.so m_sdesc.so m_svsmode.so m_swhois.so\
m_svsmotd.so m_svsnline.so m_who.so m_mkpasswd.so \
m_away.so m_svsnoop.so m_svso.so m_svsnick.so \
m_adminchat.so m_akill.so m_chgname.so m_guest.so m_htm.so m_kill.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_tkl.so m_vhost.so m_cycle.so m_svsjoin.so m_svspart.so \
@@ -42,26 +46,27 @@ R_MODULES=m_sethost.so m_chghost.so m_chgident.so m_setname.so \
m_trace.so m_netinfo.so m_links.so m_help.so m_rules.so \
m_close.so m_map.so m_eos.so m_server.so m_stats.so \
m_svsfline.so m_dccdeny.so m_undccdeny.so m_whowas.so \
m_connect.so cloak.so oldcloak.so m_dccallow.so
m_connect.so m_dccallow.so m_userip.so cloak.so oldcloak.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_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_tkl.c m_vhost.c m_cycle.c m_svsjoin.c m_svspart.c \
m_svslusers.c m_svswatch.c m_svssilence.c m_sendsno.c \
m_svssno.c m_sajoin.c m_sapart.c m_samode.c m_kick.c m_topic.c \
m_invite.c m_list.c m_time.c m_svskill.c m_sjoin.c \
m_pass.c m_userhost.c m_ison.c m_silence.c m_knock.c m_umode2.c \
m_squit.c m_protoctl.c m_addline.c m_addmotd.c m_addomotd.c \
m_wallops.c m_admin.c m_globops.c m_locops.c m_chatops.c \
m_trace.c m_netinfo.c m_links.c m_help.c m_rules.c \
m_close.c m_map.c m_eos.c m_server.c m_stats.c \
m_svsfline.c m_dccdeny.c m_undccdeny.c m_whowas.c \
m_connect.c m_dccallow.c
#note change of .c to .o
COMMANDS=m_sethost.o m_chghost.o m_chgident.o m_setname.o m_setident.o \
m_sdesc.o m_svsmode.o m_swhois.o m_svsmotd.o m_svsnline.o \
m_who.o m_mkpasswd.o m_away.o m_svsnoop.o m_svso.o m_svsnick.o \
m_adminchat.o m_akill.o m_chgname.o m_guest.o m_htm.o m_kill.o \
m_lag.o m_message.o m_nachat.o m_oper.o m_pingpong.o \
m_quit.o m_rakill.o m_rping.o m_sendumode.o m_sqline.o \
m_tsctl.o m_unkline.o m_unsqline.o m_unzline.o m_whois.o \
m_tkl.o m_vhost.o m_cycle.o m_svsjoin.o m_svspart.o \
m_svslusers.o m_svswatch.o m_svssilence.o m_sendsno.o \
m_svssno.o m_sajoin.o m_sapart.o m_samode.o m_kick.o m_topic.o \
m_invite.o m_list.o m_time.o m_svskill.o m_sjoin.o \
m_pass.o m_userhost.o m_ison.o m_silence.o m_knock.o m_umode2.o \
m_squit.o m_protoctl.o m_addline.o m_addmotd.o m_addomotd.o \
m_wallops.o m_admin.o m_globops.o m_locops.o m_chatops.o \
m_trace.o m_netinfo.o m_links.o m_help.o m_rules.o \
m_close.o m_map.o m_eos.o m_server.o m_stats.o \
m_svsfline.o m_dccdeny.o m_undccdeny.o m_whowas.o \
m_connect.o m_dccallow.o m_userip.o
MODULES=commands.so $(R_MODULES)
@@ -79,6 +84,284 @@ commands.so: l_commands.c $(COMMANDS) $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -o commands.so l_commands.c \
$(COMMANDS)
#############################################################################
# commands.so's .o's section
#############################################################################
m_adminchat.o: m_adminchat.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_adminchat.c
m_akill.o: m_akill.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_akill.c
m_chgname.o: m_chgname.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_chgname.c
m_guest.o: m_guest.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_guest.c
m_htm.o: m_htm.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_htm.c
m_kill.o: m_kill.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_kill.c
m_lag.o: m_lag.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_lag.c
m_message.o: m_message.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_message.c
m_nachat.o: m_nachat.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_nachat.c
m_oper.o: m_oper.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_oper.c
m_pingpong.o: m_pingpong.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_pingpong.c
m_quit.o: m_quit.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_quit.c
m_rakill.o: m_rakill.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_rakill.c
m_rping.o: m_rping.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_rping.c
m_sendumode.o: m_sendumode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sendumode.c
m_sqline.o: m_sqline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sqline.c
m_tsctl.o: m_tsctl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_tsctl.c
m_unkline.o: m_unkline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_unkline.c
m_unsqline.o: m_unsqline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_unsqline.c
m_unzline.o: m_unzline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_unzline.c
m_whois.o: m_whois.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_whois.c
m_sethost.o: m_sethost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sethost.c
m_chghost.o: m_chghost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_chghost.c
m_chgident.o: m_chgident.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_chgident.c
m_setident.o: m_setident.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_setident.c
m_setname.o: m_setname.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_setname.c
m_sdesc.o: m_sdesc.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sdesc.c
m_svsmode.o: m_svsmode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsmode.c
m_swhois.o: m_swhois.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_swhois.c
m_svsmotd.o: m_svsmotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsmotd.c
m_svsnline.o: m_svsnline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsnline.c
m_who.o: m_who.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_who.c
m_mkpasswd.o: m_mkpasswd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_mkpasswd.c
m_away.o: m_away.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_away.c
m_svsnoop.o: m_svsnoop.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsnoop.c
m_svso.o: m_svso.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svso.c
m_svsnick.o: m_svsnick.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsnick.c
m_tkl.o: m_tkl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_tkl.c
m_vhost.o: m_vhost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_vhost.c
m_cycle.o: m_cycle.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_cycle.c
m_svsjoin.o: m_svsjoin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsjoin.c
m_svspart.o: m_svspart.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svspart.c
m_svslusers.o: m_svslusers.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svslusers.c
m_svswatch.o: m_svswatch.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svswatch.c
m_svssilence.o: m_svssilence.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svssilence.c
m_sendsno.o: m_sendsno.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sendsno.c
m_svssno.o: m_svssno.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svssno.c
m_sajoin.o: m_sajoin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sajoin.c
m_sapart.o: m_sapart.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sapart.c
m_samode.o: m_samode.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_samode.c
m_kick.o: m_kick.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_kick.c
m_topic.o: m_topic.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_topic.c
m_invite.o: m_invite.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_invite.c
m_list.o: m_list.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_list.c
m_time.o: m_time.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_time.c
m_svskill.o: m_svskill.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svskill.c
m_sjoin.o: m_sjoin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_sjoin.c
m_pass.o: m_pass.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_pass.c
m_userhost.o: m_userhost.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_userhost.c
m_ison.o: m_ison.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_ison.c
m_silence.o: m_silence.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_silence.c
m_knock.o: m_knock.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_knock.c
m_umode2.o: m_umode2.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_umode2.c
m_squit.o: m_squit.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_squit.c
m_protoctl.o: m_protoctl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_protoctl.c
m_addline.o: m_addline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_addline.c
m_addmotd.o: m_addmotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_addmotd.c
m_addomotd.o: m_addomotd.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_addomotd.c
m_wallops.o: m_wallops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_wallops.c
m_admin.o: m_admin.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_admin.c
m_globops.o: m_globops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_globops.c
m_locops.o: m_locops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_locops.c
m_chatops.o: m_chatops.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_chatops.c
m_trace.o: m_trace.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_trace.c
m_netinfo.o: m_netinfo.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_netinfo.c
m_links.o: m_links.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_links.c
m_help.o: m_help.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_help.c
m_rules.o: m_rules.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_rules.c
m_close.o: m_close.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_close.c
m_map.o: m_map.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_map.c
m_eos.o: m_eos.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_eos.c
m_server.o: m_server.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_server.c
m_stats.o: m_stats.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_stats.c
m_svsfline.o: m_svsfline.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_svsfline.c
m_dccdeny.o: m_dccdeny.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_dccdeny.c
m_undccdeny.o: m_undccdeny.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_undccdeny.c
m_whowas.o: m_whowas.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_whowas.c
m_connect.o: m_connect.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_connect.c
m_dccallow.o: m_dccallow.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_dccallow.c
m_userip.o: m_userip.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_userip.c
#############################################################################
# .so's section
#############################################################################
m_adminchat.so: m_adminchat.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_adminchat.so m_adminchat.c
@@ -435,6 +718,13 @@ m_dccallow.so: m_dccallow.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_dccallow.so m_dccallow.c
m_userip.so: m_userip.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -c m_userip.c
#############################################################################
# and now the remaining modules...
#############################################################################
cloak.so: cloak.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o cloak.so cloak.c
@@ -445,3 +735,5 @@ oldcloak.so: oldcloak.c $(INCLUDES)
clean:
$(RM) -f *.o *.so *~ core
+6
View File
@@ -107,6 +107,12 @@ DLLFUNC int MOD_LOAD(cloak)(int module_load)
DLLFUNC int MOD_UNLOAD(cloak)(int module_unload)
{
if (cloak_key1)
{
MyFree(cloak_key1);
MyFree(cloak_key2);
MyFree(cloak_key3);
}
return MOD_SUCCESS;
}
+6 -3
View File
@@ -88,7 +88,7 @@ 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);
extern int m_akill_Init(ModuleInfo *modinfo), m_rakill_Init(ModuleInfo *modinfo), m_userip_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);
@@ -130,7 +130,7 @@ 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);
extern int m_akill_Load(int module_load), m_rakill_Load(int module_load), m_userip_Load(int unused);
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);
@@ -170,7 +170,7 @@ 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_unzline_Unload(), m_unkline_Unload();
extern int m_unzline_Unload(), m_unkline_Unload(), m_userip_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(), m_svslusers_Unload();
extern int m_svswatch_Unload(), m_svssilence_Unload(), m_svskill_Unload();
@@ -310,6 +310,7 @@ int l_commands_Init(ModuleInfo *modinfo)
m_whowas_Init(ModCmdsInfo);
m_connect_Init(ModCmdsInfo);
m_dccallow_Init(ModCmdsInfo);
m_userip_Init(ModCmdsInfo);
#ifdef GUEST
m_guest_Init(ModCmdsInfo);
#endif
@@ -410,6 +411,7 @@ int l_commands_Load(int module_load)
m_whowas_Load(module_load);
m_connect_Load(module_load);
m_dccallow_Load(module_load);
m_userip_Load(module_load);
#ifdef GUEST
m_guest_Load(module_load);
#endif
@@ -510,6 +512,7 @@ int l_commands_Unload(int module_unload)
m_whowas_Unload();
m_connect_Unload();
m_dccallow_Unload();
m_userip_Unload();
#ifdef GUEST
m_guest_Unload();
#endif
+8 -2
View File
@@ -97,8 +97,10 @@ DLLFUNC int MOD_UNLOAD(m_away)(int module_unload)
** parv[0] = sender prefix
** parv[1] = away message
*/
int m_away(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
char *away, *awy2 = parv[1];
int m_away(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
char *away, *awy2 = parv[1];
int n;
if (IsServer(sptr))
return 0;
@@ -120,6 +122,10 @@ int m_away(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
return 0;
}
n = dospamfilter(sptr, parv[1], SPAMF_AWAY, NULL);
if (n < 0)
return n;
#ifdef NO_FLOOD_AWAY
if (MyClient(sptr) && AWAY_PERIOD && !IsAnOper(sptr))
{
+1 -7
View File
@@ -47,7 +47,6 @@
DLLFUNC int m_dccallow(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_DCCALLOW "DCCALLOW"
#define TOK_DCCALLOW ""
ModuleHeader MOD_HEADER(m_dccallow)
= {
@@ -60,7 +59,7 @@ ModuleHeader MOD_HEADER(m_dccallow)
DLLFUNC int MOD_INIT(m_dccallow)(ModuleInfo *modinfo)
{
add_Command(MSG_DCCALLOW, TOK_DCCALLOW, m_dccallow, 1);
CommandAdd(modinfo->handle, MSG_DCCALLOW, NULL, m_dccallow, 1, M_USER|M_ANNOUNCE);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
@@ -72,11 +71,6 @@ DLLFUNC int MOD_LOAD(m_dccallow)(int module_load)
DLLFUNC int MOD_UNLOAD(m_dccallow)(int module_unload)
{
if (del_Command(MSG_DCCALLOW, TOK_DCCALLOW, m_dccallow) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_dccallow).name);
}
return MOD_SUCCESS;
}
+2
View File
@@ -293,6 +293,8 @@ CMD_FUNC(m_kick)
if (breakit)
continue;
RunHook5(HOOKTYPE_LOCAL_KICK, cptr,sptr,who,chptr,comment);
} else {
RunHook5(HOOKTYPE_REMOTE_KICK, cptr, sptr, who, chptr, comment);
}
if (lp)
{
+1 -6
View File
@@ -60,7 +60,7 @@ ModuleHeader MOD_HEADER(m_knock)
DLLFUNC int MOD_INIT(m_knock)(ModuleInfo *modinfo)
{
add_Command(MSG_KNOCK, TOK_KNOCK, m_knock, 2);
CommandAdd(modinfo->handle, MSG_KNOCK, TOK_KNOCK, m_knock, 2, M_USER|M_ANNOUNCE);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
@@ -72,11 +72,6 @@ DLLFUNC int MOD_LOAD(m_knock)(int module_load)
DLLFUNC int MOD_UNLOAD(m_knock)(int module_unload)
{
if (del_Command(MSG_KNOCK, TOK_KNOCK, m_knock) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_knock).name);
}
return MOD_SUCCESS;
}
+1 -6
View File
@@ -60,7 +60,7 @@ ModuleHeader MOD_HEADER(m_map)
DLLFUNC int MOD_INIT(m_map)(ModuleInfo *modinfo)
{
add_Command(MSG_MAP, TOK_MAP, m_map, MAXPARA);
CommandAdd(modinfo->handle, MSG_MAP, TOK_MAP, m_map, MAXPARA, M_USER|M_ANNOUNCE);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
@@ -72,11 +72,6 @@ DLLFUNC int MOD_LOAD(m_map)(int module_load)
DLLFUNC int MOD_UNLOAD(m_map)(int module_unload)
{
if (del_Command(MSG_MAP, TOK_MAP, m_map) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
MOD_HEADER(m_map).name);
}
return MOD_SUCCESS;
}
+5 -2
View File
@@ -270,13 +270,13 @@ DLLFUNC int m_message(aClient *cptr, aClient *sptr, int parc, char *parv[], int
if (MyClient(sptr))
{
ret = dospamfilter(sptr, text, newcmd == MSG_NOTICE ? SPAMF_USERNOTICE : SPAMF_USERMSG, acptr->name);
ret = dospamfilter(sptr, text, (notice ? SPAMF_USERNOTICE : SPAMF_USERMSG), acptr->name);
if (ret < 0)
return FLUSH_BUFFER;
}
for (tmphook = Hooks[HOOKTYPE_USERMSG]; tmphook; tmphook = tmphook->next) {
text = (*(tmphook->func.pcharfunc))(cptr, sptr, acptr, text, (int)(newcmd == MSG_NOTICE ? 1 : 0) );
text = (*(tmphook->func.pcharfunc))(cptr, sptr, acptr, text, notice);
if (!text)
break;
}
@@ -373,6 +373,9 @@ DLLFUNC int m_message(aClient *cptr, aClient *sptr, int parc, char *parv[], int
abort();
strlcpy(pfixchan+1, p2, sizeof(pfixchan)-1);
nick = pfixchan;
} else {
strlcpy(pfixchan, p2, sizeof(pfixchan));
nick = pfixchan;
}
}
+23 -9
View File
@@ -252,7 +252,10 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
/* new oper code */
sptr->umodes |= OPER_MODES;
if (aconf->modes)
sptr->umodes |= aconf->modes;
else
sptr->umodes |= OPER_MODES;
/* handle oflags that trigger umodes */
@@ -270,7 +273,19 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
sptr->oflag = aconf->oflags;
if ((aconf->oflags & OFLAG_HIDE) && iNAH && !BadPtr(host)) {
iNAH_host(sptr, host);
char *c;
char *vhost = host;
if ((c = strchr(host, '@')))
{
vhost = c+1;
strncpy(sptr->user->username, host, c-host);
sptr->user->username[c-host] = 0;
sendto_serv_butone_token(NULL, sptr->name, MSG_SETIDENT,
TOK_SETIDENT, "%s",
sptr->user->username);
}
iNAH_host(sptr, vhost);
SetHidden(sptr);
} else
if (IsHidden(sptr) && !sptr->user->virthost) {
@@ -292,15 +307,14 @@ DLLFUNC int m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
if (announce != NULL) {
sendto_ops
("%s (%s@%s) [%s] %s",
sendto_snomask(SNO_OPER,
"%s (%s@%s) [%s] %s",
parv[0], sptr->user->username, GetHost(sptr),
parv[1], announce);
sendto_serv_butone(&me,
":%s GLOBOPS :%s (%s@%s) [%s] %s",
me.name, parv[0], sptr->user->username,
GetHost(sptr), parv[1], announce);
sendto_serv_butone_token(NULL, me.name, MSG_SENDSNO, TOK_SENDSNO,
"o :%s (%s@%s) [%s] %s",
parv[0], sptr->user->username,
GetHost(sptr), parv[1], announce);
}
if (aconf->snomask)
set_snomask(sptr, aconf->snomask);
+42 -16
View File
@@ -60,7 +60,7 @@ ModuleHeader MOD_HEADER(m_sapart)
DLLFUNC int MOD_INIT(m_sapart)(ModuleInfo *modinfo)
{
add_Command(MSG_SAPART, TOK_SAPART, m_sapart, MAXPARA);
add_Command(MSG_SAPART, TOK_SAPART, m_sapart, 3);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
@@ -87,10 +87,13 @@ DLLFUNC int MOD_UNLOAD(m_sapart)(int module_unload)
parv[0] - sender
parv[1] - nick to make part
parv[2] - channel(s) to part
parv[3] - comment
*/
DLLFUNC CMD_FUNC(m_sapart)
{
aClient *acptr;
char *comment = (parc > 3 && parv[3] ? parv[3] : NULL);
char commentx[512];
if (!IsSAdmin(sptr) && !IsULine(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
@@ -108,28 +111,51 @@ DLLFUNC CMD_FUNC(m_sapart)
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]);
return 0;
}
sendto_realops("%s used SAPART to make %s part %s", sptr->name, parv[1],
parv[2]);
/* Logging function added by XeRXeS */
ircd_log(LOG_SACMDS,"SAPART: %s used SAPART to make %s part %s",
sptr->name, parv[1], parv[2]);
if (comment)
{
sendto_realops("%s used SAPART to make %s part %s (%s)", sptr->name, parv[1],
parv[2], comment);
/* Logging function added by XeRXeS */
ircd_log(LOG_SACMDS,"SAPART: %s used SAPART to make %s part %s (%s)",
sptr->name, parv[1], parv[2], comment);
strcpy(commentx, "SAPart: ");
strlcat(commentx, comment, 512);
}
else
{
sendto_realops("%s used SAPART to make %s part %s", sptr->name, parv[1],
parv[2]);
/* Logging function added by XeRXeS */
ircd_log(LOG_SACMDS,"SAPART: %s used SAPART to make %s part %s",
sptr->name, parv[1], parv[2]);
}
if (MyClient(acptr))
{
parv[0] = parv[1];
parv[1] = parv[2];
parv[2] = NULL;
sendto_one(acptr,
":%s %s %s :*** You were forced to part %s", me.name,
IsWebTV(acptr) ? "PRIVMSG" : "NOTICE", acptr->name, parv[1]);
(void)m_part(acptr, acptr, 2, parv);
parv[2] = comment ? commentx : NULL;
if (comment)
sendto_one(acptr,
":%s %s %s :*** You were forced to part %s (%s)", me.name,
IsWebTV(acptr) ? "PRIVMSG" : "NOTICE", acptr->name, parv[1],
commentx);
else
sendto_one(acptr,
":%s %s %s :*** You were forced to part %s", me.name,
IsWebTV(acptr) ? "PRIVMSG" : "NOTICE", acptr->name, parv[1]);
(void)m_part(acptr, acptr, comment ? 3 : 2, parv);
}
else
sendto_one(acptr, ":%s SAPART %s %s", parv[0],
parv[1], parv[2]);
{
if (comment)
sendto_one(acptr, ":%s SAPART %s %s :%s", parv[0],
parv[1], parv[2], comment);
else
sendto_one(acptr, ":%s SAPART %s %s", parv[0], parv[1],
parv[2]);
}
return 0;
}
+6 -1
View File
@@ -379,7 +379,7 @@ CMD_FUNC(m_sjoin)
while (
(*tp == '@') || (*tp == '+') || (*tp == '%')
|| (*tp == '*') || (*tp == '~') || (*tp == '&')
|| (*tp == '"'))
|| (*tp == '"') || (*tp == '\''))
{
switch (*(tp++))
{
@@ -405,6 +405,8 @@ CMD_FUNC(m_sjoin)
modeflags |= CHFL_EXCEPT;
goto getnick;
break;
case '\'': /* future: invex chanmode (+I) */
goto docontinue;
}
}
getnick:
@@ -472,6 +474,7 @@ CMD_FUNC(m_sjoin)
#endif
} else {
add_user_to_channel(chptr, acptr, modeflags);
RunHook4(HOOKTYPE_REMOTE_JOIN, cptr, acptr, chptr, NULL);
if (chptr->mode.mode & MODE_AUDITORIUM)
{
if (modeflags & (CHFL_CHANOP|CHFL_CHANPROT|CHFL_CHANOWNER))
@@ -517,6 +520,8 @@ CMD_FUNC(m_sjoin)
}
}
}
docontinue:
continue;
}
if (modebuf[1])
+1 -1
View File
@@ -47,7 +47,7 @@ DLLFUNC int m_svsjoin(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
#define MSG_SVSJOIN "SVSJOIN"
#define TOK_SVSJOIN "BR"
#define TOK_SVSJOIN "BX"
ModuleHeader MOD_HEADER(m_svsjoin)
= {
+1 -1
View File
@@ -174,7 +174,7 @@ int m_svso(aClient *cptr, aClient *sptr, int parc, char *parv[])
acptr->umodes &=
~(UMODE_NETADMIN | UMODE_WHOIS);
acptr->umodes &=
~(UMODE_KIX | UMODE_DEAF | UMODE_HIDEOPER);
~(UMODE_KIX | UMODE_DEAF | UMODE_HIDEOPER | UMODE_VICTIM);
acptr->oflag = 0;
remove_oper_snomasks(acptr);
RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0);
+13 -4
View File
@@ -64,7 +64,7 @@ DLLFUNC int MOD_INIT(m_svspart)(ModuleInfo *modinfo)
/*
* We call our add_Command crap here
*/
add_Command(MSG_SVSPART, TOK_SVSPART, m_svspart, MAXPARA);
add_Command(MSG_SVSPART, TOK_SVSPART, m_svspart, 3);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
@@ -92,10 +92,12 @@ DLLFUNC int MOD_UNLOAD(m_svspart)(int module_unload)
parv[0] - sender
parv[1] - nick to make part
parv[2] - channel(s) to part
parv[3] - comment
*/
CMD_FUNC(m_svspart)
{
aClient *acptr;
char *comment = (parc > 3 && parv[3] ? parv[3] : NULL);
if (!IsULine(sptr))
return 0;
@@ -105,11 +107,18 @@ CMD_FUNC(m_svspart)
{
parv[0] = parv[1];
parv[1] = parv[2];
(void)m_part(acptr, acptr, 2, parv);
parv[2] = comment;
(void)m_part(acptr, acptr, comment ? 3 : 2, parv);
}
else
sendto_one(acptr, ":%s SVSPART %s %s", parv[0],
parv[1], parv[2]);
{
if (comment)
sendto_one(acptr, ":%s SVSPART %s %s :%s", parv[0],
parv[1], parv[2], parv[3]);
else
sendto_one(acptr, ":%s SVSPART %s %s", parv[0],
parv[1], parv[2]);
}
return 0;
}
+1 -1
View File
@@ -47,7 +47,7 @@ DLLFUNC int m_svswatch(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
#define MSG_SVSWATCH "SVSWATCH"
#define TOK_SVSWATCH "BW"
#define TOK_SVSWATCH "Bw"
ModuleHeader MOD_HEADER(m_svswatch)
= {
+140
View File
@@ -0,0 +1,140 @@
/*
* IRC - Internet Relay Chat, src/modules/m_userip.c
* (C) 2004 The UnrealIRCd Team
*
* 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 "proto.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_userip(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_USERIP "USERIP"
ModuleHeader MOD_HEADER(m_userip)
= {
"m_userip",
"$Id$",
"command /userip",
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_userip)(ModuleInfo *modinfo)
{
CommandAdd(modinfo->handle, MSG_USERIP, NULL, m_userip, 1, M_USER|M_ANNOUNCE);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_userip)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_userip)(int module_unload)
{
return MOD_SUCCESS;
}
/*
* m_userip is based on m_userhost
* m_userhost added by Darren Reed 13/8/91 to aid clients and reduce
* the need for complicated requests like WHOIS. It returns user/host
* information only (no spurious AWAY labels or channels).
* Re-written by Dianora 1999
*/
DLLFUNC CMD_FUNC(m_userip)
{
char *p; /* scratch end pointer */
char *cn; /* current name */
char *ip;
struct Client *acptr;
char response[5][NICKLEN * 2 + CHANNELLEN + USERLEN + HOSTLEN + 30];
int i; /* loop counter */
if (parc < 2)
{
sendto_one(sptr, rpl_str(ERR_NEEDMOREPARAMS),
me.name, parv[0], "USERHOST");
return 0;
}
/* The idea is to build up the response string out of pieces
* none of this strlen() nonsense.
* 5 * (NICKLEN*2+CHANNELLEN+USERLEN+HOSTLEN+30) is still << sizeof(buf)
* and our ircsprintf() truncates it to fit anyway. There is
* no danger of an overflow here. -Dianora
*/
response[0][0] = response[1][0] = response[2][0] =
response[3][0] = response[4][0] = '\0';
cn = parv[1];
for (i = 0; (i < 5) && cn; i++)
{
if ((p = strchr(cn, ' ')))
*p = '\0';
if ((acptr = find_person(cn, NULL)))
{
if (!(ip = GetIP(acptr)))
ip = "<unknown>";
if (sptr != acptr && !IsOper(sptr) && IsHidden(acptr))
ip = RCallbacks[CALLBACKTYPE_CLOAK]->func.pcharfunc(ip);
ircsprintf(response[i], "%s%s=%c%s@%s",
acptr->name,
(IsAnOper(acptr) && (!IsHideOper(acptr) || sptr == acptr || IsAnOper(sptr)))
? "*" : "",
(acptr->user->away) ? '-' : '+',
acptr->user->username, ip);
}
if (p)
p++;
cn = p;
}
sendto_one(sptr, rpl_str(RPL_USERIP), me.name, parv[0],
response[0], response[1], response[2], response[3], response[4]);
return 0;
}
+3 -1
View File
@@ -175,12 +175,14 @@ int m_vhost(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (vhost->virtuser) {
strcpy(olduser, sptr->user->username);
strlcpy(sptr->user->username, vhost->virtuser, USERLEN);
sendto_serv_butone_token(cptr, sptr->name, MSG_SETIDENT, TOK_SETIDENT,
"%s", sptr->user->username);
}
sptr->umodes |= UMODE_HIDE;
sptr->umodes |= UMODE_SETHOST;
sendto_serv_butone_token(cptr, sptr->name,
MSG_SETHOST, TOK_SETHOST,
"%s", vhost->virthost);
"%s", sptr->user->virthost);
sendto_one(sptr, ":%s MODE %s :+tx",
sptr->name, sptr->name);
if (vhost->swhois) {
+20 -14
View File
@@ -204,15 +204,15 @@ static void who_sendhelp(aClient *sptr)
"Flag a: user is away",
"Flag c <channel>: user is on <channel>,",
" no wildcards accepted",
"Flag h <host>: user has string <host> in their hostname,",
"Flag h <host>: user has string <host> in his/her hostname,",
" wildcards accepted",
"Flag m <usermodes>: user has <usermodes> set on them,",
" only O/o/C/A/a/N are allowed",
"Flag n <nick>: user has string <nick> in their nickname,",
"Flag m <usermodes>: user has <usermodes> set, only",
" O/o/C/A/a/N are allowed",
"Flag n <nick>: user has string <nick> in his/her nickname,",
" wildcards accepted",
"Flag s <server>: user is on server <server>,",
" wildcards not accepted",
"Flag u <user>: user has string <user> in their username,",
"Flag u <user>: user has string <user> in his/her username,",
" wildcards accepted",
"Behavior flags:",
"Flag M: check for user in channels I am a member of",
@@ -227,23 +227,23 @@ static void who_sendhelp(aClient *sptr)
"Flag a: user is away",
"Flag c <channel>: user is on <channel>,",
" no wildcards accepted",
"Flag g <gcos/realname>: user has string <gcos> in their GCOS,",
"Flag g <gcos/realname>: user has string <gcos> in his/her GCOS,",
" wildcards accepted",
"Flag h <host>: user has string <host> in their hostname,",
"Flag h <host>: user has string <host> in his/her hostname,",
" wildcards accepted",
"Flag i <ip>: user has string <ip> in their hostname,",
"Flag i <ip>: user has string <ip> in his/her IP address,",
" wildcards accepted",
"Flag m <usermodes>: user has <usermodes> set on them",
"Flag n <nick>: user has string <nick> in their nickname,",
"Flag m <usermodes>: user has <usermodes> set",
"Flag n <nick>: user has string <nick> in his/her nickname,",
" wildcards accepted",
"Flag s <server>: user is on server <server>,",
" wildcards not accepted",
"Flag u <user>: user has string <user> in their username,",
"Flag u <user>: user has string <user> in his/her username,",
" wildcards accepted",
"Behavior flags:",
"Flag M: check for user in channels I am a member of",
"Flag R: show users' real hostnames",
"Flag I: show user's IP address",
"Flag I: show users' IP addresses",
NULL
};
char **s;
@@ -544,10 +544,16 @@ char has_common_chan = 0;
else
{
/* a user/mask who */
/* If the common channel info hasn't been set, set it now */
if (!wfl.common_channels_only)
has_common_chan = has_common_channels(sptr, acptr);
if (IsInvisible(acptr) && !has_common_chan)
{
/* don't show them unless it's an exact match */
if ((who_flags & WF_WILDCARD))
/* don't show them unless it's an exact match
or it is the user requesting the /who */
if ((who_flags & WF_WILDCARD) && sptr != acptr)
break;
}
}
+9 -9
View File
@@ -175,12 +175,15 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
IsHidden(acptr) ? user->virthost : user->realhost,
acptr->info);
if (IsEyes(sptr) && IsOper(sptr))
if (IsOper(sptr))
{
char sno[512];
strcpy(sno, get_sno_str(acptr));
/* send the target user's modes */
sendto_one(sptr, rpl_str(RPL_WHOISMODES),
me.name, parv[0], name,
get_mode_str(acptr));
get_mode_str(acptr), sno[1] == 0 ? "" : sno);
}
if ((acptr == sptr) || IsAnOper(sptr))
{
@@ -238,18 +241,15 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
&& IsAnOper(sptr))
*(buf + len++) = '!';
access = get_access(acptr, chptr);
#ifndef PREFIX_AQ
if (access & CHFL_CHANOWNER)
*(buf + len++) = '*';
else if (access & CHFL_CHANPROT)
*(buf + len++) = '^';
#else
#ifdef PREFIX_AQ
if (access & CHFL_CHANOWNER)
*(buf + len++) = '~';
else if (access & CHFL_CHANPROT)
*(buf + len++) = '&';
else
#endif
else if (access & CHFL_CHANOP)
if (access & CHFL_CHANOP)
*(buf + len++) = '@';
else if (access & CHFL_HALFOP)
*(buf + len++) = '%';
-79
View File
@@ -289,85 +289,6 @@ aCommand *add_Command_backend(char *cmd, int (*func)(), unsigned char parameters
return newcmd;
}
int CommandExists(char *name)
{
aCommand *p;
for (p = CommandHash[toupper(*name)]; p; p = p->next)
{
if (!stricmp(p->cmd, name))
return 1;
}
for (p = TokenHash[*name]; p; p = p->next)
{
if (!strcmp(p->cmd, name))
return 1;
}
return 0;
}
Command *CommandAdd(Module *module, char *cmd, char *tok, int (*func)(), unsigned char params, int flags) {
Command *command;
if (find_Command_simple(cmd) || (tok && find_Command_simple(tok)))
{
if (module)
module->errorcode = MODERR_EXISTS;
return NULL;
}
command = MyMallocEx(sizeof(Command));
command->cmd = add_Command_backend(cmd,func,params, 0, flags);
command->tok = NULL;
command->cmd->owner = module;
if (tok) {
command->tok = add_Command_backend(tok,func,params,1,flags);
command->cmd->friend = command->tok;
command->tok->friend = command->cmd;
command->tok->owner = module;
}
else
command->cmd->friend = NULL;
if (module) {
ModuleObject *cmdobj = (ModuleObject *)MyMallocEx(sizeof(ModuleObject));
cmdobj->object.command = command;
cmdobj->type = MOBJ_COMMAND;
AddListItem(cmdobj, module->objects);
module->errorcode = MODERR_NOERROR;
}
return command;
}
void CommandDel(Command *command) {
Cmdoverride *ovr, *ovrnext;
DelListItem(command->cmd, CommandHash[toupper(*command->cmd->cmd)]);
if (command->tok)
DelListItem(command->tok, TokenHash[*command->tok->cmd]);
if (command->cmd->owner) {
ModuleObject *cmdobj;
for (cmdobj = command->cmd->owner->objects; cmdobj; cmdobj = (ModuleObject *)cmdobj->next) {
if (cmdobj->type == MOBJ_COMMAND && cmdobj->object.command == command) {
DelListItem(cmdobj,command->cmd->owner->objects);
MyFree(cmdobj);
break;
}
}
}
for (ovr = command->cmd->overriders; ovr; ovr = ovrnext)
{
ovrnext = ovr->next;
CmdoverrideDel(ovr);
}
MyFree(command->cmd->cmd);
MyFree(command->cmd);
if (command->tok) {
MyFree(command->tok->cmd);
MyFree(command->tok);
}
MyFree(command);
}
void add_Command(char *name, char *token, int (*func)(), unsigned char parameters)
{
aCommand *cmd, *tok;
+102 -18
View File
@@ -51,6 +51,9 @@ static ResRQ *last, *first;
static void rem_cache(aCache *);
static void rem_request(ResRQ *);
static int do_query_name(Link *, char *, ResRQ *);
/* revquery is used when looking up IP -> name -> IP to differentiate between
* IPv6 and IPv4, to make the proper request type --slePP */
static int do_revquery_name(Link *, char *, ResRQ *, int is_ipv6_address);
static int do_query_number(Link *, struct IN_ADDR *, ResRQ *);
static void resend_query(ResRQ *);
static int proc_answer(ResRQ *, HEADER *, char *, char *);
@@ -127,13 +130,23 @@ int init_resolver(int op)
if (op & RES_INITSOCK)
{
int on = 0;
struct sockaddr_in sa; /* TODO: IPv6 */
#ifdef INET6
/* still IPv4 */
ret = resfd = socket(AF_INET, SOCK_DGRAM, 0);
#else
ret = resfd = socket(AF_INET, SOCK_DGRAM, 0);
#endif
/* TODO: IPv6 */
/* for FreeBSD jail we need to bind() explicitly.. */
bzero(&sa, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_port = 0;
sa.sin_addr.s_addr = INADDR_ANY;
bind(resfd, (struct sockaddr *) &sa, sizeof(sa));
(void)setsockopt(ret, SOL_SOCKET, SO_BROADCAST, &on, on);
}
#ifdef DEBUGMODE
@@ -304,6 +317,19 @@ void del_queries(char *cp)
}
}
void del_async_connects(void)
{
ResRQ *rptr, *r2ptr;
for (rptr = first; rptr; rptr = r2ptr)
{
r2ptr = rptr->next;
if (rptr->cinfo.flags == ASYNC_CONNECT)
rem_request(rptr);
}
}
/*
* sends msg to all nameservers found in the "ircd_res" structure.
* This should reflect /etc/resolv.conf. We will get responses
@@ -399,6 +425,7 @@ static ResRQ *find_id(int id)
return rptr;
}
/* As of 2004-10-08 gethost_byname() is only used for outgoing connects to servers */
struct hostent *gethost_byname(char *name, Link *lp)
{
aCache *cp;
@@ -412,6 +439,20 @@ struct hostent *gethost_byname(char *name, Link *lp)
return NULL;
}
/* This is identical to gethost_byname, except it includes is_ipv6_address
* See do_revquery_name() */
struct hostent *gethost_byname_revquery(char *name, Link *lp, int is_ipv6_address)
{
aCache *cp;
reinfo.re_na_look++;
if ((cp = find_cache_name(name)))
return (struct hostent *)&(cp->he);
if (!lp)
return NULL;
(void)do_revquery_name(lp, name, NULL, is_ipv6_address);
return NULL;
}
struct hostent *gethost_byaddr(char *addr, Link *lp)
{
aCache *cp;
@@ -425,20 +466,19 @@ struct hostent *gethost_byaddr(char *addr, Link *lp)
return NULL;
}
/* [2004-10-08/Syzop] used for outgoing connects to servers and
* also for repeated normal requests (in which case rptr is non-NULL).
*/
static int do_query_name(Link *lp, char *name, ResRQ *rptr)
{
char hname[HOSTLEN + 1];
int len;
char hname[HOSTLEN + 1];
strncpyzt(hname, name, sizeof(hname));
len = strlen(hname);
strlcpy(hname, name, sizeof(hname));
if (rptr && !index(hname, '.') && ircd_res.options & RES_DEFNAMES)
{
(void)strncat(hname, dot, sizeof(hname) - len - 1);
len++;
(void)strncat(hname, ircd_res.defdname,
sizeof(hname) - len - 1);
strlcat(hname, dot, sizeof(hname));
strlcat(hname, ircd_res.defdname, sizeof(hname));
}
/*
@@ -449,19 +489,57 @@ static int do_query_name(Link *lp, char *name, ResRQ *rptr)
{
rptr = make_request(lp);
#ifdef INET6
rptr->type = T_ANY; /* Was T_AAAA: now using T_ANY so we fetch both A and AAAA -- Syzop */
rptr->type = T_AAAA; /* outgoing connect: try AAAA first, then A later */
#else
rptr->type = T_A;
#endif
rptr->name = (char *)MyMalloc(strlen(name) + 1);
(void)strcpy(rptr->name, name);
rptr->name = strdup(name);
}
Debug((DEBUG_DNS, "do_query_name(): %s ", hname));
#ifdef INET6
return (query_name(hname, C_IN, T_ANY, rptr)); /* Was T_AAAA: now using T_ANY so we fetch both A and AAAA -- Syzop */
#else
return (query_name(hname, C_IN, T_A, rptr));
#endif
/* We used 'type' here instead of 'rptr->type', but I don't see
* any reason not to use the latter. -- Syzop, 2004-10-08
*/
return (query_name(hname, C_IN, rptr->type, rptr));
}
/* If is_ipv6_address is set, look for AAAA records, if not,
* go looking for A records. This fixes a bug when talking to
* servers that do not provide any non-authoritative information
* to an ANY query (ie. dnscache). --slePP */
static int do_revquery_name(Link *lp, char *name, ResRQ *rptr, int is_ipv6_address)
{
char hname[HOSTLEN + 1];
Debug((DEBUG_DNS, "do_revquery_name: looking for %s", (is_ipv6_address?"IPv6":"IPv4")));
strncpyzt(hname, name, sizeof(hname));
if (rptr && !index(hname, '.') && ircd_res.options & RES_DEFNAMES)
{
strlcat(hname, dot, sizeof(hname));
strlcat(hname, ircd_res.defdname, sizeof(hname));
}
/*
* Store the name passed as the one to lookup and generate other host
* names to pass onto the nameserver(s) for lookups.
*/
if (!rptr)
{
rptr = make_request(lp);
if(is_ipv6_address)
rptr->type = T_AAAA;
else
rptr->type = T_A;
rptr->name = strdup(name);
}
Debug((DEBUG_DNS, "do_revquery_name(): %s ", hname));
if(is_ipv6_address)
return (query_name(hname, C_IN, T_AAAA, rptr));
else
return (query_name(hname, C_IN, T_A, rptr));
}
/*
@@ -554,6 +632,7 @@ static int query_name(char *name, int class, int type, ResRQ *rptr)
return r;
}
hptr = (HEADER *) buf;
hptr->rd = 1;
do
{
hptr->id = htons(getrandom16());
@@ -900,6 +979,7 @@ struct hostent *get_res(char *lp)
if (a > 0 && rptr->type == T_PTR)
{
struct hostent *hp2 = NULL;
int is_ipv6_address = 0;
if (BadPtr(rptr->he.h_name)) /* Kludge! 960907/Vesa */
goto getres_err;
@@ -913,7 +993,11 @@ struct hostent *get_res(char *lp)
* type we automatically gain the use of the cache with no
* extra kludges.
*/
if ((hp2 = gethost_byname(rptr->he.h_name, &rptr->cinfo)))
/* We add this IPv6 check to query for T_AAAA or T_A respectively.
* djbdns/dnscache doesn't return A or AAAA to a T_ANY (as it should)
* --slePP */
is_ipv6_address = (strchr(Inet_ia2p((struct IN_ADDR *)&rptr->he.h_addr), ':') != NULL);
if ((hp2 = gethost_byname_revquery(rptr->he.h_name, &rptr->cinfo, is_ipv6_address)))
if (lp)
bcopy((char *)&rptr->cinfo, lp, sizeof(Link));
/*
+12 -7
View File
@@ -272,6 +272,7 @@ int get_res_interfaces_nt(HKEY hKey, char *subkey, char *obuf, int *size)
int idx = 0;
FILETIME lastwrite;
HKEY hVal;
while (RegEnumKeyEx(hKey, idx++, buf, &key_len, 0, NULL, NULL, &lastwrite) != ERROR_NO_MORE_ITEMS)
{
if (RegOpenKeyEx(hKey, buf, 0, KEY_QUERY_VALUE, &hVal) != ERROR_SUCCESS)
@@ -303,6 +304,8 @@ void get_res_from_reg_nt()
HKEY hKey, hInter;
char buf[BUFSIZ];
int key_len = BUFSIZ;
char no_interfaces = 0;
ircd_res.nscount = 0;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Services\\Tcpip\\Parameters",
@@ -311,7 +314,9 @@ void get_res_from_reg_nt()
Debug((DEBUG_DNS, "Error: get_res_from_reg_nt: unable to open registry key"));
return;
}
RegOpenKeyEx(hKey, "Interfaces", 0, KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS, &hInter);
if (RegOpenKeyEx(hKey, "Interfaces", 0, KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,
&hInter) != ERROR_SUCCESS)
no_interfaces = 1;
/* Retreive the Domain key */
if (!get_res_nt(hKey, "Domain", buf, &key_len))
@@ -324,7 +329,7 @@ void get_res_from_reg_nt()
if (!get_res_interfaces_nt(hInter, "Domain", buf, &key_len))
{
key_len = BUFSIZ;
if (!get_res_interfaces_nt(hInter, "DhcpDomain", buf, &key_len))
if (!no_interfaces && !get_res_interfaces_nt(hInter, "DhcpDomain", buf, &key_len))
{
Debug((DEBUG_DNS, "get_res_from_reg_nt: RegQueryValueEx: Domain failed"));
}
@@ -343,7 +348,7 @@ void get_res_from_reg_nt()
if (!get_res_nt(hKey, "DhcpSearchList", buf, &key_len))
{
key_len = BUFSIZ;
if (!get_res_interfaces_nt(hInter, "SearchList", buf, &key_len))
if (!no_interfaces && !get_res_interfaces_nt(hInter, "SearchList", buf, &key_len))
{
key_len = BUFSIZ;
if (!get_res_interfaces_nt(hInter, "DhcpSearchList", buf, &key_len))
@@ -380,8 +385,7 @@ void get_res_from_reg_nt()
++cp;
*cp = 0;
*pp++ = 0;
}
}
/* Retreive the NameServer key */
key_len = BUFSIZ;
if (!get_res_nt(hKey, "NameServer", buf, &key_len))
@@ -391,7 +395,7 @@ void get_res_from_reg_nt()
if (!get_res_nt(hKey, "DhcpNameServer", buf, &key_len))
{
key_len = BUFSIZ;
if (!get_res_interfaces_nt(hInter, "NameServer", buf, &key_len))
if (!no_interfaces && !get_res_interfaces_nt(hInter, "NameServer", buf, &key_len))
{
key_len = BUFSIZ;
if (!get_res_interfaces_nt(hInter, "DhcpNameServer", buf, &key_len))
@@ -429,7 +433,8 @@ void get_res_from_reg_nt()
} while (ircd_res.nscount <= MAXNS);
}
}
RegCloseKey(hInter);
if (!no_interfaces)
RegCloseKey(hInter);
RegCloseKey(hKey);
}
#endif
+4 -3
View File
@@ -2366,7 +2366,7 @@ int connect_server(ConfigItem_link *aconf, aClient *by, struct hostent *hp)
* If we dont know the IP# for this host and itis a hostname and
* not a ip# string, then try and find the appropriate host record.
*/
if ((!aconf->ipnum.S_ADDR))
if (!WHOSTENTP(aconf->ipnum.S_ADDR))
{
Link lin;
@@ -2530,8 +2530,9 @@ static struct SOCKADDR *connect_inet(ConfigItem_link *aconf, aClient *cptr, int
* being present instead. If we dont know it, then the connect fails.
*/
#ifdef INET6
if (!inet_pton(AF_INET6, aconf->hostname, aconf->ipnum.s6_addr))
bcopy(minus_one, aconf->ipnum.s6_addr, IN6ADDRSZ);
if (!WHOSTENTP(aconf->ipnum.S_ADDR) &&
!inet_pton(AF_INET6, aconf->hostname, aconf->ipnum.s6_addr))
bcopy(minus_one, aconf->ipnum.s6_addr, IN6ADDRSZ); /* IP->struct failed: make invalid */
if (AND16(aconf->ipnum.s6_addr) == 255)
#else
if (isdigit(*aconf->hostname) && (aconf->ipnum.S_ADDR == -1))
+239 -86
View File
@@ -23,6 +23,7 @@
#include "sys.h"
#include "numeric.h"
#include "channel.h"
#include "macros.h"
#include <fcntl.h>
#ifndef _WIN32
#include <sys/socket.h>
@@ -132,10 +133,6 @@ static int _test_set (ConfigFile *conf, ConfigEntry *ce);
static int _test_badword (ConfigFile *conf, ConfigEntry *ce);
#endif
static int _test_deny (ConfigFile *conf, ConfigEntry *ce);
/* static int _test_deny_dcc (ConfigFile *conf, ConfigEntry *ce); ** TODO? */
/* static int _test_deny_link (ConfigFile *conf, ConfigEntry *ce); ** TODO? */
/* static int _test_deny_channel (ConfigFile *conf, ConfigEntry *ce); ** TODO? */
/* static int _test_deny_version (ConfigFile *conf, ConfigEntry *ce); ** TODO? */
static int _test_allow_channel (ConfigFile *conf, ConfigEntry *ce);
static int _test_allow_dcc (ConfigFile *conf, ConfigEntry *ce);
static int _test_loadmodule (ConfigFile *conf, ConfigEntry *ce);
@@ -278,6 +275,15 @@ static OperFlag _LogFlags[] = {
{ LOG_TKL, "tkl" },
};
/* This MUST be alphabetized */
static OperFlag ExceptTklFlags[] = {
{ TKL_GLOBAL|TKL_KILL, "gline" },
{ TKL_GLOBAL|TKL_NICK, "gqline" },
{ TKL_GLOBAL|TKL_ZAP, "gzline" },
{ TKL_NICK, "qline" },
{ TKL_GLOBAL|TKL_SHUN, "shun" }
};
#ifdef USE_SSL
/* This MUST be alphabetized */
static OperFlag _SSLFlags[] = {
@@ -1362,7 +1368,7 @@ void config_progress(char *format, ...)
ConfigCommand *config_binary_search(char *cmd) {
int start = 0;
int stop = sizeof(_ConfigCommands)/sizeof(_ConfigCommands[0])-1;
int stop = ARRAY_SIZEOF(_ConfigCommands)-1;
int mid;
while (start <= stop) {
mid = (start+stop)/2;
@@ -1532,6 +1538,7 @@ int init_conf(char *rootconf, int rehash)
if (rehash)
{
Hook *h;
del_async_connects();
config_rehash();
#ifndef STATIC_LINKING
Unload_all_loaded_modules();
@@ -2879,6 +2886,8 @@ int _test_me(ConfigFile *conf, ConfigEntry *ce)
if (cep->ce_vardata)
{
int valid = 0;
char *p;
if (strlen(cep->ce_vardata) > (REALLEN-1))
{
config_error("%s:%i: too long me::info, must be max. %i characters",
@@ -2886,6 +2895,19 @@ int _test_me(ConfigFile *conf, ConfigEntry *ce)
errors++;
}
/* Valid me::info? Any data except spaces is ok */
for (p=cep->ce_vardata; *p; p++)
if (*p != ' ')
{
valid = 1;
break;
}
if (!valid)
{
config_error("%s:%i: empty me::info, should be a server description.",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
errors++;
}
}
}
if (!(cep = config_find_entry(ce->ce_entries, "numeric")))
@@ -3008,7 +3030,7 @@ int _conf_oper(ConfigFile *conf, ConfigEntry *ce)
{
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
if ((ofp = config_binary_flags_search(_OperFlags, cepp->ce_varname, sizeof(_OperFlags)/sizeof(_OperFlags[0]))))
if ((ofp = config_binary_flags_search(_OperFlags, cepp->ce_varname, ARRAY_SIZEOF(_OperFlags))))
oper->oflags |= ofp->flag;
}
}
@@ -3020,6 +3042,10 @@ int _conf_oper(ConfigFile *conf, ConfigEntry *ce)
{
ircstrdup(oper->snomask, cep->ce_vardata);
}
if ((cep = config_find_entry(ce->ce_entries, "modes")))
{
oper->modes = set_usermode(cep->ce_vardata);
}
if ((cep = config_find_entry(ce->ce_entries, "maxlogins")))
{
oper->maxlogins = (int)config_checkval(cep->ce_vardata, CFG_TIME);
@@ -3083,6 +3109,8 @@ int _test_oper(ConfigFile *conf, ConfigEntry *ce)
}
else if (!strcmp(cep->ce_varname, "snomask")) {
}
else if (!strcmp(cep->ce_varname, "modes")) {
}
else if (!strcmp(cep->ce_varname, "maxlogins"))
{
long l = config_checkval(cep->ce_vardata, CFG_TIME);
@@ -3118,7 +3146,7 @@ int _test_oper(ConfigFile *conf, ConfigEntry *ce)
errors++;
continue;
}
if (!config_binary_flags_search(_OperFlags, cepp->ce_varname, sizeof(_OperFlags)/sizeof(_OperFlags[0]))) {
if (!config_binary_flags_search(_OperFlags, cepp->ce_varname, ARRAY_SIZEOF(_OperFlags))) {
if (!strcmp(cepp->ce_varname, "can_stealth"))
{
config_status("%s:%i: unknown oper flag '%s' [feature no longer exists]",
@@ -3685,7 +3713,7 @@ int _conf_listen(ConfigFile *conf, ConfigEntry *ce)
{
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
if ((ofp = config_binary_flags_search(_ListenerFlags, cepp->ce_varname, sizeof(_ListenerFlags)/sizeof(_ListenerFlags[0]))))
if ((ofp = config_binary_flags_search(_ListenerFlags, cepp->ce_varname, ARRAY_SIZEOF(_ListenerFlags))))
tmpflags |= ofp->flag;
}
#ifndef USE_SSL
@@ -3830,7 +3858,7 @@ int _test_listen(ConfigFile *conf, ConfigEntry *ce)
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
errors++; continue;
}
if (!config_binary_flags_search(_ListenerFlags, cepp->ce_varname, sizeof(_ListenerFlags)/sizeof(_ListenerFlags[0])))
if (!config_binary_flags_search(_ListenerFlags, cepp->ce_varname, ARRAY_SIZEOF(_ListenerFlags)))
{
config_error("%s:%i: unknown listen option '%s'",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
@@ -4250,6 +4278,30 @@ int errors = 0, gotfilename=0;
return errors;
}
void create_tkl_except(char *mask, char *type)
{
ConfigItem_except *ca;
struct irc_netmask tmp;
OperFlag *opf;
ca = MyMallocEx(sizeof(ConfigItem_except));
ca->mask = strdup(mask);
opf = config_binary_flags_search(ExceptTklFlags, type, ARRAY_SIZEOF(ExceptTklFlags));
ca->type = opf->flag;
if (ca->type & TKL_KILL || ca->type & TKL_ZAP || ca->type & TKL_SHUN)
{
tmp.type = parse_netmask(ca->mask, &tmp);
if (tmp.type != HM_HOST)
{
ca->netmask = MyMallocEx(sizeof(struct irc_netmask));
bcopy(&tmp, ca->netmask, sizeof(struct irc_netmask));
}
}
ca->flag.type = CONF_EXCEPT_TKL;
AddListItem(ca, conf_except);
}
int _conf_except(ConfigFile *conf, ConfigEntry *ce)
{
@@ -4302,32 +4354,14 @@ int _conf_except(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(ce->ce_vardata, "tkl")) {
cep2 = config_find_entry(ce->ce_entries, "mask");
cep3 = config_find_entry(ce->ce_entries, "type");
ca = MyMallocEx(sizeof(ConfigItem_except));
ca->mask = strdup(cep2->ce_vardata);
if (!strcmp(cep3->ce_vardata, "gline"))
ca->type = TKL_KILL|TKL_GLOBAL;
else if (!strcmp(cep3->ce_vardata, "qline"))
ca->type = TKL_NICK;
else if (!strcmp(cep3->ce_vardata, "gqline"))
ca->type = TKL_NICK|TKL_GLOBAL;
else if (!strcmp(cep3->ce_vardata, "gzline"))
ca->type = TKL_ZAP|TKL_GLOBAL;
else if (!strcmp(cep3->ce_vardata, "shun"))
ca->type = TKL_SHUN|TKL_GLOBAL;
else
{}
if (ca->type & TKL_KILL || ca->type & TKL_ZAP || ca->type & TKL_SHUN)
if (cep3->ce_vardata)
create_tkl_except(cep2->ce_vardata, cep3->ce_vardata);
else
{
tmp.type = parse_netmask(ca->mask, &tmp);
if (tmp.type != HM_HOST)
{
ca->netmask = MyMallocEx(sizeof(struct irc_netmask));
bcopy(&tmp, ca->netmask, sizeof(struct irc_netmask));
}
ConfigEntry *cepp;
for (cepp = cep3->ce_entries; cepp; cepp = cepp->ce_next)
create_tkl_except(cep2->ce_vardata, cepp->ce_varname);
}
ca->flag.type = CONF_EXCEPT_TKL;
AddListItem(ca, conf_except);
}
else {
int value;
@@ -4416,31 +4450,84 @@ int _test_except(ConfigFile *conf, ConfigEntry *ce)
}
#endif
else if (!strcmp(ce->ce_vardata, "tkl")) {
if (!config_find_entry(ce->ce_entries, "mask"))
{
config_error("%s:%i: except tkl without mask item",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
return 1;
}
if (!(cep3 = config_find_entry(ce->ce_entries, "type")))
{
config_error("%s:%i: except tkl without type item",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
return 1;
}
char has_mask = 0, has_type = 0;
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
{
if (!cep->ce_vardata)
{
config_error("%s:%i: except tkl item without contents",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
errors++;
continue;
}
if (!strcmp(cep->ce_varname, "mask"))
{
if (!cep->ce_vardata)
{
config_error("%s:%i: except tkl item without contents",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
errors++;
continue;
}
has_mask = 1;
}
else if (!strcmp(cep->ce_varname, "type"))
{
if (cep->ce_vardata)
{
OperFlag *opf;
if (!strcmp(cep->ce_vardata, "tkline") ||
!strcmp(cep->ce_vardata, "tzline"))
{
config_error("%s:%i: except tkl of type %s is"
" deprecated. Use except ban {}"
" instead",
cep->ce_fileptr->cf_filename,
cep->ce_varlinenum,
cep->ce_vardata);
errors++;
}
if (!config_binary_flags_search(ExceptTklFlags,
cep->ce_vardata, ARRAY_SIZEOF(ExceptTklFlags)))
{
config_error("%s:%i: unknown except tkl type %s",
cep->ce_fileptr->cf_filename,
cep->ce_varlinenum,
cep->ce_vardata);
return 1;
}
}
else if (cep->ce_entries)
{
ConfigEntry *cepp;
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
OperFlag *opf;
if (!strcmp(cepp->ce_varname, "tkline") ||
!strcmp(cepp->ce_varname, "tzline"))
{
config_error("%s:%i: except tkl of type %s is"
" deprecated. Use except ban {}"
" instead",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
}
if (!config_binary_flags_search(ExceptTklFlags,
cepp->ce_varname, ARRAY_SIZEOF(ExceptTklFlags)))
{
config_error("%s:%i: unknown except tkl type %s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
return 1;
}
}
}
else
{
config_error("%s:%i: except tkl item without contents",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
errors++;
continue;
}
has_type = 1;
}
else if (!strcmp(cep->ce_varname, "type")) {}
else
{
config_error("%s:%i: unknown except tkl directive %s",
@@ -4449,28 +4536,17 @@ int _test_except(ConfigFile *conf, ConfigEntry *ce)
continue;
}
}
if (!strcmp(cep3->ce_vardata, "gline")) {}
else if (!strcmp(cep3->ce_vardata, "qline")) {}
else if (!strcmp(cep3->ce_vardata, "gqline")) {}
else if (!strcmp(cep3->ce_vardata, "gzline")){}
else if (!strcmp(cep3->ce_vardata, "shun")) {}
else if (!strcmp(cep3->ce_vardata, "tkline")) {
config_error("%s:%i: except tkl of type tkline is deprecated. Use except ban {} instead",
cep3->ce_fileptr->cf_filename, cep3->ce_varlinenum);
errors++;
}
else if (!strcmp(cep3->ce_vardata, "tzline")) {
config_error("%s:%i: except tkl of type tzline is deprecated. Use except ban {} instead",
cep3->ce_fileptr->cf_filename, cep3->ce_varlinenum);
errors++;
}
else
if (!has_mask)
{
config_error("%s:%i: unknown except tkl type %s",
cep3->ce_fileptr->cf_filename, cep3->ce_varlinenum,
cep3->ce_vardata);
config_error("%s:%i: except tkl without mask item",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
return 1;
}
if (!has_type)
{
config_error("%s:%i: except tkl without type item",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
return 1;
}
return errors;
}
@@ -4890,7 +4966,7 @@ int _test_badword(ConfigFile *conf, ConfigEntry *ce) {
}
else
{
char *errbuf = unreal_checkregex(word->ce_vardata,1,0);
char *errbuf = unreal_checkregex(word->ce_vardata,1,1);
if (errbuf)
{
config_error("%s:%i: badword::%s contains an invalid regex: %s",
@@ -5185,7 +5261,7 @@ int _conf_log(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cep->ce_varname, "flags")) {
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
if ((ofp = config_binary_flags_search(_LogFlags, cepp->ce_varname, sizeof(_LogFlags)/sizeof(_LogFlags[0]))))
if ((ofp = config_binary_flags_search(_LogFlags, cepp->ce_varname, ARRAY_SIZEOF(_LogFlags))))
ca->flags |= ofp->flag;
}
}
@@ -5258,7 +5334,7 @@ int _test_log(ConfigFile *conf, ConfigEntry *ce) {
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
errors++; continue;
}
if (!config_binary_flags_search(_LogFlags, cepp->ce_varname, sizeof(_LogFlags)/sizeof(_LogFlags[0]))) {
if (!config_binary_flags_search(_LogFlags, cepp->ce_varname, ARRAY_SIZEOF(_LogFlags))) {
config_error("%s:%i: unknown log flag '%s'",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
cepp->ce_varname);
@@ -5313,7 +5389,7 @@ int _conf_link(ConfigFile *conf, ConfigEntry *ce)
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
continue;
}
if ((ofp = config_binary_flags_search(_LinkFlags, cepp->ce_varname, sizeof(_LinkFlags)/sizeof(_LinkFlags[0]))))
if ((ofp = config_binary_flags_search(_LinkFlags, cepp->ce_varname, ARRAY_SIZEOF(_LinkFlags))))
link->options |= ofp->flag;
}
@@ -5465,7 +5541,7 @@ int _test_link(ConfigFile *conf, ConfigEntry *ce)
errors++;
continue;
}
if (!(ofp = config_binary_flags_search(_LinkFlags, cepp->ce_varname, sizeof(_LinkFlags)/sizeof(_LinkFlags[0])))) {
if (!(ofp = config_binary_flags_search(_LinkFlags, cepp->ce_varname, ARRAY_SIZEOF(_LinkFlags)))) {
config_error("%s:%i: unknown link option '%s'",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
cepp->ce_varname);
@@ -5728,6 +5804,8 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
}
else if (!strcmp(cep->ce_varname, "silence-limit")) {
tempiConf.silence_limit = atol(cep->ce_vardata);
if (loop.ircd_booted)
IsupportSetValue(IsupportFind("SILENCE"), cep->ce_vardata);
}
else if (!strcmp(cep->ce_varname, "auto-join")) {
ircstrdup(tempiConf.auto_join_chans, cep->ce_vardata);
@@ -5795,6 +5873,13 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
}
else if (!strcmp(cep->ce_varname, "maxchannelsperuser")) {
tempiConf.maxchannelsperuser = atoi(cep->ce_vardata);
if (loop.ircd_booted)
{
char tmpbuf[512];
IsupportSetValue(IsupportFind("MAXCHANNELS"), cep->ce_vardata);
ircsprintf(tmpbuf, "#:%s", cep->ce_vardata);
IsupportSetValue(IsupportFind("CHANLIMIT"), tmpbuf);
}
}
else if (!strcmp(cep->ce_varname, "maxdccallow")) {
tempiConf.maxdccallow = atoi(cep->ce_vardata);
@@ -5807,6 +5892,8 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
*cep->ce_vardata='-';
}
ircstrdup(tempiConf.network.x_ircnet005, tmp);
if (loop.ircd_booted)
IsupportSetValue(IsupportFind("NETWORK"), tmp);
cep->ce_vardata = tmp;
}
else if (!strcmp(cep->ce_varname, "default-server")) {
@@ -6489,6 +6576,7 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cep->ce_varname, "hosts")) {
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
char *c, *host;
if (!cepp->ce_vardata)
{
config_error("%s:%i: set::hosts item without value",
@@ -6526,6 +6614,60 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
continue;
}
if ((c = strchr(cepp->ce_vardata, '@')))
{
char *tmp;
if (!(*(c+1)) || (c-cepp->ce_vardata) > USERLEN ||
c == cepp->ce_vardata)
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
for (tmp = cepp->ce_vardata; tmp != c; tmp++)
{
if (*tmp == '~' && tmp == cepp->ce_vardata)
continue;
if (!isallowed(*tmp))
break;
}
if (tmp != c)
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
host = c+1;
}
else
host = cepp->ce_vardata;
if (strlen(host) > HOSTLEN)
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
for (; *host; host++)
{
if (!isallowed(*host) && *host != ':')
{
config_error("%s:%i: illegal value for set::hosts::%s",
cepp->ce_fileptr->cf_filename,
cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
continue;
}
}
}
}
else if (!strcmp(cep->ce_varname, "cloak-keys"))
@@ -6778,7 +6920,7 @@ int _conf_loadmodule(ConfigFile *conf, ConfigEntry *ce)
*(cSlash+1)=0;
}
hFind = FindFirstFile(ce->ce_vardata, &FindData);
if (!FindData.cFileName) {
if (!FindData.cFileName || hFind == INVALID_HANDLE_VALUE) {
config_status("%s:%i: loadmodule %s: failed to load",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
ce->ce_vardata);
@@ -6793,7 +6935,7 @@ int _conf_loadmodule(ConfigFile *conf, ConfigEntry *ce)
if ((ret = Module_Create(path))) {
config_status("%s:%i: loadmodule %s: failed to load: %s",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
FindData.cFileName, ret);
path, ret);
free(path);
return -1;
}
@@ -6987,7 +7129,8 @@ int _conf_alias(ConfigFile *conf, ConfigEntry *ce)
ircstrdup(format->format, cep->ce_vardata);
regcomp(&format->expr, cep->ce_vardata, REG_ICASE|REG_EXTENDED);
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next) {
if (!strcmp(cepp->ce_varname, "nick")) {
if (!strcmp(cepp->ce_varname, "nick") ||
!strcmp(cepp->ce_varname, "target")) {
ircstrdup(format->nick, cepp->ce_vardata);
}
else if (!strcmp(cepp->ce_varname, "parameters")) {
@@ -7000,12 +7143,15 @@ int _conf_alias(ConfigFile *conf, ConfigEntry *ce)
format->type = ALIAS_STATS;
else if (!strcmp(cepp->ce_vardata, "normal"))
format->type = ALIAS_NORMAL;
else if (!strcmp(cepp->ce_vardata, "channel"))
format->type = ALIAS_CHANNEL;
}
}
AddListItem(format, alias->format);
}
else if (!strcmp(cep->ce_varname, "nick")) {
else if (!strcmp(cep->ce_varname, "nick") || !strcmp(cep->ce_varname, "target"))
{
ircstrdup(alias->nick, cep->ce_vardata);
}
else if (!strcmp(cep->ce_varname, "type")) {
@@ -7015,6 +7161,8 @@ int _conf_alias(ConfigFile *conf, ConfigEntry *ce)
alias->type = ALIAS_STATS;
else if (!strcmp(cep->ce_vardata, "normal"))
alias->type = ALIAS_NORMAL;
else if (!strcmp(cep->ce_vardata, "channel"))
alias->type = ALIAS_CHANNEL;
else if (!strcmp(cep->ce_vardata, "command"))
alias->type = ALIAS_COMMAND;
}
@@ -7096,9 +7244,9 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
cep->ce_varlinenum);
errors++;
}
if (!config_find_entry(cep->ce_entries, "nick"))
if (!config_find_entry(cep->ce_entries, "nick") && !config_find_entry(cep->ce_entries, "target"))
{
config_error("%s:%i: alias::format::nick missing", cep->ce_fileptr->cf_filename,
config_error("%s:%i: alias::format::target missing", cep->ce_fileptr->cf_filename,
cep->ce_varlinenum);
errors++;
}
@@ -7111,7 +7259,8 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
cepp->ce_varname);
errors++; continue;
}
if (!strcmp(cepp->ce_varname, "nick"))
if (!strcmp(cepp->ce_varname, "nick") ||
!strcmp(cepp->ce_varname, "target"))
;
else if (!strcmp(cepp->ce_varname, "type"))
{
@@ -7121,6 +7270,8 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
;
else if (!strcmp(cepp->ce_vardata, "normal"))
;
else if (!strcmp(cepp->ce_vardata, "channel"))
;
else {
config_status("%s:%i: unknown alias type",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
@@ -7136,7 +7287,7 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
}
}
}
else if (!strcmp(cep->ce_varname, "nick"))
else if (!strcmp(cep->ce_varname, "nick") || !strcmp(cep->ce_varname, "target"))
;
else if (!strcmp(cep->ce_varname, "type")) {
if (!strcmp(cep->ce_vardata, "services"))
@@ -7145,6 +7296,8 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
;
else if (!strcmp(cep->ce_vardata, "normal"))
;
else if (!strcmp(cep->ce_vardata, "channel"))
;
else if (!strcmp(cep->ce_vardata, "command"))
;
else {
+4 -4
View File
@@ -34,7 +34,7 @@ static char *replies[] = {
/* 002 RPL_YOURHOST */ ":%s 002 %s :Your host is %s, running version %s",
/* 003 RPL_CREATED */ ":%s 003 %s :This server was created %s",
/* 004 RPL_MYINFO */ ":%s 004 %s %s %s %s %s",
/* 005 RPL_PROTOCTL */ ":%s 005 %s",
/* 005 RPL_ISUPPORT */ ":%s 005 %s %s :are supported by this server",
/* 006 RPL_MAP */ ":%s 006 %s :%s%-*s(%d) %s",
/* 007 RPL_MAPEND */ ":%s 007 %s :End of /MAP",
/* 008 RPL_SNOMASK */ ":%s 008 %s :Server notice mask (%s)",
@@ -134,7 +134,7 @@ static char *replies[] = {
/* 102 */ NULL,
/* 103 */ NULL,
/* 104 */ NULL,
/* 105 RPL_REMOTEPROTOCTL */ ":%s 105 %s",
/* 105 RPL_REMOTEISUPPORT */ ":%s 105 %s %s :are supported by this server",
/* 106 */ NULL,
/* 107 */ NULL,
/* 108 */ NULL,
@@ -377,7 +377,7 @@ static char *replies[] = {
/* 337 */ NULL,
/* 338 */ NULL, /* ircu, bahamut */
/* 339 */ NULL, /* Used */
/* 340 */ NULL, /* ircu */
/* 340 RPL_USERIP */ ":%s 340 %s :%s %s %s %s %s",
/* 341 RPL_INVITING */ ":%s 341 %s %s %s",
/* 342 RPL_SUMMONING */ ":%s 342 %s %s :User summoned to irc",
/* 343 */ NULL,
@@ -416,7 +416,7 @@ static char *replies[] = {
/* 376 RPL_ENDOFMOTD */ ":%s 376 %s :End of /MOTD command.",
/* 377 */ NULL, /* aircd, austhex */
/* 378 RPL_WHOISHOST */ ":%s 378 %s %s :is connecting from *@%s %s",
/* 379 RPL_WHOISMODES */ ":%s 379 %s %s :is using modes %s",
/* 379 RPL_WHOISMODES */ ":%s 379 %s %s :is using modes %s %s",
/* 380 */ NULL, /* aircd, austhex */
/* 381 RPL_YOUREOPER */ ":%s 381 %s :You are now an IRC Operator",
/* 382 RPL_REHASHING */ ":%s 382 %s %s :Rehashing",
+47 -6
View File
@@ -154,6 +154,10 @@ aTKline *tkl_add_line(int type, char *usermask, char *hostmask, char *reason, ch
nl->ptr.spamf->tkl_duration = spamf_tkl_duration;
nl->ptr.spamf->tkl_reason = strdup(spamf_tkl_reason); /* already encoded */
}
if (nl->subtype & SPAMF_USER)
loop.do_bancheck_spamf_user = 1;
if (nl->subtype & SPAMF_AWAY)
loop.do_bancheck_spamf_away = 1;
}
else if (type & TKL_KILL || type & TKL_ZAP || type & TKL_SHUN)
{
@@ -420,7 +424,7 @@ int find_tkline_match(aClient *cptr, int xx)
if (excepts->netmask)
{
if (match_ip(cptr->ip, NULL, NULL, excepts->netmask))
if (match_ip(cptr->ip, host2, excepts->mask, excepts->netmask))
return 1;
} else
if (!match(excepts->mask, host) || !match(excepts->mask, host2))
@@ -552,6 +556,24 @@ int find_shun(aClient *cptr)
return 2;
}
/** Checks if the user matches a spamfilter of type 'u' (user,
* nick!user@host:realname ban).
* Written by: Syzop
* Assumes: only call for clients, possible assume on local clients [?]
* Return values: see dospamfilter()
*/
int find_spamfilter_user(aClient *sptr)
{
char spamfilter_user[NICKLEN + USERLEN + HOSTLEN + REALLEN + 64]; /* n!u@h:r */
if (IsAnOper(sptr))
return 0;
ircsprintf(spamfilter_user, "%s!%s@%s:%s",
sptr->name, sptr->user->username, sptr->user->realhost, sptr->info);
return dospamfilter(sptr, spamfilter_user, SPAMF_USER, NULL);
}
aTKline *find_qline(aClient *cptr, char *nick, int *ishold)
{
aTKline *lp;
@@ -586,7 +608,7 @@ aTKline *find_qline(aClient *cptr, char *nick, int *ishold)
return lp;
}
chost = cptr->sockhost;
chost = cptr->user ? cptr->user->realhost : (MyConnect(cptr) ? cptr->sockhost : "unknown");
cname = cptr->user ? cptr->user->username : "unknown";
strcpy(host, make_user_host(cname, chost));
@@ -603,7 +625,7 @@ aTKline *find_qline(aClient *cptr, char *nick, int *ishold)
continue;
if (excepts->netmask)
{
if (match_ip(cptr->ip, NULL, NULL, excepts->netmask))
if (MyConnect(cptr) && match_ip(cptr->ip, NULL, NULL, excepts->netmask))
return NULL;
} else
if (!match(excepts->mask, host) || (host2 && !match(excepts->mask, host2)))
@@ -1060,7 +1082,8 @@ int m_tkl(aClient *cptr, aClient *sptr, int parc, char *parv[])
parv[1], parv[2], parv[3], parv[4],
tk->setby, tk->expire_at, tk->set_at, tk->ptr.spamf->tkl_duration,
tk->ptr.spamf->tkl_reason, tk->reason);
} else
}
else if (type & TKL_GLOBAL)
sendto_serv_butone(cptr,
":%s TKL %s %s %s %s %s %ld %ld :%s", sptr->name,
parv[1], parv[2], parv[3], parv[4],
@@ -1441,9 +1464,17 @@ int dospamfilter(aClient *sptr, char *str_in, int type, char *target)
{
aTKline *tk;
int n;
char *str = (char *)StripControlCodes(str_in);
char *str;
if (!IsPerson(sptr) || IsAnOper(sptr) || IsULine(sptr))
if (type == SPAMF_USER)
str = str_in;
else
str = (char *)StripControlCodes(str_in);
/* (note: using sptr->user check here instead of IsPerson()
* due to SPAMF_USER where user isn't marked as client/person yet.
*/
if (!sptr->user || IsAnOper(sptr) || IsULine(sptr))
return 0;
for (tk = tklines[tkl_hash('F')]; tk; tk = tk->next)
@@ -1494,6 +1525,16 @@ char *str = (char *)StripControlCodes(str_in);
sendnotice(sptr, "DCC to %s blocked: %s",
target, unreal_decodespace(tk->ptr.spamf->tkl_reason));
break;
case SPAMF_AWAY:
/* hack to deal with 'after-away-was-set-filters' */
if (sptr->user->away && !strcmp(str_in, sptr->user->away))
{
/* free away & broadcast the unset */
MyFree(sptr->user->away);
sptr->user->away = NULL;
sendto_serv_butone_token(sptr, sptr->name, MSG_AWAY, TOK_AWAY, "");
}
break;
default:
break;
}
+16 -5
View File
@@ -597,11 +597,8 @@ int exit_client(aClient *cptr, aClient *sptr, aClient *from, char *comment)
for (acptr = client; acptr; acptr = next)
{
next = acptr->next;
if (IsServer(acptr) && acptr->srvptr == sptr) {
exit_client(sptr, acptr, /* RECURSION */
sptr, comment1);
RunHook(HOOKTYPE_SERVER_QUIT, acptr);
}
if (IsServer(acptr) && acptr->srvptr == sptr)
exit_client(sptr, acptr, sptr, comment1); /* RECURSION */
/*
* I am not masking SQUITS like I do QUITs. This
* is probobly something we could easily do, but
@@ -990,6 +987,8 @@ int flags = 0;
case 'P': flags |= SPAMF_PART; break;
case 'q': flags |= SPAMF_QUIT; break;
case 'd': flags |= SPAMF_DCC; break;
case 'u': flags |= SPAMF_USER; break;
case 'a': flags |= SPAMF_AWAY; break;
default:
if (sptr)
{
@@ -1020,6 +1019,10 @@ int flags = 0;
return SPAMF_QUIT;
if (!strcmp(s, "dcc"))
return SPAMF_DCC;
if (!strcmp(s, "user"))
return SPAMF_USER;
if (!strcmp(s, "away"))
return SPAMF_AWAY;
return 0;
}
@@ -1042,6 +1045,10 @@ char *p = buf;
*p++ = 'q';
if (v & SPAMF_DCC)
*p++ = 'd';
if (v & SPAMF_USER)
*p++ = 'u';
if (v & SPAMF_AWAY)
*p++ = 'a';
*p = '\0';
return buf;
}
@@ -1063,6 +1070,10 @@ char *spamfilter_inttostring_long(int v)
return "QUIT";
case SPAMF_DCC:
return "DCC";
case SPAMF_USER:
return "user";
case SPAMF_AWAY:
return "AWAY";
default:
return "UNKNOWN";
}
+14 -8
View File
@@ -138,6 +138,8 @@ extern fdlist serv_fdlist;
CMD_FUNC(m_version)
{
extern char serveropts[];
extern char *IsupportStrings[];
int reply, i;
/* Only allow remote VERSIONs if registered -- Syzop */
if (!IsPerson(sptr) && !IsServer(cptr))
@@ -163,15 +165,15 @@ CMD_FUNC(m_version)
if (IsAnOper(sptr))
sendto_one(sptr, ":%s NOTICE %s :%s", me.name, sptr->name, curl_version());
#endif
if (MyClient(sptr)) {
if (MyClient(sptr))
normal:
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_1, me.name, sptr->name, PROTOCTL_PARAMETERS_1);
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_2, me.name, sptr->name, PROTOCTL_PARAMETERS_2);
}
else {
sendto_one(sptr, ":%s 105 %s " PROTOCTL_CLIENT_1, me.name, sptr->name, PROTOCTL_PARAMETERS_1);
sendto_one(sptr, ":%s 105 %s " PROTOCTL_CLIENT_2, me.name, sptr->name, PROTOCTL_PARAMETERS_2);
}
reply = RPL_ISUPPORT;
else
reply = RPL_REMOTEISUPPORT;
/* Send the text */
for (i = 0; IsupportStrings[i]; i++)
sendto_one(sptr, rpl_str(reply), me.name, sptr->name,
IsupportStrings[i]);
}
return 0;
}
@@ -437,6 +439,8 @@ CMD_FUNC(m_watch)
*/
if (*s == '+')
{
if (!*(s+1))
continue;
if (do_nick_name(s + 1))
{
if (sptr->watches >= MAXWATCH)
@@ -461,6 +465,8 @@ CMD_FUNC(m_watch)
*/
if (*s == '-')
{
if (!*(s+1))
continue;
del_from_watch_hash_table(s + 1, sptr);
show_watch(sptr, s + 1, RPL_WATCHOFF, RPL_WATCHOFF);
+79 -18
View File
@@ -220,17 +220,20 @@ void strrangetok(char *in, char *out, char tok, short first, short last) {
int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
ConfigItem_alias *alias;
aClient *acptr;
if (parc < 2 || *parv[1] == '\0') {
if (parc < 2 || *parv[1] == '\0')
{
sendto_one(sptr, err_str(ERR_NOTEXTTOSEND), me.name, parv[0]);
return -1;
}
if (!(alias = Find_alias(cmd))) {
if (!(alias = Find_alias(cmd)))
{
sendto_one(sptr, ":%s %d %s %s :Unknown command",
me.name, ERR_UNKNOWNCOMMAND, parv[0], cmd);
return 0;
}
if (alias->type == ALIAS_SERVICES) {
if (alias->type == ALIAS_SERVICES)
{
if (SERVICES_NAME && (acptr = find_person(alias->nick, NULL)))
sendto_one(acptr, ":%s %s %s@%s :%s", parv[0],
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
@@ -239,7 +242,8 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
parv[0], alias->nick);
}
else if (alias->type == ALIAS_STATS) {
else if (alias->type == ALIAS_STATS)
{
if (STATS_SERVER && (acptr = find_person(alias->nick, NULL)))
sendto_one(acptr, ":%s %s %s@%s :%s", parv[0],
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
@@ -248,11 +252,13 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
parv[0], alias->nick);
}
else if (alias->type == ALIAS_NORMAL) {
if ((acptr = find_person(alias->nick, NULL))) {
else if (alias->type == ALIAS_NORMAL)
{
if ((acptr = find_person(alias->nick, NULL)))
{
if (MyClient(acptr))
sendto_one(acptr, ":%s!%s@%s PRIVMSG %s :%s", parv[0],
sptr->user->username, IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost,
sptr->user->username, GetHost(sptr),
alias->nick, parv[1]);
else
sendto_one(acptr, ":%s %s %s :%s", parv[0],
@@ -263,11 +269,33 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name,
parv[0], alias->nick);
}
else if (alias->type == ALIAS_COMMAND) {
else if (alias->type == ALIAS_CHANNEL)
{
aChannel *chptr;
if ((chptr = find_channel(alias->nick, NULL)))
{
if (!can_send(sptr, chptr, parv[1], 0))
{
sendto_channelprefix_butone_tok(sptr,
sptr, chptr,
PREFIX_ALL,
MSG_PRIVATE,
TOK_PRIVATE,
chptr->chname, parv[1], 0);
return 0;
}
}
sendto_one(sptr, err_str(ERR_CANNOTDOCOMMAND), me.name, parv[0],
cmd, "You may not use this command at this time");
}
else if (alias->type == ALIAS_COMMAND)
{
ConfigItem_alias_format *format;
char *ptr = parv[1];
for (format = alias->format; format; format = (ConfigItem_alias_format *)format->next) {
if (regexec(&format->expr, ptr, 0, NULL, 0) == 0) {
for (format = alias->format; format; format = (ConfigItem_alias_format *)format->next)
{
if (regexec(&format->expr, ptr, 0, NULL, 0) == 0)
{
/* Parse the parameters */
int i = 0, j = 0, k = 1;
char output[501];
@@ -275,13 +303,16 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
char *current = MyMalloc(strlen(parv[1])+1);
bzero(current, strlen(parv[1])+1);
bzero(output, sizeof output);
while(format->parameters[i] && j < 500) {
while(format->parameters[i] && j < 500)
{
k = 0;
if (format->parameters[i] == '%') {
if (format->parameters[i] == '%')
{
i++;
if (format->parameters[i] == '%')
output[j++] = '%';
else if (isdigit(format->parameters[i])) {
else if (isdigit(format->parameters[i]))
{
for(; isdigit(format->parameters[i]) && k < 2; i++, k++) {
nums[k] = format->parameters[i];
}
@@ -301,7 +332,14 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
j += strlen(current);
}
else {
else if (format->parameters[i] == 'n' ||
format->parameters[i] == 'N')
{
strlcat(output, parv[0], sizeof output);
j += strlen(parv[0]);
}
else
{
output[j++] = '%';
output[j++] = format->parameters[i];
}
@@ -311,7 +349,8 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
output[j++] = format->parameters[i++];
}
output[j] = 0;
if (format->type == ALIAS_SERVICES) {
if (format->type == ALIAS_SERVICES)
{
if (SERVICES_NAME && (acptr = find_person(format->nick, NULL)))
sendto_one(acptr, ":%s %s %s@%s :%s", parv[0],
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
@@ -320,7 +359,8 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
parv[0], format->nick);
}
else if (format->type == ALIAS_STATS) {
else if (format->type == ALIAS_STATS)
{
if (STATS_SERVER && (acptr = find_person(format->nick, NULL)))
sendto_one(acptr, ":%s %s %s@%s :%s", parv[0],
IsToken(acptr->from) ? TOK_PRIVATE : MSG_PRIVATE,
@@ -329,8 +369,10 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
parv[0], format->nick);
}
else if (format->type == ALIAS_NORMAL) {
if ((acptr = find_person(format->nick, NULL))) {
else if (format->type == ALIAS_NORMAL)
{
if ((acptr = find_person(format->nick, NULL)))
{
if (MyClient(acptr))
sendto_one(acptr, ":%s!%s@%s PRIVMSG %s :%s", parv[0],
sptr->user->username, IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost,
@@ -344,6 +386,25 @@ int m_alias(aClient *cptr, aClient *sptr, int parc, char *parv[], char *cmd) {
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name,
parv[0], format->nick);
}
else if (format->type == ALIAS_CHANNEL)
{
aChannel *chptr;
if ((chptr = find_channel(alias->nick, NULL)))
{
if (!can_send(sptr, chptr, parv[1], 0))
{
sendto_channelprefix_butone_tok(sptr,
sptr, chptr,
PREFIX_ALL, MSG_PRIVATE,
TOK_PRIVATE, chptr->chname,
parv[1], 0);
return 0;
}
}
sendto_one(sptr, err_str(ERR_CANNOTDOCOMMAND), me.name,
parv[0], cmd,
"You may not use this command at this time");
}
free(current);
break;
}
+76 -35
View File
@@ -69,6 +69,10 @@ void iNAH_host(aClient *sptr, char *host)
{
if (!sptr->user)
return;
if (UHOST_ALLOWED == UHALLOW_REJOIN)
rejoin_doparts(sptr);
if (sptr->user->virthost)
{
MyFree(sptr->user->virthost);
@@ -79,6 +83,9 @@ void iNAH_host(aClient *sptr, char *host)
sendto_serv_butone_token(&me, sptr->name, MSG_SETHOST,
TOK_SETHOST, "%s", sptr->user->virthost);
sptr->umodes |= UMODE_SETHOST;
if (UHOST_ALLOWED == UHALLOW_REJOIN)
rejoin_dojoinandmode(sptr);
}
long set_usermode(char *umode)
@@ -602,7 +609,12 @@ int check_for_target_limit(aClient *sptr, void *target, const char *name)
** a change should be global, some confusion would
** result if only few servers allowed it...
*/
#if defined(CHINESE_NICK) || defined(JAPANESE_NICK)
#if defined(NICK_GB2312) || defined(NICK_GBK) || defined(NICK_GBK_JAP)
#define NICK_MULTIBYTE
#endif
#ifdef NICK_MULTIBYTE
/* Chinese Nick Verification Code - Added by RexHsu on 08/09/00 (beta2)
* Now Support All GBK Words,Thanks to Mr.WebBar <climb@guomai.sh.cn>!
* Special Char Bugs Fixed by RexHsu 09/01/00 I dont know whether it is
@@ -619,34 +631,56 @@ int check_for_target_limit(aClient *sptr, void *target, const char *name)
* 6. (a4a1-a4f3) -->work correctly?maybe...
* 7. (a5a1-a5f7) -->work correctly?maybe...
* 8. (xxxx-yyyy)
*
* isvalidChinese() rewritten by Xuefer (2004-10-10),
* this will probably be the last time we do it this way,
* in 3.2.3 we are gonna try a more generic aproach. -- Syzop
*/
int isvalidChinese(const unsigned char c1, const unsigned char c2)
int isvalidChinese(const unsigned char c1, const unsigned char c2)
{
const unsigned int GBK_S = 0xb0a1;
const unsigned int GBK_E = 0xf7fe;
const unsigned int GBK_2_S = 0x8140;
const unsigned int GBK_2_E = 0xa0fe;
const unsigned int GBK_3_S = 0xaa40;
const unsigned int GBK_3_E = 0xfea0;
const unsigned int JPN_PING_S = 0xa4a1;
const unsigned int JPN_PING_E = 0xa4f3;
const unsigned int JPN_PIAN_S = 0xa5a1;
const unsigned int JPN_PIAN_E = 0xa5f7;
unsigned int AWord = c1 * 256 + c2;
#if defined(CHINESE_NICK) && defined(JAPANESE_NICK)
return (AWord >= GBK_S && AWord <= GBK_E || AWord >= GBK_2_S
&& AWord <= GBK_2_E || AWord >= JPN_PING_S && AWord <= JPN_PING_E
|| AWord >= JPN_PIAN_S && AWord <= JPN_PIAN_E) ? 1 : 0;
unsigned int w = (((unsigned int)c1) << 8) | c2;
/* rang of w/c1/c2 (rw never used) */
#define rw(s, e) (w >= ((unsigned int )s) && w <= ((unsigned int )e))
#define r1(s, e) (c1 >= ((unsigned char)s) && c1 <= ((unsigned char)e))
#define r2(s, e) (c2 >= ((unsigned char)s) && c2 <= ((unsigned char)e))
#define e1(e) (c1 == (unsigned char)e)
#ifdef NICK_GBK_JAP
/* GBK/1 */
/* JIS_PIN part 1 */
if (e1(0xA4) && r2(0xA1, 0xF3)) return 1;
/* JIS_PIN part 2 */
if (e1(0xA5) && r2(0xA1, 0xF6)) return 1;
#endif
#if defined(CHINESE_NICK) && !defined(JAPANESE_NICK)
return (AWord >= GBK_S && AWord <= GBK_E || AWord >= GBK_2_S
&& AWord <= GBK_2_E ? 1 : 0);
#endif
#if !defined(CHINESE_NICK) && defined(JAPANESE_NICK)
return (AWord >= JPN_PING_S && AWord <= JPN_PING_E
|| AWord >= JPN_PIAN_S && AWord <= JPN_PIAN_E) ? 1 : 0;
#if defined(NICK_GB2312) || defined(NICK_GBK)
/* GBK/2 BC with GB2312 */
if (r2(0xA1, 0xFE))
{
/* Block 16-55, ordered by Chinese Spelling(PinYin) 3755 chars */
if (r1(0xB0, 0xD6)) return 1;
/* Block 55 is NOT full (w <= 0xd7f9) */
if (e1(0xD7) && c2 <= (unsigned char)0xF9 /* r2(0xA1, 0xF9)*/) return 1;
/* Block 56-87 is level 2 chars, ordered by writing 3008 chars */
if (r1(0xD8, 0xF7)) return 1;
}
#endif
#ifdef NICK_GBK
/* GBK/3 */
if (r1(0x81, 0xA0) && r2(0x40, 0xFE)) return 1;
/* GBK/4 */
if (r2(0x40, 0xA0) && r1(0xAA, 0xFE)) return 1;
#endif
/* all failed */
return 0;
#undef rw
#undef r1
#undef r2
#undef e1
}
/* Chinese Nick Supporting Code (Switch Mode) - Modified by RexHsu on 08/09/00 */
@@ -965,6 +999,9 @@ int register_user(aClient *cptr, aClient *sptr, char *nick, char *username, char
return xx;
}
find_shun(sptr);
xx = find_spamfilter_user(sptr);
if (xx < 0)
return xx;
RunHookReturnInt(HOOKTYPE_PRE_LOCAL_CONNECT, sptr, !=0);
}
else
@@ -1000,9 +1037,12 @@ int register_user(aClient *cptr, aClient *sptr, char *nick, char *username, char
sendto_one(sptr, ":%s 004 %s %s CR1.8.03-%s %s %s",
me.name, parv[0],
me.name, version, umodestring, cmodestring);
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_1, me.name, nick, PROTOCTL_PARAMETERS_1);
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_2, me.name, nick, PROTOCTL_PARAMETERS_2);
{
extern char *IsupportStrings[];
int i;
for (i = 0; IsupportStrings[i]; i++)
sendto_one(sptr, rpl_str(RPL_ISUPPORT), me.name, nick, IsupportStrings[i]);
}
#ifdef USE_SSL
if (sptr->flags & FLAGS_SSL)
if (sptr->ssl)
@@ -1319,7 +1359,7 @@ CMD_FUNC(m_nick)
}
if (!IsULine(sptr) && (tklban = find_qline(sptr, nick, &ishold)))
{
if (IsServer(sptr) && !ishold)
if (IsServer(sptr) && !ishold) /* server introducing new client */
{
acptrs =
(aClient *)find_server_b64_or_real(sptr->user ==
@@ -1332,15 +1372,14 @@ CMD_FUNC(m_nick)
&& !IsServer(sptr) ? sptr->name : "<unregistered>"),
acptrs ? acptrs->name : "unknown server");
}
else if (!ishold)
if (IsServer(cptr) && IsPerson(sptr)) /* remote user changing nick */
{
sendto_snomask(SNO_QLINE, "Q:lined nick %s from %s on %s",
nick,
*sptr->name ? sptr->name : "<unregistered>",
me.name);
sendto_snomask(SNO_QLINE, "Q:lined nick %s from %s on %s", nick,
sptr->name, sptr->srvptr ? sptr->srvptr->name : "<unknown>");
}
if (!IsServer(cptr))
if (!IsServer(cptr)) /* local */
{
if (ishold)
{
@@ -1351,6 +1390,7 @@ CMD_FUNC(m_nick)
}
if (!IsOper(cptr))
{
sptr->since += 4; /* lag them up */
sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME),
me.name, BadPtr(parv[0]) ? "*" : parv[0],
nick, tklban->reason);
@@ -1656,6 +1696,7 @@ CMD_FUNC(m_nick)
cptr->name, backupbuf);
sptr->lastnick = TStime();
}
newusr = 1;
}
else if (sptr->name[0] && IsPerson(sptr))
{
@@ -1670,7 +1711,7 @@ CMD_FUNC(m_nick)
{
for (mp = sptr->user->channel; mp; mp = mp->next)
{
if (is_banned(sptr, mp->chptr, BANCHK_NICK) && !is_chanownprotop(sptr, mp->chptr))
if (!is_skochanop(sptr, mp->chptr) && is_banned(sptr, mp->chptr, BANCHK_NICK))
{
sendto_one(sptr,
err_str(ERR_BANNICKCHANGE),
+5 -2
View File
@@ -574,10 +574,11 @@ void sendto_chmodemucrap(aClient *from, aChannel *chptr, char *text)
Member *lp;
aClient *acptr;
int i;
int remote = MyClient(from) ? 0 : 1;
sprintf(tcmd, ":%s %s %s :%s", from->name, TOK_PRIVATE, chptr->chname, text); /* token */
sprintf(ccmd, ":%s %s %s :%s", from->name, MSG_PRIVATE, chptr->chname, text); /* msg */
sprintf(xcmd, ":IRC PRIVMSG %s :%s: %s", chptr->chname, from->name, text); /* local */
sprintf(xcmd, ":IRC!IRC@%s PRIVMSG %s :%s: %s", me.name, chptr->chname, from->name, text); /* local */
++sentalong_marker;
for (lp = chptr->members; lp; lp = lp->next)
@@ -588,6 +589,8 @@ void sendto_chmodemucrap(aClient *from, aChannel *chptr, char *text)
continue;
if (!(lp->flags & (CHFL_CHANOP|CHFL_CHANOWNER|CHFL_CHANPROT)))
continue;
if (remote && (acptr->from == from->from)) /* don't send it back to where it came from */
continue;
i = acptr->from->slot;
if (MyConnect(acptr) && IsRegisteredUser(acptr))
{
@@ -1137,7 +1140,7 @@ void sendto_common_channels(aClient *user, char *pattern, ...)
for (users = channels->chptr->members; users; users = users->next)
{
cptr = users->cptr;
if (!MyConnect(cptr) || sentalong[cptr->slot] == sentalong_marker)
if (!MyConnect(cptr) || (cptr->slot < 0) || (sentalong[cptr->slot] == sentalong_marker))
continue;
if ((channels->chptr->mode.mode & MODE_AUDITORIUM) &&
!(is_chanownprotop(user, channels->chptr) || is_chanownprotop(cptr, channels->chptr)))
+2
View File
@@ -91,6 +91,7 @@ long SNO_FNICKCHANGE = 0L;
long SNO_QLINE = 0L;
long SNO_SPAMF = 0L;
long SNO_SNOTICE = 0L;
long SNO_OPER = 0L;
long AllUmodes; /* All umodes */
long SendUmodes; /* All umodes which are sent to other servers (global umodes) */
@@ -166,6 +167,7 @@ void umode_init(void)
SnomaskAdd(NULL, 'q', umode_allow_opers, &SNO_QLINE);
SnomaskAdd(NULL, 'S', umode_allow_opers, &SNO_SPAMF);
SnomaskAdd(NULL, 's', umode_allow_all, &SNO_SNOTICE);
SnomaskAdd(NULL, 'o', umode_allow_opers, &SNO_OPER);
}
void make_umodestr(void)
-2540
View File
File diff suppressed because it is too large Load Diff
+88 -58
View File
@@ -1,6 +1,6 @@
/************************************************************************
* IRC - Internet Relay Chat, win32/debug.c
* Copyright (C) 2002 Dominick Meglio (codemastr)
* Copyright (C) 2002-2004 Dominick Meglio (codemastr)
*
* 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
@@ -33,16 +33,24 @@
#define IRCDTOTALVERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4 PATCH5 PATCH6 PATCH7 PATCH8 PATCH9
#endif
#define BUFFERSIZE 0x200
extern OSVERSIONINFO VerInfo;
extern char OSName[256];
extern char backupbuf[8192];
extern char *buildid;
extern char serveropts[];
extern char *extraflags;
void CleanUp(void);
extern BOOL IsService;
void CleanUp(void);
__inline char *StackTrace(EXCEPTION_POINTERS *e) {
/* Runs a stack trace
* Parameters:
* e - The exception information
* Returns:
* The stack trace with function and line number information
*/
__inline char *StackTrace(EXCEPTION_POINTERS *e)
{
static char buffer[5000];
char curmodule[32];
DWORD symOptions, dwDisp, frame;
@@ -51,6 +59,8 @@ __inline char *StackTrace(EXCEPTION_POINTERS *e) {
IMAGEHLP_LINE pLine;
IMAGEHLP_MODULE pMod;
STACKFRAME Stack;
/* Load the stack information */
Stack.AddrPC.Offset = e->ContextRecord->Eip;
Stack.AddrPC.Mode = AddrModeFlat;
Stack.AddrFrame.Offset = e->ContextRecord->Ebp;
@@ -60,6 +70,7 @@ __inline char *StackTrace(EXCEPTION_POINTERS *e) {
else
hProcess = GetCurrentProcess();
/* Initialize symbol retrieval system */
SymInitialize(hProcess, NULL, TRUE);
SymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_UNDNAME);
bzero(pSym, sizeof(IMAGEHLP_SYMBOL)+500);
@@ -69,69 +80,65 @@ __inline char *StackTrace(EXCEPTION_POINTERS *e) {
pLine.SizeOfStruct = sizeof(IMAGEHLP_LINE);
bzero(&pMod, sizeof(IMAGEHLP_MODULE));
pMod.SizeOfStruct = sizeof(IMAGEHLP_MODULE);
/* Retrieve the first module name */
SymGetModuleInfo(hProcess, Stack.AddrPC.Offset, &pMod);
strcpy(curmodule, pMod.ModuleName);
sprintf(buffer, "\tModule: %s\n", pMod.ModuleName);
for (frame = 0; ; frame++) {
/* Walk through the stack */
for (frame = 0; ; frame++)
{
char buf[500];
if (!StackWalk(IMAGE_FILE_MACHINE_I386, GetCurrentProcess(), GetCurrentThread(),
&Stack, NULL, NULL, SymFunctionTableAccess, SymGetModuleBase, NULL))
break;
SymGetModuleInfo(hProcess, Stack.AddrPC.Offset, &pMod);
if (strcmp(curmodule, pMod.ModuleName)) {
if (strcmp(curmodule, pMod.ModuleName))
{
strcpy(curmodule, pMod.ModuleName);
sprintf(buf, "\tModule: %s\n", pMod.ModuleName);
strcat(buffer, buf);
}
SymGetLineFromAddr(hProcess, Stack.AddrPC.Offset, &dwDisp, &pLine);
SymGetSymFromAddr(hProcess, Stack.AddrPC.Offset, &dwDisp, pSym);
sprintf(buf, "\t\t#%d %s:%d: %s\n", frame, pLine.FileName, pLine.LineNumber, pSym->Name);
sprintf(buf, "\t\t#%d %s:%d: %s\n", frame, pLine.FileName, pLine.LineNumber,
pSym->Name);
strcat(buffer, buf);
}
return buffer;
}
__inline char *GetRegisters(CONTEXT *context) {
/* Retrieves the values of several registers
* Parameters:
* context - The CPU context
* Returns:
* The values of the EAX/EBX/ECX/EDX/ESI/EDI/EIP/EBP/ESP registers
*/
__inline char *GetRegisters(CONTEXT *context)
{
static char buffer[1024];
sprintf(buffer, "\tEAX=0x%08x EBX=0x%08x ECX=0x%08x\n"
"\tEDX=0x%08x ESI=0x%08x EDI=0x%08x\n"
"\tEIP=0x%08x EBP=0x%08x ESP=0x%08x\n",
context->Eax, context->Ebx, context->Ecx, context->Edx,
context->Esi, context->Edi, context->Eip, context->Ebp,
context->Esp);
context->Eax, context->Ebx, context->Ecx, context->Edx,
context->Esi, context->Edi, context->Eip, context->Ebp,
context->Esp);
return buffer;
}
/*__inline char *GetCpuName() {
static char cpuname[48];
__try {
_asm {
mov eax,080000002h
CPUID
mov DWORD PTR [cpuname+0],eax
mov DWORD PTR [cpuname+4],ebx
mov DWORD PTR [cpuname+8],ecx
mov DWORD PTR [cpuname+12],edx
mov eax,080000003h
CPUID
mov DWORD PTR [cpuname+16],eax
mov DWORD PTR [cpuname+20],ebx
mov DWORD PTR [cpuname+24],ecx
mov DWORD PTR [cpuname+28],edx
mov eax,080000004h
CPUID
mov DWORD PTR [cpuname+32],eax
mov DWORD PTR [cpuname+36],ebx
mov DWORD PTR [cpuname+40],ecx
mov DWORD PTR [cpuname+44],edx
}
} __except(EXCEPTION_EXECUTE_HANDLER) { return NULL; }
return cpuname;
}*/
__inline char *GetException(DWORD code) {
switch (code) {
/* Convert the exception code to a human readable string
* Parameters:
* code - The exception code to convert
* Returns:
* The exception code represented as a string
*/
__inline char *GetException(DWORD code)
{
switch (code)
{
case EXCEPTION_ACCESS_VIOLATION:
return "Access Violation";
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
@@ -172,46 +179,69 @@ __inline char *GetException(DWORD code) {
return "Single Step";
case EXCEPTION_STACK_OVERFLOW:
return "Stack Overflow";
default:
return "Unknown Exception";
}
return "Unknown Exception";
}
LONG __stdcall ExceptionFilter(EXCEPTION_POINTERS *e) {
/* Callback for the exception handler
* Parameters:
* e - The exception information
* Returns:
* EXCEPTION_EXECUTE_HANDLER to terminate the process
* Side Effects:
* wircd.PID.core is created
* If not running in service mode, a message box is displayed,
* else output is written to service.log
*/
LONG __stdcall ExceptionFilter(EXCEPTION_POINTERS *e)
{
MEMORYSTATUS memStats;
char file[512], text[1024];
FILE *fd;
time_t timet = time(NULL);
sprintf(file, "wircd.%d.core", getpid());
fd = fopen(file, "w");
GlobalMemoryStatus(&memStats);
fprintf(fd, "Generated at %s\n%s (%d.%d.%d)\n%s[%s%s%s] (%s)\n-----------------\nMemory Information:\n"
"\tPhysical: (Available:%ldMB/Total:%ldMB)\n\tVirtual: (Available:%ldMB/Total:%ldMB)\n"
"-----------------\nException:\n\t%s\n-----------------\nBackup Buffer:\n\t%s\n"
"-----------------\nRegisters:\n%s-----------------\nStack Trace:\n%s", asctime(gmtime(&timet)),
OSName, VerInfo.dwMajorVersion, VerInfo.dwMinorVersion, VerInfo.dwBuildNumber,
IRCDTOTALVERSION, serveropts, extraflags ? extraflags : "", tainted ? "3" : "",
buildid, memStats.dwAvailPhys/1048576, memStats.dwTotalPhys/1048576,
memStats.dwAvailVirtual/1048576, memStats.dwTotalVirtual/1048576,
GetException(e->ExceptionRecord->ExceptionCode), backupbuf,
GetRegisters(e->ContextRecord), StackTrace(e));
fprintf(fd, "Generated at %s\n%s (%d.%d.%d)\n%s[%s%s%s] (%s)\n"
"-----------------\nMemory Information:\n"
"\tPhysical: (Available:%ldMB/Total:%ldMB)\n"
"\tVirtual: (Available:%ldMB/Total:%ldMB)\n"
"-----------------\nException:\n\t%s\n-----------------\n"
"Backup Buffer:\n\t%s\n-----------------\nRegisters:\n"
"%s-----------------\nStack Trace:\n%s",
asctime(gmtime(&timet)), OSName, VerInfo.dwMajorVersion,
VerInfo.dwMinorVersion, VerInfo.dwBuildNumber, IRCDTOTALVERSION,
serveropts, extraflags ? extraflags : "", tainted ? "3" : "",
buildid, memStats.dwAvailPhys/1048576, memStats.dwTotalPhys/1048576,
memStats.dwAvailVirtual/1048576, memStats.dwTotalVirtual/1048576,
GetException(e->ExceptionRecord->ExceptionCode), backupbuf,
GetRegisters(e->ContextRecord), StackTrace(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());
" 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 {
else
{
FILE *fd = fopen("service.log", "a");
fprintf(fd, "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());
fprintf(fd, "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);
}
CleanUp();
return EXCEPTION_EXECUTE_HANDLER;
}
void InitDebug(void) {
/* Initializes the exception handler */
void InitDebug(void)
{
SetUnhandledExceptionFilter(&ExceptionFilter);
}
+777
View File
@@ -0,0 +1,777 @@
/************************************************************************
* IRC - Internet Relay Chat, win32/editor.c
* Copyright (C) 2004 Dominick Meglio (codemastr)
*
* 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 <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <richedit.h>
#include <commdlg.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <fcntl.h>
#include "resource.h"
#include "setup.h"
#include "win32.h"
#include "sys.h"
LRESULT CALLBACK GotoDLG(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ColorDLG(HWND, UINT, WPARAM, LPARAM);
HWND hFind;
/* Draws the statusbar for the editor
* Parameters:
* hInstance - The instance to create the statusbar in
* hwndParent - The parent of the statusbar
* iId - The message value used to send messages to the parent
* Returns:
* The handle to the statusbar
*/
HWND DrawStatusbar(HINSTANCE hInstance, HWND hwndParent, UINT iId)
{
HWND hStatus, hTip;
TOOLINFO ti;
RECT clrect;
hStatus = CreateStatusWindow(WS_CHILD|WS_VISIBLE|SBT_TOOLTIPS, NULL, hwndParent, iId);
hTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
WS_POPUP|TTS_NOPREFIX|TTS_ALWAYSTIP, 0, 0, 0, 0, hwndParent, NULL, hInstance, NULL);
GetClientRect(hStatus, &clrect);
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = hStatus;
ti.uId = 1;
ti.hinst = hInstance;
ti.rect = clrect;
ti.lpszText = "Go To";
SendMessage(hTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
return hStatus;
}
/* Draws the toolbar for the editor
* Parameters:
* hInstance - The instance to create the toolbar in
* hwndParent - The parent of the toolbar
* Returns:
* The handle to the toolbar
*/
HWND DrawToolbar(HINSTANCE hInstance, HWND hwndParent)
{
HWND hTool;
TBADDBITMAP tbBit;
int newidx;
TBBUTTON tbButtons[10] = {
{ STD_FILENEW, IDM_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
{ STD_FILESAVE, IDM_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0}, 0L, 0},
{ STD_CUT, IDM_CUT, 0, TBSTYLE_BUTTON, {0}, 0L, 0},
{ STD_COPY, IDM_COPY, 0, TBSTYLE_BUTTON, {0}, 0L, 0},
{ STD_PASTE, IDM_PASTE, 0, TBSTYLE_BUTTON, {0}, 0L, 0},
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0}, 0L, 0},
{ STD_UNDO, IDM_UNDO, 0, TBSTYLE_BUTTON, {0}, 0L, 0},
{ STD_REDOW, IDM_REDO, 0, TBSTYLE_BUTTON, {0}, 0L, 0},
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0}, 0L, 0}
};
TBBUTTON tbAddButtons[7] = {
{ 0, IDC_BOLD, TBSTATE_ENABLED, TBSTYLE_CHECK, {0}, 0L, 0},
{ 1, IDC_UNDERLINE, TBSTATE_ENABLED, TBSTYLE_CHECK, {0}, 0L, 0},
{ 2, IDC_COLOR, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
{ 3, IDC_BGCOLOR, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
{ 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0}, 0L, 0},
{ 4, IDC_GOTO, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0},
{ STD_FIND, IDC_FIND, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, 0}
};
hTool = CreateToolbarEx(hwndParent, WS_VISIBLE|WS_CHILD|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS,
IDC_TOOLBAR, 0, HINST_COMMCTRL, IDB_STD_SMALL_COLOR,
tbButtons, 10, 0, 0, 100, 30, sizeof(TBBUTTON));
tbBit.hInst = hInstance;
tbBit.nID = IDB_BITMAP1;
newidx = SendMessage(hTool, TB_ADDBITMAP, (WPARAM)5, (LPARAM)&tbBit);
tbAddButtons[0].iBitmap += newidx;
tbAddButtons[1].iBitmap += newidx;
tbAddButtons[2].iBitmap += newidx;
tbAddButtons[3].iBitmap += newidx;
tbAddButtons[5].iBitmap += newidx;
SendMessage(hTool, TB_ADDBUTTONS, (WPARAM)7, (LPARAM)&tbAddButtons);
return hTool;
}
/* Dialog procedure for the color selection dialog
* Parameters:
* hDlg - The dialog handle
* message - The message received
* wParam - The first message parameter
* lParam - The second message parameter
* Returns:
* TRUE if the message was processed, FALSE otherwise
*/
LRESULT CALLBACK ColorDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
static HBRUSH hBrushWhite, hBrushBlack, hBrushDarkBlue, hBrushDarkGreen, hBrushRed,
hBrushDarkRed, hBrushPurple, hBrushOrange, hBrushYellow, hBrushGreen, hBrushVDarkGreen,
hBrushLightBlue, hBrushBlue, hBrushPink, hBrushDarkGray, hBrushGray;
static UINT ResultMsg = 0;
switch (message)
{
case WM_INITDIALOG:
hBrushWhite = CreateSolidBrush(RGB(255,255,255));
hBrushBlack = CreateSolidBrush(RGB(0,0,0));
hBrushDarkBlue = CreateSolidBrush(RGB(0,0,127));
hBrushDarkGreen = CreateSolidBrush(RGB(0,147,0));
hBrushRed = CreateSolidBrush(RGB(255,0,0));
hBrushDarkRed = CreateSolidBrush(RGB(127,0,0));
hBrushPurple = CreateSolidBrush(RGB(156,0,156));
hBrushOrange = CreateSolidBrush(RGB(252,127,0));
hBrushYellow = CreateSolidBrush(RGB(255,255,0));
hBrushGreen = CreateSolidBrush(RGB(0,252,0));
hBrushVDarkGreen = CreateSolidBrush(RGB(0,147,147));
hBrushLightBlue = CreateSolidBrush(RGB(0,255,255));
hBrushBlue = CreateSolidBrush(RGB(0,0,252));
hBrushPink = CreateSolidBrush(RGB(255,0,255));
hBrushDarkGray = CreateSolidBrush(RGB(127,127,127));
hBrushGray = CreateSolidBrush(RGB(210,210,210));
ResultMsg = (UINT)lParam;
SetFocus(NULL);
return TRUE;
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
if (wParam == IDC_WHITE)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushWhite);
if (wParam == IDC_BLACK)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushBlack);
if (wParam == IDC_DARKBLUE)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushDarkBlue);
if (wParam == IDC_DARKGREEN)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushDarkGreen);
if (wParam == IDC_RED)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushRed);
if (wParam == IDC_DARKRED)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushDarkRed);
if (wParam == IDC_PURPLE)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushPurple);
if (wParam == IDC_ORANGE)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushOrange);
if (wParam == IDC_YELLOW)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushYellow);
if (wParam == IDC_GREEN)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushGreen);
if (wParam == IDC_VDARKGREEN)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushVDarkGreen);
if (wParam == IDC_LIGHTBLUE)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushLightBlue);
if (wParam == IDC_BLUE)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushBlue);
if (wParam == IDC_PINK)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushPink);
if (wParam == IDC_DARKGRAY)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushDarkGray);
if (wParam == IDC_GRAY)
FillRect(lpdis->hDC, &lpdis->rcItem, hBrushGray);
DrawEdge(lpdis->hDC, &lpdis->rcItem, EDGE_SUNKEN, BF_RECT);
return TRUE;
}
case WM_COMMAND:
{
COLORREF clrref;
if (LOWORD(wParam) == IDC_WHITE)
clrref = RGB(255,255,255);
else if (LOWORD(wParam) == IDC_BLACK)
clrref = RGB(0,0,0);
else if (LOWORD(wParam) == IDC_DARKBLUE)
clrref = RGB(0,0,127);
else if (LOWORD(wParam) == IDC_DARKGREEN)
clrref = RGB(0,147,0);
else if (LOWORD(wParam) == IDC_RED)
clrref = RGB(255,0,0);
else if (LOWORD(wParam) == IDC_DARKRED)
clrref = RGB(127,0,0);
else if (LOWORD(wParam) == IDC_PURPLE)
clrref = RGB(156,0,156);
else if (LOWORD(wParam) == IDC_ORANGE)
clrref = RGB(252,127,0);
else if (LOWORD(wParam) == IDC_YELLOW)
clrref = RGB(255,255,0);
else if (LOWORD(wParam) == IDC_GREEN)
clrref = RGB(0,252,0);
else if (LOWORD(wParam) == IDC_VDARKGREEN)
clrref = RGB(0,147,147);
else if (LOWORD(wParam) == IDC_LIGHTBLUE)
clrref = RGB(0,255,255);
else if (LOWORD(wParam) == IDC_BLUE)
clrref = RGB(0,0,252);
else if (LOWORD(wParam) == IDC_PINK)
clrref = RGB(255,0,255);
else if (LOWORD(wParam) == IDC_DARKGRAY)
clrref = RGB(127,127,127);
else if (LOWORD(wParam) == IDC_GRAY)
clrref = RGB(210,210,210);
SendMessage(GetParent(hDlg), ResultMsg, (WPARAM)clrref, (LPARAM)hDlg);
break;
}
case WM_CLOSE:
EndDialog(hDlg, TRUE);
case WM_DESTROY:
DeleteObject(hBrushWhite);
DeleteObject(hBrushBlack);
DeleteObject(hBrushDarkBlue);
DeleteObject(hBrushDarkGreen);
DeleteObject(hBrushRed);
DeleteObject(hBrushDarkRed);
DeleteObject(hBrushPurple);
DeleteObject(hBrushOrange);
DeleteObject(hBrushYellow);
DeleteObject(hBrushGreen);
DeleteObject(hBrushVDarkGreen);
DeleteObject(hBrushLightBlue);
DeleteObject(hBrushBlue);
DeleteObject(hBrushPink);
DeleteObject(hBrushDarkGray);
DeleteObject(hBrushGray);
break;
}
return FALSE;
}
/* Dialog procedure for the goto dialog
* Parameters:
* hDlg - The dialog handle
* message - The message received
* wParam - The first message parameter
* lParam - The second message parameter
* Returns:
* TRUE if the message was processed, FALSE otherwise
*/
LRESULT CALLBACK GotoDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_COMMAND)
{
if (LOWORD(wParam) == IDCANCEL)
EndDialog(hDlg, TRUE);
else if (LOWORD(wParam) == IDOK)
{
HWND hWnd = GetDlgItem(GetParent(hDlg),IDC_TEXT);
int line = GetDlgItemInt(hDlg, IDC_GOTO, NULL, FALSE);
int pos = SendMessage(hWnd, EM_LINEINDEX, (WPARAM)--line, 0);
SendMessage(hWnd, EM_SETSEL, (WPARAM)pos, (LPARAM)pos);
SendMessage(hWnd, EM_SCROLLCARET, 0, 0);
EndDialog(hDlg, TRUE);
}
}
return FALSE;
}
LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hWnd;
static FINDREPLACE find;
static char findbuf[256];
static unsigned char *file;
static HWND hTool, hClip, hStatus;
static RECT rOld;
CHARFORMAT2 chars;
if (message == WM_FINDMSGSTRING)
{
FINDREPLACE *fr = (FINDREPLACE *)lParam;
if (fr->Flags & FR_FINDNEXT)
{
HWND hRich = GetDlgItem(hDlg, IDC_TEXT);
DWORD flags=0;
FINDTEXTEX ft;
CHARRANGE chrg;
if (fr->Flags & FR_DOWN)
flags |= FR_DOWN;
if (fr->Flags & FR_MATCHCASE)
flags |= FR_MATCHCASE;
if (fr->Flags & FR_WHOLEWORD)
flags |= FR_WHOLEWORD;
ft.lpstrText = fr->lpstrFindWhat;
SendMessage(hRich, EM_EXGETSEL, 0, (LPARAM)&chrg);
if (flags & FR_DOWN)
{
ft.chrg.cpMin = chrg.cpMax;
ft.chrg.cpMax = -1;
}
else
{
ft.chrg.cpMin = chrg.cpMin;
ft.chrg.cpMax = -1;
}
if (SendMessage(hRich, EM_FINDTEXTEX, flags, (LPARAM)&ft) == -1)
MessageBox(NULL, "Unreal has finished searching the document",
"Find", MB_ICONINFORMATION|MB_OK);
else
{
SendMessage(hRich, EM_EXSETSEL, 0, (LPARAM)&(ft.chrgText));
SendMessage(hRich, EM_SCROLLCARET, 0, 0);
SetFocus(hRich);
}
}
return TRUE;
}
switch (message)
{
case WM_INITDIALOG:
{
int fd,len;
unsigned char *buffer = '\0', *string = '\0';
EDITSTREAM edit;
StreamIO *stream = malloc(sizeof(StreamIO));
unsigned char szText[256];
struct stat sb;
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT), hTip;
file = (unsigned char *)lParam;
if (file)
wsprintf(szText, "UnrealIRCd Editor - %s", file);
else
strcpy(szText, "UnrealIRCd Editor - New File");
SetWindowText(hDlg, szText);
lpfnOldWndProc = (FARPROC)SetWindowLong(hWnd, GWL_WNDPROC, (DWORD)RESubClassFunc);
hTool = DrawToolbar(hInst, hDlg);
hStatus = DrawStatusbar(hInst, hDlg, IDC_STATUS);
SendMessage(hWnd, EM_SETEVENTMASK, 0, (LPARAM)ENM_SELCHANGE);
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_FACE;
strcpy(chars.szFaceName,"Fixedsys");
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&chars);
if ((fd = open(file, _O_RDONLY|_O_BINARY)) != -1)
{
fstat(fd,&sb);
/* Only allocate the amount we need */
buffer = malloc(sb.st_size+1);
buffer[0] = 0;
len = read(fd, buffer, sb.st_size);
buffer[len] = 0;
len = CountRTFSize(buffer)+1;
string = malloc(len);
bzero(string,len);
IRCToRTF(buffer,string);
RTFBuf = string;
len--;
stream->size = &len;
stream->buffer = &RTFBuf;
edit.dwCookie = (UINT)stream;
edit.pfnCallback = SplitIt;
SendMessage(hWnd, EM_EXLIMITTEXT, 0, (LPARAM)0x7FFFFFFF);
SendMessage(hWnd, EM_STREAMIN, (WPARAM)SF_RTF|SFF_PLAINRTF, (LPARAM)&edit);
SendMessage(hWnd, EM_SETMODIFY, (WPARAM)FALSE, 0);
SendMessage(hWnd, EM_EMPTYUNDOBUFFER, 0, 0);
close(fd);
RTFBuf = NULL;
free(buffer);
free(string);
free(stream);
hClip = SetClipboardViewer(hDlg);
if (SendMessage(hWnd, EM_CANPASTE, 0, 0))
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_PASTE, (LPARAM)MAKELONG(TRUE,0));
else
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_PASTE, (LPARAM)MAKELONG(FALSE,0));
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_UNDO, (LPARAM)MAKELONG(FALSE,0));
wsprintf(szText, "Line: 1");
SetWindowText(hStatus, szText);
}
return TRUE;
}
case WM_WINDOWPOSCHANGING:
{
GetClientRect(hDlg, &rOld);
return FALSE;
}
case WM_SIZE:
{
DWORD new_width, new_height;
HWND hRich;
RECT rOldRich;
DWORD old_width, old_height;
DWORD old_rich_width, old_rich_height;
if (hDlg == hFind)
return FALSE;
new_width = LOWORD(lParam);
new_height = HIWORD(lParam);
hRich = GetDlgItem(hDlg, IDC_TEXT);
SendMessage(hStatus, WM_SIZE, 0, 0);
SendMessage(hTool, TB_AUTOSIZE, 0, 0);
old_width = rOld.right-rOld.left;
old_height = rOld.bottom-rOld.top;
new_width = new_width - old_width;
new_height = new_height - old_height;
GetWindowRect(hRich, &rOldRich);
old_rich_width = rOldRich.right-rOldRich.left;
old_rich_height = rOldRich.bottom-rOldRich.top;
SetWindowPos(hRich, NULL, 0, 0, old_rich_width+new_width,
old_rich_height+new_height,
SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOZORDER);
bzero(&rOld, sizeof(RECT));
return TRUE;
}
case WM_NOTIFY:
switch (((NMHDR *)lParam)->code)
{
case EN_SELCHANGE:
{
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT);
DWORD start, end, currline;
static DWORD prevline = 0;
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)
SendMessage(hTool, TB_CHECKBUTTON, (WPARAM)IDC_BOLD, (LPARAM)MAKELONG(TRUE,0));
else
SendMessage(hTool, TB_CHECKBUTTON, (WPARAM)IDC_BOLD, (LPARAM)MAKELONG(FALSE,0));
if (chars.dwMask & CFM_UNDERLINE && chars.dwEffects & CFE_UNDERLINE)
SendMessage(hTool, TB_CHECKBUTTON, (WPARAM)IDC_UNDERLINE, (LPARAM)MAKELONG(TRUE,0));
else
SendMessage(hTool, TB_CHECKBUTTON, (WPARAM)IDC_UNDERLINE, (LPARAM)MAKELONG(FALSE,0));
SendMessage(hWnd, EM_GETSEL,(WPARAM)&start, (LPARAM)&end);
if (start == end)
{
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_COPY, (LPARAM)MAKELONG(FALSE,0));
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_CUT, (LPARAM)MAKELONG(FALSE,0));
}
else
{
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_COPY, (LPARAM)MAKELONG(TRUE,0));
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_CUT, (LPARAM)MAKELONG(TRUE,0));
}
if (SendMessage(hWnd, EM_CANUNDO, 0, 0))
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_UNDO, (LPARAM)MAKELONG(TRUE,0));
else
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_UNDO, (LPARAM)MAKELONG(FALSE,0));
if (SendMessage(hWnd, EM_CANREDO, 0, 0))
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_REDO, (LPARAM)MAKELONG(TRUE,0));
else
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_REDO, (LPARAM)MAKELONG(FALSE,0));
currline = SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, 0);
currline++;
if (currline != prevline)
{
wsprintf(buffer, "Line: %d", currline);
SetWindowText(hStatus, buffer);
prevline = currline;
}
return TRUE;
}
case TTN_GETDISPINFO:
{
LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT) lParam;
lpttt->hinst = NULL;
switch (lpttt->hdr.idFrom)
{
case IDM_NEW:
strcpy(lpttt->szText, "New");
break;
case IDM_SAVE:
strcpy(lpttt->szText, "Save");
break;
case IDM_CUT:
strcpy(lpttt->szText, "Cut");
break;
case IDM_COPY:
strcpy(lpttt->szText, "Copy");
break;
case IDM_PASTE:
strcpy(lpttt->szText, "Paste");
break;
case IDM_UNDO:
strcpy(lpttt->szText, "Undo");
break;
case IDM_REDO:
strcpy(lpttt->szText, "Redo");
break;
case IDC_BOLD:
strcpy(lpttt->szText, "Bold");
break;
case IDC_UNDERLINE:
strcpy(lpttt->szText, "Underline");
break;
case IDC_COLOR:
strcpy(lpttt->szText, "Text Color");
break;
case IDC_BGCOLOR:
strcpy(lpttt->szText, "Background Color");
break;
case IDC_GOTO:
strcpy(lpttt->szText, "Goto");
break;
case IDC_FIND:
strcpy(lpttt->szText, "Find");
break;
}
return TRUE;
}
case NM_DBLCLK:
DialogBox(hInst, "GOTO", hDlg, (DLGPROC)GotoDLG);
return (TRUE);
}
return (TRUE);
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BOLD)
{
hWnd = GetDlgItem(hDlg, IDC_TEXT);
if (SendMessage(hTool, TB_ISBUTTONCHECKED, (WPARAM)IDC_BOLD, (LPARAM)0) != 0)
{
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_BOLD;
chars.dwEffects = CFE_BOLD;
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
SendMessage(hWnd, EM_HIDESELECTION, 0, 0);
SetFocus(hWnd);
}
else
{
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_BOLD;
chars.dwEffects = 0;
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
SendMessage(hWnd, EM_HIDESELECTION, 0, 0);
SetFocus(hWnd);
}
return TRUE;
}
else if (LOWORD(wParam) == IDC_UNDERLINE)
{
hWnd = GetDlgItem(hDlg, IDC_TEXT);
if (SendMessage(hTool, TB_ISBUTTONCHECKED, (WPARAM)IDC_UNDERLINE, (LPARAM)0) != 0)
{
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_UNDERLINETYPE;
chars.bUnderlineType = CFU_UNDERLINE;
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
SendMessage(hWnd, EM_HIDESELECTION, 0, 0);
SetFocus(hWnd);
}
else
{
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_UNDERLINETYPE;
chars.bUnderlineType = CFU_UNDERLINENONE;
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
SendMessage(hWnd, EM_HIDESELECTION, 0, 0);
SetFocus(hWnd);
}
return TRUE;
}
if (LOWORD(wParam) == IDC_COLOR)
{
DialogBoxParam(hInst, "Color", hDlg, (DLGPROC)ColorDLG, (LPARAM)WM_USER+10);
return 0;
}
if (LOWORD(wParam) == IDC_BGCOLOR)
{
DialogBoxParam(hInst, "Color", hDlg, (DLGPROC)ColorDLG, (LPARAM)WM_USER+11);
return 0;
}
if (LOWORD(wParam) == IDC_GOTO)
{
DialogBox(hInst, "GOTO", hDlg, (DLGPROC)GotoDLG);
return 0;
}
if (LOWORD(wParam) == IDC_FIND)
{
static FINDREPLACE fr;
bzero(&fr, sizeof(FINDREPLACE));
fr.lStructSize = sizeof(FINDREPLACE);
fr.hwndOwner = hDlg;
fr.lpstrFindWhat = findbuf;
fr.wFindWhatLen = 255;
hFind = FindText(&fr);
return 0;
}
hWnd = GetDlgItem(hDlg, IDC_TEXT);
if (LOWORD(wParam) == IDM_COPY)
{
SendMessage(hWnd, WM_COPY, 0, 0);
return 0;
}
if (LOWORD(wParam) == IDM_SELECTALL)
{
SendMessage(hWnd, EM_SETSEL, 0, -1);
return 0;
}
if (LOWORD(wParam) == IDM_PASTE)
{
SendMessage(hWnd, WM_PASTE, 0, 0);
return 0;
}
if (LOWORD(wParam) == IDM_CUT)
{
SendMessage(hWnd, WM_CUT, 0, 0);
return 0;
}
if (LOWORD(wParam) == IDM_UNDO)
{
SendMessage(hWnd, EM_UNDO, 0, 0);
return 0;
}
if (LOWORD(wParam) == IDM_REDO)
{
SendMessage(hWnd, EM_REDO, 0, 0);
return 0;
}
if (LOWORD(wParam) == IDM_DELETE)
{
SendMessage(hWnd, WM_CLEAR, 0, 0);
return 0;
}
if (LOWORD(wParam) == IDM_SAVE)
{
int fd;
EDITSTREAM edit;
OPENFILENAME lpopen;
if (!file)
{
unsigned char path[MAX_PATH];
path[0] = '\0';
bzero(&lpopen, sizeof(OPENFILENAME));
lpopen.lStructSize = sizeof(OPENFILENAME);
lpopen.hwndOwner = hDlg;
lpopen.lpstrFilter = NULL;
lpopen.lpstrCustomFilter = NULL;
lpopen.nFilterIndex = 0;
lpopen.lpstrFile = path;
lpopen.nMaxFile = MAX_PATH;
lpopen.lpstrFileTitle = NULL;
lpopen.lpstrInitialDir = DPATH;
lpopen.lpstrTitle = NULL;
lpopen.Flags = (OFN_ENABLESIZING|OFN_NONETWORKBUTTON|
OFN_OVERWRITEPROMPT);
if (GetSaveFileName(&lpopen))
file = path;
else
break;
}
fd = open(file, _O_TRUNC|_O_CREAT|_O_WRONLY|_O_BINARY,_S_IWRITE);
edit.dwCookie = 0;
edit.pfnCallback = BufferIt;
SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_STREAMOUT, (WPARAM)SF_RTF|SFF_PLAINRTF, (LPARAM)&edit);
RTFToIRC(fd, RTFBuf, strlen(RTFBuf));
free(RTFBuf);
RTFBuf = NULL;
SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_SETMODIFY, (WPARAM)FALSE, 0);
return 0;
}
if (LOWORD(wParam) == IDM_NEW)
{
unsigned char text[1024];
BOOL newfile = FALSE;
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");
ans = MessageBox(hDlg, text, "UnrealIRCd", MB_YESNOCANCEL|MB_ICONWARNING);
if (ans == IDNO)
newfile = TRUE;
if (ans == IDCANCEL)
return TRUE;
if (ans == IDYES)
{
SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDM_SAVE,0), 0);
newfile = TRUE;
}
}
else
newfile = TRUE;
if (newfile == TRUE)
{
unsigned char szText[256];
file = NULL;
strcpy(szText, "UnrealIRCd Editor - New File");
SetWindowText(hDlg, szText);
SetWindowText(GetDlgItem(hDlg, IDC_TEXT), NULL);
}
break;
}
break;
case WM_USER+10:
{
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT);
EndDialog((HWND)lParam, TRUE);
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_COLOR;
chars.crTextColor = (COLORREF)wParam;
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
SendMessage(hWnd, EM_HIDESELECTION, 0, 0);
SetFocus(hWnd);
break;
}
case WM_USER+11:
{
HWND hWnd = GetDlgItem(hDlg, IDC_TEXT);
EndDialog((HWND)lParam, TRUE);
chars.cbSize = sizeof(CHARFORMAT2);
chars.dwMask = CFM_BACKCOLOR;
chars.crBackColor = (COLORREF)wParam;
SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&chars);
SendMessage(hWnd, EM_HIDESELECTION, 0, 0);
SetFocus(hWnd);
break;
}
case WM_CHANGECBCHAIN:
if ((HWND)wParam == hClip)
hClip = (HWND)lParam;
else
SendMessage(hClip, WM_CHANGECBCHAIN, wParam, lParam);
break;
case WM_DRAWCLIPBOARD:
if (SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_CANPASTE, 0, 0))
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_PASTE, (LPARAM)MAKELONG(TRUE,0));
else
SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_PASTE, (LPARAM)MAKELONG(FALSE,0));
SendMessage(hClip, WM_DRAWCLIPBOARD, wParam, lParam);
break;
case WM_CLOSE:
{
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");
ans = MessageBox(hDlg, text, "UnrealIRCd", MB_YESNOCANCEL|MB_ICONWARNING);
if (ans == IDNO)
EndDialog(hDlg, TRUE);
if (ans == IDCANCEL)
return TRUE;
if (ans == IDYES)
{
SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDM_SAVE,0), 0);
EndDialog(hDlg, TRUE);
}
}
else
EndDialog(hDlg, TRUE);
break;
}
case WM_DESTROY:
ChangeClipboardChain(hDlg, hClip);
break;
}
return FALSE;
}
+1080
View File
File diff suppressed because it is too large Load Diff
+883
View File
@@ -0,0 +1,883 @@
/************************************************************************
* IRC - Internet Relay Chat, win32/rtf.c
* Copyright (C) 2004 Dominick Meglio (codemastr)
*
* 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 <windows.h>
#include "win32.h"
#include "sys.h"
#include "common.h"
#include "struct.h"
#include "h.h"
unsigned char *RTFBuf;
#define MIRC_COLORS "{\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue127;\\red0\\green147\\blue0;\\red255\\green0\\blue0;\\red127\\green0\\blue0;\\red156\\green0\\blue156;\\red252\\green127\\blue0;\\red255\\green255\\blue0;\\red0\\green252\\blue0;\\red0\\green147\\blue147;\\red0\\green255\\blue255;\\red0\\green0\\blue252;\\red255\\green0\\blue255;\\red127\\green127\\blue127;\\red210\\green210\\blue210;\\red0\\green0\\blue0;}"
/* Splits the file up for the EM_STREAMIN message
* Parameters:
* dwCookie - The file information to split
* pbBuff - The output buffer
* cb - The size of pbBuff
* pcb - The total bytes written to bpBuff
* Returns:
* Returns 0 to indicate success
*/
DWORD CALLBACK SplitIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
StreamIO *stream = (StreamIO*)dwCookie;
if (*stream->size == 0)
{
pcb = 0;
*stream->buffer = 0;
}
else if (cb <= *stream->size)
{
memcpy(pbBuff, *stream->buffer, cb);
*stream->buffer += cb;
*stream->size -= cb;
*pcb = cb;
}
else
{
memcpy(pbBuff, *stream->buffer, *stream->size);
*pcb = *stream->size;
*stream->size = 0;
}
return 0;
}
/* Reassembles the RTF buffer from EM_STREAMOUT
* Parameters:
* dwCookie - Unused
* pbBuff - The input buffer
* cb - The length of the input buffer
* pcb - The total bytes read from pbBuff
* Returns:
* 0 to indicate success
* Side Effects:
* RTFBuf contains the assembled RTF buffer
*/
DWORD CALLBACK BufferIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
unsigned char *buf2;
static long size = 0;
if (!RTFBuf)
size = 0;
buf2 = MyMalloc(size+cb+1);
if (RTFBuf)
memcpy(buf2,RTFBuf,size);
memcpy(buf2+size,pbBuff,cb);
size += cb;
if (RTFBuf)
MyFree(RTFBuf);
RTFBuf = buf2;
pcb = &cb;
return 0;
}
/* Pushes a color onto the stack
* Parameters:
* color - The color to add to the stack
* stack - The stack to add the color to
*/
void ColorPush(unsigned char *color, IRCColor **stack)
{
IRCColor *t = MyMallocEx(sizeof(IRCColor));
t->color = strdup(color);
t->next = *stack;
(*stack) = t;
}
/* Pops a color off of the stack
* Parameters:
* stack - The stack to pop from
*/
void ColorPop(IRCColor **stack)
{
IRCColor *p = *stack;
if (!(*stack))
return;
MyFree(p->color);
*stack = p->next;
MyFree(p);
}
/* Completely empties the color stack
* Parameters:
* stack - The stack to empty
*/
void ColorEmpty(IRCColor **stack)
{
IRCColor *t, *next;
for (t = *stack; t; t = next)
{
next = t->next;
MyFree(t->color);
MyFree(t);
}
}
#define iseol(x) ((x) == '\r' || (x) == '\n')
/* Converts a string in RTF format to IRC codes
* Parameters:
* fd - The file descriptor to write to
* pbBuff - The buffer containing the RTF text
* cb - The length of the RTF text
*/
DWORD CALLBACK RTFToIRC(int fd, unsigned char *pbBuff, long cb)
{
unsigned char *buffer = malloc(cb*2);
int colors[17], bold = 0, uline = 0, incolor = 0, inbg = 0;
int lastwascf = 0, lastwascf0 = 0;
int i = 0;
IRCColor *TextColors = NULL;
IRCColor *BgColors = NULL;
bzero(buffer, cb);
for (; *pbBuff; pbBuff++)
{
if (iseol(*pbBuff) || *pbBuff == '{' || *pbBuff == '}')
continue;
else if (*pbBuff == '\\')
{
/* RTF control sequence */
pbBuff++;
if (*pbBuff == '\\' || *pbBuff == '{' || *pbBuff == '}')
buffer[i++] = *pbBuff;
else if (*pbBuff == '\'')
{
/* Extended ASCII character */
unsigned char ltr, ultr[3];
ultr[0] = *(++pbBuff);
ultr[1] = *(++pbBuff);
ultr[2] = 0;
ltr = strtoul(ultr,NULL,16);
buffer[i++] = ltr;
}
else
{
int j;
char cmd[128];
/* Capture the control sequence */
for (j = 0; *pbBuff && *pbBuff != '\\' && !isspace(*pbBuff) &&
!iseol(*pbBuff); pbBuff++)
{
cmd[j++] = *pbBuff;
}
if (*pbBuff != ' ')
pbBuff--;
cmd[j] = 0;
if (!strcmp(cmd, "fonttbl{"))
{
/* Eat the parameter */
while (*pbBuff && *pbBuff != '}')
pbBuff++;
lastwascf = lastwascf0 = 0;
}
if (!strcmp(cmd, "colortbl"))
{
char color[128];
int k = 0, m = 1;
/* Capture the color table */
while (*pbBuff && !isalnum(*pbBuff))
pbBuff++;
for (; *pbBuff && *pbBuff != '}'; pbBuff++)
{
if (*pbBuff == ';')
{
color[k]=0;
if (!strcmp(color, "\\red255\\green255\\blue255"))
colors[m++] = 0;
else if (!strcmp(color, "\\red0\\green0\\blue0"))
colors[m++] = 1;
else if (!strcmp(color, "\\red0\\green0\\blue127"))
colors[m++] = 2;
else if (!strcmp(color, "\\red0\\green147\\blue0"))
colors[m++] = 3;
else if (!strcmp(color, "\\red255\\green0\\blue0"))
colors[m++] = 4;
else if (!strcmp(color, "\\red127\\green0\\blue0"))
colors[m++] = 5;
else if (!strcmp(color, "\\red156\\green0\\blue156"))
colors[m++] = 6;
else if (!strcmp(color, "\\red252\\green127\\blue0"))
colors[m++] = 7;
else if (!strcmp(color, "\\red255\\green255\\blue0"))
colors[m++] = 8;
else if (!strcmp(color, "\\red0\\green252\\blue0"))
colors[m++] = 9;
else if (!strcmp(color, "\\red0\\green147\\blue147"))
colors[m++] = 10;
else if (!strcmp(color, "\\red0\\green255\\blue255"))
colors[m++] = 11;
else if (!strcmp(color, "\\red0\\green0\\blue252"))
colors[m++] = 12;
else if (!strcmp(color, "\\red255\\green0\\blue255"))
colors[m++] = 13;
else if (!strcmp(color, "\\red127\\green127\\blue127"))
colors[m++] = 14;
else if (!strcmp(color, "\\red210\\green210\\blue210"))
colors[m++] = 15;
k=0;
}
else
color[k++] = *pbBuff;
}
lastwascf = lastwascf0 = 0;
}
else if (!strcmp(cmd, "tab"))
{
buffer[i++] = '\t';
lastwascf = lastwascf0 = 0;
}
else if (!strcmp(cmd, "par"))
{
if (bold || uline || incolor || inbg)
buffer[i++] = '\17';
buffer[i++] = '\r';
buffer[i++] = '\n';
if (!*(pbBuff+3) || *(pbBuff+3) != '}')
{
if (bold)
buffer[i++] = '\2';
if (uline)
buffer[i++] = '\37';
if (incolor)
{
buffer[i++] = '\3';
strcat(buffer, TextColors->color);
i += strlen(TextColors->color);
if (inbg)
{
buffer[i++] = ',';
strcat(buffer, BgColors->color);
i += strlen(BgColors->color);
}
}
else if (inbg)
{
buffer[i++] = '\3';
buffer[i++] = '0';
buffer[i++] = '1';
buffer[i++] = ',';
strcat(buffer, BgColors->color);
i += strlen(BgColors->color);
}
}
}
else if (!strcmp(cmd, "b"))
{
bold = 1;
buffer[i++] = '\2';
lastwascf = lastwascf0 = 0;
}
else if (!strcmp(cmd, "b0"))
{
bold = 0;
buffer[i++] = '\2';
lastwascf = lastwascf0 = 0;
}
else if (!strcmp(cmd, "ul"))
{
uline = 1;
buffer[i++] = '\37';
lastwascf = lastwascf0 = 0;
}
else if (!strcmp(cmd, "ulnone"))
{
uline = 0;
buffer[i++] = '\37';
lastwascf = lastwascf0 = 0;
}
else if (!strcmp(cmd, "cf0"))
{
lastwascf0 = 1;
lastwascf = 0;
}
else if (!strcmp(cmd, "highlight0"))
{
inbg = 0;
ColorPop(&BgColors);
buffer[i++] = '\3';
if (lastwascf0)
{
incolor = 0;
ColorPop(&TextColors);
lastwascf0 = 0;
}
else if (incolor)
{
strcat(buffer, TextColors->color);
i += strlen(TextColors->color);
buffer[i++] = ',';
buffer[i++] = '0';
buffer[i++] = '0';
}
lastwascf = lastwascf0 = 0;
}
else if (!strncmp(cmd, "cf", 2))
{
unsigned char number[3];
int num;
incolor = 1;
strcpy(number, &cmd[2]);
num = atoi(number);
buffer[i++] = '\3';
if (colors[num] < 10)
sprintf(number, "0%d", colors[num]);
else
sprintf(number, "%d", colors[num]);
ColorPush(number, &TextColors);
strcat(buffer,number);
i += strlen(number);
lastwascf = 1;
lastwascf0 = 0;
}
else if (!strncmp(cmd, "highlight", 9))
{
int num;
unsigned char number[3];
inbg = 1;
num = atoi(&cmd[9]);
if (colors[num] < 10)
sprintf(number, "0%d", colors[num]);
else
sprintf(number, "%d", colors[num]);
if (incolor && !lastwascf)
{
buffer[i++] = '\3';
strcat(buffer, TextColors->color);
i += strlen(TextColors->color);
}
else if (!incolor)
{
buffer[i++] = '\3';
buffer[i++] = '0';
buffer[i++] = '1';
}
buffer[i++] = ',';
strcat(buffer, number);
i += strlen(number);
ColorPush(number, &BgColors);
lastwascf = lastwascf0 = 0;
}
else
lastwascf = lastwascf0 = 0;
if (lastwascf0 && incolor)
{
incolor = 0;
ColorPop(&TextColors);
buffer[i++] = '\3';
}
}
}
else
{
lastwascf = lastwascf0 = 0;
buffer[i++] = *pbBuff;
}
}
write(fd, buffer, i);
close(fd);
ColorEmpty(&TextColors);
ColorEmpty(&BgColors);
return 0;
}
/* Determines the size of the buffer needed to convert IRC codes to RTF
* Parameters:
* buffer - The input buffer with IRC codes
* Returns:
* The lenght of the buffer needed to store the RTF translation
*/
int CountRTFSize(unsigned char *buffer) {
int size = 0;
char bold = 0, uline = 0, incolor = 0, inbg = 0, reverse = 0;
char *buf = buffer;
for (; *buf; buf++)
{
if (*buf == '{' || *buf == '}' || *buf == '\\')
size++;
else if (*buf == '\r')
{
if (*(buf+1) && *(buf+1) == '\n')
{
buf++;
if (bold)
size += 3;
if (uline)
size += 7;
if (incolor && !reverse)
size += 4;
if (inbg && !reverse)
size += 11;
if (reverse)
size += 15;
if (bold || uline || incolor || inbg || reverse)
size++;
bold = uline = incolor = inbg = reverse = 0;
size +=6;
continue;
}
}
else if (*buf == '\n')
{
if (bold)
size += 3;
if (uline)
size += 7;
if (incolor && !reverse)
size += 4;
if (inbg && !reverse)
size += 11;
if (reverse)
size += 15;
if (bold || uline || incolor || inbg || reverse)
size++;
bold = uline = incolor = inbg = reverse = 0;
size +=6;
continue;
}
else if (*buf == '\2')
{
if (bold)
size += 4;
else
size += 3;
bold = !bold;
continue;
}
else if (*buf == '\3' && reverse)
{
if (*(buf+1) && isdigit(*(buf+1)))
{
++buf;
if (*(buf+1) && isdigit(*(buf+1)))
++buf;
if (*(buf+1) && *(buf+1) == ',')
{
if (*(buf+2) && isdigit(*(buf+2)))
{
buf+=2;
if (*(buf+1) && isdigit(*(buf+1)))
++buf;
}
}
}
continue;
}
else if (*buf == '\3' && !reverse)
{
size += 3;
if (*(buf+1) && !isdigit(*(buf+1)))
{
incolor = 0;
size++;
if (inbg)
{
inbg = 0;
size += 11;
}
}
else if (*(buf+1))
{
unsigned char color[3];
int number;
color[0] = *(++buf);
color[1] = 0;
if (*(buf+1) && isdigit(*(buf+1)))
color[1] = *(++buf);
color[2] = 0;
number = atoi(color);
if (number == 99 || number == 1)
size += 2;
else if (number == 0)
size++;
else {
number %= 16;
_itoa(number, color, 10);
size += strlen(color);
}
color[2] = 0;
number = atoi(color);
if (*(buf+1) && *(buf+1) == ',')
{
if (*(buf+2) && isdigit(*(buf+2)))
{
size += 10;
buf++;
color[0] = *(++buf);
color[1] = 0;
if (*(buf+1) && isdigit(*(buf+1)))
color[1] = *(++buf);
color[2] = 0;
number = atoi(color);
if (number == 1)
size += 2;
else if (number == 0 || number == 99)
size++;
else
{
number %= 16;
_itoa(number, color, 10);
size += strlen(color);
}
inbg = 1;
}
}
incolor = 1;
}
size++;
continue;
}
else if (*buf == '\17')
{
if (bold)
size += 3;
if (uline)
size += 7;
if (incolor && !reverse)
size += 4;
if (inbg && !reverse)
size += 11;
if (reverse)
size += 15;
if (bold || uline || incolor || inbg || reverse)
size++;
bold = uline = incolor = inbg = reverse = 0;
continue;
}
else if (*buf == '\26')
{
if (reverse)
size += 16;
else
size += 17;
reverse = !reverse;
continue;
}
else if (*buf == '\37')
{
if (uline)
size += 8;
else
size += 4;
uline = !uline;
continue;
}
size++;
}
size += strlen("{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fmodern\\fprq1\\"
"fcharset0 Fixedsys;}}\r\n"
MIRC_COLORS
"\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs20")+1;
return (size);
}
/* Converts a string containing IRC codes to RTF
* Parameters:
* buffer - The input buffer containing IRC codes
* string - The output buffer in RTF
*/
void IRCToRTF(unsigned char *buffer, unsigned char *string)
{
unsigned char *tmp;
int i = 0;
short bold = 0, uline = 0, incolor = 0, inbg = 0, reverse = 0;
sprintf(string, "{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fmodern\\fprq1\\"
"fcharset0 Fixedsys;}}\r\n"
MIRC_COLORS
"\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs20");
i = strlen(string);
for (tmp = buffer; *tmp; tmp++)
{
if (*tmp == '{')
{
strcat(string, "\\{");
i+=2;
continue;
}
else if (*tmp == '}')
{
strcat(string, "\\}");
i+=2;
continue;
}
else if (*tmp == '\\')
{
strcat(string, "\\\\");
i+=2;
continue;
}
else if (*tmp == '\r')
{
if (*(tmp+1) && *(tmp+1) == '\n')
{
tmp++;
if (bold)
{
strcat(string, "\\b0 ");
i+=3;
}
if (uline)
{
strcat(string, "\\ulnone");
i+=7;
}
if (incolor && !reverse)
{
strcat(string, "\\cf0");
i+=4;
}
if (inbg && !reverse)
{
strcat(string, "\\highlight0");
i +=11;
}
if (reverse) {
strcat(string, "\\cf0\\highlight0");
i += 15;
}
if (bold || uline || incolor || inbg || reverse)
string[i++] = ' ';
bold = uline = incolor = inbg = reverse = 0;
strcat(string, "\\par\r\n");
i +=6;
}
else
string[i++]='\r';
continue;
}
else if (*tmp == '\n')
{
if (bold)
{
strcat(string, "\\b0 ");
i+=3;
}
if (uline)
{
strcat(string, "\\ulnone");
i+=7;
}
if (incolor && !reverse)
{
strcat(string, "\\cf0");
i+=4;
}
if (inbg && !reverse)
{
strcat(string, "\\highlight0");
i +=11;
}
if (reverse) {
strcat(string, "\\cf0\\highlight0");
i += 15;
}
if (bold || uline || incolor || inbg || reverse)
string[i++] = ' ';
bold = uline = incolor = inbg = reverse = 0;
strcat(string, "\\par\r\n");
i +=6;
continue;
}
else if (*tmp == '\2')
{
if (bold)
{
strcat(string, "\\b0 ");
i+=4;
}
else
{
strcat(string, "\\b ");
i+=3;
}
bold = !bold;
continue;
}
else if (*tmp == '\3' && reverse)
{
if (*(tmp+1) && isdigit(*(tmp+1)))
{
++tmp;
if (*(tmp+1) && isdigit(*(tmp+1)))
++tmp;
if (*(tmp+1) && *(tmp+1) == ',')
{
if (*(tmp+2) && isdigit(*(tmp+2)))
{
tmp+=2;
if (*(tmp+1) && isdigit(*(tmp+1)))
++tmp;
}
}
}
continue;
}
else if (*tmp == '\3' && !reverse)
{
strcat(string, "\\cf");
i += 3;
if (*(tmp+1) && !isdigit(*(tmp+1)))
{
incolor = 0;
string[i++] = '0';
if (inbg)
{
inbg = 0;
strcat(string, "\\highlight0");
i += 11;
}
}
else if (*(tmp+1))
{
unsigned char color[3];
int number;
color[0] = *(++tmp);
color[1] = 0;
if (*(tmp+1) && isdigit(*(tmp+1)))
color[1] = *(++tmp);
color[2] = 0;
number = atoi(color);
if (number == 99 || number == 1)
{
strcat(string, "16");
i += 2;
}
else if (number == 0)
{
strcat(string, "1");
i++;
}
else
{
number %= 16;
_itoa(number, color, 10);
strcat(string, color);
i += strlen(color);
}
if (*(tmp+1) && *(tmp+1) == ',')
{
if (*(tmp+2) && isdigit(*(tmp+2)))
{
strcat(string, "\\highlight");
i += 10;
tmp++;
color[0] = *(++tmp);
color[1] = 0;
if (*(tmp+1) && isdigit(*(tmp+1)))
color[1] = *(++tmp);
color[2] = 0;
number = atoi(color);
if (number == 1)
{
strcat(string, "16");
i += 2;
}
else if (number == 0 || number == 99)
string[i++] = '1';
else
{
number %= 16;
_itoa(number, color, 10);
strcat(string,color);
i += strlen(color);
}
inbg = 1;
}
}
incolor=1;
}
string[i++] = ' ';
continue;
}
else if (*tmp == '\17') {
if (uline) {
strcat(string, "\\ulnone");
i += 7;
}
if (bold) {
strcat(string, "\\b0");
i += 3;
}
if (incolor && !reverse) {
strcat(string, "\\cf0");
i += 4;
}
if (inbg && !reverse)
{
strcat(string, "\\highlight0");
i += 11;
}
if (reverse) {
strcat(string, "\\cf0\\highlight0");
i += 15;
}
if (uline || bold || incolor || inbg || reverse)
string[i++] = ' ';
uline = bold = incolor = inbg = reverse = 0;
continue;
}
else if (*tmp == '\26')
{
if (reverse)
{
strcat(string, "\\cf0\\highlight0 ");
i += 16;
}
else
{
strcat(string, "\\cf1\\highlight16 ");
i += 17;
}
reverse = !reverse;
continue;
}
else if (*tmp == '\37') {
if (uline) {
strcat(string, "\\ulnone ");
i += 8;
}
else {
strcat(string, "\\ul ");
i += 4;
}
uline = !uline;
continue;
}
string[i++] = *tmp;
}
strcat(string, "}");
return;
}
+67 -66
View File
@@ -1,6 +1,6 @@
/************************************************************************
* IRC - Internet Relay Chat, win32/service.c
* Copyright (C) 2002 Dominick Meglio (codemastr)
* Copyright (C) 2002-2004 Dominick Meglio (codemastr)
*
* 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
@@ -27,22 +27,48 @@
#include <string.h>
SERVICE_STATUS IRCDStatus;
SERVICE_STATUS_HANDLE IRCDStatusHandle;
SERVICE_STATUS_HANDLE IRCDStatusHandle;
/* Signal to rehash */
#define IRCD_SERVICE_CONTROL_REHASH 128
BOOL IsService = FALSE;
extern OSVERSIONINFO VerInfo;
#define WIN32_VERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4
VOID WINAPI IRCDCtrlHandler(DWORD opcode) {
/* Places the service in the STOPPED state
* Parameters:
* code - The error code (or 0)
*/
void SetServiceStop(int code)
{
IRCDStatus.dwCurrentState = SERVICE_STOPPED;
IRCDStatus.dwCheckPoint = 0;
IRCDStatus.dwWaitHint = 0;
IRCDStatus.dwWin32ExitCode = code;
IRCDStatus.dwServiceSpecificExitCode = code;
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
}
/* Handles the service messages
* Parameters:
* opcode - The message to process
*/
VOID WINAPI IRCDCtrlHandler(DWORD opcode)
{
DWORD status;
int i;
aClient *acptr;
if (opcode == SERVICE_CONTROL_STOP) {
/* Stopping */
if (opcode == SERVICE_CONTROL_STOP)
{
IRCDStatus.dwCurrentState = SERVICE_STOP_PENDING;
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
for (i = 0; i <= LastSlot; i++) {
for (i = 0; i <= LastSlot; i++)
{
if (!(acptr = local[i]))
continue;
if (IsClient(acptr))
@@ -56,91 +82,66 @@ VOID WINAPI IRCDCtrlHandler(DWORD opcode) {
for (i = LastSlot; i >= 0; i--)
if ((acptr = local[i]) && DBufLength(&acptr->sendQ) > 0)
(void)send_queued(acptr);
IRCDStatus.dwWin32ExitCode = 0;
IRCDStatus.dwCurrentState = SERVICE_STOPPED;
IRCDStatus.dwCheckPoint = 0;
IRCDStatus.dwWaitHint = 0;
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
SetServiceStop(0);
}
else if (opcode == IRCD_SERVICE_CONTROL_REHASH) {
/* Rehash */
else if (opcode == IRCD_SERVICE_CONTROL_REHASH)
rehash(&me,&me,0);
}
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
}
VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) {
/* Entry point function
* Parameters:
* dwArgc - Argument count
* lpszArgv - Arguments
*/
VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv)
{
WSADATA WSAData;
DWORD error = 0;
char path[MAX_PATH], *folder;
IsService = TRUE;
/* Initialize the service structure */
IRCDStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
IRCDStatus.dwCurrentState = SERVICE_START_PENDING;
IRCDStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP|SERVICE_ACCEPT_SHUTDOWN;
IRCDStatus.dwWin32ExitCode = NO_ERROR;
IRCDStatus.dwServiceSpecificExitCode = 0;
IRCDStatus.dwCheckPoint = 0;
IRCDStatus.dwWaitHint = 0;
IRCDStatus.dwWaitHint = 0;
GetModuleFileName(NULL,path,MAX_PATH);
folder = strrchr(path, '\\');
*folder = 0;
chdir(path);
IRCDStatusHandle = RegisterServiceCtrlHandler("unreal", IRCDCtrlHandler);
/* Register the service controller */
IRCDStatusHandle = RegisterServiceCtrlHandler("UnrealIRCd", IRCDCtrlHandler);
VerInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&VerInfo);
strcpy(OSName, "Windows ");
if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
if (VerInfo.dwMajorVersion == 4) {
if (VerInfo.dwMinorVersion == 0) {
strcat(OSName, "95 ");
if (!strcmp(VerInfo.szCSDVersion," C"))
strcat(OSName, "OSR2 ");
}
else if (VerInfo.dwMinorVersion == 10) {
strcat(OSName, "98 ");
if (!strcmp(VerInfo.szCSDVersion, " A"))
strcat(OSName, "SE ");
}
else if (VerInfo.dwMinorVersion == 90)
strcat(OSName, "Me ");
}
}
else if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
if (VerInfo.dwMajorVersion == 3 && VerInfo.dwMinorVersion == 51)
strcat(OSName, "NT 3.51 ");
else if (VerInfo.dwMajorVersion == 4 && VerInfo.dwMinorVersion == 0)
strcat(OSName, "NT 4.0 ");
else if (VerInfo.dwMajorVersion == 5) {
if (VerInfo.dwMinorVersion == 0)
strcat(OSName, "2000 ");
else if (VerInfo.dwMinorVersion == 1)
strcat(OSName, "XP ");
else if (VerInfo.dwMinorVersion == 2)
strcat(OSName, "Server 2003 ");
}
strcat(OSName, VerInfo.szCSDVersion);
}
if (OSName[strlen(OSName)-1] == ' ')
OSName[strlen(OSName)-1] = 0;
GetOSName(VerInfo, OSName);
InitDebug();
if ((error = WSAStartup(MAKEWORD(1, 1), &WSAData)) != 0) {
IRCDStatus.dwCurrentState = SERVICE_STOPPED;
IRCDStatus.dwCheckPoint = 0;
IRCDStatus.dwWaitHint = 0;
IRCDStatus.dwWin32ExitCode = error;
IRCDStatus.dwServiceSpecificExitCode = error;
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
/* Initialize Winsocks */
if ((error = WSAStartup(MAKEWORD(1, 1), &WSAData)) != 0)
{
SetServiceStop(error);
return;
}
if ((error = InitwIRCD(dwArgc, lpszArgv)) != 1) {
IRCDStatus.dwCurrentState = SERVICE_STOPPED;
IRCDStatus.dwCheckPoint = 0;
IRCDStatus.dwWaitHint = 0;
IRCDStatus.dwWin32ExitCode = error;
IRCDStatus.dwServiceSpecificExitCode = error;
SetServiceStatus(IRCDStatusHandle, &IRCDStatus);
/* Initialize the IRCd */
if ((error = InitwIRCD(dwArgc, lpszArgv)) != 1)
{
SetServiceStop(error);
return;
}
}
/* Go into the running state */
IRCDStatus.dwCurrentState = SERVICE_RUNNING;
IRCDStatus.dwCheckPoint = 0;
IRCDStatus.dwWaitHint = 0;
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+4 -2
View File
@@ -21,8 +21,10 @@
#include <string.h>
#include <stdio.h>
static OSVERSIONINFO VerInfo;
typedef BOOL (*UCHANGESERVICECONFIG2)(SC_HANDLE, DWORD, LPVOID);
HMODULE hAdvapi;
BOOL (*uChangeServiceConfig2)();
UCHANGESERVICECONFIG2 uChangeServiceConfig2;
#define IRCD_SERVICE_CONTROL_REHASH 128
void show_usage() {
fprintf(stderr, "unreal start|stop|rehash|restart|install|uninstall|config <option> <value>");
@@ -47,7 +49,7 @@ int main(int argc, char *argv[]) {
return -1;
}
hAdvapi = LoadLibrary("advapi32.dll");
(FARPROC)uChangeServiceConfig2 = GetProcAddress(hAdvapi, "ChangeServiceConfig2A");
uChangeServiceConfig2 = (UCHANGESERVICECONFIG2)GetProcAddress(hAdvapi, "ChangeServiceConfig2A");
if (!stricmp(argv[1], "install")) {
SC_HANDLE hService, hSCManager;
char path[MAX_PATH+1];
+11 -11
View File
@@ -5,13 +5,13 @@
; Uncomment the above line to package an SSL build
#define USE_ZIP
; Uncomment the above line to package with ZIP support
; #define USE_CURL
#define USE_CURL
; Uncomment the above line to package with libcurl support
[Setup]
AppName=UnrealIRCd
AppVerName=UnrealIRCd3.2.1
AppVerName=UnrealIRCd3.2.2
AppPublisher=UnrealIRCd Team
AppPublisherURL=http://www.unrealircd.com
AppSupportURL=http://www.unrealircd.com
@@ -32,7 +32,7 @@ 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 as a &service (not for beginners)"; GroupDescription: "Service support:"; MinVersion: 0,4.0
Name: "installservice"; Description: "Install as a &service (not for beginners)"; GroupDescription: "Service support:"; Flags: unchecked; 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;
@@ -92,7 +92,7 @@ external 'isxdl_Download@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: PChar): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';
const dbgurl = 'http://www.unrealircd.com/downloads/DbgHelp.Dll';
const crturl = 'http://www.unrealircd.com/downloads/msvcr70d.dll';
const crturl = 'http://www.unrealircd.com/downloads/msvcr70.dll';
var didDbgDl,didCrtDl: Boolean;
function NextButtonClick(CurPage: Integer): Boolean;
@@ -106,20 +106,20 @@ begin
if ((CurPage = wpReady)) then begin
dbghelp := ExpandConstant('{sys}\DbgHelp.Dll');
output := ExpandConstant('{app}\DbgHelp.Dll');
msvcrt := ExpandConstant('{sys}\msvcr70d.Dll');
msvcrt := ExpandConstant('{sys}\msvcr70.Dll');
GetVersionNumbersString(dbghelp,m);
if (NOT FileExists(msvcrt)) then begin
answer := MsgBox('Unreal requires the MS C Runtime 7.0 in order to run, do you wish to install it now?', mbConfirmation, MB_YESNO);
if answer = IDYES then begin
tmp := ExpandConstant('{tmp}\msvcr70d.Dll');
isxdl_SetOption('title', 'Downloading msvcr70d.dll');
tmp := ExpandConstant('{tmp}\msvcr70.Dll');
isxdl_SetOption('title', 'Downloading msvcr70.dll');
hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
if isxdl_Download(hWnd, crturl, tmp) = 0 then begin
MsgBox('Download and installation of msvcr70d.dll failed, the file must be manually installed. The file can be downloaded at http://www.unrealircd.com/downloads/mscvr70.dll', mbInformation, MB_OK);
MsgBox('Download and installation of msvcr70.dll failed, the file must be manually installed. The file can be downloaded at http://www.unrealircd.com/downloads/mscvr70.dll', mbInformation, MB_OK);
end else
didCrtDl := true;
end else
MsgBox('In order for Unreal to properly function, you must manually install msvcr70d.dll. The dll can be downloaded from http://www.unrealircd.com/downloads/msvcr70d.dll', mbInformation, MB_OK);
MsgBox('In order for Unreal to properly function, you must manually install msvcr70.dll. The dll can be downloaded from http://www.unrealircd.com/downloads/msvcr70.dll', mbInformation, MB_OK);
end;
if (NOT FileExists(output)) then begin
if (NOT FileExists(dbghelp)) then
@@ -153,8 +153,8 @@ begin
FileCopy(input, output, true);
end;
if (didCrtDl) then begin
input := ExpandConstant('{tmp}\msvcr70d.dll');
output := ExpandConstant('{sys}\msvcr70d.dll');
input := ExpandConstant('{tmp}\msvcr70.dll');
output := ExpandConstant('{sys}\msvcr70.dll');
FileCopy(input, output, true);
end;
end;
+72
View File
@@ -0,0 +1,72 @@
/************************************************************************
* IRC - Internet Relay Chat, win32/win32.c
* Copyright (C) 2004 Dominick Meglio (codemastr)
*
* 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 <windows.h>
/* Retrieves the OS name as a string
* Parameters:
* VerInfo - The version information from GetVersionEx
* OSName - The buffer to write the OS name to
*/
void GetOSName(OSVERSIONINFO VerInfo, char *OSName)
{
int len;
strcpy(OSName, "Windows ");
if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
if (VerInfo.dwMajorVersion == 4)
{
if (VerInfo.dwMinorVersion == 0)
{
strcat(OSName, "95 ");
if (!strcmp(VerInfo.szCSDVersion, " C"))
strcat(OSName, "OSR2 ");
}
else if (VerInfo.dwMinorVersion == 10)
{
strcat(OSName, "98 ");
if (!strcmp(VerInfo.szCSDVersion, " A"))
strcat(OSName, "SE ");
}
else if (VerInfo.dwMinorVersion == 90)
strcat(OSName, "Me ");
}
}
else if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
if (VerInfo.dwMajorVersion == 3 && VerInfo.dwMinorVersion == 51)
strcat(OSName, "NT 3.51 ");
else if (VerInfo.dwMajorVersion == 4 && VerInfo.dwMinorVersion == 0)
strcat(OSName, "NT 4.0 ");
else if (VerInfo.dwMajorVersion == 5)
{
if (VerInfo.dwMinorVersion == 0)
strcat(OSName, "2000 ");
else if (VerInfo.dwMinorVersion == 1)
strcat(OSName, "XP ");
else if (VerInfo.dwMinorVersion == 2)
strcat(OSName, "Server 2003 ");
}
strcat(OSName, VerInfo.szCSDVersion);
}
len = strlen(OSName)-1;
if (OSName[len] == ' ')
OSName[len] = 0;
}
+40
View File
@@ -0,0 +1,40 @@
/************************************************************************
* IRC - Internet Relay Chat, win32/win32.h
* Copyright (C) 2004 Dominick Meglio (codemastr)
*
* 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 <windows.h>
typedef struct {
int *size;
unsigned char **buffer;
} StreamIO;
typedef struct colorlist {
struct colorlist *next;
unsigned char *color;
} IRCColor;
extern UINT WM_FINDMSGSTRING;
extern unsigned char *RTFBuf;
extern HINSTANCE hInst;
extern FARPROC lpfnOldWndProc;
extern LRESULT RESubClassFunc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
extern DWORD CALLBACK SplitIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
extern DWORD CALLBACK BufferIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
extern DWORD CALLBACK RTFToIRC(int fd, unsigned char *pbBuff, long cb);

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