From 2c390a19295d497256d49620fe7537503d320828 Mon Sep 17 00:00:00 2001 From: "geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Tue, 2 Jan 2007 14:54:07 +0000 Subject: BUILD : 1.7.18 (1218) BUGS : 622 NOTES : Fixed ChanServ LIST to now search for <#chan> if only is given; Fixed all LIST commands to give error reporting when specifying incorrect ranges. git-svn-id: svn://svn.anope.org/anope/trunk@1218 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@937 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 2 ++ lang/cat.l | 13 +++++++++++++ lang/de.l | 13 +++++++++++++ lang/en_us.l | 9 ++++++++- lang/es.l | 13 +++++++++++++ lang/fr.l | 13 +++++++++++++ lang/gr.l | 13 +++++++++++++ lang/hun.l | 13 +++++++++++++ lang/it.l | 13 +++++++++++++ lang/nl.l | 14 ++++++++++++++ lang/pl.l | 13 +++++++++++++ lang/pt.l | 13 +++++++++++++ lang/ru.l | 13 +++++++++++++ lang/tr.l | 13 +++++++++++++ src/core/cs_list.c | 21 +++++++++++++++++++-- src/core/hs_list.c | 4 ++++ src/core/ns_list.c | 4 ++++ version.log | 6 +++++- 18 files changed, 199 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 47667edb2..d506055ac 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,8 @@ Anope Version S V N -------------------- 01/01 A Support for InspIRCd 1.1. [ #00] 01/02 F Issues with both InspIRCd protocol modules. [ #00] +01/02 F Error reporting on LIST commands accepting ranges. [#622] +01/02 F ChanServ LIST now searches for '#chan' if only 'chan' is given. [#622] Anope Version 1.7.18 -------------------- diff --git a/lang/cat.l b/lang/cat.l index 5417ef3a7..89495a674 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -295,6 +295,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Aquest nick pertany a un altra persona. Per favor escull un altre nick. diff --git a/lang/de.l b/lang/de.l index bfe45cef3..7edacac66 100644 --- a/lang/de.l +++ b/lang/de.l @@ -317,6 +317,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Dieser Nickname gehört schon jemand anderem. Bitte wähle einen anderen. diff --git a/lang/en_us.l b/lang/en_us.l index 7bb8dccd7..c308a2255 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -46,7 +46,7 @@ # For languages other than English, this string should have the following # format: # language-name-in-language (language-name-in-English) -# For example, "Español (Spanish)" or "Français (French)". +# For example, "Espa�l (Spanish)" or "Fran�is (French)". LANG_NAME English @@ -288,6 +288,13 @@ EXPIRES_1D END_OF_ANY_LIST End of %s list. +# Generic List error messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + ########################################################################### # # NickServ messages diff --git a/lang/es.l b/lang/es.l index f53da774b..3e3eaffb3 100644 --- a/lang/es.l +++ b/lang/es.l @@ -300,6 +300,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Este nick pertenece a otra persona. Por favor elige otro nick. diff --git a/lang/fr.l b/lang/fr.l index 6a12fcf46..61df533af 100644 --- a/lang/fr.l +++ b/lang/fr.l @@ -300,6 +300,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Ce nick appartient à quelqu'un d'autre. Veuillez en changer. diff --git a/lang/gr.l b/lang/gr.l index 815a4d584..d6ac42208 100644 --- a/lang/gr.l +++ b/lang/gr.l @@ -294,6 +294,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Áõôü ôï øåõäþíõìï áíÞêåé óå êÜðïéïí Üëëïí. Ðáñáêáëþ äéÜëåîå êÜðïéï Üëëï. diff --git a/lang/hun.l b/lang/hun.l index e6fb38b11..0237252ca 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -305,6 +305,19 @@ END_OF_ANY_LIST ########################################################## # Automatikus üzenetek +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + +# Automatic messages NICK_IS_REGISTERED Ez a nick már regisztrált. Kérlek válassz másikat. Ha ez a te nicked, akkor %R%s IDENTIFY jelszó! diff --git a/lang/it.l b/lang/it.l index 4d30a0450..5539d42d9 100644 --- a/lang/it.l +++ b/lang/it.l @@ -296,6 +296,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Questo nick appartiene a qualcun altro. Per favore scegline un altro. diff --git a/lang/nl.l b/lang/nl.l index f7f2a0476..26478327a 100644 --- a/lang/nl.l +++ b/lang/nl.l @@ -297,6 +297,20 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Ongeldig bereik opgegeven. Het correct gebruik is #van-tot. +CS_LIST_INCORRECT_RANGE + Om te zoeken naar kanalen die met een # beginnen moet gezocht + worden naar de kanaalnaam zonder het #-teken ervoor (anope + in plaats van #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Deze nick is eigendom van iemand anders. Kies een andere. diff --git a/lang/pl.l b/lang/pl.l index df1c9bd97..6fb5176b4 100644 --- a/lang/pl.l +++ b/lang/pl.l @@ -320,6 +320,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Ten nick jest zarejestrowany. Je¶li to Twój nick, diff --git a/lang/pt.l b/lang/pt.l index df788138f..8c9972d6a 100644 --- a/lang/pt.l +++ b/lang/pt.l @@ -304,6 +304,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Este nick foi registrado por outra pessoa. Por favor escolha outro. diff --git a/lang/ru.l b/lang/ru.l index cb8558164..406fb0864 100644 --- a/lang/ru.l +++ b/lang/ru.l @@ -300,6 +300,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Ýòîò íèê çàðåãèñòðèðîâàí è èñïîëüçóåòñÿ. Âûáåðèòå, ïîæàëóéñòà, äðóãîé íèê. diff --git a/lang/tr.l b/lang/tr.l index 7560dbab7..22cda2477 100644 --- a/lang/tr.l +++ b/lang/tr.l @@ -299,6 +299,19 @@ END_OF_ANY_LIST # ########################################################################### +# Automatic messages +LIST_INCORRECT_RANGE + Incorrect range specified. The correct syntax is #from-to. +CS_LIST_INCORRECT_RANGE + To search for channels starting with #, search for the channel + name without the #-sign prepended (anope instead of #anope). + +########################################################################### +# +# NickServ messages +# +########################################################################### + # Automatic messages NICK_IS_REGISTERED Bu nick baþkasýna ait. Lütfen baþka bir tane seçin. diff --git a/src/core/cs_list.c b/src/core/cs_list.c index 315f92cc7..7fa43a12a 100644 --- a/src/core/cs_list.c +++ b/src/core/cs_list.c @@ -72,6 +72,8 @@ void myChanServHelp(User * u) int do_list(User * u) { char *pattern = strtok(NULL, " "); + int spattern_size; + char *spattern; ChannelInfo *ci; int nchans, i; char buf[BUFSIZE]; @@ -97,11 +99,15 @@ int do_list(User * u) if (pattern[0] == '#') { tmp = myStrGetOnlyToken((pattern + 1), '-', 0); /* Read FROM out */ if (!tmp) { + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); + notice_lang(s_ChanServ, u, CS_LIST_INCORRECT_RANGE); return MOD_CONT; } for (s = tmp; *s; s++) { if (!isdigit(*s)) { free(tmp); + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); + notice_lang(s_ChanServ, u, CS_LIST_INCORRECT_RANGE); return MOD_CONT; } } @@ -109,11 +115,15 @@ int do_list(User * u) free(tmp); tmp = myStrGetTokenRemainder(pattern, '-', 1); /* Read TO out */ if (!tmp) { + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); + notice_lang(s_ChanServ, u, CS_LIST_INCORRECT_RANGE); return MOD_CONT; } for (s = tmp; *s; s++) { if (!isdigit(*s)) { free(tmp); + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); + notice_lang(s_ChanServ, u, CS_LIST_INCORRECT_RANGE); return MOD_CONT; } } @@ -134,6 +144,11 @@ int do_list(User * u) if (stricmp(keyword, "NOEXPIRE") == 0) matchflags |= CI_NO_EXPIRE; } + + spattern_size = (strlen(pattern) + 2) * sizeof(char); + spattern = smalloc(spattern_size); + snprintf(spattern, spattern_size, "#%s", pattern); + notice_lang(s_ChanServ, u, CHAN_LIST_HEADER, pattern); for (i = 0; i < 256; i++) { @@ -144,8 +159,10 @@ int do_list(User * u) if ((matchflags != 0) && !(ci->flags & matchflags)) continue; - if (stricmp(pattern, ci->name) == 0 - || match_wild_nocase(pattern, ci->name)) { + if ((stricmp(pattern, ci->name) == 0) + || (stricmp(spattern, ci->name) == 0) + || match_wild_nocase(pattern, ci->name) + || match_wild_nocase(spattern, ci->name)) { if ((((count + 1 >= from) && (count + 1 <= to)) || ((from == 0) && (to == 0))) && (++nchans <= CSListMax)) { diff --git a/src/core/hs_list.c b/src/core/hs_list.c index ac26a2d0b..1dc209196 100644 --- a/src/core/hs_list.c +++ b/src/core/hs_list.c @@ -93,11 +93,13 @@ int listOut(User * u) if (key[0] == '#') { tmp = myStrGetOnlyToken((key + 1), '-', 0); /* Read FROM out */ if (!tmp) { + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } for (s = tmp; *s; s++) { if (!isdigit(*s)) { free(tmp); + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } } @@ -105,11 +107,13 @@ int listOut(User * u) free(tmp); tmp = myStrGetTokenRemainder(key, '-', 1); /* Read TO out */ if (!tmp) { + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } for (s = tmp; *s; s++) { if (!isdigit(*s)) { free(tmp); + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } } diff --git a/src/core/ns_list.c b/src/core/ns_list.c index 91cd2d356..d8a67a4eb 100644 --- a/src/core/ns_list.c +++ b/src/core/ns_list.c @@ -114,11 +114,13 @@ int do_list(User * u) if (pattern[0] == '#') { tmp = myStrGetOnlyToken((pattern + 1), '-', 0); /* Read FROM out */ if (!tmp) { + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } for (s = tmp; *s; s++) { if (!isdigit(*s)) { free(tmp); + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } } @@ -126,11 +128,13 @@ int do_list(User * u) free(tmp); tmp = myStrGetTokenRemainder(pattern, '-', 1); /* Read TO out */ if (!tmp) { + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } for (s = tmp; *s; s++) { if (!isdigit(*s)) { free(tmp); + notice_lang(s_ChanServ, u, LIST_INCORRECT_RANGE); return MOD_CONT; } } diff --git a/version.log b/version.log index b6e235609..5146b350e 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="18" VERSION_EXTRA="-svn" -VERSION_BUILD="1217" +VERSION_BUILD="1218" # $Log$ # +# BUILD : 1.7.18 (1218) +# BUGS : 622 +# NOTES : Fixed ChanServ LIST to now search for <#chan> if only is given; Fixed all LIST commands to give error reporting when specifying incorrect ranges. +# # BUILD : 1.7.18 (1217) # BUGS : # NOTES : Fixed small mistakes in both InspIRCd protocol modules -- cgit