]> jfr.im git - solanum.git/commit - modules/core/m_modules.c
m_modules: make modreload work like restart
authorEd Kellett <redacted>
Sun, 17 Nov 2019 11:15:47 +0000 (11:15 +0000)
committerEd Kellett <redacted>
Sun, 17 Nov 2019 18:01:51 +0000 (18:01 +0000)
commit7b6410135b2bf53efcdf7ecb9f073f73f5d84918
tree5a04df7cff45855eec60e87611662d9f1fb96527
parent58a70480063bdca25d52a1abd60e0e28965c9617
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.
include/modules.h
ircd/modules.c
modules/core/m_modules.c