summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-04-07 13:40:51 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-04-07 13:40:51 +0200
commitf71e6bf9cb41811f18864f5d4eecb26e29d03f25 (patch)
tree88586e73f7ff864081b8831a88637680267b7201 /src/modules
parentce78080782c261aed2c0314bc8c66babc1369be2 (diff)
parent493ff75f1f89a7ede2800eff0368740fbaf02aa4 (diff)
Merge insp20
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp10
-rw-r--r--src/modules/m_banredirect.cpp2
-rw-r--r--src/modules/m_globalload.cpp7
-rw-r--r--src/modules/m_httpd.cpp2
-rw-r--r--src/modules/m_operprefix.cpp3
-rw-r--r--src/modules/m_samode.cpp9
-rw-r--r--src/modules/m_saquit.cpp2
-rw-r--r--src/modules/m_spanningtree/idle.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp5
-rw-r--r--src/modules/m_watch.cpp6
10 files changed, 35 insertions, 13 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index ee024318b..7a8bdeeb0 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -109,6 +109,9 @@ namespace OpenSSL
{
SSL_CTX_set_mode(ctx, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, OnVerify);
+
+ const unsigned char session_id[] = "inspircd";
+ SSL_CTX_set_session_id_context(ctx, session_id, sizeof(session_id) - 1);
}
~Context()
@@ -352,8 +355,11 @@ class OpenSSLIOHook : public SSLIOHook
certinfo->trusted = false;
}
- certinfo->dn = X509_NAME_oneline(X509_get_subject_name(cert),0,0);
- certinfo->issuer = X509_NAME_oneline(X509_get_issuer_name(cert),0,0);
+ char buf[512];
+ X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf));
+ certinfo->dn = buf;
+ X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf));
+ certinfo->issuer = buf;
if (!X509_digest(cert, profile->GetDigest(), md, &n))
{
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index b0be8d665..1a123e580 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -316,7 +316,7 @@ class ModuleBanRedirect : public Module
else
{
user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s :Cannot join channel (You are banned)", chan->name.c_str());
- user->WriteNumeric(470, "%s %s :You are banned from this channel, so you are automatically transfered to the redirected channel.", chan->name.c_str(), redir->targetchan.c_str());
+ user->WriteNumeric(470, "%s %s :You are banned from this channel, so you are automatically transferred to the redirected channel.", chan->name.c_str(), redir->targetchan.c_str());
nofollow = true;
Channel::JoinUser(user, redir->targetchan);
nofollow = false;
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp
index b3c664cf1..8ee8472e6 100644
--- a/src/modules/m_globalload.cpp
+++ b/src/modules/m_globalload.cpp
@@ -153,7 +153,12 @@ class CommandGreloadmodule : public Command
{
Module* m = ServerInstance->Modules->Find(parameters[0]);
if (m)
- ServerInstance->Modules->Reload(m, new GReloadModuleWorker(user->nick, user->uuid, parameters[0]));
+ {
+ GReloadModuleWorker* worker = NULL;
+ if (m != creator)
+ worker = new GReloadModuleWorker(user->nick, user->uuid, parameters[0]);
+ ServerInstance->Modules->Reload(m, worker);
+ }
else
{
user->WriteNumeric(RPL_LOADEDMODULE, "%s :Could not find module by that name", parameters[0].c_str());
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index d0291b8cc..053f4b924 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -104,7 +104,7 @@ class HttpServerSocket : public BufferedSocket
case 300:
return "MULTIPLE CHOICES";
case 301:
- return "MOVED PERMENANTLY";
+ return "MOVED PERMANENTLY";
case 302:
return "FOUND";
case 303:
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index 4fb4ae942..3bf4c8434 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -113,7 +113,8 @@ HideOperWatcher::HideOperWatcher(ModuleOperPrefixMode* parent)
void HideOperWatcher::AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding)
{
- if (IS_LOCAL(dest))
+ // If hideoper is being unset because the user is deopering, don't set +y
+ if (IS_LOCAL(dest) && dest->IsOper())
parentmod->SetOperPrefix(dest, !adding);
}
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp
index 129ad3f7b..14f79aaf7 100644
--- a/src/modules/m_samode.cpp
+++ b/src/modules/m_samode.cpp
@@ -37,6 +37,15 @@ class CommandSamode : public Command
CmdResult Handle (const std::vector<std::string>& parameters, User *user)
{
+ if (parameters[0].c_str()[0] != '#')
+ {
+ User* target = ServerInstance->FindNickOnly(parameters[0]);
+ if ((!target) || (target->registered != REG_ALL))
+ {
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
+ return CMD_FAILURE;
+ }
+ }
User* target = ServerInstance->FindNick(parameters[0]);
if ((target) && (target != user))
{
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp
index 3050e70d6..aa6aa0180 100644
--- a/src/modules/m_saquit.cpp
+++ b/src/modules/m_saquit.cpp
@@ -35,7 +35,7 @@ class CommandSaquit : public Command
CmdResult Handle (const std::vector<std::string>& parameters, User *user)
{
User* dest = ServerInstance->FindNick(parameters[0]);
- if ((dest) && (!IS_SERVER(dest)))
+ if ((dest) && (!IS_SERVER(dest)) && (dest->registered == REG_ALL))
{
if (dest->server->IsULine())
{
diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp
index d7c0cdf1b..1b020701b 100644
--- a/src/modules/m_spanningtree/idle.cpp
+++ b/src/modules/m_spanningtree/idle.cpp
@@ -35,7 +35,7 @@ CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, std::vector<std::string>
*/
User* target = ServerInstance->FindUUID(params[0]);
- if ((!target) || (IS_SERVER(target)))
+ if ((!target) || (IS_SERVER(target) || (target->registered != REG_ALL)))
return CMD_FAILURE;
LocalUser* localtarget = IS_LOCAL(target);
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 9c262f1ea..9da06e829 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -188,7 +188,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
}
else
{
- ServerInstance->SNO->WriteGlobalSno('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason);
+ ServerInstance->SNO->WriteToSnoMask('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason);
}
int num_lost_servers = 0;
int num_lost_users = 0;
@@ -204,8 +204,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
Current->Tidy();
Current->GetParent()->DelChild(Current);
Current->cull();
+ const bool ismyroot = (Current == MyRoot);
delete Current;
- if (Current == MyRoot)
+ if (ismyroot)
{
MyRoot = NULL;
Close();
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp
index 6c7000a77..57ca18a8f 100644
--- a/src/modules/m_watch.cpp
+++ b/src/modules/m_watch.cpp
@@ -231,7 +231,7 @@ class CommandWatch : public Command
}
User* target = ServerInstance->FindNick(nick);
- if (target)
+ if ((target) && (target->registered == REG_ALL))
{
(*wl)[nick] = std::string(target->ident).append(" ").append(target->dhost).append(" ").append(ConvToStr(target->age));
user->WriteNumeric(604, "%s %s :is online", nick, (*wl)[nick].c_str());
@@ -308,10 +308,10 @@ class CommandWatch : public Command
{
for (watchlist::iterator q = wl->begin(); q != wl->end(); q++)
{
- if (!q->second.empty())
+ User* targ = ServerInstance->FindNick(q->first.c_str());
+ if (targ && !q->second.empty())
{
user->WriteNumeric(604, "%s %s :is online", q->first.c_str(), q->second.c_str());
- User *targ = ServerInstance->FindNick(q->first.c_str());
if (targ->IsAway())
{
user->WriteNumeric(609, "%s %s %s %lu :is away", targ->nick.c_str(), targ->ident.c_str(), targ->dhost.c_str(), (unsigned long) targ->awaytime);