1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 13:03:14 +02:00

BUILD : 1.7.21 (1373) BUGS : 855 NOTES : Fixed various issues in handling of DefCon modes with params

git-svn-id: svn://svn.anope.org/anope/trunk@1373 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1088 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b
2008-02-05 14:35:42 +00:00
parent 2844a3ed59
commit 1baff08ad8
3 changed files with 29 additions and 5 deletions
+1
View File
@@ -26,6 +26,7 @@ Anope Version S V N
02/08 F Various small compiler warnings. [#685]
02/08 F Updated docs/WIN32.txt. [#846]
02/08 F Removed bs_fantasy_unban from core modules. [#854]
02/08 F Defcon mode parsing breaking when fed with modes with parameters. [#855]
Provided by Jan Milants <jan_renee@msn.com> - 2008
01/16 F Server traversion with next_server() failed to list all servers. [#831]
+23 -4
View File
@@ -1668,7 +1668,9 @@ int defconParseModeString(const char *str)
int add = -1; /* 1 if adding, 0 if deleting, -1 if neither */
unsigned char mode;
CBMode *cbm;
char *str_copy = sstrdup(str); /* We need this copy as str is const -GD */
char *param; /* Store parameters during mode parsing */
/* Reinitialize everything */
DefConModesOn = 0;
DefConModesOff = 0;
@@ -1676,9 +1678,12 @@ int defconParseModeString(const char *str)
DefConModesCI.mlock_key = NULL;
DefConModesCI.mlock_flood = NULL;
DefConModesCI.mlock_redirect = NULL;
/* Initialize strtok() internal buffer */
strtok(str_copy, " ");
/* Loop while there are modes to set */
while ((mode = *str++)) {
while ((mode = *str++) && (mode != ' ')) {
switch (mode) {
case '+':
add = 1;
@@ -1694,26 +1699,40 @@ int defconParseModeString(const char *str)
if ((int) mode < 128 && (cbm = &cbmodes[(int) mode])->flag != 0) {
if (cbm->flags & CBM_NO_MLOCK) {
alog("DefConChanModes mode character '%c' cannot be locked", mode);
free(str_copy);
return 0;
} else if (add) {
DefConModesOn |= cbm->flag;
DefConModesOff &= ~cbm->flag;
if (cbm->cssetvalue)
cbm->cssetvalue(&DefConModesCI, strtok(NULL, " "));
{
if (!(param = strtok(NULL, " ")))
{
alog("DefConChanModes mode character '%c' has no parameter while one is expected", mode);
free(str_copy);
return 0;
}
cbm->cssetvalue(&DefConModesCI, param);
}
} else {
DefConModesOff |= cbm->flag;
if (DefConModesOn & cbm->flag) {
DefConModesOn &= ~cbm->flag;
if (cbm->cssetvalue)
{
cbm->cssetvalue(&DefConModesCI, NULL);
}
}
}
} else {
alog("DefConChanModes unknown mode character '%c'", mode);
free(str_copy);
return 0;
}
} /* while (*param) */
free(str_copy);
if (ircd->Lmode) {
/* We can't mlock +L if +l is not mlocked as well. */
if ((DefConModesOn & ircd->chan_lmode)
+5 -1
View File
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="21"
VERSION_EXTRA="-svn"
VERSION_BUILD="1372"
VERSION_BUILD="1373"
# $Log$
#
# BUILD : 1.7.21 (1373)
# BUGS : 855
# NOTES : Fixed various issues in handling of DefCon modes with params
#
# BUILD : 1.7.21 (1372)
# BUGS : 854
# NOTES : Removed bs_fantasy_unban from core modules.