aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLEstateData.cs
diff options
context:
space:
mode:
authorDahlia Trimble2008-07-18 03:23:40 +0000
committerDahlia Trimble2008-07-18 03:23:40 +0000
commit230a7ecaec47f5891f39a8893f7587e86a2efb41 (patch)
treeb5e4988656045f4a6d6b061e75df4531b28e43b3 /OpenSim/Data/MySQL/MySQLEstateData.cs
parentPatch #9151 (diff)
downloadopensim-SC_OLD-230a7ecaec47f5891f39a8893f7587e86a2efb41.zip
opensim-SC_OLD-230a7ecaec47f5891f39a8893f7587e86a2efb41.tar.gz
opensim-SC_OLD-230a7ecaec47f5891f39a8893f7587e86a2efb41.tar.bz2
opensim-SC_OLD-230a7ecaec47f5891f39a8893f7587e86a2efb41.tar.xz
masks MySQL password from console startup messages
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLEstateData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index eeff31b..052c404 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -59,9 +59,32 @@ namespace OpenSim.Data.MySQL
59 59
60 public void Initialise(string connectionString) 60 public void Initialise(string connectionString)
61 { 61 {
62 m_connectionString = connectionString; 62 m_connectionString = connectionString;
63
64 int passPosition = 0;
65 int passEndPosition = 0;
66 string displayConnectionString = null;
67
68 try
69 { // hide the password in the connection string
70 passPosition = m_connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase);
71 passPosition = m_connectionString.IndexOf("=", passPosition);
72 if (passPosition < m_connectionString.Length)
73 passPosition += 1;
74 passEndPosition = m_connectionString.IndexOf(";", passPosition);
75
76 displayConnectionString = m_connectionString.Substring(0, passPosition);
77 displayConnectionString += "***";
78 displayConnectionString += m_connectionString.Substring(passEndPosition, m_connectionString.Length - passEndPosition);
79 }
80 catch (Exception e)
81 {
82 m_log.Debug("Exception: password not found in connection string\n" + e.ToString());
83 }
84
85 m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString);
63 86
64 m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); 87 //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString);
65 88
66 m_connection = new MySqlConnection(m_connectionString); 89 m_connection = new MySqlConnection(m_connectionString);
67 m_connection.Open(); 90 m_connection.Open();