diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index 25956d5b09..d1db064dc1 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -113,7 +113,28 @@ namespace OpenSim.Data.MySQL m_dataSet = new DataSet(); this.persistPrimInventories = persistPrimInventories; - m_log.Info("[REGION DB]: MySql - connecting: " + m_connectionString); + int passPosition = 0; + int passEndPosition = 0; + string displayConnectionString = null; + + try + { // hide the password in the connection string + passPosition = m_connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase); + passPosition = m_connectionString.IndexOf("=", passPosition); + if (passPosition < m_connectionString.Length) + passPosition += 1; + passEndPosition = m_connectionString.IndexOf(";", passPosition); + + displayConnectionString = m_connectionString.Substring(0, passPosition); + displayConnectionString += "***"; + displayConnectionString += m_connectionString.Substring(passEndPosition, m_connectionString.Length - passEndPosition); + } + catch (Exception e ) + { + m_log.Debug("Exception: password not found in connection string\n" + e.ToString()); + } + + m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); m_connection = new MySqlConnection(m_connectionString); m_connection.Open(); diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index eeff31b21c..052c40484c 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -59,9 +59,32 @@ namespace OpenSim.Data.MySQL public void Initialise(string connectionString) { - m_connectionString = connectionString; + m_connectionString = connectionString; + + int passPosition = 0; + int passEndPosition = 0; + string displayConnectionString = null; + + try + { // hide the password in the connection string + passPosition = m_connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase); + passPosition = m_connectionString.IndexOf("=", passPosition); + if (passPosition < m_connectionString.Length) + passPosition += 1; + passEndPosition = m_connectionString.IndexOf(";", passPosition); + + displayConnectionString = m_connectionString.Substring(0, passPosition); + displayConnectionString += "***"; + displayConnectionString += m_connectionString.Substring(passEndPosition, m_connectionString.Length - passEndPosition); + } + catch (Exception e) + { + m_log.Debug("Exception: password not found in connection string\n" + e.ToString()); + } + + m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString); - m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); + //m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString); m_connection = new MySqlConnection(m_connectionString); m_connection.Open();