List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:March 31 2011 5:23pm
Subject:bzr commit into connector-net-trunk branch (reggie.burnett:965)
View as plain text  
#At file:///C:/Users/Reggie/work/connector-net/trunk-windows-auth/ based on revid:reggie.burnett@stripped

  965 Reggie Burnett	2011-03-31 [merge]
      windows authentication:
      - Introduce NormalizeValue in ConnectionStringBuilder, that would change
       "Integrated Security=SSPI" to "Integrated Security=true"
      (SSPI is supported for SQLServer compatibility, logically IntegratedSecurity is boolean)
      
      - Fix Compact Framework build

    modified:
      MySql.Data/Provider/MySql.Data.CF.csproj
      MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs
      MySql.Data/Provider/Source/SSPI.cs
=== modified file 'MySql.Data/Provider/MySql.Data.CF.csproj'
=== modified file 'MySql.Data/Provider/MySql.Data.CF.csproj'
--- a/MySql.Data/Provider/MySql.Data.CF.csproj	2010-10-14 22:10:08 +0000
+++ b/MySql.Data/Provider/MySql.Data.CF.csproj	2010-10-22 20:20:50 +0000
@@ -114,6 +114,7 @@
     <Compile Include="Source\ProcedureCache.cs" />
     <Compile Include="Source\ResultSet.cs" />
     <Compile Include="Source\SchemaProvider.cs" />
+    <Compile Include="Source\SSPI.cs" />
     <Compile Include="Source\Statement.cs" />
     <Compile Include="Source\StoredProcedure.cs" />
     <Compile Include="Source\TimedStream.cs" />
@@ -152,7 +153,6 @@
     <Compile Include="Source\zlib\ZOutputStream.cs" />
     <Compile Include="Source\zlib\ZStream.cs" />
     <Compile Include="Source\zlib\ZStreamException.cs" />
-    <Compile Include="SSPI.cs" />
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="Properties\Resources.resx">

=== modified file 'MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs'
--- a/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs	2011-03-31 17:21:49 +0000
+++ b/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs	2011-03-31 17:23:01 +0000
@@ -879,6 +879,8 @@
 
             Remove(keyword);
 
+            NormalizeValue(keyword, ref value);
+
             object val = null;
             if (value is string && defaultValues[keyword].DefaultValue is Enum)
                 val = ParseEnum(defaultValues[keyword].Type, (string)value, keyword);
@@ -888,6 +890,18 @@
             base[keyword] = val;
         }
 
+        private static void NormalizeValue(string keyword, ref object value)
+        {
+            // Handle special case "Integrated Security=SSPI"
+            // Integrated Security is a logically bool parameter, SSPI value 
+            // for it is the same as "true" (SSPI is SQL Server legacy value
+            if (keyword == "Integrated Security" && value is string &&
+                ((string)value).ToLowerInvariant() == "sspi")
+            {
+                value = true;
+            }
+        }
+
         private object ParseEnum(Type t, string requestedValue, string key)
         {
             try
@@ -909,9 +923,6 @@
                 if (s == "yes" || s == "true") return true;
                 if (s == "no" || s == "false") return false;
 
-                // Unclean, but we need IntegratedSecurity=SSPI to be
-                // the same as IntegratedSecurity=true, to match SqlClient
-                if (s == "sspi") return true;
                 throw new FormatException(String.Format(Resources.InvalidValueForBoolean, value));
             }
             else

=== modified file 'MySql.Data/Provider/Source/SSPI.cs'
--- a/MySql.Data/Provider/Source/SSPI.cs	2010-10-14 22:10:08 +0000
+++ b/MySql.Data/Provider/Source/SSPI.cs	2010-10-22 20:20:50 +0000
@@ -21,7 +21,6 @@
 // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
 using System.Collections;
-using System.Security.Principal;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
 using System.Net.Sockets;
@@ -223,7 +222,8 @@
                 }
                 else
                 {
-                    String s = System.Text.Encoding.UTF8.GetString(serverBlob);
+                    String s = System.Text.Encoding.UTF8.GetString(serverBlob, 0, 
+                        serverBlob.Length);
                     SecBufferDesc serverBufferDesc = new SecBufferDesc(serverBlob);
 
                     try

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into connector-net-trunk branch (reggie.burnett:965) Reggie Burnett31 Mar