diff options
author | Vincent Sylvester | 2018-04-24 20:57:38 +0200 |
---|---|---|
committer | UbitUmarov | 2018-07-08 13:05:47 +0100 |
commit | 6e3f934c4bc15ade3c2c0d0829a618e552e33b3b (patch) | |
tree | 48a0ff351978b7c9ac18832e70d375f9fe8ef587 /OpenSim | |
parent | update contributors (diff) | |
download | opensim-SC-6e3f934c4bc15ade3c2c0d0829a618e552e33b3b.zip opensim-SC-6e3f934c4bc15ade3c2c0d0829a618e552e33b3b.tar.gz opensim-SC-6e3f934c4bc15ade3c2c0d0829a618e552e33b3b.tar.bz2 opensim-SC-6e3f934c4bc15ade3c2c0d0829a618e552e33b3b.tar.xz |
Add mac banning
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/HypergridService/GatekeeperService.cs | 16 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 5c6abd2..019bab8 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Services.HypergridService | |||
62 | 62 | ||
63 | private static string m_AllowedClients = string.Empty; | 63 | private static string m_AllowedClients = string.Empty; |
64 | private static string m_DeniedClients = string.Empty; | 64 | private static string m_DeniedClients = string.Empty; |
65 | private static string m_DeniedMacs = string.Empty; | ||
65 | private static bool m_ForeignAgentsAllowed = true; | 66 | private static bool m_ForeignAgentsAllowed = true; |
66 | private static List<string> m_ForeignsAllowedExceptions = new List<string>(); | 67 | private static List<string> m_ForeignsAllowedExceptions = new List<string>(); |
67 | private static List<string> m_ForeignsDisallowedExceptions = new List<string>(); | 68 | private static List<string> m_ForeignsDisallowedExceptions = new List<string>(); |
@@ -137,6 +138,8 @@ namespace OpenSim.Services.HypergridService | |||
137 | config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); | 138 | config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); |
138 | m_DeniedClients = Util.GetConfigVarFromSections<string>( | 139 | m_DeniedClients = Util.GetConfigVarFromSections<string>( |
139 | config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); | 140 | config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); |
141 | m_DeniedMacs = Util.GetConfigVarFromSections<string>( | ||
142 | config, "DeniedMacs", possibleAccessControlConfigSections, string.Empty); | ||
140 | m_ForeignAgentsAllowed = serverConfig.GetBoolean("ForeignAgentsAllowed", true); | 143 | m_ForeignAgentsAllowed = serverConfig.GetBoolean("ForeignAgentsAllowed", true); |
141 | 144 | ||
142 | LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions); | 145 | LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions); |
@@ -275,6 +278,8 @@ namespace OpenSim.Services.HypergridService | |||
275 | (source == null) ? "Unknown" : string.Format("{0} ({1}){2}", source.RegionName, source.RegionID, (source.RawServerURI == null) ? "" : " @ " + source.ServerURI)); | 278 | (source == null) ? "Unknown" : string.Format("{0} ({1}){2}", source.RegionName, source.RegionID, (source.RawServerURI == null) ? "" : " @ " + source.ServerURI)); |
276 | 279 | ||
277 | string curViewer = Util.GetViewerName(aCircuit); | 280 | string curViewer = Util.GetViewerName(aCircuit); |
281 | string curMac = aCircuit.Mac.ToString(); | ||
282 | |||
278 | 283 | ||
279 | // | 284 | // |
280 | // Check client | 285 | // Check client |
@@ -304,6 +309,17 @@ namespace OpenSim.Services.HypergridService | |||
304 | return false; | 309 | return false; |
305 | } | 310 | } |
306 | } | 311 | } |
312 | |||
313 | if (m_DeniedMacs != string.Empty) | ||
314 | { | ||
315 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Checking users Mac {0} against list of denied macs {1} ...", curMac, m_DeniedMacs); | ||
316 | if (m_DeniedMacs.Contains(curMac)) | ||
317 | { | ||
318 | reason = "Login failed: client with Mac " + curMac + " is denied"; | ||
319 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client with mac {0} is denied", curMac); | ||
320 | return false; | ||
321 | } | ||
322 | } | ||
307 | 323 | ||
308 | // | 324 | // |
309 | // Authenticate the user | 325 | // Authenticate the user |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 3ccdc9c..e2cb5d0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -88,6 +88,7 @@ namespace OpenSim.Services.LLLoginService | |||
88 | protected string m_AvatarPicker; | 88 | protected string m_AvatarPicker; |
89 | protected string m_AllowedClients; | 89 | protected string m_AllowedClients; |
90 | protected string m_DeniedClients; | 90 | protected string m_DeniedClients; |
91 | protected string m_DeniedMacs; | ||
91 | protected string m_MessageUrl; | 92 | protected string m_MessageUrl; |
92 | protected string m_DSTZone; | 93 | protected string m_DSTZone; |
93 | protected bool m_allowDuplicatePresences = false; | 94 | protected bool m_allowDuplicatePresences = false; |
@@ -134,6 +135,8 @@ namespace OpenSim.Services.LLLoginService | |||
134 | config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); | 135 | config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); |
135 | m_DeniedClients = Util.GetConfigVarFromSections<string>( | 136 | m_DeniedClients = Util.GetConfigVarFromSections<string>( |
136 | config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); | 137 | config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); |
138 | m_DeniedMacs = Util.GetConfigVarFromSections<string>( | ||
139 | config, "DeniedMacs", possibleAccessControlConfigSections, string.Empty); | ||
137 | 140 | ||
138 | m_MessageUrl = m_LoginServerConfig.GetString("MessageUrl", string.Empty); | 141 | m_MessageUrl = m_LoginServerConfig.GetString("MessageUrl", string.Empty); |
139 | m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); | 142 | m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); |
@@ -290,6 +293,8 @@ namespace OpenSim.Services.LLLoginService | |||
290 | 293 | ||
291 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ", | 294 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ", |
292 | firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString()); | 295 | firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString()); |
296 | |||
297 | string curMac = mac.ToString(); | ||
293 | 298 | ||
294 | try | 299 | try |
295 | { | 300 | { |
@@ -323,6 +328,17 @@ namespace OpenSim.Services.LLLoginService | |||
323 | return LLFailedLoginResponse.LoginBlockedProblem; | 328 | return LLFailedLoginResponse.LoginBlockedProblem; |
324 | } | 329 | } |
325 | } | 330 | } |
331 | |||
332 | if (m_DeniedMacs != string.Empty) | ||
333 | { | ||
334 | m_log.InfoFormat("[LLOGIN SERVICE]: Checking users Mac {0} against list of denied macs {1} ...", curMac, m_DeniedMacs); | ||
335 | if (m_DeniedMacs.Contains(curMac)) | ||
336 | { | ||
337 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client with mac {0} is denied", curMac); | ||
338 | return LLFailedLoginResponse.LoginBlockedProblem; | ||
339 | } | ||
340 | } | ||
341 | |||
326 | 342 | ||
327 | // | 343 | // |
328 | // Get the account and check that it exists | 344 | // Get the account and check that it exists |