aboutsummaryrefslogtreecommitdiffstats
path: root/src/s_misc.c
Commit message (Expand)AuthorAgeFilesLines
* Fix compile errors when building with clang instead of gcc, which is more•••and more becoming the default nowadays such as on FreeBSD. Reported by QIXOZL (#4239). Backported the patch from Heero. Gravatar Bram Matthys2014-07-061-1/+1
* PROTOCTL EAUTH/SERVERS/new linking protocol:•••- Server protocol: added PROTOCTL EATH=servername, which allows us to authenticate the server very early in the handshake process. That way, certain commands and PROTOCTL tokens can 'trust' the server. See doc/technical/protoctl.txt for details. - Server protocol: between new Unreal servers we now do the handshake a little bit different, so it waits with sending the SERVER command until the first PROTOCTL is received. Needed for next. - Server protocol: added PROTOCTL SERVERS=1,2,3,4,etc by which a server can inform the other server which servers (server numeric, actually) it has linked. See doc/technical/protoctl.txt and next for details. - When our server was trying to link to some server, and at the same time another server was also trying to link with us, this would lead to a server collision: the server would link (twice) ok at first, but then a second later or so both would quit with 'Server Exists' with quite some mess as a result. This isn't unique to Unreal, btw. This happened more often when you had a low connfreq in your link blocks (aka: quick reconnects), or had multiple hubs on autoconnect (with same connfreq), or when you (re)started all servers at the same time. This should now be solved by a new server handshake design, which detects this race condition and solves it by closing one of the two (or more) connections to avoid the issue. This also means that it should now be safe to have multiple hubs with low connfreq's (eg: 10s) without risking that your network falls apart. This new server handshake (protocol updates, etc) was actually quite some work, especially for something that only happened sporadically. I felt it was needed though, because (re)linking stability is extremely important. This new feature/design/fix requires extensive testing. This feature can be disabled by: set { new-linking-protocol 0; }; Gravatar Bram Matthys2010-01-011-1/+1
* - Added some countermeasures against crash-on-boot, #0003725 and #0003653,••• reported by Ablom2008 and mist26. Gravatar Bram Matthys2008-12-221-0/+4
* - #0002844 reported by RandomNumber: make spamfilter actions case insensitiveGravatar Bram Matthys2007-04-301-1/+1
* - Kick non-SSL users when the channel turns out to be +z during netmerge, rep...••• Ron2K (#0002942). (patch 90% by Trocotronic) Gravatar Bram Matthys2006-09-151-0/+32
* - Module coders: For cloaking, added a new callback type CALLBACKTYPE_CLOAK_E...••• CALLBACKTYPE_CLOAK). This passes 'aClient *sptr, char *host' instead of only 'char *host' to the cloaking module, which can be useful if you need to cloak on something other than IP/host. Suggested by fez (#0002275). Module may still provide only CALLBACKTYPE_CLOAK though, in fact this is what the official cloaking module does. So no updating of cloaking modules needed. A side-effect of this "extra cloaking" callback is that we needed to change make_virthost() which now has an extra parameter in front, and another side-effect is that calling the CALLBACKTYPE_CLOAK may not work since only *_EX might be available. To my knowledge there are very few modules (only 1 I know) that will have a problem due to this, so sounds like an affordable tradeoff. Gravatar Bram Matthys2006-04-291-1/+1
* - Made the IRCd calculate the cloaked host only once upon connect, and store ...•••- When checking if a user is banned, we always check the cloakhost too. Previously we could not do this if the user had a /VHOST (=a minority of the cases, but still...). In short, this is some extra protection to combat ban evasion. - Performance of is_banned() *slightly* improved (just 1-2 usec, but 7 usec if no bans). - [Module coders] For extban routines, we now offer a routine extban_is_banned_helper(buf) which can be used instead of the ban_realhost/etc static chars stuff, see extban_modeq_is_banned for a (real-life) example of how this is used. - [Services coders!] Added PROTOCTL CLK (requires NICKv2) which adds an extra field in the NICK command (when a user connects) right before the infofield (gecos). The added field contains the cloaked host, that is: the masked host if +x would have been set. This field is ALWAYS sent, regardless of whether the user is actually +x or not. Services can then store this field in memory, to know the host of the user if the user is set +x (+x-t). This is a (better) alternative to PROTOCTL VHP, with no race conditions, and avoids some other VHP problems. VHP will stay supported though... so it's not mandatory to switch over. Gravatar Bram Matthys2006-04-161-2/+24
* - When OPEROVERRIDE_VERIFY is enabled, we now allow opers to still join any c...••• in set::auto-join or set::oper-auto-join, even if they are +s/+p. Suggested by ultrotter (#0002644). Gravatar Bram Matthys2005-10-151-0/+26
* - Removed all old resolver code and switched over to c-ares (+our caching rou...••• This should get rid of some annoying untracable (and usually rare) crashbugs in the old resolver. Besides that, it makes things look more clean and understandable. This should be the fix for the following bugids (all the same issue): #2499, #2551, #2558, #2559, #2603, #2642, #2502, #2501, #2618, #2616. Feedback and testing is very much welcomed (syzop@unrealircd.com). Gravatar Bram Matthys2005-10-101-0/+7
* - Added 'warn' target which is basically the same as 'block' except it does n...••• It also sends a numeric to the user saying the command has been processed, but a copy has been sent to ircops. I feel this is a good idea for privacy reasons (anti-spy), though I don't know how users will react to this. If you are using this on your network and get users bothering you about it (or before that ;p), it's probably a good idea to explain it somewhere on your site or FAQ :). Example usage: /spamfilter add p warn - Testing_mirc_decode_filter \$decode\(.*\) [WARNING] The numeric text is likely to change in the next few weeks (early-cvs-commit). - If a class block was removed and any other blocks would be referencing the class block (such as: allow::class, oper::class, link::class), then this would cause a crash. Reported by Mike_ (#0002646). Gravatar Bram Matthys2005-09-251-158/+115
* TYPO!Gravatar Bram Matthys2005-09-051-1/+1
* get rid of "please report!" in operator count bug thing.. we had enough respo...Gravatar Bram Matthys2005-09-041-2/+1
* - Fixed ~c not working properly with * and ?'s in channel names.. Now you jus...••• escape them like in all bans (eg: to ban #* you need to +b ~c:#\*). As an additional bonus, real wildcards are now accepted and processed (eg: +b ~c:#*sex*, just don't forget to specify the #). Reported by PhantasyX (#2605). - Sidenote on above: ~c:*chan* is not supported (use ~c:#*chan* instead) because it would cause "hidden bans", therefore it now prints a message (which is useful anyway), but does accept such remote bans. In 3.2.5 or so we could enable support for it, it's not that important though... ;) - Added ifdefs for mass closing of file descriptors on start, can now be disabled by adding -DNOCLOSEFD as a compile option. Useful for valgrind w/--db-attach=yes, mpatrol, and some other debugging tools (not useful for anyone normally running a server). - Fixed a read-after-free: sptr->serv->aconf was freed but not NULL'ed in exit_client, causing close_connection to read from it (when deciding on doing a quick reconnect). Could have caused a crash, although nobody ever reported one... - Removed useless strncpyzt with dest==src. Gravatar Bram Matthys2005-08-191-0/+1
* fixed incorrect badword { } causing a crashGravatar Bram Matthys2005-03-141-1/+1
* - Added channelmode +j (jointhrottle), syntax: /mode #chan +j X:Y, and then i...••• throttle the number of joins per-user to X in Y seconds. Idea from Angrywolf (who wrote a module that did this before). This might need some more testing :). It's enabled by default but can be #undef'ed in include/config.h (line 449). Gravatar Bram Matthys2005-02-121-0/+3
* - Added spamfilter topic support ('t' in /spamfilter, or 'topic' in conf), su...••• by Z3l3zT (#0001929). Gravatar Bram Matthys2005-02-041-0/+7
* Corrected numerous -Wall warningsGravatar codemastr2004-11-041-2/+0
* - Added spamfilter 'away' ('a') target (#0002057).Gravatar Bram Matthys2004-10-111-0/+7
* - Module coders: Added HOOKTYPE_REMOTE_JOIN, HOOKTYPE_REMOTE_PART, HOOKTYPE_R...••• 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. Gravatar Bram Matthys2004-10-061-0/+7
* - Fixed bugs regarding HOOKTYPE_SERVER_QUIT: was sometimes called twice and c...••• crashes due read-after-free. Reported by SET (#0001988). Gravatar Bram Matthys2004-07-221-5/+2
* - Fixed "quickly-rehashing + autoconnect linkblocks = crash"-bug. This involv...••• multiple reference count bugs, one related to sptr->serv->conf, and another one related to sptr->serv->class. Both caused problems when someone did a /rehash when a server was in the process of connecting (so it might also happen when connfreq was hit and you did a /rehash). Original bug was reported by sh0 (#0001872). Gravatar Bram Matthys2004-06-251-6/+16
* - Fixed '/stats P' negative usercount bug (#0001691).Gravatar Bram Matthys2004-06-251-1/+1
* CmdoverrideAdd, DCCALLOW, allow dcc { }, umode +v change, register_user fix.•••- Module coders: if CmdoverrideAdd() is called for an override that is already in place, it now sets MODERR_EXISTS as errorcode and returns NULL (previously it added duplicates). In the past module coders had many issues with PERM mods... you had to use weird tricks, but now you can (and should!) just override on INIT and on HOOKTYPE_REHASH_COMPLETE. - Moved register_user declaration to h.h, updated call in m_pingpong.c (due new 'ip' field). - Usermode +v ('receive dcc send rejection notices') is oper-only now for privacy reasons. - Added dcc allow { }, which allows one to make exceptions over deny dcc { }. - Added deny dcc::soft and allow dcc::soft item, if set to 'yes' it allows someone to explicitly override it per-person via /DCCALLOW (see next). - Added DCCALLOW system, taken directly 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/etc. See '/DCCALLOW HELP' for more info. - Added example dccallow.conf which filters everything except some known 'safe types' (jpg, jpeg, png, gif, etc). Note that the purpose of this file is NOT to get a complete list, rather to limit it to a few 'known safe' entries. - Added set::maxdccallow: max number of entries of the DCCALLOW list (default: 10). Gravatar Bram Matthys2004-06-101-0/+48
* Added NICKIPGravatar codemastr2004-05-271-5/+1
* minor adjustment.Gravatar Bram Matthys2004-03-101-4/+1
* - Added '__' -> '_' decoding for spamfilter reason field.Gravatar Bram Matthys2004-03-101-1/+18
* Added check to detect broad /spamfilter masksGravatar codemastr2004-03-081-1/+9
* spamfilter improvements•••- Fixed a few wrong macro's (ircstrdup/ircfree) in s_conf.c causing very weird behavior... This also fixes a bug where set::spamfilter::ban-reason would have the value of ban-time. - Improved spamfilter again. - The new syntax is: /spamfilter [what] [type] [action] [tkltime] [reason] [regex] [tkltime] specifies the duration of any *lines placed by this rule. [reason] specifies the *line, kill and/or block reason.. no spaces allowed, but '_' will be escaped to a space. In both cases you can simply use '-' to skip and use the default. Ex: /spamfilter add p block - - Come watch me on my webcam /spamfilter add p gline 3h Please_go_to_www.viruscan.xx/ nicepage/virus=blah Come watch me on my webcam - A message is now shown if the msg/notice/dcc is blocked. - There are 2 new spamfilter action types: 'dccblock' will mark the user so (s)he's unable to send any files by DCC. 'viruschan' will part the user from all channels and join set::spamfilter::virus-help-channel (default: #help). this action might be improved to do more later. - Internal: added EXTTKL PROTOCTL, this determinates if 10 parameters instead of 8 are supported for m_tkl (used by spamfilter add). This new system needs some testing... :) Gravatar Bram Matthys2004-02-201-0/+34
* - Fixed a bug in the unreal_checkregex() routine which could cause a crash••• if you added an invalid regex. Reported by Tony (#0001556). or... 'freeing a buffer on the stack is not exactly good!' ;) Gravatar Bram Matthys2004-02-181-1/+1
* this should be the last "big commit" before release :p.•••- Added snomasks 'S' (Spamfilter) which notifies you of any spamfilter matches. - [internal] always return after spamfilter match, don't continue looping trough targets list (eg in case of: /msg #a,#b,#c spamspam), otherwise you would get duplicate notification msgs. - Added SENDSNO server command, similar to SENDUMODE but for snomasks, this is used by the spamfilter snomask (+S) so you get network-wide notifications. - Added "compiled for.." versioning system, this way a beta17 module can't be loaded on beta18, etc... People often forgot to recompile their modules or had old ones somewhere by mistake, therefore crashing after upgrades... this should fix this (in the future). Module coders don't have to do anything for making this work, it's done automatically (via modules.h). Gravatar Bram Matthys2004-02-071-0/+22
* - Ripped out fast (bad)words support out of spamfilter to avoid confusion, al...••• spamfilter::word to spamfilter::regex to make it even more clear (since we match on the whole line and have nothing to do with words.. 'word' doesn't make sense). - Updated docs with some better regex examples, reported by AngryWolf (#0001520). Gravatar Bram Matthys2004-02-061-56/+6
* spamfilter etc... *pray*Gravatar Bram Matthys2004-01-281-22/+43
* - internal: Ok, I'm committing this in parts... did most of the TKL spamfilter••• integration now, no.. it doesn't work at all yet but most of the internal stuff has now been done (but I temporarely need to work on other things now). moved/added a lot of regex stuff, banaction/spamfilter helper functions, etc into s_misc.c. [note: current code has some bugs but since the stuff isn't used that's no problem... it's also a bit ugly, do NOT mail me about these things ;p] - Enabled talk-trough-+M for opers (just like +m) - Disabled talk-trough-+m/+M for opers if NO_OPEROVERRIDE is defined - Display zlib/SSL version in /version (oper only)... will prolly be improved later. - updated doc/compiling_win32.txt Gravatar Bram Matthys2004-01-161-0/+231
* added configure checks for libcurl and other various changesGravatar codemastr2003-12-261-2/+2
* - example.conf: added +i in modes-on-connect.•••- Temporarely added fdlist debugcode, please report any bugreports it gives, it would especially be helpful if you know _what_ triggered the error :). Gravatar Bram Matthys2003-11-301-0/+23
* - Fixed a compile problem on alpha, reported by Hyperi (#0001374).•••- Made "operator count bug" not notice all opers (log only), unless in debugmode. Gravatar Bram Matthys2003-11-201-0/+2
* - (Internal) Moved most valid-host checking into 1 function, valid_host(),••• which checks for invalid characters. - Added hostname check for me::name since this could cause mysterious trouble. Gravatar Bram Matthys2003-11-041-0/+13
* - (Internal) Added __attribute__ format checking for most format string funct...••• this will currently produce a lot of warnings with -Wall. - Fixed 159 of 184 warnings detected by the above, the other warnings are false. Most warnings had to do with long vs int, and thus the format strings (%d->%ld) or the vars (int->long) have been changed (many of these were time_t/TS vs int). Only a few rare crashbugs were discovered. - Module coders: for HOOKTYPE_LOCAL_CHANMODE the 'sendts' parameter was changed from type 'int' to 'time_t', while in most circumstances (like on ia32) you won't notice, I suggest you to update your callback functions anyway. - Possibly fixed an issue with set::modes-on-join and mode +f, it could have set random remove-chanmode times in the default chanmode line. Gravatar Bram Matthys2003-11-021-2/+2
* - Fixed even more negative oper count bugs...Gravatar Bram Matthys2003-10-031-1/+1
* - Fix for HOOKTYPE_REMOTE_QUIT (was called for local quits too)Gravatar Bram Matthys2003-09-201-1/+4
* - Added HOOKTYPE_REMOTE_QUITGravatar Bram Matthys2003-09-181-0/+1
* - Added HOOKTYPE_UNKUSER_QUIT (disconnects of unregistered clients).Gravatar Bram Matthys2003-09-141-0/+4
* - Temporarely added trace code for hunting down negative operator counts (#00...Gravatar Bram Matthys2003-09-051-0/+22
* Added a new stats systemGravatar codemastr2003-08-011-88/+0
* Fixed numerous logging bugsGravatar codemastr2003-07-151-0/+1
* multiple patches:•••- Module coders: new hooks: part, kick, chanmode, topic. changed: quit (added 'comment' param). - Enlarged REPORT_* vars a bit. - IPv6: UnrealIRCd can now lookup ip6.arpa addresses too (original IRCnet patch modified for UnrealIRCd by Onliner). Gravatar Bram Matthys2003-05-271-1/+1
* Fixed an HCN bug with client exiting noticesGravatar codemastr2003-01-271-9/+1
* Added a patch for logging vhosts in connect/disconnect noticesGravatar codemastr2002-11-301-3/+9
* More WinXP IPv6 fixesGravatar codemastr2002-06-301-1/+1
* Fixed some stuffGravatar griever2002-04-231-1/+1