[srvx-devel] modcmd commit
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-07-30 02:15:50
|
I just committed a rather huge patch. It does three things:
- #include all ANSI C headers from compat.h
- minimize #includes in other files
- implement a generic command handler framework, including
"free-form" aliases
The #include changes are pretty boring, and I should have split them
out, but they helped pretty up the doxygen graphs and made the modcmd
code easier, so they're lumped in.
The guts of the command framework is in modcmd.c and modcmd.h (modcmd
is short for "modularized commands"). It mostly works, but a few
things are known to not work yet:
- There's no command to tweak the settings for existing commands.
This is a thin wrapper around svccmd_configure(). I'll add that
soon.
- Commands that use unsplit_line() with freeform aliases break.
There are a few ways to fix this this; the easy way is to make it
fill in a fixed buffer, and change argv[0] to point to that buffer
instead. The "cleaner" way is to replace it with something else.
- Some commands don't work 100% right (for example, ?join to an
existing does not op OpServ). These are easy enough to fix once
they are found, but we need to test enough to find them.
- Help indexes ("!help", "?help" without any arguments) do not show
the right contents. This is also a simple enough fix; I just got
sick of having this huge diff on my disk and haven't fixed it yet.
- Help output is not as clean as it could be, either. There should
be some line that works like the "${command/ADDBAN/access}" in
chanserv.help, but automatically inserted by modcmd. modcmd should
probably also automatically put the "$bADDBAN$b" line at the top.
- Needs a replacement for !command.
- Permissions checks need to be fixed. It currently does a
require-all for "staff" privileges; as discussed on IRC, it should
do a require-any instead. This really requires permissions to be
flattened rather than recursively checked. Easy enough to fix.
- Related to the above, policer weights are never checked.
And there are probably a lot of bugs that slipped by my (scanty)
testing. For folks that don't have commit access, please try to get
backtraces of crashes and/or simple instructions on how to reproduce a
problem.
-- Entrope
|