summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/cmd_list.cpp15
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/modmanager_dynamic.cpp3
-rw-r--r--src/modules/m_hideoper.cpp6
-rw-r--r--src/modules/m_operprefix.cpp18
-rw-r--r--src/xline.cpp3
6 files changed, 34 insertions, 13 deletions
diff --git a/src/commands/cmd_list.cpp b/src/commands/cmd_list.cpp
index 2f417bc04..2c420d1dd 100644
--- a/src/commands/cmd_list.cpp
+++ b/src/commands/cmd_list.cpp
@@ -82,14 +82,15 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User
// if the channel is not private/secret, OR the user is on the channel anyway
bool n = (i->second->HasUser(user) || user->HasPrivPermission("channels/auspex"));
- if (!n && i->second->IsModeSet('p'))
+ // If we're not in the channel and +s is set on it, we want to ignore it
+ if (n || !i->second->IsModeSet('s'))
{
- /* Channel is +p and user is outside/not privileged */
- user->WriteNumeric(322, "%s * %ld :",user->nick.c_str(), users);
- }
- else
- {
- if (n || !i->second->IsModeSet('s'))
+ if (!n && i->second->IsModeSet('p'))
+ {
+ /* Channel is +p and user is outside/not privileged */
+ user->WriteNumeric(322, "%s * %ld :",user->nick.c_str(), users);
+ }
+ else
{
/* User is in the channel/privileged, channel is not +s */
user->WriteNumeric(322, "%s %s %ld :[+%s] %s",user->nick.c_str(),i->second->name.c_str(),users,i->second->ChanModes(n),i->second->topic.c_str());
diff --git a/src/configreader.cpp b/src/configreader.cpp
index bd147782e..b3caf8c75 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -730,7 +730,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
if (valid)
ServerInstance->WritePID(this->PID);
- if (old)
+ if (old && valid)
{
// On first run, ports are bound later on
FailedPortList pl;
diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp
index 045b488b5..050f41c75 100644
--- a/src/modmanager_dynamic.cpp
+++ b/src/modmanager_dynamic.cpp
@@ -36,7 +36,10 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
{
/* Don't allow people to specify paths for modules, it doesn't work as expected */
if (filename.find('/') != std::string::npos)
+ {
+ LastModuleError = "You can't load modules with a path: " + filename;
return false;
+ }
char modfile[MAXBUF];
snprintf(modfile,MAXBUF,"%s/%s",ServerInstance->Config->ModPath.c_str(),filename.c_str());
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp
index b83c7de1a..88b0c4cdf 100644
--- a/src/modules/m_hideoper.cpp
+++ b/src/modules/m_hideoper.cpp
@@ -82,7 +82,11 @@ class ModuleHideOper : public Module
if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex"))
{
// hide the "*" that marks the user as an oper from the /WHO line
- std::string::size_type pos = line.find("*");
+ std::string::size_type spcolon = line.find(" :");
+ if (spcolon == std::string::npos)
+ return; // Another module hid the user completely
+ std::string::size_type sp = line.rfind(' ', spcolon-1);
+ std::string::size_type pos = line.find('*', sp);
if (pos != std::string::npos)
line.erase(pos, 1);
// hide the line completely if doing a "/who * o" query
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index 62ddb6c67..9f1f6cc5e 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -85,7 +85,7 @@ class ModuleOperPrefixMode : public Module
{
ServerInstance->Modules->AddService(opm);
- Implementation eventlist[] = { I_OnUserPreJoin, I_OnPostOper, I_OnLoadModule, I_OnUnloadModule };
+ Implementation eventlist[] = { I_OnUserPreJoin, I_OnPostOper, I_OnLoadModule, I_OnUnloadModule, I_OnPostJoin };
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
/* To give clients a chance to learn about the new prefix we don't give +y to opers
@@ -110,6 +110,22 @@ class ModuleOperPrefixMode : public Module
return MOD_RES_PASSTHRU;
}
+ void OnPostJoin(Membership* memb)
+ {
+ if ((!IS_LOCAL(memb->user)) || (!IS_OPER(memb->user)) || (((mw_added) && (memb->user->IsModeSet('H')))))
+ return;
+
+ if (memb->hasMode(opm.GetModeChar()))
+ return;
+
+ // The user was force joined and OnUserPreJoin() did not run. Set the operprefix now.
+ std::vector<std::string> modechange;
+ modechange.push_back(memb->chan->name);
+ modechange.push_back("+y");
+ modechange.push_back(memb->user->nick);
+ ServerInstance->SendGlobalMode(modechange, ServerInstance->FakeClient);
+ }
+
void SetOperPrefix(User* user, bool add)
{
std::vector<std::string> modechange;
diff --git a/src/xline.cpp b/src/xline.cpp
index 66d24f439..b710c5c43 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -598,9 +598,6 @@ void GLine::Apply(User* u)
bool ELine::Matches(User *u)
{
- if (u->exempt)
- return false;
-
if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map))
{
if (InspIRCd::MatchCIDR(u->host, this->hostmask, ascii_case_insensitive_map) ||