1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 08:33:12 +02:00

BUILD : 1.7.6 (439) BUGS : 68, 170, 209 NOTES : 1. DrSteins XOP patch (bug# 170), 2. Cleaned up the English language file for grammar (bug# 209), 3. Patch that fixes segfaults under NetBSD, 4. Cleaned up some places that could lead to segfaults, 5. DrSteins patch for NS ACCESS LIST, 6. Chanserv taking modes more than once (bug #68), 7. Fixed errors when doing "make" under some BSD systems, 8. Fixed syntax error when NSForceEmail is disabled

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


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@294 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-11-07 03:36:30 +00:00
parent b4489cffed
commit c58d37f49d
24 changed files with 173 additions and 58 deletions
+26 -4
View File
@@ -235,10 +235,32 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
mode, chan->name, user->nick);
if (add) {
if (check && cum->is_valid
&& !cum->is_valid(user, chan, servermode))
continue;
chan_set_user_status(chan, user, cum->status);
/* Fixes bug #68
- might be a bit ugly but it works, the idea is that since the
is_valid function strips out all of the modes there is no point
in sending it over and over again
*/
if (check) {
if (check == 2 && cum->is_valid) {
if (debug) {
alog("debug: Modes already removed, calling remove_user_status() to clean up");
}
chan_remove_user_status(chan, user, cum->status);
continue;
} else if (cum->is_valid
&& !cum->is_valid(user, chan, servermode)) {
if (debug) {
alog("debug: Modes already sent calling remove_user_status() to clean up");
}
chan_remove_user_status(chan, user, cum->status);
check = 2;
continue;
} else {
chan_set_user_status(chan, user, cum->status);
}
} else {
chan_set_user_status(chan, user, cum->status);
}
} else {
chan_remove_user_status(chan, user, cum->status);
}
+7 -6
View File
@@ -1971,7 +1971,8 @@ ChannelInfo *cs_findchan(const char *chan)
return NULL;
}
for (ci = chanlists[tolower(chan[1])]; ci; ci = ci->next) {
for (ci = chanlists[(unsigned char) tolower(chan[1])]; ci;
ci = ci->next) {
if (stricmp(ci->name, chan) == 0)
return ci;
}
@@ -2035,13 +2036,13 @@ void alpha_insert_chan(ChannelInfo * ci)
chan = ci->name;
for (prev = NULL, ptr = chanlists[tolower(chan[1])];
for (prev = NULL, ptr = chanlists[(unsigned char) tolower(chan[1])];
ptr != NULL && stricmp(ptr->name, chan) < 0;
prev = ptr, ptr = ptr->next);
ci->prev = prev;
ci->next = ptr;
if (!prev)
chanlists[tolower(chan[1])] = ci;
chanlists[(unsigned char) tolower(chan[1])] = ci;
else
prev->next = ci;
if (ptr)
@@ -2126,7 +2127,7 @@ int delchan(ChannelInfo * ci)
if (ci->prev)
ci->prev->next = ci->next;
else
chanlists[tolower(ci->name[1])] = ci->next;
chanlists[(unsigned char) tolower(ci->name[1])] = ci->next;
if (ci->desc)
free(ci->desc);
if (ci->mlock_key)
@@ -3700,7 +3701,7 @@ static int do_xop(User * u, char *xname, int xlev, int *xmsgs)
ulev = get_access(u, ci);
if (xlev >= ulev || ulev < ACCESS_AOP) {
if ((xlev >= ulev || ulev < ACCESS_AOP) && !is_servadmin) {
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
return MOD_CONT;
}
@@ -3721,7 +3722,7 @@ static int do_xop(User * u, char *xname, int xlev, int *xmsgs)
/**
* Patch provided by PopCorn to prevert AOP's reducing SOP's levels
**/
if ((access->level >= ulev) && (!u->isSuperAdmin)) {
if ((access->level >= ulev) && (!is_servadmin)) {
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
return MOD_CONT;
}
+17 -3
View File
@@ -2044,9 +2044,13 @@ static int do_register(User * u)
}
}
if (!pass || (NSForceEmail && !email)) {
syntax_error(s_NickServ, u, "REGISTER",
NICK_REGISTER_SYNTAX_EMAIL);
if (!pass) {
if (NSForceEmail && !email) {
syntax_error(s_NickServ, u, "REGISTER",
NICK_REGISTER_SYNTAX_EMAIL);
} else {
syntax_error(s_NickServ, u, "REGISTER", NICK_REGISTER_SYNTAX);
}
} else if (time(NULL) < u->lastnickreg + NSRegDelay) {
notice_lang(s_NickServ, u, NICK_REG_PLEASE_WAIT, NSRegDelay);
} else if (u->na) { /* i.e. there's already such a nick regged */
@@ -3247,6 +3251,11 @@ static int do_access(User * u)
if (cmd && stricmp(cmd, "LIST") == 0 && mask && is_services_admin(u)
&& (na = findnick(mask))) {
if (na->nc->accesscount == 0) {
notice_lang(s_NickServ, u, NICK_ACCESS_LIST_X_EMPTY, na->nick);
return MOD_CONT;
}
if (na->status & NS_VERBOTEN) {
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick);
return MOD_CONT;
@@ -3326,6 +3335,11 @@ static int do_access(User * u)
na->nc->access = NULL;
}
} else if (stricmp(cmd, "LIST") == 0) {
if (na->nc->accesscount == 0) {
notice_lang(s_NickServ, u, NICK_ACCESS_LIST_EMPTY, u->nick);
return MOD_CONT;
}
notice_lang(s_NickServ, u, NICK_ACCESS_LIST);
for (access = na->nc->access, i = 0; i < na->nc->accesscount;
access++, i++) {
+1 -1
View File
@@ -234,7 +234,7 @@ int proxy_check(char *nick, char *host, uint32 ip)
for (message = ProxyMessage, i = 0; i < 8 && *message && **message;
message++, i++)
notice(s_GlobalNoticer, nick, *message);
notice(s_GlobalNoticer, nick, "%s", *message);
hc = proxy_cache_add(host);
if (ircd->nickip) {
+4
View File
@@ -183,6 +183,10 @@ Server *findserver(Server * s, const char *name)
{
Server *sl;
if (!name || !*name) {
return NULL;
}
if (debug >= 3)
alog("debug: findserver(%p)", name);
while (s && (stricmp(s->name, name) != 0)) {
+1 -1
View File
@@ -240,7 +240,7 @@ int add_session(char *nick, char *host)
if (SessionLimitExceeded)
notice(s_OperServ, nick, SessionLimitExceeded, host);
if (SessionLimitDetailsLoc)
notice(s_OperServ, nick, SessionLimitDetailsLoc);
notice(s_OperServ, nick, "%s", SessionLimitDetailsLoc);
/* We don't use kill_user() because a user stucture has not yet
* been created. Simply kill the user. -TheShadow
+6 -5
View File
@@ -27,14 +27,15 @@ int send_timeout_list(User * u)
{
Timeout *to, *last;
notice(s_OperServ, u->nick, "Now: %ld", time(NULL));
notice(s_OperServ, u->nick, "Now: %ld", (long int) time(NULL));
for (to = timeouts, last = NULL; to; last = to, to = to->next) {
notice(s_OperServ, u->nick, "%p: %ld: %p (%p)",
to, to->timeout, to->code, to->data);
notice(s_OperServ, u->nick, "0x%p: %ld: 0x%p (0x%p)",
(void *) to, (long int) to->timeout, (void *) to->code,
(void *) to->data);
if (to->prev != last)
notice(s_OperServ, u->nick,
" to->prev incorrect! expected=%p seen=%p",
last, to->prev);
" to->prev incorrect! expected=0x%p seen=0x%p",
(void *) last, (void *) to->prev);
}
return MOD_CONT;
}