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

  964 Reggie Burnett	2011-03-31 [merge]
      Windows authenitcation, addressing review comments.

    modified:
      MySql.Data/Provider/Properties/Resources.Designer.cs
      MySql.Data/Provider/Properties/Resources.resx
      MySql.Data/Provider/Source/MySqlPoolManager.cs
      MySql.Data/Provider/Source/NativeDriver.cs
=== modified file 'MySql.Data/Provider/Properties/Resources.Designer.cs'
=== modified file 'MySql.Data/Provider/Properties/Resources.Designer.cs'
--- a/MySql.Data/Provider/Properties/Resources.Designer.cs	2010-04-27 18:31:24 +0000
+++ b/MySql.Data/Provider/Properties/Resources.Designer.cs	2010-10-21 18:28:31 +0000
@@ -587,6 +587,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Cannot retrieve Windows identity for current user. Connections that use  IntegratedSecurity cannot be  pooled. Use either &apos;ConnectionReset=true&apos; or  &apos;Pooling=false&apos; in the connection string to fix..
+        /// </summary>
+        public static string NoWindowsIdentity {
+            get {
+                return ResourceManager.GetString("NoWindowsIdentity", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to The object is not open or has been disposed..
         /// </summary>
         public static string ObjectDisposed {

=== modified file 'MySql.Data/Provider/Properties/Resources.resx'
--- a/MySql.Data/Provider/Properties/Resources.resx	2010-03-11 21:04:56 +0000
+++ b/MySql.Data/Provider/Properties/Resources.resx	2010-10-21 18:28:31 +0000
@@ -459,4 +459,7 @@
   <data name="TraceQueryNormalized" xml:space="preserve">
     <value>{0}: Query Normalized: {2}</value>
   </data>
+  <data name="NoWindowsIdentity" xml:space="preserve">
+    <value>Cannot retrieve Windows identity for current user. Connections that use  IntegratedSecurity cannot be  pooled. Use either 'ConnectionReset=true' or  'Pooling=false' in the connection string to fix.</value>
+  </data>
 </root>
\ No newline at end of file

=== modified file 'MySql.Data/Provider/Source/MySqlPoolManager.cs'
--- a/MySql.Data/Provider/Source/MySqlPoolManager.cs	2010-10-14 22:10:08 +0000
+++ b/MySql.Data/Provider/Source/MySqlPoolManager.cs	2010-10-21 18:28:31 +0000
@@ -24,6 +24,7 @@
 using System.Diagnostics;
 using System.Collections.Generic;
 using System.Threading;
+using MySql.Data.MySqlClient.Properties;
 
 namespace MySql.Data.MySqlClient
 {
@@ -58,23 +59,15 @@
                     // connection string may be mapped to different MySQL accounts.
                     System.Security.Principal.WindowsIdentity id =
                         System.Security.Principal.WindowsIdentity.GetCurrent();
-                    if (id != null)
-                    {
-                        key += ";" + id.User;
-                    }
+
+                    key += ";" + id.User;
                 }
                 catch (System.Security.SecurityException ex)
                 {
                     // Documentation for WindowsIdentity.GetCurrent() states 
                     // SecurityException can be thrown. In this case the 
                     // connection can only be pooled if reset is done.
-                    throw new MySqlException(
-                        "Cannot retrieve Windows identity for current user " +
-                        "authentication using IntegratedSecurity" +
-                        "Connections that use  IntegratedSecurity cannot be " + 
-                        "pooled. Use either 'ConnectionReset=true' or " +
-                        "'Pooling=false' in the connection string" +
-                        "to fix", ex );
+                    throw new MySqlException(Resources.NoWindowsIdentity, ex );
                 }
             }
 #endif

=== modified file 'MySql.Data/Provider/Source/NativeDriver.cs'
--- a/MySql.Data/Provider/Source/NativeDriver.cs	2011-03-31 17:21:49 +0000
+++ b/MySql.Data/Provider/Source/NativeDriver.cs	2011-03-31 17:22:29 +0000
@@ -122,7 +122,6 @@
                 byte marker = (byte) packet.ReadByte();
                 if (marker != 0)
                 {
-                    string s = packet.ReadString();
                     throw new MySqlException("Out of sync with server", true, null);
                 }
 
@@ -228,13 +227,13 @@
             owner.ConnectionCharSetIndex = (int)packet.ReadByte();
 
             serverStatus = (ServerStatusFlags) packet.ReadInteger(2);
+
+            // Since 5.5, high bits of server caps are stored after status.
+            // Previously, it was part of reserved always 0x00 13-byte filler.
             uint serverCapsHigh = (uint)packet.ReadInteger(2);
             serverCaps |= (ClientFlags)(serverCapsHigh << 16);
-           
-
-            int scrambleLength = (int)packet.ReadByte();
-
-            packet.Position += 10;
+
+            packet.Position += 11;
             string seedPart2 = packet.ReadString();
             encryptionSeed += seedPart2;
 

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:964) Reggie Burnett31 Mar