Commit graph

  • df71812707
    HOOKTYPE_CAN_SEND and HOOKTYPE_PRE_USERMSG changes: 1) HOOKTYPE_CAN_SEND is now called HOOKTYPE_CAN_SEND_TO_CHANNEL The arguments and return values are unchanged 2) similarly can_send() is now called can_send_to_channel() 3) If you want to block or alter a message you must now use HOOKTYPE_CAN_SEND_TO_CHANNEL and return HOOK_DENY from there with an appropriate *errmsg filled (see nocolor and many other modules for an example) 4) You CANNOT use HOOKTYPE_PRE_USERMSG anymore to block a message. I actually wanted to rip this hooktype out entirely, but delayjoin needs it. HOOKTYPE_PRE_USERMSG is only useful for notification that a message is going to be sent BEFORE it is actually sent (which is exactly what delayjoin needs, so it can send a JOIN if the user is currently invisible). 5) This is all to make things more clean: * HOOKTYPE_PRE_USERMSG is only for delayjoin * HOOKTYPE_CAN_SEND_TO_CHANNEL is used for exactly what the name implies. You can also change the message text there, such as for +G, +S, etc. Bram Matthys 2019-10-05 09:48:33 +0200
  • 798f502875
    Mass change (at least this one could be fully automated): 'chptr' -> 'channel' to be consistent with the 'sptr' -> 'client' rename earlier. Bram Matthys 2019-10-05 08:49:10 +0200
  • c2d7da6e35
    Rename channel list to 'channels', for next commit. Bram Matthys 2019-10-05 08:47:24 +0200
  • 858debdd01
    Protect against duplicate PROTOCTL EAUTH (possible memleak) Bram Matthys 2019-10-05 07:49:54 +0200
  • 3a64077f51
    Use 'client' everywhere (if there is no confusion) instead of 'sptr' or 'cptr'. This so I - and others - don't constantly have to wonder whether the client is called sptr, cptr or acptr in a simple routine. Insane --> 212 files changed, 6814 insertions(+), 6945 deletions(-) Couldn't just mass-replace of course since there are places where there are multiple clients involved. So had to check each function. Also renamed some 'acptr' to 'target' and such. Bram Matthys 2019-10-04 15:25:35 +0200
  • 40cd6aa639
    Get rid of reference counting in User, which was unused. Bram Matthys 2019-10-04 13:25:56 +0200
  • 9d98e6b411
    do_join: int -> void Bram Matthys 2019-10-04 13:22:53 +0200
  • e8c17e3aed
    Get rid of pseudo ID's. This also means that SASL with anope won't work anymore if you run latest anope 2.0.6. You need the fix from Feb 9, 2019: da6e2730c2 (.. which also fixes SASL problems with anope + UnrealIRCd 4 by the way) or just run anope latest git (2.0 branch). Bram Matthys 2019-10-04 13:06:30 +0200
  • 999fde8fee
    Update release notes (the module coders section) on the recent changes. Bram Matthys 2019-10-04 12:38:01 +0200
  • 3d5e49e701
    Get rid of FLUSH_BUFFER, since we no longer signal things that way. Merge check_init and AllowClient into one single AllowClient() and make it use the more logic 1 and 0 return values for allow / deny. Similarly, use logic 1 / 0 return values for verify_link. Bram Matthys 2019-10-04 12:30:51 +0200
  • 3f18cf5ea1
    find_shun() return value change, simply 1 / 0 now. Bram Matthys 2019-10-04 11:41:12 +0200
  • 9e4dbf8c89
    dead_link() -> dead_socket() since that is more descriptive Bram Matthys 2019-10-04 11:36:34 +0200
  • cbe20e1d5a
    check_unknowns -> handshake_timeout, check_tkls -> match_tkls and inversion of the return value. Bram Matthys 2019-10-04 11:35:51 +0200
  • 92df36a87f
    Return values of various functions changed, in particular the ones that deal with finding TKL's or spamfilters etc. More will likely follow, to make things more logical. Also, run_spamfilter -> match_spamfilter place_host_ban, can_privmsg, check_dcc, find_tkline_match all impacted. Bram Matthys 2019-10-04 11:30:27 +0200
  • 3126a3fae4
    BIG changes internally that will break all modules and required many code changes in UnrealIRCd itself: 1) Clients are no longer freed directly by exit_client. Most fields are freed, but 'sptr' itself is not, so you can use IsDead() on it. 2) exit_client now returns void rather than int 3) ALL command functions return void rather than int. Of course this also affects do_cmd, command overrides, etc. Bram Matthys 2019-10-04 10:28:41 +0200
  • ea6651fb26
    More Windows fixes [skip ci] Bram Matthys 2019-10-02 15:00:35 +0200
  • 0092263fee
    Possibly fix Windows build Bram Matthys 2019-10-02 14:55:15 +0200
  • ab3feff7c2
    exit_client() now takes 3 parameters rather than 5: ** Exit this IRC client, and all the dependents (users, servers) if this is a server. * @param sptr The client to exit. * @param recv_mtags Message tags to use as a base (if any). * @param comment The (s)quit message * @returns FLUSH_BUFFER is returned if a local client disconnects, * otherwise 0 is returned. This so it can be used from * command functions like: return exit_client(sptr, ....); Bram Matthys 2019-10-02 14:54:09 +0200
  • 1c746afdf1
    Fix broken build by last minute change Bram Matthys 2019-10-02 14:45:25 +0200
  • 4ac8015f84
    Remove 'cptr' from all commands, hooks, etc. It only confuses people and 'sptr' is sufficient and in most cases the only one you should care about. Should you need it, you can access sptr->direction in cases where you need the old information (usually only for some sendto_* functions and some protoctl checks), so 'cptr' was redundant too. Bram Matthys 2019-10-02 14:25:40 +0200
  • 396ae3f218
    Module coders: rename M_* to CMD_*, eg M_SERVER -> CMD_SERVER. Also add more doxygen documentation. Bram Matthys 2019-09-30 10:25:26 +0200
  • 9d7cf312cf
    Cleanup main line parsing code, move do_numeric() to parse.c. Add complete doxygen documentation for parse.c. Bram Matthys 2019-09-30 08:56:21 +0200
  • d7ef752888
    Detect combination of non-UTF8 nickchars in use and websocket type text. In such a case we refuse to run since the consequences are too big. (Actually I may change the non-UTF8 channel warning to an error as well, right now it isn't.. simply because I cannot read a certain setting) Bram Matthys 2019-09-23 10:13:56 +0200
  • 9669e32447
    test set { } settings before all the rest Bram Matthys 2019-09-23 09:33:57 +0200
  • 0b5a4bf51d
    Compile fix for Windows Bram Matthys 2019-09-23 08:29:46 +0200
  • 3f5ea851cb
    Do a better job at detecting ASan Bram Matthys 2019-09-23 08:14:41 +0200
  • 4ae374477f
    Add websocket support for 'text' instead of current 'binary'. And change how you use websockets in the configuration file: In addition to loading the websocket module you now ALSO have to mark specific listen blocks with listen::options::websocket, and you have to specify a type as well. Example: listen { ip *; port 1234; options { websocket { type binary; } } } The type 'text' is compatible with kiwi although this is currently completely untested. Also I should add something to the release notes about this change. Tomorrow... Bram Matthys 2019-09-22 20:49:37 +0200
  • d9e8206b80
    Fix memory leak in modules.c Bram Matthys 2019-09-22 20:19:46 +0200
  • 5a57eec4c7
    Channel names must now be valid UTF8 by default. We actually have 3 possible settings of set::allowed-channelchars: utf8: Channel must be valid UTF8, this is the new default ascii: A very strict setting, for example in use at freenode, the channel name may not contain high ascii or UTF8 any: A very loose setting, which allows almost all characters in the channel name. This was the OLD default, up to and including UnrealIRCd 4. It is no longer recommended. For most networks this new default setting of utf8 will be fine, since by far most IRC clients use UTF8 for many years already. If you have a network that has a significant portion of chatters that are on old non-UTF8 clients that use a specific character set then you may want to use set { allowed-nickchars any; } Some Russian and Ukrainian networks are known to need this. Bram Matthys 2019-09-22 18:40:29 +0200
  • cd713369b1
    Update Windows makefile, was missing ident_lookup. [skip ci] Bram Matthys 2019-09-22 15:25:56 +0200
  • 6687591bb0
    Fix for build without DEBUGMODE. Bram Matthys 2019-09-22 15:06:47 +0200
  • 5b8f393a8f
    * EventAdd() changed the order of parameters and expects every_msec now which specifies the time in milliseconds rather than seconds. This allows for additional precision, or at least multiple calls per second. The minimum allowed every_msec value is 100 at this time. The prototype is now: EventAdd(Module *module, char *name, vFP event, void *data, long every_msec, int count); Bram Matthys 2019-09-22 15:05:00 +0200
  • 4d277ccef8
    Clean up and comment SocketLoop. Also preparations for later. Bram Matthys 2019-09-22 14:18:46 +0200
  • b17deb7517
    Fix for previous commit. See also the notes there :D Bram Matthys 2019-09-22 13:35:17 +0200
  • 117a87dd8e
    I/O engine performance improvements (and fixes) This is work in progress. The work was already done but the patch was postponed until after alpha3 since it's not sufficiently stable yet. Bram Matthys 2019-09-22 08:42:24 +0200
  • 784ba625ec
    Fix crash shortly after THROTTLE RESET. Bug was introduced yesterday with commit b4636f183c Bram Matthys 2019-09-22 08:24:05 +0200
  • 97cf32c941
    Compile fix for Windows Bram Matthys 2019-09-21 18:31:49 +0200
  • e846596b37
    UnrealIRCd 5.0.0-alpha3 Bram Matthys 2019-09-21 18:19:33 +0200
  • c3f250750b
    Add support for storing ELINEs in tkl.db. Reported by westor in https://bugs.unrealircd.org/view.php?id=5418 Bram Matthys 2019-09-21 18:12:20 +0200
  • 953cb774ad
    ASan: log to tmp/unrealircd_asan.<pid> and attach this if the IRCd crashes (has a core file) to the crash bug report. Also, disable leak detection since this is too noisy and would cause a core dump each time + bothering the user to submit a crash report + send this crashreport etc. We still enable this in our own tests though, but not for end-users. Bram Matthys 2019-09-21 18:01:57 +0200
  • 4ecd7cca4c
    Fix memory leak when unloading an ISupport module. Bram Matthys 2019-09-21 16:52:27 +0200
  • b4636f183c
    connthrottle: use SavePersistentPointer/LoadPersistentPointer rather than temporary file to dump and read current settings (the old method). Bram Matthys 2019-09-21 16:41:23 +0200
  • 330cf9ed24
    Remove confusing information regarding /TSCTL. Bram Matthys 2019-09-21 16:22:49 +0200
  • 83492a613d
    Fix memory leak in modules codes. Bram Matthys 2019-09-21 16:07:44 +0200
  • dd536b4a92
    Fix memory leak with conditional config. And remove the comment which predicted this memory leak (:D) Bram Matthys 2019-09-21 16:04:33 +0200
  • f88f30c815
    Mark delayjoin module as perm, as we don't support dynamic unloading this, which would be too much coding effort for such an unusual event. (Reloading is fine though, for eg upgrading-on-the-fly) Bram Matthys 2019-09-21 15:30:59 +0200
  • 4426cdacc9
    Disable the warning from 95f9c56a16 that was not supposed to be committed :D It would also warn about if'd out blocks, which is confusing, so best to disable the warning altogether for now. Bram Matthys 2019-09-18 20:09:10 +0200
  • b24fe0f336
    Just in case someone uses a set::anti-flood::connection-flood of X:1... Bram Matthys 2019-09-18 19:35:56 +0200
  • 95f9c56a16
    Add warning if an unknown $VAR is encountered (without @define). Also, you can escape a $VAR to $$VAR if you really just mean $VAR literally. Such usage would be very rare though. Note that the parser is smart enough to know that $var is never a global variable, it only warns for valid variable names like $VAR and even then only if it's at the end or has whitespace/dot/comma/etc. So... false positives should be extremely low... Bram Matthys 2019-09-18 09:43:45 +0200
  • 2c9be4eb97
    Conditional conf: syntax is now always @define $VAR "xyz". Also restrict the variable names to UPPERCASE, digits and underscores (A-Z0-9_). This makes them easily distinguishable from other items in the conf, so they don't clash with for example $ip in blacklist::reason. Bram Matthys 2019-09-18 08:42:28 +0200
  • 41f2b5f884
    Fix some more numerics with incorrect arguments in U5: WATCH and failed to JOIN reasons, such as when banned. Bram Matthys 2019-09-17 18:53:07 +0200
  • 66345246ef
    Fix incorrect /ADMIN output, reported by westor. Bram Matthys 2019-09-17 18:29:09 +0200
  • b2cfc6de69
    Fix double free in AWAY due to changes of past week. Bram Matthys 2019-09-16 07:41:33 +0200
  • 70a8985d43
    Compile with -fno-common Bram Matthys 2019-09-15 16:53:58 +0200
  • 54cb647925
    Fix odd looking remote /REHASH message to globops. Bram Matthys 2019-09-15 15:47:56 +0200
  • f3ec97ee23
    floodprot (+f): fix issue where 't' was kicking innocent users due to flooding. The 't' action was activated in if no 'r' type was present because the counter was not reset. https://bugs.unrealircd.org/view.php?id=5401 Bram Matthys 2019-09-15 15:33:30 +0200
  • c7c3fbdfa8
    struct stats *ircstp; -> IRCStatistics ircstats; (for statistics, /STATS) Bram Matthys 2019-09-15 14:48:45 +0200
  • bea2564e5d
    IRCStatistics ircstats; -> IRCCounts irccounts; (this is used for LUSERS) Bram Matthys 2019-09-15 14:39:51 +0200
  • 677afe9ca4
    Don't use memory pools when using ASan, since it would miss things. -> See my comment in src/mempool.c Bram Matthys 2019-09-15 14:37:25 +0200
  • f81f221b13
    Use memory pool for Client and LocalClient. Also reorder struct a bit. Bram Matthys 2019-09-15 11:55:45 +0200
  • 1a24a634e5
    Make Link functions (make_link, free_link) use memory pool code. Also clean up a bit. Bram Matthys 2019-09-15 11:25:47 +0200
  • edb199841a
    Move all the (remaining) LIST stuff to modules/list and use ModData. Bram Matthys 2019-09-15 11:07:15 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 6cc94b4b11
    Move add_silence and del_silence out of the core to modules/silence Bram Matthys 2019-09-15 07:52:04 +0200
  • 2b2fb8906e
    Zero memory in make_link() - needed since memory changes of today. Bram Matthys 2019-09-14 21:03:12 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • de87b439b7
    Update memory allocation routines. Step 1 of X. Bram Matthys 2019-09-14 16:32:58 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • baf02e8980
    Rename all m_* functions to cmd_* functions. Bram Matthys 2019-09-13 15:45:05 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 5c209bf6ca
    require-module: CONFIG_RUN: only return 1 for settings that are for us. Bram Matthys 2019-09-13 09:46:41 +0200
  • 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 +0200
  • 4a85e4cd8b Load require-module by default [skip-ci] GottemHams 2019-09-12 20:54:09 +0200
  • 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 +0200
  • 70410b3f33
    Remove unused variables (67 files done, will do rest another time). Bram Matthys 2019-09-12 17:57:01 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 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 +0200
  • 3948c3a74b Forgot to remove a lil' comment :D [skip-ci] GottemHams 2019-09-11 22:26:53 +0200
  • 358a31eaee First draft of require-modules module (require modules globally or deny them) GottemHams 2019-09-11 22:18:03 +0200
  • daa2441c1c Stray tab in rmtkl :D GottemHams 2019-09-11 22:14:03 +0200
  • c833ac2082
    And some final cleanups of today, nothing important. Bram Matthys 2019-09-11 20:07:47 +0200
  • 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 +0200
  • 5659a2b177
    Document more core structs. [skip ci] Bram Matthys 2019-09-11 19:43:16 +0200
  • 9b113c27e4
    Document some more structs and group them in a logical place. Bram Matthys 2019-09-11 19:07:11 +0200
  • 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 +0200
  • 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 +0200