summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/account.h4
-rw-r--r--src/modules/extra/README3
-rw-r--r--src/modules/extra/m_ldapauth.cpp21
-rw-r--r--src/modules/hash.h4
-rw-r--r--src/modules/httpd.h4
-rw-r--r--src/modules/m_cap.h4
-rw-r--r--src/modules/m_regex.h4
-rw-r--r--src/modules/m_spanningtree/cachetimer.h4
-rw-r--r--src/modules/m_spanningtree/commands.h4
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp1
-rw-r--r--src/modules/m_spanningtree/link.h4
-rw-r--r--src/modules/m_spanningtree/main.h4
-rw-r--r--src/modules/m_spanningtree/protocolinterface.h4
-rw-r--r--src/modules/m_spanningtree/resolvers.h4
-rw-r--r--src/modules/m_spanningtree/treeserver.h4
-rw-r--r--src/modules/m_spanningtree/treesocket.h4
-rw-r--r--src/modules/m_spanningtree/utils.h4
-rw-r--r--src/modules/sasl.h4
-rw-r--r--src/modules/spanningtree.h4
-rw-r--r--src/modules/ssl.h4
20 files changed, 56 insertions, 37 deletions
diff --git a/src/modules/account.h b/src/modules/account.h
index 8f4631cc8..77f84ec4d 100644
--- a/src/modules/account.h
+++ b/src/modules/account.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __ACCOUNT_H__
-#define __ACCOUNT_H__
+#ifndef ACCOUNT_H
+#define ACCOUNT_H
#include <map>
#include <string>
diff --git a/src/modules/extra/README b/src/modules/extra/README
index 6dc9bb18a..2478b57cf 100644
--- a/src/modules/extra/README
+++ b/src/modules/extra/README
@@ -3,8 +3,7 @@ For example, m_filter_pcre requires the PCRE libraries.
To compile any of these modules first ensure you have the required dependencies
(read the online documentation at http://wiki.inspircd.org/) and then symlink
-the .cpp file from this directory into the parent directory (src/modules/) and
-re-configure your inspircd with ./configure -modupdate to detect the new module.
+the .cpp file from this directory into the parent directory (src/modules/).
Alternatively, use the command: ./configure --enable-extras=m_extra.cpp, which will
automatically take care of symlinking the module of that name and any headers it needs
diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp
index 4fae7a2e7..a3d80b8f3 100644
--- a/src/modules/extra/m_ldapauth.cpp
+++ b/src/modules/extra/m_ldapauth.cpp
@@ -46,6 +46,7 @@ class ModuleLDAPAuth : public Module
std::string killreason;
std::string username;
std::string password;
+ std::vector<std::string> whitelistedcidrs;
int searchscope;
bool verbose;
bool useusername;
@@ -73,6 +74,7 @@ public:
void OnRehash(User* user)
{
ConfigReader Conf;
+ whitelistedcidrs.clear();
base = Conf.ReadValue("ldapauth", "baserdn", 0);
attribute = Conf.ReadValue("ldapauth", "attribute", 0);
@@ -85,6 +87,16 @@ public:
verbose = Conf.ReadFlag("ldapauth", "verbose", 0); /* Set to true if failed connects should be reported to operators */
useusername = Conf.ReadFlag("ldapauth", "userfield", 0);
+ ConfigTagList whitelisttags = ServerInstance->Config->ConfTags("ldapwhitelist");
+
+ for (ConfigIter i = whitelisttags.first; i != whitelisttags.second; ++i)
+ {
+ std::string cidr = i->second->getString("cidr");
+ if (!cidr.empty()) {
+ whitelistedcidrs.push_back(cidr);
+ }
+ }
+
if (scope == "base")
searchscope = LDAP_SCOPE_BASE;
else if (scope == "onelevel")
@@ -128,6 +140,15 @@ public:
return MOD_RES_PASSTHRU;
}
+ for (std::vector<std::string>::iterator i = whitelistedcidrs.begin(); i != whitelistedcidrs.end(); i++)
+ {
+ if (InspIRCd::MatchCIDR(user->GetIPString(), *i, ascii_case_insensitive_map))
+ {
+ ldapAuthed.set(user,1);
+ return MOD_RES_PASSTHRU;
+ }
+ }
+
if (!CheckCredentials(user))
{
ServerInstance->Users->QuitUser(user, killreason);
diff --git a/src/modules/hash.h b/src/modules/hash.h
index 7e93f0ddc..c2b8abfd1 100644
--- a/src/modules/hash.h
+++ b/src/modules/hash.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __HASH_H__
-#define __HASH_H__
+#ifndef HASH_H
+#define HASH_H
#include "modules.h"
diff --git a/src/modules/httpd.h b/src/modules/httpd.h
index 40e619ea3..18876be20 100644
--- a/src/modules/httpd.h
+++ b/src/modules/httpd.h
@@ -13,8 +13,8 @@
#include "base.h"
-#ifndef __HTTPD_H__
-#define __HTTPD_H__
+#ifndef HTTPD_H
+#define HTTPD_H
#include <string>
#include <sstream>
diff --git a/src/modules/m_cap.h b/src/modules/m_cap.h
index d2d094c85..919075a0a 100644
--- a/src/modules/m_cap.h
+++ b/src/modules/m_cap.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __CAP_H__
-#define __CAP_H__
+#ifndef M_CAP_H
+#define M_CAP_H
#include <map>
#include <string>
diff --git a/src/modules/m_regex.h b/src/modules/m_regex.h
index 523f9f0d3..fc196fac1 100644
--- a/src/modules/m_regex.h
+++ b/src/modules/m_regex.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef _M_REGEX_H
-#define _M_REGEX_H
+#ifndef M_REGEX_H
+#define M_REGEX_H
#include "inspircd.h"
diff --git a/src/modules/m_spanningtree/cachetimer.h b/src/modules/m_spanningtree/cachetimer.h
index 2ed6c9fff..7b68f5779 100644
--- a/src/modules/m_spanningtree/cachetimer.h
+++ b/src/modules/m_spanningtree/cachetimer.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __TIMESYNC_H__
-#define __TIMESYNC_H__
+#ifndef M_SPANNINGTREE_CACHETIMER_H
+#define M_SPANNINGTREE_CACHETIMER_H
#include "timer.h"
diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h
index 09591b4e4..358acaa29 100644
--- a/src/modules/m_spanningtree/commands.h
+++ b/src/modules/m_spanningtree/commands.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __COMMANDS_H__
-#define __COMMANDS_H__
+#ifndef M_SPANNINGTREE_COMMANDS_H
+#define M_SPANNINGTREE_COMMANDS_H
#include "main.h"
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index ea217b398..8846b2fbc 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -93,7 +93,6 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
parameterlist param_list;
if (Utils->AnnounceTSChange)
chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), channel.c_str(), (unsigned long) ourTS, (unsigned long) TS);
- ourTS = TS;
// while the name is equal in case-insensitive compare, it might differ in case; use the remote version
chan->name = channel;
chan->age = TS;
diff --git a/src/modules/m_spanningtree/link.h b/src/modules/m_spanningtree/link.h
index c60cb0bb7..942389167 100644
--- a/src/modules/m_spanningtree/link.h
+++ b/src/modules/m_spanningtree/link.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __LINK_H__
-#define __LINK_H__
+#ifndef M_SPANNINGTREE_LINK_H
+#define M_SPANNINGTREE_LINK_H
class Link : public refcountbase
{
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index ce7709189..735c31049 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __ST_MAIN__
-#define __ST_MAIN__
+#ifndef M_SPANNINGTREE_MAIN_H
+#define M_SPANNINGTREE_MAIN_H
#include "inspircd.h"
#include <stdarg.h>
diff --git a/src/modules/m_spanningtree/protocolinterface.h b/src/modules/m_spanningtree/protocolinterface.h
index 762946901..7559897bd 100644
--- a/src/modules/m_spanningtree/protocolinterface.h
+++ b/src/modules/m_spanningtree/protocolinterface.h
@@ -1,5 +1,5 @@
-#ifndef _SPANNINGTREE_PROTOCOL_INT_
-#define _SPANNINGTREE_PROTOCOL_INT_
+#ifndef M_SPANNINGTREE_PROTOCOLINTERFACE_H
+#define M_SPANNINGTREE_PROTOCOLINTERFACE_H
class SpanningTreeUtilities;
class ModuleSpanningTree;
diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h
index 348debe47..af22331f1 100644
--- a/src/modules/m_spanningtree/resolvers.h
+++ b/src/modules/m_spanningtree/resolvers.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __RESOLVERS__H__
-#define __RESOLVERS__H__
+#ifndef M_SPANNINGTREE_RESOLVERS_H
+#define M_SPANNINGTREE_RESOLVERS_H
#include "socket.h"
#include "inspircd.h"
diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h
index 7eb19d9a1..65d095c5a 100644
--- a/src/modules/m_spanningtree/treeserver.h
+++ b/src/modules/m_spanningtree/treeserver.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __TREESERVER_H__
-#define __TREESERVER_H__
+#ifndef M_SPANNINGTREE_TREESERVER_H
+#define M_SPANNINGTREE_TREESERVER_H
#include "treesocket.h"
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index 2ad4d68af..80f9e0798 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __TREESOCKET_H__
-#define __TREESOCKET_H__
+#ifndef M_SPANNINGTREE_TREESOCKET_H
+#define M_SPANNINGTREE_TREESOCKET_H
#include "socket.h"
#include "inspircd.h"
diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h
index 2e527ae12..2543eb04f 100644
--- a/src/modules/m_spanningtree/utils.h
+++ b/src/modules/m_spanningtree/utils.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __ST__UTIL__
-#define __ST__UTIL__
+#ifndef M_SPANNINGTREE_UTILS_H
+#define M_SPANNINGTREE_UTILS_H
#include "inspircd.h"
diff --git a/src/modules/sasl.h b/src/modules/sasl.h
index 9abfc558a..927a4fb02 100644
--- a/src/modules/sasl.h
+++ b/src/modules/sasl.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __SASL_H__
-#define __SASL_H__
+#ifndef SASL_H
+#define SASL_H
class SASLFallback : public Event
{
diff --git a/src/modules/spanningtree.h b/src/modules/spanningtree.h
index ec3c36214..8a38d5588 100644
--- a/src/modules/spanningtree.h
+++ b/src/modules/spanningtree.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __SPANNINGTREE_H__
-#define __SPANNINGTREE_H__
+#ifndef SPANNINGTREE_H
+#define SPANNINGTREE_H
struct AddServerEvent : public Event
{
diff --git a/src/modules/ssl.h b/src/modules/ssl.h
index e66e423aa..060c64a0e 100644
--- a/src/modules/ssl.h
+++ b/src/modules/ssl.h
@@ -11,8 +11,8 @@
* ---------------------------------------------------
*/
-#ifndef __SSL_H__
-#define __SSL_H__
+#ifndef SSL_H
+#define SSL_H
#include <map>
#include <string>