aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLDataStore.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/MySQLDataStore.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/MySQLDataStore.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index 25956d5..d1db064 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -113,7 +113,28 @@ namespace OpenSim.Data.MySQL
113 m_dataSet = new DataSet(); 113 m_dataSet = new DataSet();
114 this.persistPrimInventories = persistPrimInventories; 114 this.persistPrimInventories = persistPrimInventories;
115 115
116 m_log.Info("[REGION DB]: MySql - connecting: " + m_connectionString); 116 int passPosition = 0;
117 int passEndPosition = 0;
118 string displayConnectionString = null;
119
120 try
121 { // hide the password in the connection string
122 passPosition = m_connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase);
123 passPosition = m_connectionString.IndexOf("=", passPosition);
124 if (passPosition < m_connectionString.Length)
125 passPosition += 1;
126 passEndPosition = m_connectionString.IndexOf(";", passPosition);
127
128 displayConnectionString = m_connectionString.Substring(0, passPosition);
129 displayConnectionString += "***";
130 displayConnectionString += m_connectionString.Substring(passEndPosition, m_connectionString.Length - passEndPosition);
131 }
132 catch (Exception e )
133 {
134 m_log.Debug("Exception: password not found in connection string\n" + e.ToString());
135 }
136
137 m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString);
117 m_connection = new MySqlConnection(m_connectionString); 138 m_connection = new MySqlConnection(m_connectionString);
118 m_connection.Open(); 139 m_connection.Open();
119 140