List:Internals« Previous MessageNext Message »
From:rburnett Date:August 24 2005 3:21pm
Subject:Connector/NET commit: r162 - in branches/1.0: . mysqlclient mysqlclient/common
View as plain text  
Modified:
   branches/1.0/CHANGES
   branches/1.0/MySQLClient.sln
   branches/1.0/Package.build
   branches/1.0/README
   branches/1.0/mysqlclient/Connection.cs
   branches/1.0/mysqlclient/ConnectionString.cs
   branches/1.0/mysqlclient/MySqlPoolManager.cs
   branches/1.0/mysqlclient/common/DBConnectionString.cs
Log:
* Fixed connection string handling so the password is only removed if PersistSecurityInfo=false _AND_ the connection is open or has been Open
* Updated the changlog and readme file 


Modified: branches/1.0/CHANGES
===================================================================
--- branches/1.0/CHANGES	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/CHANGES	2005-08-24 15:21:19 UTC (rev 162)
@@ -1,3 +1,5 @@
+8-24-05 - Version 1.0.4  
+
 	Bugs fixed or addressed
 	-------------------------
 	Bug #8667  	OUT parameters are not being valued [fixed]
@@ -40,6 +42,9 @@
     Bug #12245  using Prepare() on an insert command causes null parameters to convert to "0"	
 	Bug #12646  Parameters are defaulted to Decimal [added a new test case]
 	Bug #12628 	off by one on random selection of multiple hosts/ip addresses [fixed]
+	Bug #12551 	Error at the ConnectionString - Property [fixed]
+	Bug #8724 	NullReferenceException in Designer [fixed]
+	Bug #12771 	Connector/Net can't connect to MySQL 4.1.14-nt [fixed]
 
 	Other changes
 	-------------

Modified: branches/1.0/MySQLClient.sln
===================================================================
--- branches/1.0/MySQLClient.sln	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/MySQLClient.sln	2005-08-24 15:21:19 UTC (rev 162)
@@ -8,6 +8,10 @@
 		{5EAEFBC4-8389-4120-BAB3-9B27174F6F6F} = {5EAEFBC4-8389-4120-BAB3-9B27174F6F6F}
 	EndProjectSection
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dummy2", "c:\Dummy2\Dummy2.csproj", "{D3A251D7-83F1-433E-9EC9-1C514D02C08E}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfiguration) = preSolution
 		Debug = Debug
@@ -22,6 +26,10 @@
 		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Debug.Build.0 = Debug|.NET
 		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Release.ActiveCfg = Release|.NET
 		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Release.Build.0 = Release|.NET
+		{D3A251D7-83F1-433E-9EC9-1C514D02C08E}.Debug.ActiveCfg = Debug|.NET
+		{D3A251D7-83F1-433E-9EC9-1C514D02C08E}.Debug.Build.0 = Debug|.NET
+		{D3A251D7-83F1-433E-9EC9-1C514D02C08E}.Release.ActiveCfg = Release|.NET
+		{D3A251D7-83F1-433E-9EC9-1C514D02C08E}.Release.Build.0 = Release|.NET
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 	EndGlobalSection

Modified: branches/1.0/Package.build
===================================================================
--- branches/1.0/Package.build	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/Package.build	2005-08-24 15:21:19 UTC (rev 162)
@@ -22,8 +22,8 @@
 	</fileset>
 
 	<!-- first remove all previous packages -->
-<!--	<delete dir="packages" failonerror="false"/>
-	<mkdir dir="packages"/>	-->
+	<delete dir="packages" failonerror="false"/>
+	<mkdir dir="packages"/>
 
 
 
@@ -115,7 +115,7 @@
     </target>
     
     <!-- verification targets -->
-	<target name="VerifyAll">
+	<target name="VerifyAll" depends="all">
 		<property name="licenseFile" value="gpl-banner.txt"/>
 		<property name="package" value="mysql-connector-net-${ver}"/>
 		<call target="VerifyPackage"/>

Modified: branches/1.0/README
===================================================================
--- branches/1.0/README	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/README	2005-08-24 15:21:19 UTC (rev 162)
@@ -1,6 +1,6 @@
-MySQL Connector/Net 1.0.4 (formerly ByteFX.Data)
+MySQL Connector/Net 1.0.5
 MySQL AB's ADO.Net Driver for MySQL
-Copyright (c) 2004 MySQL AB
+Copyright (c) 2004-2005 MySQL AB
 
 CONTENTS
 

Modified: branches/1.0/mysqlclient/Connection.cs
===================================================================
--- branches/1.0/mysqlclient/Connection.cs	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/mysqlclient/Connection.cs	2005-08-24 15:21:19 UTC (rev 162)
@@ -38,6 +38,7 @@
 		internal Driver						driver;
 		private  MySqlDataReader			dataReader;
 		private  MySqlConnectionString		settings;
