]> jfr.im git - irc/atheme/atheme.git/commitdiff
modules/chanserv/close: check correct flags variable for log target
authorAaron Jones <redacted>
Fri, 15 Jul 2022 01:09:02 +0000 (01:09 +0000)
committerAaron Jones <redacted>
Fri, 15 Jul 2022 01:18:36 +0000 (01:18 +0000)
A user reported that the ChanServ CLOSE command was not working for
their channel, saying that the channel could not be closed.

MC_HOLD and CHAN_LOG both have the same value (1), but the former is
for flags in `struct mychan`, and the latter is for `struct channel`.

This lead me to believe that the channel was defined as a log target,
when in reality it was checking the wrong flags field and deducing
that the channel was a log target because it was held.

Check the correct flags field.

Reported-by: @hello-smile6
modules/chanserv/close.c

index 382f97c889d2f0b4ebed643f7806a78ee9173be2..1ba7559adaffdeaee23e947bc6d50c9ae0d801ea 100644 (file)
@@ -73,7 +73,7 @@ cs_cmd_close(struct sourceinfo *si, int parc, char *parv[])
                        return;
                }
 
-               if (mc->flags & CHAN_LOG)
+               if (mc->chan != NULL && mc->chan->flags & CHAN_LOG)
                {
                        command_fail(si, fault_noprivs, _("\2%s\2 cannot be closed."), target);
                        return;