| Commit message (Expand) | Author | Age | Files | Lines |
| * | Automatically rehash when modules change conf•••When loading a module that modifies config (add/remove conf items or top
conf sections), we now queue a rehash operation so that new config can
be immediately applied. A new rb_defer_once() function was added to
deduplicate these rehash requests so that at most one rehash will occur
regardless of how many modules change conf.
| Ryan Schmidt | 2026-04-29 | 1 | -0/+7 |
| * | Tidy up module loading code•••The existing code had several defects:
- Core module file names were hardcoded, while autoloaded non-
core module filenames were not. Code that loaded core modules
had a different but in some places duplicated structure to the
code that loaded autoloaded modules.
- Module loading for autoloaded modules happened in dentry
order, making it unpredictable from one server to the next, or
even across instances of `make install` on the same server.
- Module loading for autoloaded modules did not verify that the
dentry was a file before trying to load it.
- An IRCd start (or a conftest) only printed lines about loading
modules mentioned in the configuration file.
- The configuration file was parsed before loading core and
autoloaded modules, meaning any modules specified in the
configuration file would be loaded first.
- Once a module was loaded, it was added to the head of the
module list, making MODLIST show them in reverse loaded order
(newest (re)loaded modules at the top of the list).
These are addressed as follows:
- We now scan the core and autoload module directories and use
this to determine which modules to load.
- We now sort the dentries according to their filename before
iterating them to load them, making module load order finally
deterministic.
- We now test if a dentry is actually a file before trying to
load it.
- We now print a message to the console (if running in
foreground or conftest mode) when loading any module,
including core and autoloaded modules.
- The message printed to the console now has the IRCd module
directory prefix stripped from it if it matches.
- The configuration file is now parsed after loading core and
autoload modules.
- The modules are added to the module list in the order that
they are loaded. This now makes MODLIST show the order that
modules were (re)loaded in.
Modifications to two modules are part of this effort:
- The autoload module `m_alias` relied upon the alias dict not
being NULL when loaded, but this is only the case after the
configuration file has been parsed.
The module already had a "rehash" hook to destroy all existing
aliases and create new ones, so we can just make the module do
nothing on load (remove its modinit function) and change it to
use the "conf_read_end" hook instead of the "rehash" hook, and
it will still create aliases after the configuration file is
subsequently parsed.
With this modification, there are now no in-tree consumers of
the "rehash" hook.
- The autoload module `m_services` iterated `service_list` upon
loading it, which will now be empty (a no-op) since the module
is loaded before configuration file is parsed.
This module too handles the configuration file being parsed
with a "conf_read_end" hook and takes the appropriate action,
so we can just remove this code from its modinit function.
All other modules' modinit functions have been audited for
behaviour like this; there was nothing of note.
| Aaron Jones | 2026-03-22 | 1 | -65/+133 |
| * | modules: quietly succeed at loading a module if already loaded•••This allows explicitly loading a module in the config so it's available
for later config items that might need it, and skips the double load
when main loads all modules, which would cause errors
| Doug Freed | 2023-07-01 | 1 | -0/+4 |
| * | modules: clear module list and mod paths in init•••If main is called more than once (like in tests), everything is
reinitialized except the loaded module list and module paths, so clear
them too so that modules are loaded again and the path list is correct.
| Doug Freed | 2023-07-01 | 1 | -0/+3 |
| * | Remove Windows support | jailbird777 | 2021-07-30 | 1 | -5/+4 |
| * | make more snotes L_NETWIDE | jess | 2020-11-08 | 1 | -12/+12 |
| * | Implement the solanum.chat/identify-msg vendor cap | Ed Kellett | 2020-10-16 | 1 | -0/+1 |
| * | Innovation by sed | Ed Kellett | 2020-10-15 | 1 | -1/+1 |
| * | ircd/modules.c: complain to foreground if unable to locate module•••Without this a conftest user has no idea whether the module path
is correct or not.
[ci skip]
| Aaron Jones | 2020-07-04 | 1 | -0/+4 |
| * | Actually use modules' declared hook priorities | Doug Freed | 2020-07-01 | 1 | -1/+1 |
| * | Merge pull request #329 from edk0/reload-by-path•••Reload modules by path | Aaron Jones | 2020-06-25 | 1 | -1/+7 |
| |\ |
|
| | * | Reload modules by path | Ed Kellett | 2020-06-02 | 1 | -1/+7 |
| * | | Merge pull request #330 from edk0/caps-before-init•••modules: create caps before mapi_register() | Aaron Jones | 2020-06-10 | 1 | -34/+53 |
| |\ \ |
|
| | * | | modules: create caps before mapi_register() | Ed Kellett | 2020-06-02 | 1 | -34/+53 |
| | |/ |
|
| * / | Implement hook priorities | Ed Kellett | 2020-05-01 | 1 | -0/+5 |
| |/ |
|
| * | modules: fix use-after-free when reloading | Ed Kellett | 2020-01-02 | 1 | -1/+3 |
| * | m_modules: make modreload work like restart•••/modrestart used to be implemented as a normal command and could crash
when used remotely because it would reload m_encap, which was on the
call stack at the time. This was fixed in 41390bfe5f. However,
/modreload has exactly the same problem, so I'm giving it the
same treatment.
Incidentally: This bug was first discovered in ircd-seven, where the
`/mod*` commands themselves live in the core, so m_encap was the only way
the crash could happen (and it didn't most of the time, because m_encap
would only be moved if you got unlucky). But `/mod*` are in modules in
charybdis, so /modrestart would have unloaded the code it was in the
middle of executing. With that in mind, I'm not sure how it ever
appeared to work.
| Ed Kellett | 2019-11-17 | 1 | -0/+44 |
| * | Deferred capability notifications from modules•••Reloading modules sends CAP DEL followed by an immediate CAP NEW:
:staberinde.local CAP * DEL :account-tag
:staberinde.local CAP * NEW :account-tag
This isn't very nice. /modrestart is particularly bad. In order to avoid
doing this, we remember the capability set at the beginning of module
operations, compare that with the set afterwards, and report only the
differences with CAP {DEL,NEW}.
| Ed Kellett | 2019-09-07 | 1 | -6/+27 |
| * | remove unused variables | Simon Arlott | 2017-08-04 | 1 | -1/+0 |
| * | Revert "Core modules cannot be unloaded, otherwise bad things happen."•••This reverts commit b5cfad03195d566cd259154d212875fb238f5d80.
| Simon Arlott | 2017-07-29 | 1 | -3/+0 |
| * | When a remote MODRESTART command is received, it will pass through the•••ENCAP module. The ms_encap function is responsible for dispatching the
command handler and then the modules will eventually be reloaded.
However, if the ENCAP module is reloaded to a different address, the
stack now contains the address of a function that no longer exists.
Also, in this version of the IRCd, the module restarting functionality
was located in a function that is itself located in a module, so things
will also go badly if that module is reloaded to a different address,
too.
Return immediately from the command handler and have the event loop
call the function responsible for reloading the modules instead.
c.f. release/3.5 commit db05a3621058
Reported-by: mniip (Freenode)
| Aaron Jones | 2016-12-28 | 1 | -0/+35 |
| * | Core modules cannot be unloaded, otherwise bad things happen.•••Additionally some information is logged and passed to the operator
conducting a MODRESTART.
| Jason Volk | 2016-06-21 | 1 | -0/+3 |
| * | modules: serious cleanups | William Pitcock | 2016-06-18 | 1 | -74/+36 |
| * | modules: cleanups | William Pitcock | 2016-06-18 | 1 | -5/+3 |
| * | minor spring cleaning: remove/relocate duplicate/unused includes & macros•••[ci skip]
| Aaron Jones | 2016-05-14 | 1 | -2/+0 |
| * | modules: use exit(EXIT_FAILURE) on failure•••This will allow service process monitoring to recognise the difference
between a shutdown and an error of a -foreground ircd, because only
/DIE (or SIGINT) will exit with return code 0.
| Simon Arlott | 2016-04-25 | 1 | -2/+2 |
| * | modules: add missing break | Simon Arlott | 2016-04-23 | 1 | -0/+1 |
| * | modules: fix up display names | Elizabeth Myers | 2016-04-07 | 1 | -25/+30 |
| * | modules: move module loading/unloading commands to dedicated module.•••There's no reason to really have these in the main ircd anymore, static
modules are dead and aren't coming back.
To ensure people don't do something hopelessly retarded, this is a core
module.
| Elizabeth Myers | 2016-04-07 | 1 | -370/+1 |
| * | Use rb_* versions of nonportable string functions | Elizabeth Myers | 2016-04-05 | 1 | -1/+1 |
| * | Announce changed capabilities on module load•••Closes #165
| Elizabeth Myers | 2016-04-04 | 1 | -1/+8 |
| * | modules: Revert mapi_register() to use ints•••modinit() returns either 0 (success) or -1 (failure) so we
can't check for true/false.
| staticfox | 2016-04-03 | 1 | -1/+1 |
| * | boolify calls to rehash | Elizabeth Myers | 2016-04-03 | 1 | -3/+3 |
| * | bool-ify modules stuff | Elizabeth Myers | 2016-04-03 | 1 | -59/+49 |
| * | Clean up module loading a bit. | Elizabeth Myers | 2016-04-03 | 1 | -4/+5 |
| * | ircd: start staging for relocatable paths | William Pitcock | 2016-03-24 | 1 | -6/+6 |
| * | Cleanup warnings | Matt Ullman | 2016-03-21 | 1 | -1/+0 |
| * | modules: fix thinko | William Pitcock | 2016-03-20 | 1 | -2/+2 |
| * | ircd: modules: findmodule_byname(): also check LT_MODULE_EXT here | William Pitcock | 2016-03-20 | 1 | -0/+8 |
| * | ircd: modules: use LT_MODULE_EXT more consistently | William Pitcock | 2016-03-20 | 1 | -4/+3 |
| * | modules: warning cleanups | William Pitcock | 2016-03-20 | 1 | -4/+4 |
| * | modules: fix stupid GCC false positive warning.•••This invocation of strlen is on a constant string and should be folded
by any sane compiler (GCC included), but it warns anyway because GCC is
stupid.
| Elizabeth Myers | 2016-03-18 | 1 | -2/+2 |
| * | modules: can .la suffix.•••.la archives are prohibited by most Linux distributions because they
clutter up the linker. They may get caught up as victims in scripts that
purge .la files. Besides, .la files don't matter for simple loadable
modules on most systems.
So, what we do now instead is just use the platform suffix detected by
libtool.
| Elizabeth Myers | 2016-03-12 | 1 | -9/+15 |
| * | More bool conversions | Elizabeth Myers | 2016-03-09 | 1 | -1/+1 |
| * | Merge branch 'master' of github.com:charybdis-ircd/charybdis into elizafox-cl... | Elizabeth Myers | 2016-03-09 | 1 | -3/+2 |
| |\ |
|
| | * | ircd: fix up some iwarn() calls which referred to L_MAIN | William Pitcock | 2016-03-08 | 1 | -2/+1 |
| | * | modules: using labs() for date math is unsafe | William Pitcock | 2016-03-08 | 1 | -1/+1 |
| * | | Message handlers should return void.•••Also fix up some return values and stuff to use bool (or void if
nothing). I just did it whilst I was here.
According to jilles, the return value used to signify whether or not the
client had exited. This was error-prone and was fixed a long, long time
ago, but the return value was left int for historical reasons.
Since the return type is not used (and has no clear use case anyway),
it's safe to just get rid of it.
| Elizabeth Myers | 2016-03-09 | 1 | -169/+162 |
| |/ |
|
| * | Add ircd serials to AV2. | Elizabeth Myers | 2016-03-07 | 1 | -2/+25 |
| * | modules: show module provenance in modlist | Elizabeth Myers | 2016-03-06 | 1 | -7/+21 |