From 63b02b8c97e73d5a1fc7005e9693a954179ded0d Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 13 May 2014 22:57:53 -0400 Subject: Sanitize nuh masks more to prevent the other side from rewriting them, which screws with our internal tracking of them --- include/modes.h | 10 ++++++---- include/protocol.h | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/modes.h b/include/modes.h index 3ba54c439..d1dc4624e 100644 --- a/include/modes.h +++ b/include/modes.h @@ -88,7 +88,7 @@ class CoreExport UserModeParam : public UserMode * @param value The param * @return true or false */ - virtual bool IsValid(const Anope::string &value) const { return true; } + virtual bool IsValid(Anope::string &value) const { return true; } }; /** This class is a channel mode, all channel modes use this/inherit from this @@ -135,7 +135,7 @@ class CoreExport ChannelModeList : public ChannelMode * @param mask The mask * @return true for yes, false for no */ - virtual bool IsValid(const Anope::string &mask) const { return true; } + virtual bool IsValid(Anope::string &mask) const; /** Checks if mask affects user * Should only be used for extbans or other weird ircd-specific things. @@ -177,7 +177,7 @@ class CoreExport ChannelModeParam : public ChannelMode * @param value The param * @return true for yes, false for no */ - virtual bool IsValid(const Anope::string &value) const { return true; } + virtual bool IsValid(Anope::string &value) const { return true; } }; /** This is a mode that is a channel status, eg +v/h/o/a/q. @@ -259,7 +259,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam public: ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { } - bool IsValid(const Anope::string &value) const anope_override; + bool IsValid(Anope::string &value) const anope_override; }; /** This class is used for oper only channel modes @@ -404,6 +404,8 @@ class CoreExport Entry */ const Anope::string GetMask() const; + const Anope::string GetNUHMask() const; + /** Check if this entry matches a user * @param u The user * @param full True to match against a users real host and IP diff --git a/include/protocol.h b/include/protocol.h index 8f4f2ea58..48520ca43 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -232,6 +232,8 @@ class CoreExport IRCDProto : public Service * Defaults to Config->ListSize */ virtual unsigned GetMaxListFor(Channel *c); + + virtual Anope::string NormalizeMask(const Anope::string &mask); }; class CoreExport MessageSource -- cgit