mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 12:09:03 -04:00
Fixed bug #404; this was caused by recieving multiple OPERTYPEs from a remote server, which eventually resulted in bad pointers inside the all_opers list
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8085 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
44700449e9
commit
69273a20e5
@ -28,6 +28,7 @@
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <list>
|
||||
#include "inspircd_config.h"
|
||||
#include "users.h"
|
||||
#include "channels.h"
|
||||
@ -503,7 +504,7 @@ class CoreExport InspIRCd : public classbase
|
||||
|
||||
/** Oper list, a vector containing all local and remote opered users
|
||||
*/
|
||||
std::vector<userrec*> all_opers;
|
||||
std::list<userrec*> all_opers;
|
||||
|
||||
/** Map of local ip addresses for clone counting
|
||||
*/
|
||||
|
@ -299,7 +299,7 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
|
||||
if (opt_viewopersonly)
|
||||
{
|
||||
/* Showing only opers */
|
||||
for (std::vector<userrec*>::iterator i = ServerInstance->all_opers.begin(); i != ServerInstance->all_opers.end(); i++)
|
||||
for (std::list<userrec*>::iterator i = ServerInstance->all_opers.begin(); i != ServerInstance->all_opers.end(); i++)
|
||||
{
|
||||
userrec* oper = *i;
|
||||
|
||||
|
@ -118,7 +118,7 @@ void InspIRCd::WriteOpers(const char* text, ...)
|
||||
|
||||
void InspIRCd::WriteOpers(const std::string &text)
|
||||
{
|
||||
for (std::vector<userrec*>::iterator i = this->all_opers.begin(); i != this->all_opers.end(); i++)
|
||||
for (std::list<userrec*>::iterator i = this->all_opers.begin(); i != this->all_opers.end(); i++)
|
||||
{
|
||||
userrec* a = *i;
|
||||
if (IS_LOCAL(a) && a->IsModeSet('s'))
|
||||
|
@ -55,7 +55,7 @@ void SnomaskManager::WriteToSnoMask(char letter, const std::string &text)
|
||||
if (n != SnoMasks.end())
|
||||
{
|
||||
/* Only opers can receive snotices, so we iterate the oper list */
|
||||
for (std::vector<userrec*>::iterator i = ServerInstance->all_opers.begin(); i != ServerInstance->all_opers.end(); i++)
|
||||
for (std::list<userrec*>::iterator i = ServerInstance->all_opers.begin(); i != ServerInstance->all_opers.end(); i++)
|
||||
{
|
||||
userrec* a = *i;
|
||||
if (IS_LOCAL(a) && a->IsModeSet('s') && a->IsModeSet('n') && a->IsNoticeMaskSet(n->first))
|
||||
|
@ -818,16 +818,9 @@ void userrec::UnOper()
|
||||
// unset their oper type (what IS_OPER checks), and remove +o
|
||||
*this->oper = 0;
|
||||
this->modes[UM_OPERATOR] = 0;
|
||||
|
||||
// remove them from the opers list.
|
||||
for (std::vector<userrec*>::iterator a = ServerInstance->all_opers.begin(); a < ServerInstance->all_opers.end(); a++)
|
||||
{
|
||||
if (*a == this)
|
||||
{
|
||||
ServerInstance->all_opers.erase(a);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404
|
||||
ServerInstance->all_opers.remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user