mirror of
https://github.com/anope/anope.git
synced 2026-07-02 04:26:39 +02:00
BUILD : 1.7.19 (1303) BUGS : 703 NOTES : Fixed user being able to change channel modes on empty channels without permission (eg SECUREOPS)
git-svn-id: svn://svn.anope.org/anope/trunk@1303 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1021 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
76f61c3e33
commit
5f5ac9f0d7
@@ -39,6 +39,7 @@ Anope Version S V N
|
||||
08/29 F TS6 UID generation for all supported TS6 IRCDs. [#731]
|
||||
09/01 F Added a note in WIN32.txt about pre-compiled installers [# 00]
|
||||
09/02 F Created MySQL indexes to decrease load on the database. [# 00]
|
||||
09/08 F User being able to set modes on empty channels without permission.[#703]
|
||||
|
||||
Provided by Trystan <trystan@nomadirc.net> - 2007
|
||||
08/29 F Module runtime directory not always properly cleaned up. [#768]
|
||||
|
||||
@@ -1287,6 +1287,7 @@ typedef struct ircd_modes_ {
|
||||
#define CUS_HALFOP 0x0004 /* Halfop (+h) */
|
||||
#define CUS_OWNER 0x0008 /* Owner/Founder (+q) */
|
||||
#define CUS_PROTECT 0x0010 /* Protected users (+a) */
|
||||
#define CUS_DEOPPED 0x0080 /* User has been specifically deopped */
|
||||
|
||||
#define MUT_DEOP 0
|
||||
#define MUT_OP 1
|
||||
|
||||
+30
-3
@@ -165,7 +165,7 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
|
||||
CUMode *cum;
|
||||
unsigned char botmode = 0;
|
||||
BotInfo *bi;
|
||||
User *user;
|
||||
User *u, *user;
|
||||
int i, real_ac = ac;
|
||||
char **real_av = av;
|
||||
|
||||
@@ -173,6 +173,27 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
|
||||
alog("debug: Changing modes for %s to %s", chan->name,
|
||||
merge_args(ac, av));
|
||||
|
||||
u = finduser(source);
|
||||
if (u && (chan_get_user_status(chan, u) & CUS_DEOPPED)) {
|
||||
char *s;
|
||||
|
||||
if (debug)
|
||||
alog("debug: Removing instead of setting due to DEOPPED flag");
|
||||
|
||||
/* Swap adding and removing of the modes */
|
||||
for (s = av[0]; *s; s++) {
|
||||
if (*s == '+')
|
||||
*s = '-';
|
||||
else if (*s == '-')
|
||||
*s = '+';
|
||||
}
|
||||
|
||||
/* Set the resulting mode buffer */
|
||||
anope_cmd_mode(whosends(chan->ci), chan->name, merge_args(ac, av));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ac--;
|
||||
|
||||
while ((mode = *modes++)) {
|
||||
@@ -231,10 +252,14 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
|
||||
alog("debug: Setting %c%c on %s for %s", (add ? '+' : '-'),
|
||||
mode, chan->name, user->nick);
|
||||
|
||||
if (add)
|
||||
if (add) {
|
||||
chan_set_user_status(chan, user, cum->status);
|
||||
else
|
||||
/* If this does +o, remove any DEOPPED flag */
|
||||
if (cum->status & CUS_OP)
|
||||
chan_remove_user_status(chan, user, CUS_DEOPPED);
|
||||
} else {
|
||||
chan_remove_user_status(chan, user, cum->status);
|
||||
}
|
||||
|
||||
} else if ((cbm = &cbmodes[(int) mode])->flag != 0) {
|
||||
if (check >= 0) {
|
||||
@@ -1405,6 +1430,7 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
|
||||
}
|
||||
if ((add_modes & CUS_OP) && !(status & CUS_OP)) {
|
||||
strcat(modebuf, "o");
|
||||
strcat(userbuf, " ");
|
||||
strcat(userbuf, user->nick);
|
||||
rem_modes |= CUS_DEOPPED;
|
||||
} else {
|
||||
@@ -1443,6 +1469,7 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
|
||||
}
|
||||
if (rem_modes & CUS_OP) {
|
||||
strcat(modebuf, "o");
|
||||
strcat(userbuf, " ");
|
||||
strcat(userbuf, user->nick);
|
||||
add_modes |= CUS_DEOPPED;
|
||||
}
|
||||
|
||||
+5
-1
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="19"
|
||||
VERSION_EXTRA="-svn"
|
||||
VERSION_BUILD="1302"
|
||||
VERSION_BUILD="1303"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.19 (1303)
|
||||
# BUGS : 703
|
||||
# NOTES : Fixed user being able to change channel modes on empty channels without permission (eg SECUREOPS)
|
||||
#
|
||||
# BUILD : 1.7.19 (1302)
|
||||
# BUGS :
|
||||
# NOTES : Minor style changes in Changes
|
||||
|
||||
Reference in New Issue
Block a user