diff options
author | Oren Hurvitz | 2013-12-08 16:50:24 +0200 |
---|---|---|
committer | Oren Hurvitz | 2014-03-24 12:26:52 +0100 |
commit | 921f0052f43e0e4553e970a8d560c5635fcd3ca6 (patch) | |
tree | 10bc5c8041c355adaef139d6d23f6f62e95f6bdf /OpenSim/Services/HypergridService/GatekeeperService.cs | |
parent | Better error messages (diff) | |
download | opensim-SC_OLD-921f0052f43e0e4553e970a8d560c5635fcd3ca6.zip opensim-SC_OLD-921f0052f43e0e4553e970a8d560c5635fcd3ca6.tar.gz opensim-SC_OLD-921f0052f43e0e4553e970a8d560c5635fcd3ca6.tar.bz2 opensim-SC_OLD-921f0052f43e0e4553e970a8d560c5635fcd3ca6.tar.xz |
Get the full viewer name even if it's (incorrectly) sent in the 'Channel' field
Recent versions of Firestorm and Singularity have started sending the viewer name in the 'Channel' field, leaving only their version number in the 'Viewer' field. So we need to search both of these fields for the viewer name.
This resolves http://opensimulator.org/mantis/view.php?id=6952
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/HypergridService/GatekeeperService.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index f6136b5..7a0228b 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -228,17 +228,19 @@ namespace OpenSim.Services.HypergridService | |||
228 | aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, | 228 | aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, |
229 | aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString()); | 229 | aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString()); |
230 | 230 | ||
231 | string curViewer = Util.GetViewerName(aCircuit); | ||
232 | |||
231 | // | 233 | // |
232 | // Check client | 234 | // Check client |
233 | // | 235 | // |
234 | if (m_AllowedClients != string.Empty) | 236 | if (m_AllowedClients != string.Empty) |
235 | { | 237 | { |
236 | Regex arx = new Regex(m_AllowedClients); | 238 | Regex arx = new Regex(m_AllowedClients); |
237 | Match am = arx.Match(aCircuit.Viewer); | 239 | Match am = arx.Match(curViewer); |
238 | 240 | ||
239 | if (!am.Success) | 241 | if (!am.Success) |
240 | { | 242 | { |
241 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", aCircuit.Viewer); | 243 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", curViewer); |
242 | return false; | 244 | return false; |
243 | } | 245 | } |
244 | } | 246 | } |
@@ -246,11 +248,11 @@ namespace OpenSim.Services.HypergridService | |||
246 | if (m_DeniedClients != string.Empty) | 248 | if (m_DeniedClients != string.Empty) |
247 | { | 249 | { |
248 | Regex drx = new Regex(m_DeniedClients); | 250 | Regex drx = new Regex(m_DeniedClients); |
249 | Match dm = drx.Match(aCircuit.Viewer); | 251 | Match dm = drx.Match(curViewer); |
250 | 252 | ||
251 | if (dm.Success) | 253 | if (dm.Success) |
252 | { | 254 | { |
253 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", aCircuit.Viewer); | 255 | m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", curViewer); |
254 | return false; | 256 | return false; |
255 | } | 257 | } |
256 | } | 258 | } |