summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_dccallow.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index 22df5aa7e..c2febadce 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -340,23 +340,26 @@ class ModuleDCCAllow : public Module
std::string defaultaction = Conf->ReadValue("dccallow", "action", 0);
std::string filename = tokens[2];
- if (defaultaction == "allow")
- return 0;
-
+ bool found = false;
for (unsigned int i = 0; i < bfl.size(); i++)
{
if (InspIRCd::Match(filename, bfl[i].filemask, ascii_case_insensitive_map))
{
+ /* We have a matching badfile entry, override whatever the default action is */
if (bfl[i].action == "allow")
return 0;
- }
- else
- {
- if (defaultaction == "allow")
- return 0;
+ else
+ {
+ found = true;
+ break;
+ }
}
}
+ /* only follow the default action if no badfile matches were found above */
+ if ((!found) && (defaultaction == "allow"))
+ return 0;
+
user->WriteServ("NOTICE %s :The user %s is not accepting DCC SENDs from you. Your file %s was not sent.", user->nick.c_str(), u->nick.c_str(), filename.c_str());
u->WriteServ("NOTICE %s :%s (%s@%s) attempted to send you a file named %s, which was blocked.", u->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), filename.c_str());
u->WriteServ("NOTICE %s :If you trust %s and were expecting this, you can type /DCCALLOW HELP for information on the DCCALLOW system.", u->nick.c_str(), user->nick.c_str());