Browse Source

Debugging for impersonation

Melanie 4 years ago
parent
commit
b1d7d2a625

+ 1 - 0
.gitignore

@@ -12,6 +12,7 @@
 *.dll.build
 *.dll
 *.log
+.idea
 
 # Ignore .user and .suo files as these are user preference specific
 # http://stackoverflow.com/questions/72298/should-i-add-the-visual-studio-suo-and-user-files-to-source-control

+ 10 - 6
OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs

@@ -115,7 +115,10 @@ namespace OpenSim.Services.AuthenticationService
 
             List<UserAccount> accounts = m_UserAccountService.GetUserAccountsWhere(UUID.Zero, "UserLevel >= 200");
             if (accounts == null || accounts.Count == 0)
+            {
+                m_log.DebugFormat("[PASS AUTH]: No suitable gods found");
                 return String.Empty;
+            }
 
             foreach (UserAccount a in accounts)
             {
@@ -124,6 +127,7 @@ namespace OpenSim.Services.AuthenticationService
                     !data.Data.ContainsKey("passwordHash") ||
                     !data.Data.ContainsKey("passwordSalt"))
                 {
+                    m_log.DebugFormat("[PASS AUTH]: {0} {1} has no suitable password set", a.FirstName, a.LastName);
                     continue;
                 }
 
@@ -138,12 +142,12 @@ namespace OpenSim.Services.AuthenticationService
                     realID = a.PrincipalID;
                     return GetToken(principalID, lifetime);
                 }
-//                else
-//                {
-//                    m_log.DebugFormat(
-//                        "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}.  Authentication failure.",
-//                        hashed, data.Data["passwordHash"], data.PrincipalID);
-//                }
+                else
+                {
+                    m_log.DebugFormat(
+                        "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}.  Authentication failure.",
+                        hashed, data.Data["passwordHash"], data.PrincipalID);
+                }
             }
 
             m_log.DebugFormat("[PASS AUTH]: Impersonation of {0} failed", principalID);