Commit graph

  • 085c0f0c4e
    Move jointhrottle data from moddata_client to moddata_local_client since we only count for local users. Bram Matthys 2019-09-15 09:50:27 +02:00
  • ffe5abe30b
    ModData: moddata_localvar -> moddata_local_variable, moddata_globalvar -> moddata_global_variable, and the just-added moddata_localclient -> moddata_local_client ..all this so it's more consistent Bram Matthys 2019-09-15 09:47:54 +02:00
  • b2f32c1746
    Add moddata_localclient(), which is for locally connected clients only. Make the silence module use this. Bram Matthys 2019-09-15 09:20:12 +02:00
  • 654919f2c4
    Make modules/silence use ModData and remove more out of the core. It uses a Silence struct now, rather than Link. Also, SILENCE is handled only for local clients now (different cost/benefit tradeoff nowadays). Bram Matthys 2019-09-15 09:01:25 +02:00
  • 6cc94b4b11
    Move add_silence and del_silence out of the core to modules/silence Bram Matthys 2019-09-15 07:52:04 +02:00
  • 2b2fb8906e
    Zero memory in make_link() - needed since memory changes of today. Bram Matthys 2019-09-14 21:03:12 +02:00
  • 7c9a188cb7
    Done. New rule: use safe_alloc, safe_free, safe_strdup, do NOT use malloc/calloc/free. Bram Matthys 2019-09-14 17:26:55 +02:00
  • f2e3712d62
    Remove various if's and such that are now unneeded This is part 5 of the memory function / caller changes. Bram Matthys 2019-09-14 17:23:07 +02:00
  • a75d10d3e4
    Some remaining malloc() calls -> safe_alloc() Unimportant, but this way 100% of those is done. This is step 4 of X of the memory function / caller changes. Bram Matthys 2019-09-14 17:15:15 +02:00
  • 950fc5001e
    Update memory allocation calls, step 3 of X This changes free() calls to safe_free(). This mass change could be automated and unaudited, fortunately. Bram Matthys 2019-09-14 17:12:37 +02:00
  • 9fc1e758ab
    Mass change of dst = strdup(str) to safe_strdup(dst,str) but with a manual audit since 'dst' must now be initialized memory. There's still a raw_strdup() if you insist. Bram Matthys 2019-09-14 16:53:15 +02:00
  • de87b439b7
    Update memory allocation routines. Step 1 of X. Bram Matthys 2019-09-14 16:32:58 +02:00
  • 7c6358024c
    Add 'natural order' string comparison to core: strnatcmp and strnatcasecmp extern int strnatcmp(char const *a, char const *b); extern int strnatcasecmp(char const *a, char const *b); This will be handy for version comparisons. For example they will return -1 (=lower) for things like ("1.4.9", "1.4.10"), unlike strcmp. Bram Matthys 2019-09-14 08:02:55 +02:00
  • f1f0acdd25
    ident_lookup: reject spaces and control characters early. ...even though in m_nick there is code so it never gets into sptr->user->username. Bram Matthys 2019-09-13 19:37:28 +02:00
  • 9b14970c2a
    Move ident lookups to module 'ident_lookup' and rewrite the code to be a bit less ugly. The module is loaded by default so you can still use set::options::identd-check like before, even though I hate ident... it's old shit... still, other's seem to like it. Bram Matthys 2019-09-13 19:09:25 +02:00
  • 3592d8db3a
    Update name in first few lines of .c files. Eg: src/modules/m_away.c is src/modules/away.c nowadays. Bram Matthys 2019-09-13 15:46:20 +02:00
  • baf02e8980
    Rename all m_* functions to cmd_* functions. Bram Matthys 2019-09-13 15:45:05 +02:00
  • bb1bb35f50
    MOD_LOAD(xyz) is now just MOD_LOAD(), same for MOD_TEST, MOD_INIT, MOD_UNLOAD. And MOD_HEADER(xyz) is now MOD_HEADER even without () since this isn't a function, really. To make things understandable I added the following to the developer section of the release notes: Bram Matthys 2019-09-13 15:15:47 +02:00
  • 9114c0ed85
    The name of the module must now match the relative path, e.g. the chanmodes/delayjoin module must be named chanmodes/delayjoin in the module header. This because currently we have two module names for each module, one is the name from the MOD_HEADER and the other is the relative path, such as used by loadmodule and is_module_loaded(). Bram Matthys 2019-09-13 15:07:11 +02:00
  • b40981f0ab
    Prevent a dlopen() if module is already loaded (instead of ~50 lines further down). This is in case you have two loadmodule lines, which isn't particularly unusual. Saves some CPU too.... Bram Matthys 2019-09-13 14:52:57 +02:00
  • 5c209bf6ca
    require-module: CONFIG_RUN: only return 1 for settings that are for us. Bram Matthys 2019-09-13 09:46:41 +02:00
  • 43b03e75a6 Fixed some now-outdated comments in require-module, also send deny module notices globally instead of locally and change the default message for this GottemHams 2019-09-12 21:45:33 +02:00
  • 4a85e4cd8b Load require-module by default [skip-ci] GottemHams 2019-09-12 20:54:09 +02:00
  • ab7cdbf2a7 Fix a couple of bugs recently introduced in require-module, also delay SQUITting until after the current SMOD command has been parsed GottemHams 2019-09-12 19:48:33 +02:00
  • 70410b3f33
    Remove unused variables (67 files done, will do rest another time). Bram Matthys 2019-09-12 17:57:01 +02:00
  • 8d2dad4796
    chanmodes/floodprot: remove old +f 1:1 conversion code, cleanup a bit and remove unused variables (unused now, that is). Bram Matthys 2019-09-12 16:49:20 +02:00
  • c3f7bbd9c0
    require-mode: account for a little bit more room in S2S command (not just hostname but also the command "SMOD" etc.. let's just say 16 bytes for now) ..and some minor cleanups of variables that are not needed. Bram Matthys 2019-09-12 07:54:20 +02:00
  • cafe3cfd6d
    Some S2S command changes to new require-modules module: REQMODS Gmodname:version .... to: SMOD G:modname:version .... Also, call the module require-module to be consistent with the naming of the configuration directive. Not sure yet of the set name, but call it set::require-module for now as well. Bram Matthys 2019-09-12 07:31:37 +02:00
  • 88cbc38ff2
    Do some more syntax checking, even for servers. This fixes a crash in case of incorrect server to server traffic. Bram Matthys 2019-09-12 07:15:28 +02:00
  • 3948c3a74b Forgot to remove a lil' comment :D [skip-ci] GottemHams 2019-09-11 22:26:53 +02:00
  • 358a31eaee First draft of require-modules module (require modules globally or deny them) GottemHams 2019-09-11 22:18:03 +02:00
  • daa2441c1c Stray tab in rmtkl :D GottemHams 2019-09-11 22:14:03 +02:00
  • c833ac2082
    And some final cleanups of today, nothing important. Bram Matthys 2019-09-11 20:07:47 +02:00
  • 482c85de44
    Get rid of this sptr->serv->user, as we already have sptr->serv->by to track who initiated the connect. It also didn't seem to be displayed anywhere but in /TRACE. Bram Matthys 2019-09-11 19:46:52 +02:00
  • 5659a2b177
    Document more core structs. [skip ci] Bram Matthys 2019-09-11 19:43:16 +02:00
  • 9b113c27e4
    Document some more structs and group them in a logical place. Bram Matthys 2019-09-11 19:07:11 +02:00
  • c72d848b61
    Get rid of MembershipL since there's no difference anymore between local membership structs (MembershipL) and remote ones (Membership), so they are now all called... Membership. Bram Matthys 2019-09-11 17:53:29 +02:00
  • bf2c5110db
    IsPerson() -> IsUser(), MyClient() -> MyUser(), etc. This so we have a few simple concepts: Client: this can be a user, server, or something unknown yet Then the type of clients: User: this is a user, someone with a nick name. Server: this is a server Etc. Bram Matthys 2019-09-11 17:43:17 +02:00
  • fcf0ff4e3c
    Document client statuses (cptr->status) and some more renames. Bram Matthys 2019-09-11 16:52:11 +02:00
  • 2df5326615
    Overhaul of all client flag macros (mass renaming, always use getters/setters/checkers) Bram Matthys 2019-09-11 16:00:47 +02:00
  • e372e9118d
    Move cptr->count to cptr->local->identbufcnt since this only used by the ident reading code nowadays, which obviously only happens for locally connected users. Bram Matthys 2019-09-11 14:36:12 +02:00
  • d80e601760
    Rename sptr->username to sptr->ident, since that is what it is. [skip ci] Bram Matthys 2019-09-11 14:31:14 +02:00
  • c69bdbe175
    ->status is now an enum of ClientStatus and STAT_xx -> CLIENT_STATUS_xx Bram Matthys 2019-09-11 14:27:32 +02:00
  • 792709bf4f
    Move cptr->fd to cptr->local->fd. This may cause some crashes while the rest of the code is audited / checked ;) Bram Matthys 2019-09-11 14:21:07 +02:00
  • 68b7368305
    Document Client struct [skip ci] Bram Matthys 2019-09-11 14:14:09 +02:00
  • cb236eea88
    Rename cptr->from to cptr->direction, since the 'from' is rather misleading as cptr->from is NOT (necessarily) the server where cptr is connected to. So we now call it cptr->direction since it indicates the directly connected server (or &me)... in other words: the direction of the client path. Bram Matthys 2019-09-11 14:03:27 +02:00
  • 6a019d6188
    Let's allow user connections. *sigh* (at least we have automated tests for this) Bram Matthys 2019-09-11 13:43:50 +02:00
  • 628aab3a76
    Duh, check NULL pointer properly in Auth_Check() in case of NULL structs. Fixes crash-on-connect due to an earlier commit last hour. Bram Matthys 2019-09-11 13:38:49 +02:00
  • 1e6a3bdd55
    Bump PASSWDLEN to something "large enough for everyone" (256) rather than current (48). Bram Matthys 2019-09-11 13:27:21 +02:00
  • 786054e6b7
    Remove 'md5', 'sha1' and 'ripemd160' from auth code. These are insecure and old authentication types that are already deprecated in UnrealIRCd 4.x. They don't contain any rounds which means they can be cracked at a rate of millions per second. Use the secure hashing type 'argon2' instead (or, if you must, use the less secure 'bcrypt' type). Bram Matthys 2019-09-11 13:17:28 +02:00
  • 04607f5b1a
    Various auth cleanups: Auth_Check() now returns 1 on allow and 0 on deny (!) to keep things simple, rather than having 4 different return values (yes.. FOUR!). [skip ci] Bram Matthys 2019-09-11 13:09:14 +02:00
  • 05e776fb71
    More cleanups: now mostly auth-related: use better names and use enums for authentication types. Rename Auth_Make to Auth_Hash. Add docs. etc. Bram Matthys 2019-09-11 12:37:34 +02:00
  • e8d53ffe8e
    And more type changes to make things consistent and more readable. Bram Matthys 2019-09-11 11:04:31 +02:00
  • 2a5ea10453
    Lots of changes again. Most notable: Cmdoverride -> CommandOverride, including things like CallCmdoverride() to CallCommandOverride(). Type changes like aTKline -> TKL and many more (in particular aSomething to Something etc. such as aWatch to Watch) but these are less used by 3rd party module coders. Bram Matthys 2019-09-11 10:18:09 +02:00
  • f55682cbaa
    More (typedef) struct name changes. Mostly configuration but also aCommand to RealCommand. Although not sure if this latter makes things a lot more descriptive :D. Can revisit later. (more to follow) Bram Matthys 2019-09-11 10:04:47 +02:00
  • 23116d344a
    Give structs the same name as the typedefs. Rename aClient to Client, aChannel to Channel, and some more. Third party module coders will love this. But.. it makes things more logical and the doxygen output will look more clean and logical as well. (More changes will follow) Bram Matthys 2019-09-11 09:48:00 +02:00
  • fbd7ff1f5a Implemented set::min-nick-length (default 0 aka no minimum required) and added a line for it to /stats S, as a bonus my editor strips trailing whitespace :D GottemHams 2019-09-09 20:33:38 +02:00
  • a0db737408 hideserver module still used old-style version string [skip-ci] GottemHams 2019-09-09 19:46:46 +02:00
  • 5b361e69bb
    Get rid of configure check for strtoul and the src/strtoul.c file. Bram Matthys 2019-09-09 17:49:10 +02:00
  • ec2fdb82e0
    Get rid of configure check for strerror() Bram Matthys 2019-09-09 17:43:58 +02:00
  • 80bc15c6d3
    Apparently our strtoken() is special, don't bother then. Still, get rid of the configure check. Bram Matthys 2019-09-09 17:32:59 +02:00
  • 1cdbbe043f
    Make strtoken() use strtok_r / strtok_s. And get rid of the config check, as strtoken() never existed anyway. Bram Matthys 2019-09-09 17:16:38 +02:00
  • e5f73fdbcd
    Don't use custom inet_pton{4,6} functions [skip ci] Bram Matthys 2019-09-09 17:08:25 +02:00
  • 078cfa88ea
    Get rid of configure check for strtok() [skip ci] Bram Matthys 2019-09-09 16:58:44 +02:00
  • 36cb2226cc
    Get rid of checking inet_pton/net_ntop. Should be available on IPv6-capable operating systems. And we require IPv6-capable since UnrealIRCd 4 already, so.. ;) Bram Matthys 2019-09-09 16:51:31 +02:00
  • c86d03dcca
    Windows build fixes Bram Matthys 2019-09-09 16:46:57 +02:00
  • 5f9e919b18
    Remove more configure checks: malloc.h, AC_FUNC_SETPGRP, AC_FUNC_SETVBUF_REVERSED [skip ci] Bram Matthys 2019-09-09 16:37:09 +02:00
  • 5e4c481d93
    Yes, strcasecmp is always available, configure. Bram Matthys 2019-09-09 16:30:02 +02:00
  • ca2239827e
    Get rid of NICK_GB2312/NICK_GBK/NICK_GBK_JAP in config.h. I am not aware of anyone actually using these. So running with this was rather untested (if it worked at all, which I doubt). Bram Matthys 2019-09-09 16:19:38 +02:00
  • 7d4b7c2fed
    Get rid of stricmp/strnicmp (use strcasecmp/strncasecmp) Bram Matthys 2019-09-09 16:13:32 +02:00
  • 9636f83a2b
    Always assume POSIX signals (on non-Windows, that is). Bram Matthys 2019-09-09 16:08:18 +02:00
  • 05af50d1fc
    Remove some HPUX stuff. We don't support or test this so leaving this in the source gives a false impression. Also some ULTRIX stuff (from 1995???). Bram Matthys 2019-09-09 15:52:32 +02:00
  • 1183e88077
    Remove old SunOS / Solaris / AIX code. And some other outdated things for non-POSIX systems... Bram Matthys 2019-09-09 15:46:19 +02:00
  • 8d453ffc40
    Get rid of index() and some useless casts Bram Matthys 2019-09-09 14:54:49 +02:00
  • 3f690ec1df
    Get rid of configure checks for inet_addr and inet_ntoa. Bram Matthys 2019-09-09 14:47:42 +02:00
  • d434cf948b
    Get rid of bcmp/bcopy/bzero. Bram Matthys 2019-09-09 14:41:40 +02:00
  • e34888802a
    Move check for C99 compiler to the beginning and print some meaningful hint to the user if it cannot be found. Bram Matthys 2019-09-09 14:05:32 +02:00
  • 2276185939
    Get rid of more ./configure checks. (Let's see if Windows complains again...) Bram Matthys 2019-09-09 13:56:37 +02:00
  • a0aec38df2
    Get rid of DISABLE_USERMOD, since you can achieve the same in U5 via the restrict-commands module in a dynamic way (with more options too). Bram Matthys 2019-09-09 13:27:25 +02:00
  • 5141e3cdfe
    Fix for Windows due to previous [skip ci] Bram Matthys 2019-09-09 13:16:31 +02:00
  • a9e0655650
    Remove more old stuff from ./configure Bram Matthys 2019-09-09 13:11:30 +02:00
  • 90d39d4665
    tkldb module: Turn a few config_error() into config_warn() since we continue, while errors mean we would fail to boot (or fail to rehash) which is not the case. Bram Matthys 2019-09-08 20:50:55 +02:00
  • c423f9c8f7
    Remove some more ./configure checks that are likely unneeded. Bram Matthys 2019-09-08 20:22:45 +02:00
  • 7be894bcda
    Let's see if we can drop unreal_CHECK_TYPE_SIZES in configure.ac. Saves some ./configure CPU time. Bram Matthys 2019-09-08 20:14:35 +02:00
  • 0c4502bf79
    Define and use SIPHASH_KEY_LENGTH rather than some magic value. Bram Matthys 2019-09-08 14:15:23 +02:00
  • ebd9c738f2
    Some cleanup/rewrites of 'r' (repeat) in the floodprot module (+f). Use a more simple hashing algorithm and one that uses 64 bits, don't allocate any memory dynamically, just use an int64_t. Also, only do the hashing if 'r' is actually enabled in +f on the channel, as otherwise it's pointless. Bram Matthys 2019-09-08 14:06:40 +02:00
  • 9fe82e4a9f
    Fix read-after-free in HOOKTYPE_LOCAL_PART hook. Bram Matthys 2019-09-08 08:41:58 +02:00
  • e9847a2279
    Fix OOB read due to last commit (62c7f67f7a) Bram Matthys 2019-09-08 08:38:13 +02:00
  • 62c7f67f7a
    Make StripControlCodes() filter out zero width space as well (U+200B). Bram Matthys 2019-09-07 18:32:21 +02:00
  • 08a4c489f6
    Update HELPOP SPAMFILTER. The syntax was OK but the explanation under it was confusing since it was explaining the fields in a different order. Bram Matthys 2019-09-07 18:00:58 +02:00
  • ec5a66ba80
    UnrealIRCd 5.0.0-alpha2 release Bram Matthys 2019-09-07 15:54:15 +02:00
  • 7eb9ed90cb
    Cleanup sub1_from_channel. Don't kick insecure users on +z channels when we are merging (equal TS), only kick our users when we are on the losing side (=if there is a different TS, IOTW: the channel was recreated later). Bram Matthys 2019-09-07 14:45:47 +02:00
  • ab0608a98c
    Don't send OperOverride notice if &me (server) [skip ci] Bram Matthys 2019-09-07 11:05:25 +02:00
  • c6cfc2f5c8
    Fix receiving "+i must be set" twice (for users) or more (for opers) [skip ci] Bram Matthys 2019-09-07 10:48:20 +02:00
  • b9e2f1c5fb
    Fix crash in RMTKL (only possible with rogue server traffic) [skip ci] Bram Matthys 2019-09-07 10:23:54 +02:00
  • 62dc1181ba
    Protect against late bogus PROTOCTL SID=xxx (from authenticated servers) Bram Matthys 2019-09-07 10:16:46 +02:00
  • d3db771a1b
    Add some tracing code until a certain RMTKL bug is found. Bram Matthys 2019-09-07 09:35:50 +02:00
  • 7c9325d8d1
    Move get_mode_bitbychar() and get_extmode_bitbychar() to the core rather than helper functions in floodprot. (I need them) Bram Matthys 2019-09-07 09:24:26 +02:00
  • 62c0edde12
    Partially rewrite SVSMODE #chan code to fix a crash from hostile servers. Also get rid of the TS parameter in there, which nobody uses anyway. It didn't even refer to the channel TS.. quite confusing.. it used user->since... so it seems it was against crossing users (nick changes)... well, we have UID for that now. Bram Matthys 2019-09-07 08:02:07 +02:00
  • 579c4bd884
    Compile with -O1 in ASan mode, rather than -O0. Bram Matthys 2019-09-06 20:57:20 +02:00