+		private  bool						hasBeenOpen;
 
 		/// <include file='docs/MySqlConnection.xml' path='docs/StateChange/*'/>
 		public event StateChangeEventHandler		StateChange;
@@ -170,7 +171,7 @@
 			{
 				// Always return exactly what the user set.
 				// Security-sensitive information may be removed.
-				return settings.GetConnectionString();
+				return settings.GetConnectionString(!hasBeenOpen);
 			}
 			set
 			{
@@ -304,6 +305,7 @@
 			driver.Configure(this);
 			if (settings.Database != null && settings.Database.Length != 0)
 				ChangeDatabase(settings.Database);
+			hasBeenOpen = true;
 		}
 
 		internal void Terminate()

Modified: branches/1.0/mysqlclient/ConnectionString.cs
===================================================================
--- branches/1.0/mysqlclient/ConnectionString.cs	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/mysqlclient/ConnectionString.cs	2005-08-24 15:21:19 UTC (rev 162)
@@ -265,10 +265,16 @@
 		/// stripping out the password info
 		/// </summary>
 		/// <returns></returns>
-		public string GetConnectionString()
+		public string GetConnectionString(bool includePass)
 		{
-			if (connectString == null) return CreateConnectionString();
+			if (connectString == null) return String.Empty;//CreateConnectionString();
 
+			string connStr = connectString;
+			if (! PersistSecurityInfo && !includePass)
+				connStr = RemovePassword(connStr);
+
+			return connStr;
+/*
 			StringBuilder str = new StringBuilder();
 			Hashtable ht = ParseKeyValuePairs( connectString );
 
@@ -281,9 +287,15 @@
 			if (str.Length > 0)
 				str.Remove( str.Length-1, 1 );
 
-			return str.ToString();
+			return str.ToString();*/
 		}
 
+
+		private string RemovePassword(string connStr)
+		{
+			return RemoveKeys(connStr, new string[2] { "password", "pwd" });
+		}
+
 		/// <summary>
 		/// Uses the values in the keyValues hash to create a
 		/// connection string

Modified: branches/1.0/mysqlclient/MySqlPoolManager.cs
===================================================================
--- branches/1.0/mysqlclient/MySqlPoolManager.cs	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/mysqlclient/MySqlPoolManager.cs	2005-08-24 15:21:19 UTC (rev 162)
@@ -43,13 +43,13 @@
 			pools = new Hashtable();
 		}
 
-		public static Driver GetConnection( MySqlConnectionString settings ) 
+		public static Driver GetConnection(MySqlConnectionString settings) 
 		{
 			// make sure the manager is initialized
 			if (MySqlPoolManager.pools == null)
 				MySqlPoolManager.Initialize();
 
-			string text = settings.GetConnectionString();
+			string text = settings.GetConnectionString(true);
 
 			lock( pools.SyncRoot ) 
 			{
@@ -73,7 +73,7 @@
 		{
 			lock (pools.SyncRoot) 
 			{
-				string key = driver.Settings.GetConnectionString();
+				string key = driver.Settings.GetConnectionString(true);
 				MySqlPool pool = (MySqlPool)pools[ key ];
 				if (pool == null)
 					throw new MySqlException("Pooling exception: Unable to find original pool for connection");

Modified: branches/1.0/mysqlclient/common/DBConnectionString.cs
===================================================================
--- branches/1.0/mysqlclient/common/DBConnectionString.cs	2005-08-23 21:51:35 UTC (rev 161)
+++ branches/1.0/mysqlclient/common/DBConnectionString.cs	2005-08-24 15:21:19 UTC (rev 162)
@@ -46,7 +46,7 @@
 
 		public void SetConnectionString(string value)
 		{
-			Hashtable ht = Parse( value );			
+			Hashtable ht = Parse(value);			
 			connectString = value;
 			keyValues = ht;
 		}
@@ -71,6 +71,22 @@
 			return false;
 		}
 
+		protected string RemoveKeys(string value, string[] keys)
+		{
+			System.Text.StringBuilder sb = new System.Text.StringBuilder();
+			string[] pairs = Utility.ContextSplit(value, ";", "\"'");
+			foreach (string keyvalue in pairs)
+			{
+				string test = keyvalue.Trim().ToLower();
+				if (test.StartsWith("pwd") || test.StartsWith("password"))
+					continue;
+				sb.Append(keyvalue);
+				sb.Append(";");
+			}
+			sb.Remove(sb.Length-1, 1);  // remove the trailing ;
+			return sb.ToString();
+		}
+
 		protected virtual bool ConnectionParameterParsed(Hashtable hash, string key, string value)
 		{
 			string lowerKey =  key.ToLower(System.Globalization.CultureInfo.InvariantCulture);

Thread
Connector/NET commit: r162 - in branches/1.0: . mysqlclient mysqlclient/commonrburnett24 Aug