From add9f99dfa681fbf6d326e91dd4ffd60f53f1d2b Mon Sep 17 00:00:00 2001 From: jilles Date: Wed, 28 Mar 2007 08:22:49 -0700 Subject: [PATCH] [svn] Merge old trunk r2907,r2991: Allow TESTLINE on channel names. --- ChangeLog | 10 ++++++++++ doc/sgml/oper-guide/commands.sgml | 4 ++++ help/opers/testline | 4 ++++ include/serno.h | 2 +- modules/m_testline.c | 26 ++++++++++++++++++++++++-- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9903cc0..860de32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +jilles 2007/03/28 15:04:06 UTC (20070328-3301) + Log: + Merge old trunk r2835: + resolver: if sendto(2) fails, try sending to the next nameserver + + + Changes: Modified: + +1 -1 trunk/src/res.c (File Modified) + + jilles 2007/03/28 14:54:10 UTC (20070328-3299) Log: Merge old trunk r2817: diff --git a/doc/sgml/oper-guide/commands.sgml b/doc/sgml/oper-guide/commands.sgml index 52e0517..b2e72d8 100644 --- a/doc/sgml/oper-guide/commands.sgml +++ b/doc/sgml/oper-guide/commands.sgml @@ -532,6 +532,10 @@ in use. As of charybdis 2.1.1, no_tilde and username truncation will be taken into account like in the normal client access check. + + As of charybdis 2.2.0, a channel name can be specified and the + RESV will be returned, if there is one. + TESTMASK diff --git a/help/opers/testline b/help/opers/testline index 5efbd8d..c083843 100644 --- a/help/opers/testline +++ b/help/opers/testline @@ -6,3 +6,7 @@ If nickname is specified it will also search for RESVs. This command will not perform dns lookups on a host, for best results you must testline a host and its IP form. + +TESTLINE <#channel> + +Shows whether the channel is reserved or not. diff --git a/include/serno.h b/include/serno.h index 6db3815..415152b 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070328-3299" +#define SERNO "20070328-3301" diff --git a/modules/m_testline.c b/modules/m_testline.c index c57bd09..ca5930b 100644 --- a/modules/m_testline.c +++ b/modules/m_testline.c @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: m_testline.c 2757 2006-11-10 22:58:15Z jilles $ + * $Id: m_testline.c 3303 2007-03-28 15:22:49Z jilles $ */ #include "stdinc.h" #include "tools.h" @@ -35,6 +35,7 @@ #include "client.h" #include "modules.h" #include "msg.h" +#include "hash.h" #include "hostmask.h" #include "numeric.h" #include "s_conf.h" @@ -54,7 +55,7 @@ struct Message testgecos_msgtab = { }; mapi_clist_av1 testline_clist[] = { &testline_msgtab, &testgecos_msgtab, NULL }; -DECLARE_MODULE_AV1(testline, NULL, NULL, testline_clist, NULL, NULL, "$Revision: 2757 $"); +DECLARE_MODULE_AV1(testline, NULL, NULL, testline_clist, NULL, NULL, "$Revision: 3303 $"); static int mo_testline(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) @@ -73,6 +74,27 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch mask = LOCAL_COPY(parv[1]); + if (IsChannelName(mask)) + { + resv_p = hash_find_resv(mask); + if (resv_p != NULL) + { + sendto_one(source_p, form_str(RPL_TESTLINE), + me.name, source_p->name, + resv_p->hold ? 'q' : 'Q', + resv_p->hold ? (long) ((resv_p->hold - CurrentTime) / 60) : 0L, + resv_p->name, resv_p->passwd); + /* this is a false positive, so make sure it isn't counted in stats q + * --nenolod + */ + resv_p->port--; + } + else + sendto_one(source_p, form_str(RPL_NOTESTLINE), + me.name, source_p->name, parv[1]); + return 0; + } + if((p = strchr(mask, '!'))) { *p++ = '\0';