diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | src/core/cs_suspend.c | 29 | ||||
-rw-r--r-- | version.log | 6 |
3 files changed, 32 insertions, 4 deletions
@@ -7,6 +7,7 @@ Anope Version S V N 01/15 F Re-assigned access to OS CHANLIST to Services Opers. [#827] 01/24 F Several language errors. [ #00] 01/26 F Various oddities in moduleAddData(). [#833] +01/26 F Various oddities in ChanServ suspend code. [#834] Provided by Jan Milants <jan_renee@msn.com> - 2008 01/16 F Server traversion with next_server() failed to list all servers. [#831] diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c index 69e236a33..674861578 100644 --- a/src/core/cs_suspend.c +++ b/src/core/cs_suspend.c @@ -88,6 +88,11 @@ int do_suspend(User * u) return MOD_CONT; } + if (chan[0] != '#') { + notice_lang(s_ChanServ, u, CHAN_UNSUSPEND_ERROR); + return MOD_CONT; + } + /* Only SUSPEND existing channels, otherwise use FORBID (bug #54) */ if ((ci = cs_findchan(chan)) == NULL) { notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan); @@ -163,12 +168,30 @@ int do_unsuspend(User * u) if (readonly) notice_lang(s_ChanServ, u, READ_ONLY_MODE); - ci = cs_findchan(chan); + /* Only UNSUSPEND already suspended channels */ + if ((ci = cs_findchan(chan)) == NULL) { + notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan); + return MOD_CONT; + } + + if (!(ci->flags & CI_SUSPENDED)) + { + notice_lang(s_ChanServ, u, CHAN_UNSUSPEND_FAILED, chan); + return MOD_CONT; + } if (ci) { ci->flags &= ~CI_SUSPENDED; - ci->forbidreason = NULL; - ci->forbidby = NULL; + if (ci->forbidreason) + { + free(ci->forbidreason); + ci->forbidreason = NULL; + } + if (ci->forbidby) + { + free(ci->forbidby); + ci->forbidby = NULL; + } if (WallForbid) anope_cmd_global(s_ChanServ, diff --git a/version.log b/version.log index e9295725d..a63769556 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="21" VERSION_EXTRA="-svn" -VERSION_BUILD="1354" +VERSION_BUILD="1355" # $Log$ # +# BUILD : 1.7.21 (1355) +# BUGS : 834 +# NOTES : Fixed various oddities in ChanServ suspend code +# # BUILD : 1.7.21 (1354) # BUGS : 833 # NOTES : Ficed various oddities in moduleAddData() |