You've already forked linux-packaging-mono
Imported Upstream version 3.12.0
Former-commit-id: cf92446697332992ec36726e78eb8703e1f259d7
This commit is contained in:
@@ -107,7 +107,7 @@ namespace Commons.Xml.Relaxng.Rnc
|
||||
|
||||
public RelaxngPattern Parse (TextReader source, string baseUri, string defaultNamespace)
|
||||
{
|
||||
this.defaultNamespace = defaultNamespace;
|
||||
this.defaultNamespace = defaultNamespace ?? string.Empty;
|
||||
if (defaultNamespace != null && defaultNamespace.Length != 0)
|
||||
nsmgr.AddNamespace (String.Empty, defaultNamespace);
|
||||
try {
|
||||
|
@@ -13,7 +13,7 @@ using System.Xml;
|
||||
using Commons.Xml.Nvdl;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.Commons.Xml.Nvdl
|
||||
namespace MonoTests.Commons.Xml.Relaxng
|
||||
{
|
||||
[TestFixture]
|
||||
public class NvdlValidatingReaderTests
|
||||
|
@@ -95,5 +95,19 @@ start = mine";
|
||||
r.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SimpleDefaultNamespace ()
|
||||
{
|
||||
var g = RncParser.ParseRnc (new StringReader ("element e { empty }"));
|
||||
var x = XmlReader.Create (new StringReader ("<e/>"));
|
||||
var r = new RelaxngValidatingReader (x, g);
|
||||
try {
|
||||
while (!r.EOF)
|
||||
r.Read ();
|
||||
} finally {
|
||||
r.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.COMException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComMemberType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComSourceInterfacesAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComInterfaceType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.IStream))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.ComTypes.STATSTG))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.InteropServices.CriticalHandle))]
|
||||
|
@@ -106,7 +106,7 @@ net_2_0_only_dirs := \
|
||||
|
||||
pcl_facade_dirs := Facades
|
||||
|
||||
mobile_dirs := \
|
||||
mobile_common_dirs := \
|
||||
corlib \
|
||||
System \
|
||||
System.Core \
|
||||
@@ -134,19 +134,27 @@ mobile_dirs := \
|
||||
System.Net \
|
||||
System.Windows \
|
||||
System.Xml.Serialization \
|
||||
$(pcl_facade_dirs)
|
||||
|
||||
monodroid_dirs := \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
Mono.CSharp \
|
||||
Microsoft.CSharp \
|
||||
$(pcl_facade_dirs)
|
||||
|
||||
mobile_static_dirs := \
|
||||
$(mobile_common_dirs) \
|
||||
Mono.Dynamic.Interpreter
|
||||
|
||||
mobile_dynamic_dirs := \
|
||||
$(mobile_common_dirs) \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
System.Net.Http
|
||||
|
||||
xammac_dirs := \
|
||||
Mono.CompilerServices.SymbolWriter \
|
||||
Mono.CSharp \
|
||||
Microsoft.CSharp \
|
||||
System.Net.Http
|
||||
$(mobile_dynamic_dirs)
|
||||
|
||||
monodroid_dirs := \
|
||||
$(mobile_dynamic_dirs)
|
||||
|
||||
monotouch_dirs := \
|
||||
$(mobile_static_dirs)
|
||||
|
||||
monotouch_runtime_dirs := \
|
||||
corlib \
|
||||
@@ -155,11 +163,6 @@ monotouch_runtime_dirs := \
|
||||
System.XML \
|
||||
Mono.CSharp
|
||||
|
||||
monotouch_dirs := \
|
||||
Mono.CSharp \
|
||||
Microsoft.CSharp \
|
||||
Mono.Dynamic.Interpreter
|
||||
|
||||
net_4_0_dirs := \
|
||||
System.Numerics \
|
||||
Microsoft.CSharp \
|
||||
@@ -229,12 +232,12 @@ xbuild_4_0_dirs := \
|
||||
Microsoft.Build
|
||||
|
||||
net_2_0_SUBDIRS := $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler
|
||||
monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs)
|
||||
monotouch_SUBDIRS := $(mobile_dirs) $(monotouch_dirs)
|
||||
monodroid_SUBDIRS := $(monodroid_dirs)
|
||||
monotouch_SUBDIRS := $(monotouch_dirs)
|
||||
monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
|
||||
mobile_static_SUBDIRS := $(mobile_dirs)
|
||||
mobile_SUBDIRS := $(mobile_dirs)
|
||||
xammac_SUBDIRS := $(mobile_dirs) $(xammac_dirs)
|
||||
mobile_static_SUBDIRS := $(mobile_static_dirs)
|
||||
mobile_SUBDIRS := $(mobile_dynamic_dirs)
|
||||
xammac_SUBDIRS := $(xammac_dirs)
|
||||
net_3_5_SUBDIRS := $(xbuild_2_0_dirs)
|
||||
net_4_0_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs)
|
||||
net_4_5_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler
|
||||
@@ -242,7 +245,7 @@ xbuild_12_SUBDIRS := $(xbuild_4_0_dirs)
|
||||
|
||||
include ../build/rules.make
|
||||
|
||||
SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_dirs) $(monotouch_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
|
||||
SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
|
||||
|
||||
DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs)
|
||||
|
||||
|
@@ -175,7 +175,7 @@ namespace System.Windows.Forms {
|
||||
Rectangle text_rectangle;
|
||||
Rectangle image_rectangle;
|
||||
|
||||
ThemeEngine.Current.CalculateButtonTextAndImageLayout (this, out text_rectangle, out image_rectangle);
|
||||
ThemeEngine.Current.CalculateButtonTextAndImageLayout (pevent.Graphics, this, out text_rectangle, out image_rectangle);
|
||||
|
||||
// Draw our button
|
||||
if (this.FlatStyle == FlatStyle.Standard)
|
||||
|
@@ -1 +1 @@
|
||||
f7075e8ef8f7cfbc0c67a85dbedc54b114523b38
|
||||
3af4684710ade1ef9420d2e56c7319fc0e32c4cd
|
@@ -258,11 +258,19 @@ namespace System.Windows.Forms
|
||||
StringFormat sf = FlagsToStringFormat (flags);
|
||||
|
||||
Size retval;
|
||||
|
||||
|
||||
int proposedWidth;
|
||||
if (proposedSize.Width == 0)
|
||||
proposedWidth = Int32.MaxValue;
|
||||
else {
|
||||
proposedWidth = proposedSize.Width;
|
||||
if ((flags & TextFormatFlags.NoPadding) == 0)
|
||||
proposedWidth -= 9;
|
||||
}
|
||||
if (dc is Graphics)
|
||||
retval = (dc as Graphics).MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
|
||||
retval = (dc as Graphics).MeasureString (text, font, proposedWidth, sf).ToSize ();
|
||||
else
|
||||
retval = TextRenderer.MeasureString (text, font, proposedSize.Width == 0 ? Int32.MaxValue : proposedSize.Width, sf).ToSize ();
|
||||
retval = TextRenderer.MeasureString (text, font, proposedWidth, sf).ToSize ();
|
||||
|
||||
if (retval.Width > 0 && (flags & TextFormatFlags.NoPadding) == 0)
|
||||
retval.Width += 9;
|
||||
|
@@ -698,7 +698,7 @@ namespace System.Windows.Forms
|
||||
|
||||
#region Button
|
||||
public abstract Size CalculateButtonAutoSize (Button button);
|
||||
public abstract void CalculateButtonTextAndImageLayout (ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
|
||||
public abstract void CalculateButtonTextAndImageLayout (Graphics g, ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
|
||||
public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
|
||||
public abstract void DrawFlatButton (Graphics g, ButtonBase b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
|
||||
public abstract void DrawPopupButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
|
||||
|
@@ -1 +1 @@
|
||||
522dec40ec616af384bc431f1c9406aabdaec3fb
|
||||
29921942b4eddbcd9cdbc0b9c29b4e12a60804a8
|
@@ -1 +1 @@
|
||||
1f3af25846450af900f33b95ed551929392ee807
|
||||
657a42457c9f222751c977278db272df8f1f1caf
|
@@ -1018,13 +1018,27 @@ namespace Microsoft.Build.BuildEngine
|
||||
if (!StartHandlerHasExecuted)
|
||||
return;
|
||||
|
||||
if (EventArgs is ProjectStartedEventArgs)
|
||||
ConsoleLogger.ProjectFinishedHandler (Sender, finished_args as ProjectFinishedEventArgs);
|
||||
else if (EventArgs is TargetStartedEventArgs)
|
||||
ConsoleLogger.TargetFinishedHandler (Sender, finished_args as TargetFinishedEventArgs);
|
||||
else if (EventArgs is TaskStartedEventArgs)
|
||||
ConsoleLogger.TaskFinishedHandler (Sender, finished_args as TaskFinishedEventArgs);
|
||||
else if (!(EventArgs is BuildStartedEventArgs))
|
||||
if (EventArgs is ProjectStartedEventArgs) {
|
||||
var pfa = finished_args as ProjectFinishedEventArgs;
|
||||
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
|
||||
if (pfa == null)
|
||||
return;
|
||||
|
||||
ConsoleLogger.ProjectFinishedHandler (Sender, pfa);
|
||||
} else if (EventArgs is TargetStartedEventArgs) {
|
||||
var fa = finished_args as TargetFinishedEventArgs;
|
||||
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
|
||||
if (fa == null)
|
||||
return;
|
||||
|
||||
ConsoleLogger.TargetFinishedHandler (Sender, fa);
|
||||
} else if (EventArgs is TaskStartedEventArgs) {
|
||||
// FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
|
||||
if (!(finished_args is TaskFinishedEventArgs))
|
||||
return;
|
||||
|
||||
ConsoleLogger.TaskFinishedHandler (Sender, (TaskFinishedEventArgs) finished_args);
|
||||
} else if (!(EventArgs is BuildStartedEventArgs))
|
||||
throw new InvalidOperationException ("Unexpected event on the stack, type: " + EventArgs.GetType ());
|
||||
}
|
||||
}
|
||||
|
@@ -1,12 +1,14 @@
|
||||
//
|
||||
// ToolTask.cs: Base class for command line tool tasks.
|
||||
//
|
||||
// Author:
|
||||
// Authors:
|
||||
// Marek Sieradzki (marek.sieradzki@gmail.com)
|
||||
// Ankit Jain (jankit@novell.com)
|
||||
// Marek Safar (marek.safar@gmail.com)
|
||||
//
|
||||
// (C) 2005 Marek Sieradzki
|
||||
// Copyright 2009 Novell, Inc (http://www.novell.com)
|
||||
// Copyright 2014 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
@@ -90,12 +92,45 @@ namespace Microsoft.Build.Utilities
|
||||
return true;
|
||||
}
|
||||
|
||||
string CreateToolPath ()
|
||||
{
|
||||
string tp;
|
||||
if (string.IsNullOrEmpty (ToolPath)) {
|
||||
tp = GenerateFullPathToTool ();
|
||||
if (string.IsNullOrEmpty (tp))
|
||||
return null;
|
||||
|
||||
//
|
||||
// GenerateFullPathToTool can return path including tool name
|
||||
//
|
||||
if (string.IsNullOrEmpty (ToolExe))
|
||||
return tp;
|
||||
|
||||
tp = Path.GetDirectoryName (tp);
|
||||
} else {
|
||||
tp = ToolPath;
|
||||
}
|
||||
|
||||
var path = Path.Combine (tp, ToolExe);
|
||||
if (!File.Exists (path)) {
|
||||
if (Log != null)
|
||||
Log.LogError ("Tool executable '{0}' could not be found", path);
|
||||
return null;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public override bool Execute ()
|
||||
{
|
||||
if (SkipTaskExecution ())
|
||||
return true;
|
||||
|
||||
exitCode = ExecuteTool (GenerateFullPathToTool (), GenerateResponseFileCommands (),
|
||||
var tool_path = CreateToolPath ();
|
||||
if (tool_path == null)
|
||||
return false;
|
||||
|
||||
exitCode = ExecuteTool (tool_path, GenerateResponseFileCommands (),
|
||||
GenerateCommandLineCommands ());
|
||||
|
||||
// HandleTaskExecutionErrors is called only if exitCode != 0
|
||||
@@ -289,14 +324,14 @@ namespace Microsoft.Build.Utilities
|
||||
|
||||
protected virtual string GenerateCommandLineCommands ()
|
||||
{
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
|
||||
protected abstract string GenerateFullPathToTool ();
|
||||
|
||||
protected virtual string GenerateResponseFileCommands ()
|
||||
{
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
|
||||
protected virtual string GetResponseFileSwitch (string responseFilePath)
|
||||
|
@@ -26,6 +26,7 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -424,6 +425,53 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
Assert.AreEqual (a.ToolPath, "Bar", "#5");
|
||||
a.ToolPath = "";
|
||||
Assert.AreEqual (a.ToolPath, "", "#6");
|
||||
|
||||
a.Execute ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Execute_1 ()
|
||||
{
|
||||
var t = new TestExecuteToolTask ();
|
||||
t.OnExecuteTool = delegate { Assert.Fail ("#1"); };
|
||||
t.BuildEngine = new MockBuildEngine ();
|
||||
Assert.IsFalse (t.Execute (), "result");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Execute_2 ()
|
||||
{
|
||||
var t = new TestExecuteToolTask ();
|
||||
t.BuildEngine = new MockBuildEngine ();
|
||||
t.ToolPath = Directory.GetCurrentDirectory ();
|
||||
t.ToolExe = "Makefile";
|
||||
|
||||
t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
|
||||
Assert.AreEqual (Path.Combine (Directory.GetCurrentDirectory (), "Makefile"), pathToTool, "#1");
|
||||
Assert.AreEqual ("", responseFileCommands, "#2");
|
||||
Assert.AreEqual ("", commandLineCommands, "#3");
|
||||
|
||||
};
|
||||
|
||||
Assert.IsTrue (t.Execute (), "result");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Execute_3 ()
|
||||
{
|
||||
var t = new TestExecuteToolTask ();
|
||||
t.FullPathToTool = "fpt";
|
||||
t.BuildEngine = new MockBuildEngine ();
|
||||
t.ToolExe = "Makefile.mk";
|
||||
|
||||
t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
|
||||
Assert.AreEqual ("Makefile.mk", pathToTool, "#1");
|
||||
Assert.AreEqual ("", responseFileCommands, "#2");
|
||||
Assert.AreEqual ("", commandLineCommands, "#3");
|
||||
|
||||
};
|
||||
|
||||
Assert.IsFalse (t.Execute (), "result");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,9 +596,86 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
}
|
||||
|
||||
protected override string GenerateFullPathToTool ()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
class MockBuildEngine : IBuildEngine
|
||||
{
|
||||
public int ColumnNumberOfTaskNode {
|
||||
get {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ContinueOnError {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public int LineNumberOfTaskNode {
|
||||
get {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public string ProjectFileOfTaskNode {
|
||||
get {
|
||||
return "ProjectFileOfTaskNode";
|
||||
}
|
||||
}
|
||||
|
||||
public bool BuildProjectFile (string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void LogCustomEvent (CustomBuildEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogErrorEvent (BuildErrorEventArgs e)
|
||||
{
|
||||
Console.WriteLine (e.Message);
|
||||
}
|
||||
|
||||
public void LogMessageEvent (BuildMessageEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public void LogWarningEvent (BuildWarningEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class TestExecuteToolTask : ToolTask
|
||||
{
|
||||
public Action<string, string, string> OnExecuteTool;
|
||||
public string FullPathToTool;
|
||||
|
||||
protected override string ToolName {
|
||||
get { return "TestTool.exe"; }
|
||||
}
|
||||
|
||||
protected override bool CallHostObjectToExecute ()
|
||||
{
|
||||
return base.CallHostObjectToExecute ();
|
||||
}
|
||||
|
||||
protected override string GenerateFullPathToTool ()
|
||||
{
|
||||
return FullPathToTool;
|
||||
}
|
||||
|
||||
protected override int ExecuteTool (string pathToTool, string responseFileCommands, string commandLineCommands)
|
||||
{
|
||||
if (OnExecuteTool != null)
|
||||
OnExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,9 @@ LIBRARY = Mono.CSharp.dll
|
||||
|
||||
LIB_MCS_FLAGS = -r:System.Core.dll -r:System.Xml.dll -r:System.dll
|
||||
|
||||
ifeq (monotouch, $(PROFILE))
|
||||
MOBILE_STATIC := $(filter mobile_static monotouch, $(PROFILE))
|
||||
|
||||
ifdef MOBILE_STATIC
|
||||
LIB_MCS_FLAGS += -d:IOS_REFLECTION
|
||||
endif
|
||||
|
||||
|
13
mcs/class/Mono.CSharp/mobile_static_Mono.CSharp.dll.sources
Normal file
13
mcs/class/Mono.CSharp/mobile_static_Mono.CSharp.dll.sources
Normal file
@@ -0,0 +1,13 @@
|
||||
#include Mono.CSharp.dll.sources
|
||||
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
|
||||
../corlib/System.Reflection.Emit/FlowControl.cs
|
||||
../corlib/System.Reflection.Emit/OpCode.cs
|
||||
../corlib/System.Reflection.Emit/OpCodeNames.cs
|
||||
../corlib/System.Reflection.Emit/OpCodes.cs
|
||||
../corlib/System.Reflection.Emit/OpCodeType.cs
|
||||
../corlib/System.Reflection.Emit/OperandType.cs
|
||||
../corlib/System.Reflection.Emit/PEFileKinds.cs
|
||||
../corlib/System.Reflection.Emit/Label.cs
|
||||
../corlib/System.Reflection.Emit/MethodToken.cs
|
||||
../corlib/System.Reflection.Emit/StackBehaviour.cs
|
||||
monotouch.cs
|
@@ -1,13 +1,2 @@
|
||||
#include Mono.CSharp.dll.sources
|
||||
../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
|
||||
../corlib/System.Reflection.Emit/FlowControl.cs
|
||||
../corlib/System.Reflection.Emit/OpCode.cs
|
||||
../corlib/System.Reflection.Emit/OpCodeNames.cs
|
||||
../corlib/System.Reflection.Emit/OpCodes.cs
|
||||
../corlib/System.Reflection.Emit/OpCodeType.cs
|
||||
../corlib/System.Reflection.Emit/OperandType.cs
|
||||
../corlib/System.Reflection.Emit/PEFileKinds.cs
|
||||
../corlib/System.Reflection.Emit/Label.cs
|
||||
../corlib/System.Reflection.Emit/MethodToken.cs
|
||||
../corlib/System.Reflection.Emit/StackBehaviour.cs
|
||||
monotouch.cs
|
||||
#include mobile_static_Mono.CSharp.dll.sources
|
||||
monotouch.cs
|
||||
|
@@ -41,7 +41,9 @@ using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Sockets;
|
||||
using System.Globalization;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Data.Tds.Protocol
|
||||
{
|
||||
@@ -1468,7 +1470,7 @@ namespace Mono.Data.Tds.Protocol
|
||||
t3.Domain = this.connectionParms.DefaultDomain;
|
||||
t3.Host = this.connectionParms.Hostname;
|
||||
t3.Username = this.connectionParms.User;
|
||||
t3.Password = this.connectionParms.Password;
|
||||
t3.Password = GetPlainPassword(this.connectionParms.Password);
|
||||
|
||||
Comm.StartPacket (TdsPacketType.SspAuth); // 0x11
|
||||
Comm.Append (t3.GetBytes ());
|
||||
@@ -1919,6 +1921,20 @@ namespace Mono.Data.Tds.Protocol
|
||||
comm.Skip(4);
|
||||
}
|
||||
|
||||
public static string GetPlainPassword(SecureString secPass)
|
||||
{
|
||||
IntPtr plainString = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
plainString = Marshal.SecureStringToGlobalAllocUnicode(secPass);
|
||||
return Marshal.PtrToStringUni(plainString);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.ZeroFreeGlobalAllocUnicode(plainString);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Private Methods
|
||||
|
||||
#if NET_2_0
|
||||
|
@@ -29,6 +29,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Security;
|
||||
|
||||
namespace Mono.Data.Tds.Protocol {
|
||||
public sealed class Tds42 : Tds
|
||||
@@ -77,7 +78,7 @@ namespace Mono.Data.Tds.Protocol {
|
||||
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
|
||||
|
||||
// password (offset 62 0x3e)
|
||||
tmp = Comm.Append (connectionParameters.Password, 30, pad);
|
||||
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
|
||||
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
|
||||
|
||||
// hostproc (offset 93 0x5d)
|
||||
@@ -145,7 +146,7 @@ namespace Mono.Data.Tds.Protocol {
|
||||
|
||||
// remote passwords
|
||||
Comm.Append (empty, 2, pad);
|
||||
tmp = Comm.Append (connectionParameters.Password, 253, pad);
|
||||
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
|
||||
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
|
||||
|
||||
// tds version
|
||||
|
@@ -31,6 +31,7 @@
|
||||
using Mono.Data.Tds;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Security;
|
||||
|
||||
namespace Mono.Data.Tds.Protocol
|
||||
{
|
||||
@@ -118,7 +119,7 @@ namespace Mono.Data.Tds.Protocol
|
||||
|
||||
// password (offset 62 0x3e)
|
||||
// 62-92
|
||||
tmp = Comm.Append (connectionParameters.Password, 30, pad);
|
||||
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
|
||||
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
|
||||
|
||||
// hostproc (offset 93 0x5d)
|
||||
@@ -187,7 +188,7 @@ namespace Mono.Data.Tds.Protocol
|
||||
// remote passwords
|
||||
// 202-457
|
||||
Comm.Append (empty, 2, pad);
|
||||
tmp = Comm.Append (connectionParameters.Password, 253, pad);
|
||||
tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
|
||||
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
|
||||
|
||||
// tds version
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user