Add CIDR support to TrustedProxy setting

Fix #1219
This commit is contained in:
Alexey Sokolov
2016-12-25 13:00:02 +00:00
parent bd1a71cb29
commit 6fbab7b44c
7 changed files with 116 additions and 107 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ class CUser {
bool AddAllowedHost(const CString& sHostMask);
bool RemAllowedHost(const CString& sHostMask);
void ClearAllowedHosts();
bool IsHostAllowed(const CString& sHostMask) const;
bool IsHostAllowed(const CString& sHost) const;
bool IsValid(CString& sErrMsg, bool bSkipPass = false) const;
static bool IsValidUserName(const CString& sUserName);
static CString MakeCleanUserName(const CString& sUserName);
+5
View File
@@ -83,6 +83,11 @@ class CUtils {
static timeval ParseServerTime(const CString& sTime);
static SCString GetTimezones();
static SCString GetEncodings();
/** CIDR notation checker, e.g. "192.0.2.0/24" or "2001:db8::/32"
*
* For historical reasons also allows wildcards, e.g. "192.168.*"
*/
static bool CheckCIDR(const CString& sIP, const CString& sRange);
/// @deprecated Use CMessage instead
static MCString GetMessageTags(const CString& sLine);