From f9a2fbed83a33a5734fbd566f356b1fb67dd2c11 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 9 Nov 2018 15:22:15 +0000 Subject: [PATCH] mantis 8396: on access control, change viewer string to match so it does include the viewer name, not just version --- OpenSim/Services/LLLoginService/LLLoginService.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index d7cade5141..647bdb8558 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -301,16 +301,22 @@ namespace OpenSim.Services.LLLoginService // // Check client // + string clientNameToCheck; + if(clientVersion.Contains(" ")) + clientNameToCheck = clientVersion; + else + clientNameToCheck = channel + " " + clientVersion; + if (!String.IsNullOrWhiteSpace(m_AllowedClients)) { Regex arx = new Regex(m_AllowedClients); - Match am = arx.Match(clientVersion); + Match am = arx.Match(clientNameToCheck); if (!am.Success) { m_log.InfoFormat( "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: client {2} is not allowed", - firstName, lastName, clientVersion); + firstName, lastName, clientNameToCheck); return LLFailedLoginResponse.LoginBlockedProblem; } } @@ -318,13 +324,13 @@ namespace OpenSim.Services.LLLoginService if (!String.IsNullOrWhiteSpace(m_DeniedClients)) { Regex drx = new Regex(m_DeniedClients); - Match dm = drx.Match(clientVersion); + Match dm = drx.Match(clientNameToCheck); if (dm.Success) { m_log.InfoFormat( "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: client {2} is denied", - firstName, lastName, clientVersion); + firstName, lastName, clientNameToCheck); return LLFailedLoginResponse.LoginBlockedProblem; } }