Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 mono (4.2.1.102+dfsg2-6) unstable; urgency=medium
 .
   * [d2d5aeb] Don't remap all versions of Npgsql to 4.0.0.0.
   * [dc3f62a] Don't use unowned /usr/share/.mono for certs (Closes: #808308)
Author: Jo Shields <jo.shields@xamarin.com>
Bug-Debian: https://bugs.debian.org/808308

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- mono-4.2.1.102+dfsg2.orig/Makefile.am
+++ mono-4.2.1.102+dfsg2/Makefile.am
@@ -10,7 +10,7 @@ SUBDIRS = po $(libgc_dir) eglib mono $(i
 ## 'tools' is not normally built
 DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
 else
-SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
+SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc
 # Keep in sync with SUBDIRS
 ## 'tools' is not normally built
 DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
--- mono-4.2.1.102+dfsg2.orig/configure.ac
+++ mono-4.2.1.102+dfsg2/configure.ac
@@ -2732,6 +2732,7 @@ case "$host" in
 	mips*)
 		TARGET=MIPS;
 		arch_target=mips;
+		with_tls=pthread
 		sgen_supported=true
 		ACCESS_UNALIGNED="no"
 
--- mono-4.2.1.102+dfsg2.orig/data/mono-cairo.pc.in
+++ mono-4.2.1.102+dfsg2/data/mono-cairo.pc.in
@@ -1,5 +1,5 @@
-prefix=${pcfiledir}/../..
-exec_prefix=${pcfiledir}/../..
+prefix=@prefix@
+exec_prefix=${prefix}
 libdir=${prefix}/@reloc_libdir@
 includedir=${prefix}/include
 
--- mono-4.2.1.102+dfsg2.orig/data/mono.pc.in
+++ mono-4.2.1.102+dfsg2/data/mono.pc.in
@@ -1,5 +1,5 @@
-prefix=${pcfiledir}/../..
-exec_prefix=${pcfiledir}/../..
+prefix=@prefix@
+exec_prefix=${prefix}
 libdir=${prefix}/@reloc_libdir@
 includedir=${prefix}/include/mono-@API_VER@
 sysconfdir=@sysconfdir@
--- mono-4.2.1.102+dfsg2.orig/data/net_1_1/machine.config
+++ mono-4.2.1.102+dfsg2/data/net_1_1/machine.config
@@ -75,7 +75,7 @@
 			<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 		</webRequestModules>
 		<settings>
-			<ipv6 enabled="false"/>
+			<ipv6 enabled="true"/>
 		</settings>
 	</system.net>
 	<system.web>
--- mono-4.2.1.102+dfsg2.orig/data/net_2_0/machine.config
+++ mono-4.2.1.102+dfsg2/data/net_2_0/machine.config
@@ -119,7 +119,7 @@
 			<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 		</webRequestModules>
 		<settings>
-			<ipv6 enabled="false"/>
+			<ipv6 enabled="true"/>
 		</settings>
 	</system.net>
 	
--- mono-4.2.1.102+dfsg2.orig/data/net_4_0/machine.config
+++ mono-4.2.1.102+dfsg2/data/net_4_0/machine.config
@@ -136,7 +136,7 @@
 			<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 		</webRequestModules>
 		<settings>
-			<ipv6 enabled="false"/>
+			<ipv6 enabled="true"/>
 		</settings>
 	</system.net>
 	
--- mono-4.2.1.102+dfsg2.orig/data/net_4_5/machine.config
+++ mono-4.2.1.102+dfsg2/data/net_4_5/machine.config
@@ -139,7 +139,7 @@
 			<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 		</webRequestModules>
 		<settings>
-			<ipv6 enabled="false"/>
+			<ipv6 enabled="true"/>
 		</settings>
 	</system.net>
 	
--- mono-4.2.1.102+dfsg2.orig/libgc/include/private/gcconfig.h
+++ mono-4.2.1.102+dfsg2/libgc/include/private/gcconfig.h
@@ -2157,6 +2157,50 @@
 	extern char * GC_FreeBSDGetDataStart();
 #	define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
 #   endif
+#   ifdef FREEBSD
+#	define OS_TYPE "FREEBSD"
+#	ifndef GC_FREEBSD_THREADS
+#	    define MPROTECT_VDB
+#	endif
+#	ifdef __GLIBC__
+#	    define SIG_SUSPEND		(32+6)
+#	    define SIG_THR_RESTART	(32+5)
+	    extern int _end[];
+#	    define DATAEND (_end)
+#	else
+#	    define SIG_SUSPEND SIGUSR1
+#	    define SIG_THR_RESTART SIGUSR2
+#	endif
+#	define FREEBSD_STACKBOTTOM
+#	ifdef __ELF__
+#	    define DYNAMIC_LOADING
+#	endif
+	extern char etext[];
+	extern char * GC_FreeBSDGetDataStart();
+#	define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
+#   endif
+#   ifdef FREEBSD
+#	define OS_TYPE "FREEBSD"
+#	ifndef GC_FREEBSD_THREADS
+#	    define MPROTECT_VDB
+#	endif
+#	ifdef __GLIBC__
+#	    define SIG_SUSPEND		(32+6)
+#	    define SIG_THR_RESTART	(32+5)
+	    extern int _end[];
+#	    define DATAEND (_end)
+#	else
+#	    define SIG_SUSPEND SIGUSR1
+#	    define SIG_THR_RESTART SIGUSR2
+#	endif
+#	define FREEBSD_STACKBOTTOM
+#	ifdef __ELF__
+#	    define DYNAMIC_LOADING
+#	endif
+	extern char etext[];
+	extern char * GC_FreeBSDGetDataStart();
+#	define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
+#   endif
 #   ifdef NETBSD
 #	define OS_TYPE "NETBSD"
 #	ifdef __ELF__
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/Mono.WebBrowser/Mono.NullBrowser/Base.cs
@@ -0,0 +1,174 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+//	Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+using Mono.WebBrowser;
+
+namespace Mono.NullBrowser
+{
+	internal class Base
+	{
+		private static Hashtable boundControls;
+		private static bool initialized;
+		private static object initLock = new object ();
+		private static string monoMozDir;
+
+		private static bool isInitialized ()
+		{
+			if (!initialized)
+				return false;
+			return true;
+		}
+
+		static Base ()
+		{
+			boundControls = new Hashtable ();
+		}
+
+		public Base () { }
+
+		public static bool Init (WebBrowser control, Platform platform)
+		{
+			lock (initLock) {
+				if (!initialized) {
+				
+					initialized = true;
+				}
+			}
+			return initialized;
+		}
+
+		public static bool Bind (WebBrowser control, IntPtr handle, int width, int height)
+		{
+			if (!isInitialized ())
+				return false;
+
+			
+			return true;
+		}
+
+		public static bool Create (IWebBrowser control) {
+			if (!isInitialized ())
+				return false;
+
+			return true;
+		}
+
+		public static void Shutdown (IWebBrowser control)
+		{
+			lock (initLock) {
+				if (!initialized)
+					return;
+					
+				
+				boundControls.Remove (control);
+				if (boundControls.Count == 0) {
+					initialized = false;
+				}
+			}
+		}
+
+		// layout
+		public static void Focus (IWebBrowser control, FocusOption focus)
+		{
+			if (!isInitialized ())
+				return;
+
+		}
+
+
+		public static void Blur (IWebBrowser control)
+		{
+			if (!isInitialized ())
+				return;
+
+		}
+
+		public static void Activate (IWebBrowser control)
+		{
+			if (!isInitialized ())
+				return;
+
+		}
+
+		public static void Deactivate (IWebBrowser control)
+		{
+			if (!isInitialized ())
+				return;
+
+		}
+
+		public static void Resize (IWebBrowser control, int width, int height)
+		{
+			if (!isInitialized ())
+				return;
+
+		}
+
+		// navigation
+		public static void Home (IWebBrowser control)
+		{
+			if (!isInitialized ())
+				return;
+
+		}
+
+
+		public static IntPtr StringInit ()
+		{
+			return IntPtr.Zero;
+		}
+
+		public static void StringFinish (HandleRef str)
+		{
+		}
+
+		public static string StringGet (HandleRef str)
+		{
+			return String.Empty;
+		}
+
+		public static void StringSet (HandleRef str, string text)
+		{
+		}
+
+
+		public static object GetProxyForObject (IWebBrowser control, Guid iid, object obj)
+		{
+			return null;
+		}
+
+		public static string EvalScript (IWebBrowser control, string script)
+		{
+			return null;
+		}
+
+
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/Mono.WebBrowser/Mono.NullBrowser/DOM/Navigation.cs
@@ -0,0 +1,127 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+//
+// Authors:
+//	Andreia Gaita (avidigal@novell.com)
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.NullBrowser.DOM
+{
+	internal class Navigation: INavigation
+	{
+
+
+		#region INavigation Members
+
+		public bool CanGoBack {
+			get {
+				return false;
+			}
+		}
+
+		public bool CanGoForward {
+			get {
+				return false;
+			}
+		}
+
+		public bool Back ()
+		{
+			return false;
+		}
+
+		public bool Forward ()
+		{
+			return false;
+		}
+
+		public void Home ()
+		{
+		}
+
+		public void Reload ()
+		{
+		}
+
+		public void Reload (ReloadOption option)
+		{
+		}
+
+		public void Stop ()
+		{
+		}
+		
+		
+		/// <summary>
+		/// Navigate to the page in the history, by index.
+		/// </summary>
+		/// <param name="index">
+		/// A <see cref="System.Int32"/> representing an absolute index in the 
+		/// history (that is, > -1 and < history length
+		/// </param>
+		public void Go (int index)
+		{
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="index">
+		/// A <see cref="System.Int32"/> representing an index in the 
+		/// history, that can be relative or absolute depending on the relative argument
+		/// </param>
+		/// <param name="relative">
+		/// A <see cref="System.Boolean"/> indicating whether the index is relative to 
+		/// the current place in history or not (i.e., if relative = true, index can be
+		/// positive or negative, and index=-1 means load the previous page in the history.
+		/// if relative = false, index must be > -1, and index = 0 means load the first
+		/// page of the history.
+		/// </param>
+		public void Go (int index, bool relative) {
+		}
+		
+		public void Go (string url)
+		{
+		}
+
+		public void Go (string url, LoadFlags flags) 
+		{
+		}
+
+		public int HistoryCount {
+			get {
+				return 0;
+			}
+		}
+
+		#endregion
+
+		public override int GetHashCode () {
+			return 0;
+		}		
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/Mono.WebBrowser/Mono.NullBrowser/WebBrowser.cs
@@ -0,0 +1,414 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007, 2008 Novell, Inc.
+// Copyright (c) 2013 Jo Shields
+//
+// Authors:
+//	Andreia Gaita (avidigal@novell.com)
+//	Jo Shields (directhex@apebox.org)
+//
+
+#undef debug
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Diagnostics;
+using Mono.WebBrowser;
+using Mono.WebBrowser.DOM;
+
+namespace Mono.NullBrowser
+{
+	internal class WebBrowser : IWebBrowser
+	{
+		bool loaded;
+		internal bool created = false;
+		bool creating = false;
+
+                internal DOM.Navigation navigation;
+
+		internal Platform platform;
+		internal Platform enginePlatform;
+		System.ComponentModel.EventHandlerList events;
+		System.ComponentModel.EventHandlerList domEvents;
+
+		string statusText;
+
+		bool streamingMode;
+		
+		internal Hashtable documents;
+
+		int width;
+		int height;
+		bool isDirty;
+		
+		public WebBrowser (Platform platform)
+		{
+			this.platform = platform;
+			loaded = Base.Init (this, platform);
+			documents = new Hashtable ();
+		}
+
+		public bool Load (IntPtr handle, int width, int height)
+		{
+			loaded = Base.Bind (this, handle, width, height);
+			return loaded;
+		}
+
+		bool Created {
+			get {
+				if (!creating && !created) {
+					creating = true;
+					created = Base.Create (this);
+					if (created && isDirty) {
+						isDirty = false;
+						Base.Resize (this, width, height);
+					}
+				}
+				return created;
+			}
+		}
+
+		public void Shutdown ()
+		{
+			Base.Shutdown (this);
+		}
+		
+		internal void Reset ()
+		{
+			this.DomEvents.Dispose ();
+			this.domEvents = null;
+			this.documents.Clear ();
+		}
+
+		public bool Initialized {
+			get { return this.loaded; }
+		}
+		
+		public IWindow Window {
+			get {
+				return null;
+			}
+		}
+
+		public IDocument Document {
+			get {
+				return null;
+			}
+		}
+
+		public INavigation Navigation {
+			get {
+                                if (!Created) return null;
+
+                                if (navigation == null) {
+
+                                        navigation = new DOM.Navigation ();
+                                }
+                                return navigation as INavigation;
+			}
+		}
+		
+		public string StatusText {
+			get { return statusText; }
+		}
+		
+		public bool Offline {
+			get {
+				return false;
+			}
+			set {
+			}
+		}
+		
+		internal System.ComponentModel.EventHandlerList DomEvents {
+			get {
+				if (domEvents == null)
+					domEvents = new System.ComponentModel.EventHandlerList();
+
+				return domEvents;
+			}
+		}
+
+		internal System.ComponentModel.EventHandlerList Events {
+			get {
+				if (events == null)
+					events = new System.ComponentModel.EventHandlerList();
+
+				return events;
+			}
+		}
+		
+		#region Layout
+		public void FocusIn (FocusOption focus)
+		{
+			if (!created) return;
+			Base.Focus (this, focus);
+		}
+		public void FocusOut ()
+		{
+			if (!created) return;
+			Base.Blur (this);
+		}
+		
+		public void Activate ()
+		{
+			if (!Created) return;
+			Base.Activate (this);
+		}
+		public void Deactivate ()
+		{
+			if (!created) return;
+			Base.Deactivate (this);
+		}
+
+		public void Resize (int width, int height)
+		{
+			this.width = width;
+			this.height = height;
+			isDirty = true;
+			if (!created) return;
+			Base.Resize (this, width, height);			
+		}
+
+		public void Render (byte[] data)
+		{
+			if (!Created) return;
+			if (data == null)
+				throw new ArgumentNullException ("data");
+			string html = System.Text.ASCIIEncoding.UTF8.GetString (data);
+			Render (html);
+		}
+
+		public void Render (string html)
+		{
+			if (!Created) return;
+			Render (html, "file:///", "text/html");
+		}
+
+				
+		public void Render (string html, string uri, string contentType)
+		{
+			if (!Created) return;
+			throw new Mono.WebBrowser.Exception (Mono.WebBrowser.Exception.ErrorCodes.Navigation);
+
+			IntPtr native_html = Marshal.StringToHGlobalAnsi (html);
+			Marshal.FreeHGlobal (native_html);
+
+
+		}
+		
+		public void ExecuteScript (string script) {
+			if (!Created) return;
+			Base.EvalScript (this, script);
+		}
+				
+		internal void AttachEvent (INode node, string eve, EventHandler handler) {
+			string key = String.Intern (node.GetHashCode() + ":" + eve);
+#if debug
+			Console.Error.WriteLine ("Event Attached: " + key);
+#endif
+			DomEvents.AddHandler (key, handler);
+		}
+
+		internal void DetachEvent (INode node, string eve, EventHandler handler) {
+			string key = String.Intern (node.GetHashCode() + ":" + eve);
+#if debug			
+			Console.Error.WriteLine ("Event Detached: " + key);
+#endif			
+			DomEvents.RemoveHandler (key, handler);
+		}
+		
+		#endregion
+
+		#region Events
+		internal static object KeyDownEvent = new object ();
+		internal static object KeyPressEvent = new object ();
+		internal static object KeyUpEvent = new object ();
+		internal static object MouseClickEvent = new object ();
+		internal static object MouseDoubleClickEvent = new object ();
+		internal static object MouseDownEvent = new object ();
+		internal static object MouseEnterEvent = new object ();
+		internal static object MouseLeaveEvent = new object ();
+		internal static object MouseMoveEvent = new object ();
+		internal static object MouseUpEvent = new object ();
+		internal static object FocusEvent = new object ();
+		internal static object BlurEvent = new object ();
+		internal static object CreateNewWindowEvent = new object ();
+		internal static object AlertEvent = new object ();
+			
+		internal static object LoadStartedEvent = new object ();
+		internal static object LoadCommitedEvent = new object ();
+		internal static object ProgressChangedEvent = new object ();
+		internal static object LoadFinishedEvent = new object ();	
+		
+		internal static object LoadEvent = new object ();
+		internal static object UnloadEvent = new object ();
+		internal static object StatusChangedEvent = new object ();
+		internal static object SecurityChangedEvent = new object ();
+		internal static object ProgressEvent = new object ();
+		internal static object ContextMenuEvent = new object ();
+		
+		internal static object NavigationRequestedEvent = new object ();
+		
+		public event NodeEventHandler KeyDown
+		{
+			add { Events.AddHandler (KeyDownEvent, value); }
+			remove { Events.RemoveHandler (KeyDownEvent, value); }
+		}
+
+		public event NodeEventHandler KeyPress
+		{
+			add { Events.AddHandler (KeyPressEvent, value); }
+			remove { Events.RemoveHandler (KeyPressEvent, value); }
+		}
+		public event NodeEventHandler KeyUp
+		{
+			add { Events.AddHandler (KeyUpEvent, value); }
+			remove { Events.RemoveHandler (KeyUpEvent, value); }
+		}
+		public event NodeEventHandler MouseClick
+		{
+			add { Events.AddHandler (MouseClickEvent, value); }
+			remove { Events.RemoveHandler (MouseClickEvent, value); }
+		}
+		public event NodeEventHandler MouseDoubleClick
+		{
+			add { Events.AddHandler (MouseDoubleClickEvent, value); }
+			remove { Events.RemoveHandler (MouseDoubleClickEvent, value); }
+		}
+		public event NodeEventHandler MouseDown
+		{
+			add { Events.AddHandler (MouseDownEvent, value); }
+			remove { Events.RemoveHandler (MouseDownEvent, value); }
+		}
+		public event NodeEventHandler MouseEnter
+		{
+			add { Events.AddHandler (MouseEnterEvent, value); }
+			remove { Events.RemoveHandler (MouseEnterEvent, value); }
+		}
+		public event NodeEventHandler MouseLeave
+		{
+			add { Events.AddHandler (MouseLeaveEvent, value); }
+			remove { Events.RemoveHandler (MouseLeaveEvent, value); }
+		}
+		public event NodeEventHandler MouseMove
+		{
+			add { Events.AddHandler (MouseMoveEvent, value); }
+			remove { Events.RemoveHandler (MouseMoveEvent, value); }
+		}
+		public event NodeEventHandler MouseUp
+		{
+			add { Events.AddHandler (MouseUpEvent, value); }
+			remove { Events.RemoveHandler (MouseUpEvent, value); }
+		}
+		public event EventHandler Focus
+		{
+			add { Events.AddHandler (FocusEvent, value); }
+			remove { Events.RemoveHandler (FocusEvent, value); }
+		}
+		public event EventHandler Blur
+		{
+			add { Events.AddHandler (BlurEvent, value); }
+			remove { Events.RemoveHandler (BlurEvent, value); }
+		}
+		public event CreateNewWindowEventHandler CreateNewWindow
+		{
+			add { Events.AddHandler (CreateNewWindowEvent, value); }
+			remove { Events.RemoveHandler (CreateNewWindowEvent, value); }
+		}
+		public event AlertEventHandler Alert
+		{
+			add { Events.AddHandler (AlertEvent, value); }
+			remove { Events.RemoveHandler (AlertEvent, value); }
+		}
+		public event EventHandler Loaded
+		{
+			add { Events.AddHandler (LoadEvent, value); }
+			remove { Events.RemoveHandler (LoadEvent, value); }
+		}
+		public event EventHandler Unloaded
+		{
+			add { Events.AddHandler (UnloadEvent, value); }
+			remove { Events.RemoveHandler (UnloadEvent, value); }
+		}
+
+ 		public event StatusChangedEventHandler StatusChanged
+		{
+			add { Events.AddHandler (StatusChangedEvent, value); }
+			remove { Events.RemoveHandler (StatusChangedEvent, value); }
+		}
+		
+ 		public event SecurityChangedEventHandler SecurityChanged
+		{
+			add { Events.AddHandler (SecurityChangedEvent, value); }
+			remove { Events.RemoveHandler (SecurityChangedEvent, value); }
+		}
+
+		public event LoadStartedEventHandler LoadStarted
+		{
+			add { Events.AddHandler (LoadStartedEvent, value); }
+			remove { Events.RemoveHandler (LoadStartedEvent, value); }
+		}
+		
+		public event LoadCommitedEventHandler LoadCommited
+		{
+			add { Events.AddHandler (LoadCommitedEvent, value); }
+			remove { Events.RemoveHandler (LoadCommitedEvent, value); }
+		}		
+		
+		public event ProgressChangedEventHandler ProgressChanged
+		{
+			add { Events.AddHandler (ProgressChangedEvent, value); }
+			remove { Events.RemoveHandler (ProgressChangedEvent, value); }
+		}
+		
+		public event LoadFinishedEventHandler LoadFinished
+		{
+			add { Events.AddHandler (LoadFinishedEvent, value); }
+			remove { Events.RemoveHandler (LoadFinishedEvent, value); }
+		}
+
+		public event ContextMenuEventHandler ContextMenuShown
+		{
+			add { Events.AddHandler (ContextMenuEvent, value); }
+			remove { Events.RemoveHandler (ContextMenuEvent, value); }
+		}
+
+		public event NavigationRequestedEventHandler NavigationRequested
+		{
+			add { }
+			remove { }
+		}
+
+		internal static object GenericEvent = new object ();
+		internal event EventHandler Generic
+		{
+			add { Events.AddHandler (GenericEvent, value); }
+			remove { Events.RemoveHandler (GenericEvent, value); }
+		}
+
+		#endregion
+
+
+	}
+}
--- mono-4.2.1.102+dfsg2.orig/mcs/class/Mono.WebBrowser/Mono.WebBrowser.dll.sources
+++ mono-4.2.1.102+dfsg2/mcs/class/Mono.WebBrowser/Mono.WebBrowser.dll.sources
@@ -133,6 +133,9 @@ Mono.Mozilla/interfaces/nsIWebNavigation
 Mono.Mozilla/interfaces/extras/NodeType.cs
 Mono.Mozilla/interfaces/extras/nsIWriteSegmentFun.cs
 Mono.Mozilla/interfaces/extras/Options.cs
+Mono.NullBrowser/Base.cs
+Mono.NullBrowser/WebBrowser.cs
+Mono.NullBrowser/DOM/Navigation.cs
 Mono.WebBrowser/DOM/IDocumentType.cs
 Mono.WebBrowser/DOM/IDOMImplementation.cs
 Mono.WebBrowser/DOM/IMediaList.cs
--- mono-4.2.1.102+dfsg2.orig/mcs/class/Mono.WebBrowser/Mono.WebBrowser/Manager.cs
+++ mono-4.2.1.102+dfsg2/mcs/class/Mono.WebBrowser/Mono.WebBrowser/Manager.cs
@@ -50,8 +50,15 @@ namespace Mono.WebBrowser
 					browserEngine = null;
 				}
 			}
-			if (browserEngine == null || browserEngine == "mozilla")
-				return new Mono.Mozilla.WebBrowser (platform);
+			if (browserEngine == "mozilla") {
+				try {
+					return new Mono.Mozilla.WebBrowser (platform);
+				} catch {
+					browserEngine = null;
+				}
+			}
+			if (browserEngine == null)
+				return new Mono.NullBrowser.WebBrowser (platform);
 			throw new Exception (Mono.WebBrowser.Exception.ErrorCodes.EngineNotSupported, browserEngine);
 		}
 
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/ReferenceSources/DbConnectionStringDefaults.cs
@@ -0,0 +1,57 @@
+using System.Data.SqlClient;
+
+namespace System.Data.Common {
+    internal static class DbConnectionStringDefaults {
+        // all
+//        internal const string NamedConnection           = "";
+
+        // Odbc
+        internal const string Driver                    = "";
+        internal const string Dsn                       = "";
+
+        // OleDb
+        internal const bool   AdoNetPooler              = false;
+        internal const string FileName                  = "";
+        internal const int    OleDbServices             = ~(/*DBPROPVAL_OS_AGR_AFTERSESSION*/0x00000008 | /*DBPROPVAL_OS_CLIENTCURSOR*/0x00000004); // -13
+        internal const string Provider                  = "";
+
+        // OracleClient
+        internal const bool   Unicode                   = false;
+        internal const bool   OmitOracleConnectionName  = false;
+
+        // SqlClient
+        internal const ApplicationIntent ApplicationIntent = System.Data.SqlClient.ApplicationIntent.ReadWrite;
+        internal const string ApplicationName           = ".Net SqlClient Data Provider";
+        internal const bool   AsynchronousProcessing    = false;
+        internal const string AttachDBFilename          = "";
+        internal const int    ConnectTimeout            = 15;
+        internal const bool   ConnectionReset           = true;
+        internal const bool   ContextConnection         = false;
+        internal const string CurrentLanguage           = "";
+        internal const string DataSource                = "";
+        internal const bool   Encrypt                   = false;
+        internal const bool   Enlist                    = true;
+        internal const string FailoverPartner           = "";
+        internal const string InitialCatalog            = "";
+        internal const bool   IntegratedSecurity        = false;
+        internal const int    LoadBalanceTimeout        = 0; // default of 0 means don't use
+        internal const bool   MultipleActiveResultSets  = false;
+        internal const bool   MultiSubnetFailover       = false;
+        internal const int    MaxPoolSize               = 100;
+        internal const int    MinPoolSize               = 0;
+        internal const string NetworkLibrary            = "";
+        internal const int    PacketSize                = 8000;
+        internal const string Password                  = "";
+        internal const bool   PersistSecurityInfo       = false;
+        internal const bool   Pooling                   = true;
+        internal const bool   TrustServerCertificate    = false;
+        internal const string TypeSystemVersion         = "Latest";
+        internal const string UserID                    = "";
+        internal const bool   UserInstance              = false;
+        internal const bool   Replication               = false;
+        internal const string WorkstationID             = "";
+        internal const string TransactionBinding        = "Implicit Unbind";
+        internal const int    ConnectRetryCount         = 1;
+        internal const int    ConnectRetryInterval      = 10;
+    }
+}
\ No newline at end of file
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs
@@ -0,0 +1,131 @@
+//
+// System.Data.Common.DataColumnMapping.cs
+//
+// Authors:
+//   Rodrigo Moya (rodrigo@ximian.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// (C) Ximian, Inc
+// Copyright (C) Tim Coleman, 2002-2003
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.Data;
+
+namespace System.Data.Common {
+#if NET_2_0
+	[TypeConverterAttribute ("System.Data.Common.DataColumnMapping+DataColumnMappingConverter, " + Consts.AssemblySystem_Data)]
+#else
+	[TypeConverterAttribute (typeof (DataColumnMappingConverter))]
+#endif
+	public sealed class DataColumnMapping : MarshalByRefObject, IColumnMapping, ICloneable
+	{
+		#region Fields
+
+		string sourceColumn;
+		string dataSetColumn;
+
+		#endregion // Fields
+
+		#region Constructors
+		
+		public DataColumnMapping () 
+		{
+			sourceColumn = String.Empty;
+			dataSetColumn = String.Empty;
+		}
+
+		public DataColumnMapping (string sourceColumn, string dataSetColumn) 
+		{
+			this.sourceColumn = sourceColumn;
+			this.dataSetColumn = dataSetColumn;
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+#if ONLY_1_1
+		[DataSysDescription ("DataColumn.ColumnName")]
+#endif
+		[DefaultValue ("")]
+		public string DataSetColumn {
+			get { return dataSetColumn; }
+			set { dataSetColumn = value; }
+		}
+
+#if !NET_2_0
+		[DataSysDescription ("Source column name - case sensitive.")]
+#endif
+		[DefaultValue ("")]
+		public string SourceColumn {
+			get { return sourceColumn; }
+			set { sourceColumn = value; }
+		}
+
+		#endregion // Properties
+
+		#region Methods
+
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public DataColumn GetDataColumnBySchemaAction (DataTable dataTable, Type dataType, MissingSchemaAction schemaAction) 
+		{
+			if (dataTable.Columns.Contains (dataSetColumn))
+				return dataTable.Columns [dataSetColumn];
+			if (schemaAction == MissingSchemaAction.Ignore)
+				return null;
+			if (schemaAction == MissingSchemaAction.Error)
+				throw new InvalidOperationException (String.Format ("Missing the DataColumn '{0}' in the DataTable '{1}' for the SourceColumn '{2}'", DataSetColumn, dataTable.TableName, SourceColumn));
+			return new DataColumn (dataSetColumn, dataType);
+		}
+
+#if NET_2_0
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public static DataColumn GetDataColumnBySchemaAction (string sourceColumn, string dataSetColumn, DataTable dataTable, Type dataType, MissingSchemaAction schemaAction)
+		{
+			if (dataTable.Columns.Contains (dataSetColumn))
+				return dataTable.Columns [dataSetColumn];
+			if (schemaAction == MissingSchemaAction.Ignore)
+				return null;
+			if (schemaAction == MissingSchemaAction.Error)
+				throw new InvalidOperationException (String.Format ("Missing the DataColumn '{0}' in the DataTable '{1}' for the SourceColumn '{2}'", dataSetColumn, dataTable.TableName, sourceColumn));
+			return new DataColumn (dataSetColumn, dataType);
+		}
+#endif
+
+		object ICloneable.Clone ()
+		{
+			return new DataColumnMapping (SourceColumn, DataSetColumn);
+		}
+
+		public override string ToString ()
+		{
+			return SourceColumn; 
+		}
+
+		#endregion // Methods
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs
@@ -0,0 +1,338 @@
+//
+// System.Data.Common.DataColumnMappingCollection
+//
+// Authors:
+//   Rodrigo Moya (rodrigo@ximian.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// (C) Ximian, Inc
+// Copyright (C) Tim Coleman, 2002-2003
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Data;
+
+namespace System.Data.Common
+{
+	public sealed class DataColumnMappingCollection : MarshalByRefObject, IColumnMappingCollection , IList, ICollection, IEnumerable
+	{
+		#region Fields
+
+		readonly ArrayList list;
+		readonly Hashtable sourceColumns;
+		readonly Hashtable dataSetColumns;
+
+		#endregion // Fields
+
+		#region Constructors 
+
+		public DataColumnMappingCollection ()
+		{
+			list = new ArrayList ();
+			sourceColumns = new Hashtable ();
+			dataSetColumns = new Hashtable ();
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		[Browsable (false)]
+#if !NET_2_0
+		[DataSysDescription ("The number of items in the collection")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		public int Count {
+			get { return list.Count; }
+		}
+
+		[Browsable (false)]
+#if !NET_2_0
+		[DataSysDescription ("The specified DataColumnMapping object.")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		public DataColumnMapping this [int index] {
+			get { return (DataColumnMapping)(list[index]); }
+			set { 
+				DataColumnMapping mapping = (DataColumnMapping)(list[index]);
+				sourceColumns[mapping] = value;
+				dataSetColumns[mapping] = value;
+				list[index] = value;
+			}
+		}
+
+		[Browsable (false)]
+#if !NET_2_0
+		[DataSysDescription ("The specified DataColumnMapping object.")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		public DataColumnMapping this [string sourceColumn] {
+			get {
+				if (!Contains(sourceColumn))
+					throw new IndexOutOfRangeException("DataColumnMappingCollection doesn't contain DataColumnMapping with SourceColumn '" + sourceColumn + "'.");
+				return (DataColumnMapping) sourceColumns [sourceColumn];
+			}
+			set {
+				this [list.IndexOf (sourceColumns [sourceColumn])] = value;
+			}
+		}
+
+		object ICollection.SyncRoot {
+			get { return list.SyncRoot; }
+		}
+
+		bool ICollection.IsSynchronized {
+			get { return list.IsSynchronized; }
+		}
+
+		object IColumnMappingCollection.this [string index] {
+			get { return this [index]; }
+			set {
+				if (!(value is DataColumnMapping))
+					throw new ArgumentException ();
+				this [index] = (DataColumnMapping) value;
+			}
+		}
+
+		object IList.this [int index] {
+			get { return this [index]; }
+			set {
+				if (!(value is DataColumnMapping))
+					throw new ArgumentException ();
+				this [index] = (DataColumnMapping) value;
+			}
+		}
+
+		bool IList.IsReadOnly {
+			get { return false; }
+		}
+
+		bool IList.IsFixedSize {
+			get { return false; }
+		}
+		
+		#endregion // Properties
+
+		#region Methods
+
+		public int Add (object value)
+		{
+			if (!(value is DataColumnMapping))
+				throw new InvalidCastException ();
+
+			list.Add (value);
+			sourceColumns [((DataColumnMapping) value).SourceColumn] = value;
+			dataSetColumns [((DataColumnMapping )value).DataSetColumn] = value;
+			return list.IndexOf (value);
+		}
+
+		public DataColumnMapping Add (string sourceColumn, string dataSetColumn)
+		{
+			DataColumnMapping mapping = new DataColumnMapping (sourceColumn, dataSetColumn);
+			Add (mapping);
+			return mapping;
+		}
+
+#if NET_2_0
+		public void AddRange (Array values)
+		{
+			for (int i = 0; i < values.Length; ++i)
+				Add (values.GetValue (i));
+		}
+#endif
+
+		public void AddRange (DataColumnMapping[] values)
+		{
+			foreach (DataColumnMapping mapping in values)
+				Add (mapping);
+		}
+
+		public void Clear ()
+		{
+			list.Clear ();
+		}
+
+		public bool Contains (object value)
+		{
+			if (!(value is DataColumnMapping))
+				throw new InvalidCastException("Object is not of type DataColumnMapping");
+			return (list.Contains (value));
+		}
+
+		public bool Contains (string value)
+		{
+			return (sourceColumns.Contains (value));
+		}
+
+		public void CopyTo (Array array, int index)
+		{
+			list.CopyTo (array,index);
+		}
+
+#if NET_2_0
+		public void CopyTo (DataColumnMapping [] array, int index)
+		{
+			list.CopyTo (array, index);
+		}
+#endif
+
+		public DataColumnMapping GetByDataSetColumn (string value)
+		{
+			// this should work case-insenstive.
+			if (!(dataSetColumns [value] == null))
+				return (DataColumnMapping) (dataSetColumns [value]);
+			else {
+				string lowcasevalue = value.ToLower ();
+				object [] keyarray = new object [dataSetColumns.Count];
+				dataSetColumns.Keys.CopyTo (keyarray, 0);
+				for (int i = 0; i < keyarray.Length; i++) {
+					string temp = (string) keyarray [i];
+					if (lowcasevalue.Equals (temp.ToLower ()))
+						return (DataColumnMapping) (dataSetColumns [keyarray [i]]);
+				}
+				return null;
+			}
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public static DataColumnMapping GetColumnMappingBySchemaAction (DataColumnMappingCollection columnMappings, string sourceColumn, MissingMappingAction mappingAction)
+		{
+			if (columnMappings.Contains (sourceColumn))
+				return columnMappings[sourceColumn];
+			if (mappingAction == MissingMappingAction.Ignore)
+				return null;
+			if (mappingAction == MissingMappingAction.Error)
+				throw new InvalidOperationException (String.Format ("Missing SourceColumn mapping for '{0}'", sourceColumn));
+			return new DataColumnMapping (sourceColumn, sourceColumn);
+		}
+
+#if NET_2_0
+		[MonoTODO]
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public static DataColumn GetDataColumn (DataColumnMappingCollection columnMappings, string sourceColumn, Type dataType, DataTable dataTable, MissingMappingAction mappingAction, MissingSchemaAction schemaAction)
+		{
+			throw new NotImplementedException ();
+		}
+#endif
+
+		public IEnumerator GetEnumerator ()
+		{
+			return list.GetEnumerator ();
+		}
+
+		IColumnMapping IColumnMappingCollection.Add (string sourceColumnName, string dataSetColumnName)
+		{
+			return Add (sourceColumnName, dataSetColumnName);
+		}
+
+		IColumnMapping IColumnMappingCollection.GetByDataSetColumn (string dataSetColumnName)
+		{
+			return GetByDataSetColumn (dataSetColumnName);
+		}
+
+		public int IndexOf (object value)
+		{
+			return list.IndexOf (value);
+		}
+
+		public int IndexOf (string sourceColumn)
+		{
+			return list.IndexOf (sourceColumns [sourceColumn]);
+		}
+
+		public int IndexOfDataSetColumn (string dataSetColumn)
+		{
+			// this should work case-insensitive
+			if (!(dataSetColumns [dataSetColumn] == null))
+				return list.IndexOf (dataSetColumns [dataSetColumn]);
+			else {
+				string lowcasevalue = dataSetColumn.ToLower ();
+				object [] keyarray = new object[dataSetColumns.Count];
+				dataSetColumns.Keys.CopyTo (keyarray,0);
+				for (int i = 0; i < keyarray.Length; i++) {
+					string temp = (string) keyarray [i];
+					if (lowcasevalue.Equals (temp.ToLower ()))
+						return list.IndexOf (dataSetColumns [keyarray [i]]);
+				}
+				return -1;
+			}
+		}
+
+		public void Insert (int index, object value)
+		{
+			list.Insert (index, value);
+			sourceColumns [((DataColumnMapping) value).SourceColumn] = value;
+			dataSetColumns [((DataColumnMapping) value).DataSetColumn] = value;
+		}
+
+#if NET_2_0
+		public void Insert (int index, DataColumnMapping value)
+		{
+			list.Insert (index, value);
+			sourceColumns [value.SourceColumn] = value;
+			dataSetColumns [value.DataSetColumn] = value;
+		}
+#endif
+
+		public void Remove (object value)
+		{
+			int index = list.IndexOf (value);
+			sourceColumns.Remove (((DataColumnMapping) value).SourceColumn);
+			dataSetColumns.Remove (((DataColumnMapping) value).DataSetColumn);
+			if (index < 0 || index >=list.Count)
+				throw new ArgumentException("There is no such element in collection.");
+			list.Remove (value);
+		}
+
+#if NET_2_0
+		public void Remove (DataColumnMapping value)
+		{
+			int index = list.IndexOf (value);
+			sourceColumns.Remove (value.SourceColumn);
+			dataSetColumns.Remove (value.DataSetColumn);
+			if ( index < 0 || index >=list.Count)
+				throw new ArgumentException("There is no such element in collection.");
+			list.Remove (value);
+		}
+#endif
+
+		public void RemoveAt (int index)
+		{
+			if (index < 0 || index >=list.Count)
+				throw new IndexOutOfRangeException("There is no element in collection.");
+			Remove (list [index]);
+		}
+
+		public void RemoveAt (string sourceColumn)
+		{
+			RemoveAt (list.IndexOf (sourceColumns [sourceColumn]));
+		}
+
+		#endregion // Methods
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DataColumnMappingConverter.cs
@@ -0,0 +1,59 @@
+//
+// System.Data.Common.DataColumnMappingConverter.cs
+//
+// Author:
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) 2004 Andreas Nahr
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Globalization;
+using System.ComponentModel;
+
+namespace System.Data.Common
+{
+	internal sealed class DataColumnMappingConverter : ExpandableObjectConverter
+	{
+		[MonoTODO]
+		public DataColumnMappingConverter ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DataTableMapping.cs
@@ -0,0 +1,159 @@
+//
+// System.Data.Common.DataTableMapping.cs
+//
+// Authors:
+//   Rodrigo Moya (rodrigo@ximian.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// (C) Ximian, Inc
+// Copyright (C) Tim Coleman, 2002-2003
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.Data;
+
+namespace System.Data.Common {
+#if NET_2_0
+	[TypeConverterAttribute ("System.Data.Common.DataTableMapping+DataTableMappingConverter, " + Consts.AssemblySystem_Data)]
+#else
+	[TypeConverterAttribute (typeof (DataTableMappingConverter))]
+#endif
+	public sealed class DataTableMapping : MarshalByRefObject, ITableMapping, ICloneable
+	{
+		#region Fields
+
+		string sourceTable;
+		string dataSetTable;
+		DataColumnMappingCollection columnMappings;
+
+		#endregion // Fields
+
+		#region Constructors
+
+		public DataTableMapping () 
+		{
+			dataSetTable = String.Empty;
+			sourceTable = String.Empty;
+			columnMappings = new DataColumnMappingCollection ();
+		}
+
+		public DataTableMapping (string sourceTable, string dataSetTable) 
+			: this ()
+		{
+			this.sourceTable = sourceTable;
+			this.dataSetTable = dataSetTable;
+		}
+		
+		public DataTableMapping (string sourceTable, string dataSetTable, DataColumnMapping[] columnMappings) 
+			: this (sourceTable, dataSetTable)
+		{
+			this.columnMappings.AddRange (columnMappings);
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+#if !NET_2_0
+		[DataSysDescription ("Individual columns mappings when this table mapping is matched.")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
+		public DataColumnMappingCollection ColumnMappings {
+			get { return columnMappings; }
+		}
+
+#if !NET_2_0
+		[DataSysDescription ("DataTable.TableName")]
+#endif
+		[DefaultValue ("")]
+		public string DataSetTable {
+			get { return dataSetTable; } 
+			set { dataSetTable = value; }
+		}
+
+		IColumnMappingCollection ITableMapping.ColumnMappings {
+			get { return ColumnMappings; }
+		}
+	
+#if !NET_2_0
+		[DataSysDescription ("The DataTableMapping source table name. This name is case sensitive.")]
+#endif
+		[DefaultValue ("")]
+		public string SourceTable {
+			get { return sourceTable; }
+			set { sourceTable = value; }
+		}
+
+		#endregion // Properties
+
+		#region Methods
+
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public DataColumnMapping GetColumnMappingBySchemaAction (string sourceColumn, MissingMappingAction mappingAction) 
+		{
+			return DataColumnMappingCollection.GetColumnMappingBySchemaAction (columnMappings, sourceColumn, mappingAction);
+		}
+
+#if NET_2_0
+		[MonoTODO]
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public DataColumn GetDataColumn (string sourceColumn, 
+						 Type dataType, 
+						 DataTable dataTable, 
+						 MissingMappingAction mappingAction, 
+						 MissingSchemaAction schemaAction)
+		{
+			throw new NotImplementedException ();
+		}
+#endif
+
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public DataTable GetDataTableBySchemaAction (DataSet dataSet, MissingSchemaAction schemaAction) 
+		{
+			if (dataSet.Tables.Contains (DataSetTable))
+				return dataSet.Tables [DataSetTable];
+			if (schemaAction == MissingSchemaAction.Ignore)
+				return null;
+			if (schemaAction == MissingSchemaAction.Error)
+				throw new InvalidOperationException (String.Format ("Missing the '{0} DataTable for the '{1}' SourceTable", DataSetTable, SourceTable));
+			return new DataTable (DataSetTable);
+		}
+
+		object ICloneable.Clone ()
+		{
+			DataColumnMapping [] arr = new DataColumnMapping [columnMappings.Count];
+			columnMappings.CopyTo (arr, 0);
+			return new DataTableMapping (SourceTable, DataSetTable, arr);
+		}
+
+		public override string ToString ()
+		{
+			return SourceTable; 
+		}
+		
+		#endregion // Methods
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DataTableMappingCollection.cs
@@ -0,0 +1,326 @@
+//
+// System.Data.Common.DataTableMappingCollection.cs
+//
+// Author:
+//   Rodrigo Moya (rodrigo@ximian.com)
+//   Tim Coleman (tim@timcoleman.com)
+//
+// (C) Ximian, Inc
+// Copyright (C) Tim Coleman, 2002-2003
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Data.Common
+{
+	[ListBindable (false)]
+	[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DataTableMappingCollectionEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
+	public sealed class DataTableMappingCollection : MarshalByRefObject, ITableMappingCollection, IList, ICollection, IEnumerable
+	{
+		#region Fields
+
+		ArrayList mappings;
+		Hashtable sourceTables;
+		Hashtable dataSetTables;
+
+		#endregion
+
+		#region Constructors 
+
+		public DataTableMappingCollection() 
+		{
+			mappings = new ArrayList ();
+			sourceTables = new Hashtable ();
+			dataSetTables = new Hashtable ();
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		[Browsable (false)]
+#if !NET_2_0
+		[DataSysDescription ("The number of items in the collection")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		public int Count {
+			get { return mappings.Count; }
+		}
+
+		[Browsable (false)]
+#if !NET_2_0
+		[DataSysDescription ("The specified DataTableMapping object")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		public DataTableMapping this [int index] {
+			get { return (DataTableMapping)(mappings[index]); }
+			set {
+				DataTableMapping mapping = (DataTableMapping) mappings[index];
+				sourceTables [mapping.SourceTable] = value;
+				dataSetTables [mapping.DataSetTable] = value;
+				mappings [index] = value; 
+			}
+		}
+
+		[Browsable (false)]
+#if !NET_2_0
+		[DataSysDescription ("The specified DataTableMapping object")]
+#endif
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		public DataTableMapping this [string sourceTable] {
+			get { return (DataTableMapping) sourceTables[sourceTable]; }
+			set { this [mappings.IndexOf (sourceTables[sourceTable])] = value; }
+		}
+
+		object IList.this [int index] {
+			get { return (object)(this[index]); }
+			set {
+				if (!(value is DataTableMapping))
+					throw new ArgumentException (); 
+				this[index] = (DataTableMapping)value;
+			}
+		}
+
+		bool ICollection.IsSynchronized {
+			get { return mappings.IsSynchronized; }
+		}
+
+		object ICollection.SyncRoot {
+			get { return mappings.SyncRoot; }
+		}
+
+		bool IList.IsFixedSize {
+			get { return false; }
+		}
+
+		bool IList.IsReadOnly {
+			get { return false; }
+		}
+
+		object ITableMappingCollection.this [string index] {
+			get { return this [index]; }
+			set {
+				if (!(value is DataTableMapping))
+					throw new ArgumentException ();
+				this [index] = (DataTableMapping) value;
+			}
+		}
+
+		#endregion // Properties
+
+		#region Methods
+
+		public int Add (object value)
+		{
+			if (!(value is System.Data.Common.DataTableMapping))
+				throw new InvalidCastException ("The object passed in was not a DataTableMapping object.");
+
+			sourceTables [((DataTableMapping) value).SourceTable] = value;
+			dataSetTables [((DataTableMapping) value).DataSetTable] = value;
+			return mappings.Add (value);
+		}
+
+		public DataTableMapping Add (string sourceTable, string dataSetTable) 
+		{
+			DataTableMapping mapping = new DataTableMapping (sourceTable, dataSetTable);
+			Add (mapping);
+			return mapping;
+		}
+
+#if NET_2_0
+		public void AddRange (Array values)
+		{
+			for (int i = 0; i < values.Length; ++i)
+				Add (values.GetValue (i));
+		}
+#endif
+
+		public void AddRange (DataTableMapping[] values)
+		{
+			foreach (DataTableMapping dataTableMapping in values)
+				this.Add (dataTableMapping);
+		}
+
+		public void Clear ()
+		{
+			sourceTables.Clear ();
+			dataSetTables.Clear ();
+			mappings.Clear ();
+		}
+
+		public bool Contains (object value)
+		{
+			return mappings.Contains (value);
+		}
+
+		public bool Contains (string value)
+		{
+			return sourceTables.Contains (value);
+		}
+
+		public void CopyTo (Array array, int index)
+		{
+			mappings.CopyTo (array, index);
+		}
+
+#if NET_2_0
+		public void CopyTo (DataTableMapping[] array, int index) 
+		{
+			mappings.CopyTo (array, index);
+		}
+#endif
+
+		public DataTableMapping GetByDataSetTable (string dataSetTable) 
+		{
+			// this should work case-insenstive.
+			if (!(dataSetTables[dataSetTable] == null))
+				return (DataTableMapping) (dataSetTables [dataSetTable]);
+			else {
+				string lowcasevalue = dataSetTable.ToLower ();
+				object [] keyarray = new object [dataSetTables.Count];
+				dataSetTables.Keys.CopyTo (keyarray, 0);
+				for (int i=0; i<keyarray.Length; i++) {
+					string temp = (string) keyarray [i];
+					if (lowcasevalue.Equals (temp.ToLower ()))
+						return (DataTableMapping) (dataSetTables [keyarray [i]]);
+				}
+				return null;
+			}
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Advanced)]
+		public static DataTableMapping GetTableMappingBySchemaAction (DataTableMappingCollection tableMappings, string sourceTable, string dataSetTable, MissingMappingAction mappingAction) 
+		{
+			if (tableMappings.Contains (sourceTable))
+				return tableMappings[sourceTable];
+			if (mappingAction == MissingMappingAction.Error)
+				throw new InvalidOperationException (String.Format ("Missing source table mapping: '{0}'",
+										    sourceTable));
+			if (mappingAction == MissingMappingAction.Ignore)
+				return null;
+			return new DataTableMapping (sourceTable, dataSetTable);
+		}
+
+		public IEnumerator GetEnumerator ()
+		{
+			return mappings.GetEnumerator ();
+		}
+
+		public int IndexOf (object value) 
+		{
+			return mappings.IndexOf (value);
+		}
+
+		public int IndexOf (string sourceTable) 
+		{
+			return IndexOf (sourceTables[sourceTable]);
+		}
+
+		public int IndexOfDataSetTable (string dataSetTable) 
+		{
+			// this should work case-insensitive
+			if (!(dataSetTables[dataSetTable] == null)) 
+				return IndexOf ((DataTableMapping)(dataSetTables[dataSetTable]));
+			else {
+				string lowcasevalue = dataSetTable.ToLower();
+				object [] keyarray = new object[dataSetTables.Count];
+				dataSetTables.Keys.CopyTo(keyarray,0);
+				for (int i=0; i<keyarray.Length; i++) {
+					string temp = (string) keyarray[i];
+					if (lowcasevalue.Equals(temp.ToLower()))
+						return IndexOf ((DataTableMapping)(dataSetTables[keyarray[i]]));
+				}
+				return -1;
+			}
+
+		}
+
+		public void Insert (int index, object value) 
+		{
+			mappings.Insert (index, value);
+			sourceTables [((DataTableMapping) value).SourceTable] = value;
+			dataSetTables [((DataTableMapping) value).DataSetTable] = value;
+		}
+
+#if NET_2_0
+		public void Insert (int index, DataTableMapping value) 
+		{
+			mappings.Insert (index, value);
+			sourceTables [value.SourceTable] = value;
+			dataSetTables [value.DataSetTable] = value;
+		}
+#endif
+
+		ITableMapping ITableMappingCollection.Add (string sourceTableName, string dataSetTableName)
+		{
+			ITableMapping tableMapping = new DataTableMapping (sourceTableName, dataSetTableName);
+			Add (tableMapping);
+			return tableMapping;
+		}
+
+		ITableMapping ITableMappingCollection.GetByDataSetTable (string dataSetTableName)
+		{
+			return this [mappings.IndexOf (dataSetTables [dataSetTableName])];
+		}
+
+		public void Remove (object value) 
+		{
+			if (!(value is DataTableMapping))
+				throw new InvalidCastException ();
+			int index = mappings.IndexOf (value);
+			if (index < 0 || index >= mappings.Count)
+				throw new ArgumentException("There is no such element in collection.");
+			mappings.Remove ((DataTableMapping) value);
+		}
+
+#if NET_2_0
+		public void Remove (DataTableMapping value) 
+		{
+			int index = mappings.IndexOf (value);
+			if (index < 0 || index >= mappings.Count)
+				throw new ArgumentException("There is no such element in collection."); 
+			mappings.Remove ((DataTableMapping) value);
+		}
+#endif
+
+		public void RemoveAt (int index) 
+		{
+			 if (index < 0 || index >= mappings.Count)
+				throw new IndexOutOfRangeException("There is no element in collection.");
+
+			mappings.RemoveAt (index);
+		}
+
+		public void RemoveAt (string sourceTable) 
+		{
+			RemoveAt (mappings.IndexOf (sourceTables[sourceTable]));
+		}
+
+		#endregion // Methods
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DataTableMappingConverter.cs
@@ -0,0 +1,59 @@
+//
+// System.Data.Common.DataTableMappingConverter.cs
+//
+// Author:
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) 2004 Andreas Nahr
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Globalization;
+using System.ComponentModel;
+
+namespace System.Data.Common
+{
+	internal sealed class DataTableMappingConverter : ExpandableObjectConverter
+	{
+		[MonoTODO]
+		public DataTableMappingConverter ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DbConnectionOptions.cs
@@ -0,0 +1,257 @@
+//
+// System.Data.Common.DbConnectionOptions
+//	adapted from older (pre beta1) DbConnectionString
+//
+// Authors:
+//	Tim Coleman (tim@timcoleman.com)
+//	Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) Tim Coleman, 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System.Collections;
+using System.Collections.Specialized;
+using System.Security;
+using System.Text;
+
+namespace System.Data.Common {
+
+	internal class DbConnectionOptions {
+
+		#region Fields
+
+		internal NameValueCollection options;
+		internal string normalizedConnectionString;
+
+		#endregion // Fields
+
+		#region Constructors
+
+		internal DbConnectionOptions ()
+		{
+		}
+
+		protected internal DbConnectionOptions (DbConnectionOptions connectionOptions)
+		{
+			options = connectionOptions.options;
+		}
+
+		public DbConnectionOptions (string connectionString)
+		{
+			options = new NameValueCollection ();
+			ParseConnectionString (connectionString);
+		}
+		
+		[MonoTODO]
+		public DbConnectionOptions (string connectionString, Hashtable synonyms, bool useFirstKeyValuePair)
+			: this (connectionString)
+		{
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		[MonoTODO]
+		public bool IsEmpty {
+			get { throw new NotImplementedException (); }
+		}
+
+		public string this [string keyword] {
+			get { return options [keyword]; }
+		}
+
+		public ICollection Keys {
+			get { return options.Keys; }
+		}
+
+		#endregion // Properties
+
+		#region Methods
+
+		[MonoTODO]
+		protected void BuildConnectionString (StringBuilder builder, string[] withoutOptions, string insertValue)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public bool ContainsKey (string keyword)
+		{
+			return (options.Get (keyword) != null);
+		}
+
+		public bool ConvertValueToBoolean (string keyname, bool defaultvalue)
+		{
+			if (ContainsKey (keyname))
+				return Boolean.Parse (this [keyname].Trim ());
+			return defaultvalue;
+		}
+
+		public int ConvertValueToInt32 (string keyname, int defaultvalue)
+		{
+			if (ContainsKey (keyname))
+				return Int32.Parse (this [keyname].Trim ());
+			return defaultvalue;
+		}
+
+		[MonoTODO]
+		public bool ConvertValueToIntegratedSecurity ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public string ConvertValueToString (string keyname, string defaultValue)
+		{
+			if (ContainsKey (keyname))
+				return this [keyname];
+			return defaultValue;
+		}
+
+		[MonoTODO]
+		protected internal virtual PermissionSet CreatePermissionSet ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected internal virtual string Expand ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public static string RemoveKeyValuePairs (string connectionString, string[] keynames)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public string UsersConnectionString (bool hisPasswordPwd)
+		{
+			throw new NotImplementedException ();
+		}
+
+		internal void ParseConnectionString (string connectionString)
+		{
+			if (connectionString.Length == 0)
+				return;
+
+			connectionString += ";";
+
+			bool inQuote = false;
+			bool inDQuote = false;
+			bool inName = true;
+
+			string name = String.Empty;
+			string value = String.Empty;
+			StringBuilder sb = new StringBuilder ();
+
+			for (int i = 0; i < connectionString.Length; i += 1) {
+				char c = connectionString [i];
+				char peek;
+				if (i == connectionString.Length - 1)
+					peek = '\0';
+				else 
+					peek = connectionString [i + 1];
+
+				switch (c) {
+				case '\'':
+					if (inDQuote) 
+						sb.Append (c);
+					else if (peek.Equals (c)) {
+						sb.Append (c);
+						i += 1;
+					}
+					else 
+						inQuote = !inQuote;
+					break;
+				case '"':
+					if (inQuote) 
+						sb.Append (c);
+					else if (peek.Equals (c)) {
+						sb.Append (c);
+						i += 1;
+					}
+					else 
+						inDQuote = !inDQuote;
+					break;
+				case ';':
+					if (inDQuote || inQuote)
+						sb.Append (c);
+					else {
+						if (name != String.Empty && name != null) {
+							value = sb.ToString ();
+							// FIXME - KeywordLookup is an NOP
+							// options [KeywordLookup (name.Trim ())] = value;
+							options [name.Trim ()] = value;
+						}
+						inName = true;
+						name = String.Empty;
+						value = String.Empty;
+						sb = new StringBuilder ();
+					}
+					break;
+				case '=':
+					if (inDQuote || inQuote || !inName)
+						sb.Append (c);
+					else if (peek.Equals (c)) {
+						sb.Append (c);
+						i += 1;
+					} 
+					else {
+						name = sb.ToString ();
+						sb = new StringBuilder ();
+						inName = false;
+					}
+					break;
+				case ' ':
+					if (inQuote || inDQuote)
+						sb.Append (c);
+					else if (sb.Length > 0 && !peek.Equals (';'))
+						sb.Append (c);
+					break;
+				default:
+					sb.Append (c);
+					break;
+				}
+			}	
+			
+			StringBuilder normalized = new StringBuilder ();
+			ArrayList keys = new ArrayList ();
+			keys.AddRange (Keys);
+			keys.Sort ();
+			foreach (string key in keys)
+			{
+				string entry = String.Format ("{0}=\"{1}\";", key, this [key].Replace ("\"", "\"\""));
+				normalized.Append (entry);
+			}
+			normalizedConnectionString = normalized.ToString ();
+		}
+
+		#endregion // Methods
+	}
+}
+
+#endif
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DbConnectionString.cs
@@ -0,0 +1,113 @@
+//
+// System.Data.Common.DbConnectionString
+//
+// Authors:
+//	Tim Coleman (tim@timcoleman.com)
+//	Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) Tim Coleman, 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System.Collections;
+using System.Collections.Specialized;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace System.Data.Common {
+
+	[Obsolete ()]
+	internal class DbConnectionString : DbConnectionOptions, ISerializable {
+
+		#region Fields
+
+		KeyRestrictionBehavior behavior;
+
+		#endregion // Fields
+
+		#region Constructors
+
+		protected internal DbConnectionString (DbConnectionString constr)
+		{
+			options = constr.options;
+		}
+
+		public DbConnectionString (string connectionString)
+			: base (connectionString)
+		{
+			options = new NameValueCollection ();
+			ParseConnectionString (connectionString);
+		}
+		
+		[MonoTODO]
+		protected DbConnectionString (SerializationInfo si, StreamingContext sc)
+		{
+		}
+
+		[MonoTODO]
+		public DbConnectionString (string connectionString, string restrictions, KeyRestrictionBehavior behavior)
+			: this (connectionString)
+		{
+			this.behavior = behavior;
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		public KeyRestrictionBehavior Behavior {
+			get { return behavior; }
+		}
+
+		[MonoTODO]
+		public string Restrictions {
+			get { throw new NotImplementedException (); }
+		}
+		
+		#endregion // Properties
+
+		#region Methods
+
+		[MonoTODO]
+		public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
+		{
+			throw new NotImplementedException ();
+		}
+
+		protected virtual string KeywordLookup (string keyname)
+		{
+			return keyname;
+		}
+
+		[MonoTODO]
+		public virtual void PermissionDemand ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		#endregion // Methods
+	}
+}
+
+#endif
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs
@@ -0,0 +1,802 @@
+//
+// System.Data.Common.DbConnectionStringBuilder.cs
+//
+// Author:
+//	Sureshkumar T (tsureshkumar@novell.com)
+//	Gert Driesen (drieseng@users.sourceforge.net
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Data;
+using System.Data.Common;
+using System.Reflection;
+using System.Text;
+
+namespace System.Data.Common
+{
+	public class DbConnectionStringBuilder : IDictionary, ICollection, IEnumerable, ICustomTypeDescriptor
+	{
+		#region Fields
+
+		readonly Dictionary<string, object> _dictionary;
+		readonly bool useOdbcRules;
+
+		#endregion Fields
+
+		#region Constructors
+
+		public DbConnectionStringBuilder () : this (false)
+		{
+		}
+
+		public DbConnectionStringBuilder (bool useOdbcRules)
+		{
+			this.useOdbcRules = useOdbcRules;
+			_dictionary = new Dictionary <string, object> (StringComparer.InvariantCultureIgnoreCase);
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+		[EditorBrowsable (EditorBrowsableState.Never)]
+		[Browsable (false)]
+		[DesignOnly (true)]
+		public bool BrowsableConnectionString {
+			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
+		}
+
+		[RefreshProperties (RefreshProperties.All)]
+		public string ConnectionString {
+			get {
+				IDictionary<string, object> dictionary = (IDictionary <string, object>) _dictionary;
+				StringBuilder sb = new StringBuilder ();
+				foreach (string key in Keys) {
+					object value = null;
+					if (!dictionary.TryGetValue (key, out value))
+						continue;
+					string val = value.ToString ();
+					AppendKeyValuePair (sb, key, val, useOdbcRules);
+				}
+				return sb.ToString ();
+			}
+			set {
+				Clear ();
+				if (value == null)
+					return;
+				if (value.Trim ().Length == 0)
+					return;
+				ParseConnectionString (value);
+			}
+		}
+
+		[Browsable (false)]
+                public virtual int Count
+                {
+                        get { return _dictionary.Count; }
+                }
+
+		[Browsable (false)]
+                public virtual bool IsFixedSize
+                {
+                        get { return false; }
+                }
+
+		[Browsable (false)]
+                public bool IsReadOnly
+                {
+                        get { throw new NotImplementedException (); }
+                }
+
+		[Browsable (false)]
+		public virtual object this [string keyword] {
+			get {
+				if (ContainsKey (keyword))
+					return _dictionary [keyword];
+				else
+					throw new ArgumentException (string.Format (
+						"Keyword '{0}' does not exist",
+						keyword));
+			}
+			set {
+				if (value == null) {
+					Remove (keyword);
+					return;
+				}
+
+				if (keyword == null)
+					throw new ArgumentNullException ("keyword");
+
+				if (keyword.Length == 0)
+					throw CreateInvalidKeywordException (keyword);
+
+				for (int i = 0; i < keyword.Length; i++) {
+					char c = keyword [i];
+					if (i == 0 && (Char.IsWhiteSpace (c) || c == ';'))
+						throw CreateInvalidKeywordException (keyword);
+					if (i == (keyword.Length - 1) && Char.IsWhiteSpace (c))
+						throw CreateInvalidKeywordException (keyword);
+					if (Char.IsControl (c))
+						throw CreateInvalidKeywordException (keyword);
+				}
+
+				if (ContainsKey (keyword))
+					_dictionary [keyword] = value;
+				else
+					_dictionary.Add (keyword, value);
+			}
+		}
+
+		[Browsable (false)]
+		public virtual ICollection Keys
+		{
+			get {
+				string [] keys = new string [_dictionary.Keys.Count];
+				((ICollection<string>) _dictionary.Keys).CopyTo (keys, 0);
+				ReadOnlyCollection<string> keyColl = new ReadOnlyCollection<string> (keys);
+				return keyColl; 
+			}
+		}
+
+                bool ICollection.IsSynchronized
+                {
+                        get { throw new NotImplementedException (); }
+                }
+
+                object ICollection.SyncRoot
+                {
+                        get { throw new NotImplementedException (); }
+                }
+
+                object IDictionary.this [object keyword]
+                {
+                        get { return this [(string) keyword]; }
+                        set { this [(string) keyword] = value; }
+                }
+
+		[Browsable (false)]
+		public virtual ICollection Values {
+			get {
+				object [] values = new object [_dictionary.Values.Count];
+				((ICollection<object>) _dictionary.Values).CopyTo (values, 0);
+				ReadOnlyCollection<object> valuesColl = new ReadOnlyCollection<object> (values);
+				return valuesColl; 
+			}
+		}
+
+		#endregion // Properties
+
+		#region Methods
+
+		public void Add (string keyword, object value)
+		{
+			this [keyword] = value;
+		}
+
+		public static void AppendKeyValuePair (StringBuilder builder, string keyword, string value,
+						       bool useOdbcRules)
+		{
+			if (builder == null)
+				throw new ArgumentNullException ("builder");
+			if (keyword == null)
+				throw new ArgumentNullException ("keyName");
+			if (keyword.Length == 0)
+				throw new ArgumentException ("Empty keyword is not valid.");
+
+			if (builder.Length > 0)
+				builder.Append (';');
+			if (!useOdbcRules)
+				builder.Append (keyword.Replace ("=", "=="));
+			else
+				builder.Append (keyword);
+			builder.Append ('=');
+
+			if (value == null || value.Length == 0)
+				return;
+
+			if (!useOdbcRules) {
+				bool dquoteFound = (value.IndexOf ('\"') > -1);
+				bool squoteFound = (value.IndexOf ('\'') > -1);
+	
+				if (dquoteFound && squoteFound) {
+					builder.Append ('\"');
+					builder.Append (value.Replace ("\"", "\"\""));
+					builder.Append ('\"');
+				} else if (dquoteFound) {
+					builder.Append ('\'');
+					builder.Append (value);
+					builder.Append ('\'');
+				} else if (squoteFound || value.IndexOf ('=') > -1 || value.IndexOf (';') > -1) {
+					builder.Append ('\"');
+					builder.Append (value);
+					builder.Append ('\"');
+				} else if (ValueNeedsQuoting (value)) {
+					builder.Append ('\"');
+					builder.Append (value);
+					builder.Append ('\"');
+				} else
+					builder.Append (value);
+			} else {
+				int braces = 0;
+				bool semicolonFound = false;
+				int len = value.Length;
+				bool needBraces = false;
+
+				int lastChar = -1;
+
+				for (int i = 0; i < len; i++) {
+					int peek = 0;
+					if (i == (len - 1))
+						peek = -1;
+					else
+						peek = value [i + 1];
+
+					char c = value [i];
+					switch (c) {
+					case '{':
+						braces++;
+						break;
+					case '}':
+						if (peek.Equals (c)) {
+							i++;
+							continue;
+						} else {
+							braces--;
+							if (peek != -1)
+								needBraces = true;
+						}
+						break;
+					case ';':
+						semicolonFound = true;
+						break;
+					default:
+						break;
+					}
+					lastChar = c;
+				}
+
+				if (value [0] == '{' && (lastChar != '}' || (braces == 0 && needBraces))) {
+					builder.Append ('{');
+					builder.Append (value.Replace ("}", "}}"));
+					builder.Append ('}');
+					return;
+				}
+
+				bool isDriver = (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0);
+				if (isDriver) {
+					if (value [0] == '{' && lastChar == '}' && !needBraces) {
+						builder.Append (value);
+						return;
+					}
+					builder.Append ('{');
+					builder.Append (value.Replace ("}", "}}"));
+					builder.Append ('}');
+					return;
+				}
+
+				if (value [0] == '{' && (braces != 0 || lastChar != '}') && needBraces) {
+					builder.Append ('{');
+					builder.Append (value.Replace ("}", "}}"));
+					builder.Append ('}');
+					return;
+				}
+
+				if (value [0] != '{' && semicolonFound) {
+					builder.Append ('{');
+					builder.Append (value.Replace ("}", "}}"));
+					builder.Append ('}');
+					return;
+				}
+
+				builder.Append (value);
+			}
+		}
+
+		public static void AppendKeyValuePair (StringBuilder builder, string keyword, string value)
+		{
+			AppendKeyValuePair (builder, keyword, value, false);
+		}
+
+		public virtual void Clear ()
+		{
+			_dictionary.Clear ();
+		}
+
+		public virtual bool ContainsKey (string keyword)
+		{
+			if (keyword == null)
+				throw new ArgumentNullException ("keyword");
+			return _dictionary.ContainsKey (keyword);
+		}
+
+                public virtual bool EquivalentTo (DbConnectionStringBuilder connectionStringBuilder)
+                {
+                        bool ret = true;
+                        try {
+                                if (Count != connectionStringBuilder.Count)
+                                        ret = false;
+                                else {
+                                        foreach (string key in Keys) {
+                                                if (!this [key].Equals (connectionStringBuilder [key])) {
+                                                        ret = false;
+                                                        break;
+                                                }
+                                        }
+                                }
+                        } catch (ArgumentException) {
+                                ret = false;
+                        }
+                        return ret;
+                }
+
+		[MonoTODO]
+		protected virtual void GetProperties (Hashtable propertyDescriptors)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected internal void ClearPropertyDescriptors ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public virtual bool Remove (string keyword)
+		{
+			if (keyword == null)
+				throw new ArgumentNullException ("keyword");
+			return _dictionary.Remove (keyword);
+		}
+
+                public virtual bool ShouldSerialize (string keyword)
+                {
+                        throw new NotImplementedException ();
+                }
+
+                void ICollection.CopyTo (Array array, int index)
+                {
+			if (array == null)
+				throw new ArgumentNullException ("array");
+			KeyValuePair<string, object> [] arr = array as KeyValuePair<string, object> [];
+			if (arr == null)
+				throw new ArgumentException ("Target array type is not compatible with the type of items in the collection");
+			((ICollection<KeyValuePair<string, object>>) _dictionary).CopyTo (arr, index);
+                }
+
+                void IDictionary.Add (object keyword, object value)
+                {
+                        this.Add ((string) keyword, value);
+                }
+
+                bool IDictionary.Contains (object keyword)
+                {
+                        return ContainsKey ((string) keyword);
+                }
+
+                IDictionaryEnumerator IDictionary.GetEnumerator ()
+                {
+                        return (IDictionaryEnumerator) _dictionary.GetEnumerator ();
+                }
+
+                void IDictionary.Remove (object keyword)
+                {
+                        Remove ((string) keyword);
+                }
+
+                IEnumerator IEnumerable.GetEnumerator ()
+                {
+                        return (IEnumerator) _dictionary.GetEnumerator ();
+                }
+
+                private static object _staticAttributeCollection = null;
+                AttributeCollection ICustomTypeDescriptor.GetAttributes ()
+                {
+                        object value = _staticAttributeCollection;
+                        if (value == null) {
+                                CLSCompliantAttribute clsAttr = new CLSCompliantAttribute (true);
+                                DefaultMemberAttribute defMemAttr = new DefaultMemberAttribute ("Item");
+                                Attribute [] attrs = {clsAttr, defMemAttr};
+                                value = new AttributeCollection (attrs);
+                        }
+                        System.Threading.Interlocked.CompareExchange (ref _staticAttributeCollection, value, null);
+                        return _staticAttributeCollection as AttributeCollection;
+                }
+
+                string ICustomTypeDescriptor.GetClassName ()
+                {
+                        return this.GetType ().ToString ();
+                }
+
+                string ICustomTypeDescriptor.GetComponentName ()
+                {
+                        return null;
+                }
+
+                TypeConverter ICustomTypeDescriptor.GetConverter ()
+                {
+                        return new CollectionConverter ();
+                }
+
+                EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
+                {
+                        return null;
+                }
+
+                PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
+                {
+                        return null;
+                }
+
+                object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
+                {
+                        return null;
+                }
+
+                EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
+                {
+                        return EventDescriptorCollection.Empty;
+                }
+
+                EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute [] attributes)
+                {
+                        return EventDescriptorCollection.Empty;
+                }
+
+                PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
+                {
+                        return PropertyDescriptorCollection.Empty;
+                }
+
+                PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute [] attributes)
+                {
+                        return PropertyDescriptorCollection.Empty;
+                }
+
+                object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
+                {
+                        throw new NotImplementedException ();
+                }
+
+                public override string ToString ()
+                {
+                        return ConnectionString;
+                }
+
+                public virtual bool TryGetValue (string keyword, out object value)
+                {
+                        // FIXME : not sure, difference between this [keyword] and this method
+                        bool found = ContainsKey (keyword);
+                        if (found)
+                                value = this [keyword];
+                        else
+                                value = null;
+                        return found;
+                }
+
+		static ArgumentException CreateInvalidKeywordException (string keyword)
+		{
+			return new ArgumentException ("A keyword cannot contain "
+				+ "control characters, leading semicolons or "
+				+ "leading or trailing whitespace.", keyword);
+		}
+
+		static ArgumentException CreateConnectionStringInvalidException (int index)
+		{
+			return new ArgumentException ("Format of initialization "
+				+ "string does not conform to specifications at "
+				+ "index " + index + ".");
+		}
+
+		static bool ValueNeedsQuoting (string value)
+		{
+			foreach (char c in value) {
+				if (char.IsWhiteSpace (c))
+					return true;
+			}
+			return false;
+		}
+		void ParseConnectionString (string connectionString)
+		{
+			if (useOdbcRules)
+				ParseConnectionStringOdbc (connectionString);
+			else
+				ParseConnectionStringNonOdbc (connectionString);
+		}
+
+		void ParseConnectionStringOdbc (string connectionString)
+		{
+			bool inQuote = false;
+			bool inDQuote = false;
+			bool inName = true;
+			bool inBraces = false;
+
+			string name = String.Empty;
+			string val = String.Empty;
+			StringBuilder sb = new StringBuilder ();
+			int len = connectionString.Length;
+
+			for (int i = 0; i < len; i++) {
+				char c = connectionString [i];
+				int peek = (i == (len - 1)) ? -1 : connectionString [i + 1];
+
+				switch (c) {
+				case '{':
+					if (inName) {
+						sb.Append (c);
+						continue;
+					}
+
+					if (sb.Length == 0)
+						inBraces = true;
+					sb.Append (c);
+					break;
+				case '}':
+					if (inName || !inBraces) {
+						sb.Append (c);
+						continue;
+					}
+
+					if (peek == -1) {
+						sb.Append (c);
+						inBraces = false;
+					} else if (peek.Equals (c)) {
+						sb.Append (c);
+						sb.Append (c);
+						i++;
+					} else {
+						int next = NextNonWhitespaceChar (connectionString, i);
+						if (next != -1 && ((char) next) != ';')
+							throw CreateConnectionStringInvalidException (next);
+						sb.Append (c);
+						inBraces = false;
+					}
+					break;
+				case ';':
+					if (inName || inBraces) {
+						sb.Append (c);
+						continue;
+					}
+
+					if (name.Length > 0 && sb.Length > 0) {
+						val = sb.ToString ();
+						name = name.ToLower ().TrimEnd ();
+						this [name] = val;
+					} else if (sb.Length > 0)
+						throw CreateConnectionStringInvalidException (c);
+					inName = true;
+					name = String.Empty;
+					sb.Length = 0;
+					break;
+				case '=':
+					if (inBraces || !inName) {
+						sb.Append (c);
+						continue;
+					}
+
+					name = sb.ToString ();
+					if (name.Length == 0)
+						throw CreateConnectionStringInvalidException (c);
+					sb.Length = 0;
+					inName = false;
+					break;
+				default:
+					if (inDQuote || inQuote || inBraces)
+						sb.Append (c);
+					else if (char.IsWhiteSpace (c)) {
+						// ignore leading whitespace
+						if (sb.Length > 0) {
+							int nextChar = SkipTrailingWhitespace (connectionString, i);
+							if (nextChar == -1)
+								sb.Append (c);
+							else
+								i = nextChar;
+						}
+					} else
+						sb.Append (c);
+					break;
+				}
+			}
+
+			if ((inName && sb.Length > 0) || inDQuote || inQuote || inBraces)
+				throw CreateConnectionStringInvalidException (len - 1);
+
+			if (name.Length > 0 && sb.Length > 0) {
+				val = sb.ToString ();
+				name = name.ToLower ().TrimEnd ();
+				this [name] = val;
+			}
+		}
+
+		void ParseConnectionStringNonOdbc (string connectionString)
+		{
+			bool inQuote = false;
+			bool inDQuote = false;
+			bool inName = true;
+
+			string name = String.Empty;
+			string val = String.Empty;
+			StringBuilder sb = new StringBuilder ();
+			int len = connectionString.Length;
+
+			for (int i = 0; i < len; i++) {
+				char c = connectionString [i];
+				int peek = (i == (len - 1)) ? -1 : connectionString [i + 1];
+
+				switch (c) {
+				case '\'':
+					if (inName) {
+						sb.Append (c);
+						continue;
+					}
+
+					if (inDQuote)
+						sb.Append (c);
+					else if (inQuote) {
+						if (peek == -1)
+							inQuote = false;
+						else if (peek.Equals (c)) {
+							sb.Append (c);
+							i++;
+						} else {
+							int next = NextNonWhitespaceChar (connectionString, i);
+							if (next != -1 && ((char) next) != ';')
+								throw CreateConnectionStringInvalidException (next);
+							inQuote = false;
+						}
+
+						if (!inQuote) {
+							val = sb.ToString ();
+							name = name.ToLower ().TrimEnd ();
+							this [name] = val;
+							inName = true;
+							name = String.Empty;
+							sb.Length = 0;
+						}
+					} else if (sb.Length == 0)
+						inQuote = true;
+					else
+						sb.Append (c);
+					break;
+				case '"':
+					if (inName) {
+						sb.Append (c);
+						continue;
+					}
+
+					if (inQuote)
+						sb.Append (c);
+					else if (inDQuote) {
+						if (peek == -1)
+							inDQuote = false;
+						else if (peek.Equals (c)) {
+							sb.Append (c);
+							i++;
+						} else {
+							int next = NextNonWhitespaceChar (connectionString, i);
+							if (next != -1 && ((char) next) != ';')
+								throw CreateConnectionStringInvalidException (next);
+							inDQuote = false;
+						}
+					} else if (sb.Length == 0)
+						inDQuote = true;
+					else
+						sb.Append (c);
+					break;
+				case ';':
+					if (inName) {
+						sb.Append (c);
+						continue;
+					}
+
+					if (inDQuote || inQuote)
+						sb.Append (c);
+					else {
+						if (name.Length > 0 && sb.Length > 0) {
+							val = sb.ToString ();
+							name = name.ToLower ().TrimEnd ();
+							this [name] = val;
+						} else if (sb.Length > 0)
+							throw CreateConnectionStringInvalidException (c);
+						inName = true;
+						name = String.Empty;
+						sb.Length = 0;
+					}
+					break;
+				case '=':
+					if (inDQuote || inQuote || !inName)
+						sb.Append (c);
+					else if (peek != -1 && peek.Equals (c)) {
+						sb.Append (c);
+						i++;
+					} else {
+						name = sb.ToString ();
+						if (name.Length == 0)
+							throw CreateConnectionStringInvalidException (c);
+						sb.Length = 0;
+						inName = false;
+					}
+					break;
+				default:
+					if (inDQuote || inQuote)
+						sb.Append (c);
+					else if (char.IsWhiteSpace (c)) {
+						// ignore leading whitespace
+						if (sb.Length > 0) {
+							int nextChar = SkipTrailingWhitespace (connectionString, i);
+							if (nextChar == -1)
+								sb.Append (c);
+							else
+								i = nextChar;
+						}
+					} else
+						sb.Append (c);
+					break;
+				}
+			}
+
+			if ((inName && sb.Length > 0) || inDQuote || inQuote)
+				throw CreateConnectionStringInvalidException (len -1);
+
+			if (name.Length > 0 && sb.Length > 0) {
+				val = sb.ToString ();
+				name = name.ToLower ().TrimEnd ();
+				this [name] = val;
+			}
+		}
+
+		static int SkipTrailingWhitespace (string value, int index)
+		{
+			int len = value.Length;
+			for (int i = (index + 1); i < len; i++) {
+				char c = value [i];
+				if (c == ';')
+					return (i - 1);
+				if (!char.IsWhiteSpace (c))
+					return -1;
+			}
+			return len - 1;
+		}
+
+		static int NextNonWhitespaceChar (string value, int index)
+		{
+			int len = value.Length;
+			for (int i = (index + 1); i < len; i++) {
+				char c = value [i];
+				if (!char.IsWhiteSpace (c))
+					return (int) c;
+			}
+			return -1;
+		}
+
+		#endregion // Public Methods
+	}
+}
+#endif // NET_2_0 using
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DbDataPermission.cs
@@ -0,0 +1,317 @@
+//
+// System.Data.Common.DbDataPermission.cs
+//
+// Authors:
+//	Rodrigo Moya (rodrigo@ximian.com)
+//	Tim Coleman (tim@timcoleman.com)
+//	Sebastien Pouliot  <sebastien@ximian.com>
+//
+// (C) Ximian, Inc
+// Copyright (C) Tim Coleman, 2002-2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections;
+using System.Security;
+using System.Security.Permissions;
+
+namespace System.Data.Common {
+
+	[Serializable]
+	public abstract class DBDataPermission : CodeAccessPermission, IUnrestrictedPermission {
+
+		#region Fields
+
+		private const int version = 1;
+
+		private bool allowBlankPassword;
+		private PermissionState state;
+		private Hashtable _connections;
+
+		#endregion // Fields
+
+		#region Constructors
+
+#if NET_2_0
+		[Obsolete ("use DBDataPermission (PermissionState.None)", true)]
+#endif
+		protected DBDataPermission () 
+			: this (PermissionState.None)
+		{
+		}
+
+		protected DBDataPermission (DBDataPermission permission)
+		{
+			if (permission == null)
+				throw new ArgumentNullException ("permission");
+
+			state = permission.state;
+			if (state != PermissionState.Unrestricted) {
+				allowBlankPassword = permission.allowBlankPassword;
+				_connections = (Hashtable) permission._connections.Clone ();
+			}
+		}
+
+		protected DBDataPermission (DBDataPermissionAttribute permissionAttribute)
+		{
+			if (permissionAttribute == null)
+				throw new ArgumentNullException ("permissionAttribute");
+
+			_connections = new Hashtable ();
+			if (permissionAttribute.Unrestricted) {
+				state = PermissionState.Unrestricted;
+			}
+			else {
+				state = PermissionState.None;
+				allowBlankPassword = permissionAttribute.AllowBlankPassword;
+				if (permissionAttribute.ConnectionString.Length > 0) {
+					Add (permissionAttribute.ConnectionString, permissionAttribute.KeyRestrictions, 
+						permissionAttribute.KeyRestrictionBehavior);
+				}
+			}
+		}
+
+		protected DBDataPermission (PermissionState state) 
+		{
+			this.state = PermissionHelper.CheckPermissionState (state, true);
+			_connections = new Hashtable ();
+		}
+
+#if NET_2_0
+		[Obsolete ("use DBDataPermission (PermissionState.None)", true)]
+		protected 
+#else
+		public
+#endif
+		DBDataPermission (PermissionState state, bool allowBlankPassword)
+			: this (state)
+		{
+			this.allowBlankPassword = allowBlankPassword;
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		public bool AllowBlankPassword {
+			get { return allowBlankPassword; }
+			set { allowBlankPassword = value; }
+		}
+		
+		#endregion // Properties
+
+		#region Methods
+
+		public virtual void Add (string connectionString, string restrictions, KeyRestrictionBehavior behavior)
+		{
+			state = PermissionState.None;
+			_connections [connectionString] = new object [2] { restrictions, behavior };
+		}
+
+		protected void Clear ()
+		{
+			_connections.Clear ();
+		}
+
+		public override IPermission Copy () 
+		{
+			DBDataPermission dbdp = CreateInstance ();
+			dbdp.allowBlankPassword = this.allowBlankPassword;
+			dbdp._connections = (Hashtable) this._connections.Clone ();
+			return dbdp;
+		}
+
+		protected virtual DBDataPermission CreateInstance ()
+		{
+			return (DBDataPermission) Activator.CreateInstance (this.GetType (), new object [1] { PermissionState.None });
+		}
+
+		public override void FromXml (SecurityElement securityElement) 
+		{
+			PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
+			// Note: we do not (yet) care about the return value 
+			// as we only accept version 1 (min/max values)
+
+			state = (PermissionHelper.IsUnrestricted (securityElement) ? 
+				PermissionState.Unrestricted : PermissionState.None);
+
+			allowBlankPassword = false;
+			string blank = securityElement.Attribute ("AllowBlankPassword");
+			if (blank != null) {
+#if NET_2_0
+				// avoid possible exceptions with Fx 2.0
+				if (!Boolean.TryParse (blank, out allowBlankPassword))
+					allowBlankPassword = false;
+#else
+				try {
+					allowBlankPassword = Boolean.Parse (blank);
+				}
+				catch {
+					allowBlankPassword = false;
+				}
+#endif
+			}
+
+			if (securityElement.Children != null) {
+				foreach (SecurityElement child in securityElement.Children) {
+					string connect = child.Attribute ("ConnectionString");
+					string restricts = child.Attribute ("KeyRestrictions");
+					KeyRestrictionBehavior behavior = (KeyRestrictionBehavior) Enum.Parse (
+						typeof (KeyRestrictionBehavior), child.Attribute ("KeyRestrictionBehavior"));
+
+					if ((connect != null) && (connect.Length > 0))
+						Add (connect, restricts, behavior);
+				}
+			}
+		}
+
+		public override IPermission Intersect (IPermission target) 
+		{
+			// FIXME: restrictions not completely implemented - nor documented
+			DBDataPermission dbdp = Cast (target);
+			if (dbdp == null)
+				return null;
+			if (IsUnrestricted ()) {
+				if (dbdp.IsUnrestricted ()) {
+					DBDataPermission u = CreateInstance ();
+					u.state = PermissionState.Unrestricted;
+					return u;
+				}
+				return dbdp.Copy ();
+			}
+			if (dbdp.IsUnrestricted ())
+				return Copy ();
+			if (IsEmpty () || dbdp.IsEmpty ())
+				return null;
+
+			DBDataPermission p = CreateInstance ();
+			p.allowBlankPassword = (allowBlankPassword && dbdp.allowBlankPassword);
+			foreach (DictionaryEntry de in _connections) {
+				object o = dbdp._connections [de.Key];
+				if (o != null)
+					p._connections.Add (de.Key, de.Value);
+			}
+			return (p._connections.Count > 0) ? p : null;
+		}
+
+		public override bool IsSubsetOf (IPermission target) 
+		{
+			// FIXME: restrictions not completely implemented - nor documented
+			DBDataPermission dbdp = Cast (target);
+			if (dbdp == null)
+				return IsEmpty ();
+			if (dbdp.IsUnrestricted ())
+				return true;
+			if (IsUnrestricted ())
+				return dbdp.IsUnrestricted ();
+
+			if (allowBlankPassword && !dbdp.allowBlankPassword)
+				return false;
+			if (_connections.Count > dbdp._connections.Count)
+				return false;
+
+			foreach (DictionaryEntry de in _connections) {
+				object o = dbdp._connections [de.Key];
+				if (o == null)
+					return false;
+				// FIXME: this is a subset of what is required
+				// it seems that we must process both the connect string
+				// and the restrictions - but this has other effects :-/
+			}
+			return true;
+		}
+
+		public bool IsUnrestricted () 
+		{
+			return (state == PermissionState.Unrestricted);
+		}
+
+		public override SecurityElement ToXml ()
+		{
+			SecurityElement se = PermissionHelper.Element (this.GetType (), version);
+			if (IsUnrestricted ()) {
+				se.AddAttribute ("Unrestricted", "true");
+			}
+			else {
+				// attribute is present for both True and False
+				se.AddAttribute ("AllowBlankPassword", allowBlankPassword.ToString ());
+				foreach (DictionaryEntry de in _connections) {
+					SecurityElement child = new SecurityElement ("add");
+					child.AddAttribute ("ConnectionString", (string) de.Key);
+					object[] restrictionsInfo = (object[]) de.Value;
+					child.AddAttribute ("KeyRestrictions", (string) restrictionsInfo [0]);
+					KeyRestrictionBehavior krb = (KeyRestrictionBehavior) restrictionsInfo [1];
+					child.AddAttribute ("KeyRestrictionBehavior", krb.ToString ());
+					se.AddChild (child);
+				}
+			}
+			return se;
+		}
+
+		public override IPermission Union (IPermission target) 
+		{
+			// FIXME: restrictions not completely implemented - nor documented
+			DBDataPermission dbdp = Cast (target);
+			if (dbdp == null)
+				return Copy ();
+			if (IsEmpty () && dbdp.IsEmpty ())
+				return Copy ();
+
+			DBDataPermission p = CreateInstance ();
+			if (IsUnrestricted () || dbdp.IsUnrestricted ()) {
+				p.state = PermissionState.Unrestricted;
+			}
+			else {
+				p.allowBlankPassword = (allowBlankPassword || dbdp.allowBlankPassword);
+				p._connections = new Hashtable (_connections.Count + dbdp._connections.Count);
+				foreach (DictionaryEntry de in _connections)
+					p._connections.Add (de.Key, de.Value);
+				// don't duplicate
+				foreach (DictionaryEntry de in dbdp._connections)
+					p._connections [de.Key] = de.Value;
+			}
+			return p;
+		}
+
+		// helpers
+
+		private bool IsEmpty ()
+		{
+			return ((state != PermissionState.Unrestricted) && (_connections.Count == 0));
+		}
+
+		private DBDataPermission Cast (IPermission target)
+		{
+			if (target == null)
+				return null;
+
+			DBDataPermission dbdp = (target as DBDataPermission);
+			if (dbdp == null) {
+				PermissionHelper.ThrowInvalidPermission (target, this.GetType ());
+			}
+
+			return dbdp;
+		}
+
+		#endregion // Methods
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs
@@ -0,0 +1,113 @@
+//
+// System.Data.Common.DbDataPermissionAttribute.cs
+//
+// Authors:
+//	Rodrigo Moya (rodrigo@ximian.com)
+//	Tim Coleman (tim@timcoleman.com)
+//	Sebastien Pouliot  <sebastien@ximian.com>
+//
+// (C) Ximian, Inc
+// Copyright (C) Tim Coleman, 2002
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.ComponentModel;
+using System.Security.Permissions;
+using System.Globalization;
+
+namespace System.Data.Common {
+
+	[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | 
+			 AttributeTargets.Struct | AttributeTargets.Constructor | 
+			 AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
+	[Serializable]
+	public abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute {
+		#region Fields
+
+		bool allowBlankPassword;
+		string keyRestrictions;
+		KeyRestrictionBehavior keyRestrictionBehavior;
+		string connectionString;
+
+		#endregion // Fields
+
+		#region Constructors
+
+		protected DBDataPermissionAttribute (SecurityAction action) 
+			: base (action) 
+		{
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		public bool AllowBlankPassword {
+			get { return allowBlankPassword; }
+			set { allowBlankPassword = value; }
+		}
+
+		public string KeyRestrictions {
+			get {
+				if (keyRestrictions == null)
+					return String.Empty;
+				return keyRestrictions;
+			}
+			set { keyRestrictions = value; }
+		}
+
+		public string ConnectionString {
+			get {
+				if (connectionString == null)
+					return String.Empty;
+				return connectionString;
+			}
+			set { connectionString = value; }
+		}
+
+		public KeyRestrictionBehavior KeyRestrictionBehavior {
+			get { return keyRestrictionBehavior; }
+			set {
+				ExceptionHelper.CheckEnumValue (typeof (KeyRestrictionBehavior), value);
+				keyRestrictionBehavior = value;
+			}
+		}
+
+		#endregion // Properties
+
+		#region // Methods
+		[EditorBrowsableAttribute (EditorBrowsableState.Never)]
+		public bool ShouldSerializeConnectionString ()
+		{
+			// FIXME: configurable ? why is this in the attribute class ?
+			return false;
+		}
+
+		[EditorBrowsableAttribute (EditorBrowsableState.Never)]
+		public bool ShouldSerializeKeyRestrictions ()
+		{
+			// FIXME: configurable ? why is this in the attribute class ?
+			return false;
+		}
+		#endregion // Methods
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Odbc/OdbcConnectionStringBuilder.cs
@@ -0,0 +1,219 @@
+//
+// System.Data.Odbc.OdbcConnectionStringBuilder
+//
+// Authors: 
+//	  Nidhi Rawal (rawalnidhi_rawal@yahoo.com)
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.Common;
+using System.Data.Odbc;
+using System.Reflection;
+using System.Text;
+
+namespace System.Data.Odbc
+{
+	[DefaultProperty ("Driver")]
+	[TypeConverter ("System.Data.Odbc.OdbcConnectionStringBuilder+OdbcConnectionStringBuilderConverter, " + Consts.AssemblySystem_Data)]
+	public sealed class OdbcConnectionStringBuilder : DbConnectionStringBuilder
+	{
+		#region Fields
+		string driver;
+		string dsn;
+		#endregion //Fields
+
+		#region Constructors
+
+		public OdbcConnectionStringBuilder () : base (true)
+		{
+		}
+
+		public OdbcConnectionStringBuilder (string connectionString) : base (true)
+		{
+			if (connectionString == null) {
+				base.ConnectionString = string.Empty;
+				return;
+			}
+
+			base.ConnectionString = connectionString;
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		public override Object this [string keyword] {
+			get {
+				if (keyword == null)
+					throw new ArgumentNullException ("keyword");
+				if (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0)
+					return Driver;
+				if (string.Compare (keyword, "Dsn", StringComparison.InvariantCultureIgnoreCase) == 0)
+					return Dsn;
+				return base [keyword];
+			}
+			set {
+				if (value == null) {
+					Remove (keyword);
+					return;
+				}
+
+				if (keyword == null)
+					throw new ArgumentNullException ("keyword");
+
+				string text_value = value.ToString ();
+
+				if (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0) {
+					Driver = text_value;
+					return;
+				} else if (string.Compare (keyword, "Dsn", StringComparison.InvariantCultureIgnoreCase) == 0) {
+					dsn = text_value;
+				} else if (value.ToString ().IndexOf (';') != -1) {
+					text_value = "{" + text_value + "}";
+				}
+				base [keyword] = value;
+			}
+		}
+
+		public override ICollection Keys {
+			get {
+				List<string> keys = new List<string> ();
+				keys.Add ("Dsn");
+				keys.Add ("Driver");
+
+				ICollection base_keys = base.Keys;
+				foreach (string keyword in base_keys) {
+					if (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0)
+						continue;
+					if (string.Compare (keyword, "Dsn", StringComparison.InvariantCultureIgnoreCase) == 0)
+						continue;
+					keys.Add (keyword);
+				}
+
+				string [] final = new string [keys.Count];
+				keys.CopyTo (final);
+				return final;
+			}
+		}
+
+		[DisplayName ("Driver")]
+		[RefreshProperties (RefreshProperties.All)]
+		public string Driver {
+			get {
+				if (driver == null)
+					return string.Empty;
+				return driver;
+			}
+			set {
+				if (value == null)
+					throw new ArgumentNullException ("Driver");
+				driver = value;
+
+				if (value.Length > 0) {
+					int startBrace = value.IndexOf ('{');
+					int endBrace = value.IndexOf ('}');
+					if (startBrace == -1 || endBrace == -1)
+						value = "{" + value + "}";
+					else if (startBrace > 0 || endBrace < (value.Length - 1))
+						value = "{" + value + "}";
+				}
+				base ["Driver"] = value;
+			}
+		}
+		
+		[DisplayName ("Dsn")]
+		[RefreshProperties (RefreshProperties.All)]
+		public string Dsn {
+			get {
+				if (dsn == null)
+					return string.Empty;
+				return dsn;
+			}
+			set {
+				if (value == null)
+					throw new ArgumentNullException ("Dsn");
+				dsn = value;
+				base ["Dsn"] = dsn;
+			}
+		}
+
+		#endregion // Properties
+
+		#region Methods
+
+		public override bool ContainsKey (string keyword)
+		{
+			if (keyword == null)
+				throw new ArgumentNullException ("keyword");
+			if (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0)
+				return true;
+			if (string.Compare (keyword, "Dsn", StringComparison.InvariantCultureIgnoreCase) == 0)
+				return true;
+			return base.ContainsKey (keyword);
+		}
+
+		public override bool Remove (string keyword)
+		{
+			if (keyword == null)
+				throw new ArgumentNullException ("keyword");
+			if (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0)
+				driver = string.Empty;
+			else if (string.Compare (keyword, "Dsn", StringComparison.InvariantCultureIgnoreCase) == 0)
+				dsn = string.Empty;
+			return base.Remove (keyword);
+		}
+
+		public override void Clear ()
+		{
+			driver = null;
+			dsn = null;
+			base.Clear ();
+		}
+
+		public override bool TryGetValue (string keyword, out Object value)
+		{
+			if (keyword == null )
+				throw new ArgumentNullException ("keyword");
+			bool found = base.TryGetValue (keyword, out value);
+			if (found)
+				return found;
+			if (string.Compare (keyword, "Driver", StringComparison.InvariantCultureIgnoreCase) == 0) {
+				value = string.Empty;
+				return true;
+			} else if (string.Compare (keyword, "Dsn", StringComparison.InvariantCultureIgnoreCase) == 0) {
+				value = string.Empty;
+				return true;
+			}
+			return false;
+		}
+
+		#endregion // Methods
+	}
+}
+#endif // NET_2_0 using
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Odbc/OdbcError.cs
@@ -0,0 +1,104 @@
+//
+// System.Data.Odbc.OdbcError
+//
+// Author:
+//   Brian Ritchie (brianlritchie@hotmail.com) 
+//
+// Copyright (C) Brian Ritchie, 2002
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections;
+using System.ComponentModel;
+using System.Data;
+using System.Data.Common;
+using System.Text;
+
+namespace System.Data.Odbc
+{
+	[Serializable]
+	public sealed class OdbcError
+	{
+		readonly string _message;
+		string _source;
+		readonly string _state;
+		readonly int _nativeerror;
+
+		#region Constructors
+
+		internal OdbcError (OdbcConnection connection)
+		{
+			_nativeerror = 1;
+			_source = connection.SafeDriver;
+			_message = "Error in " + _source;
+			_state = string.Empty;
+		}
+
+		internal OdbcError (string message, string state, int nativeerror)
+		{
+			_message = message;
+			_state = state;
+			_nativeerror = nativeerror;
+		}
+
+		#endregion // Constructors
+		
+		#region Properties
+
+		public string Message {
+			get { return _message; }
+		}
+
+		public int NativeError {
+			get { return _nativeerror; }
+		}
+
+		public string Source {
+			get { return _source; }
+		}
+
+		public string SQLState {
+			get { return _state; }
+		}
+
+		#endregion // Properties
+		
+		#region methods
+		
+		public override string ToString ()
+		{
+			return Message;
+		}
+
+		internal void SetSource (string source)
+		{
+			_source = source;
+		}
+
+		#endregion
+
+	}
+
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs
@@ -0,0 +1,87 @@
+//
+// System.Data.Odbc.OdbcPermission
+//
+// Authors:
+//	Umadevi S (sumadevi@novell.com)
+//	Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Data.Common;
+using System.Security;
+using System.Security.Permissions;
+
+namespace System.Data.Odbc
+{
+	[Serializable]
+	public sealed class OdbcPermission : DBDataPermission
+	{
+		#region Constructors
+
+		[Obsolete ("use OdbcPermission(PermissionState.None)", true)]
+		public OdbcPermission ()
+			: base (PermissionState.None)
+		{
+		}
+
+		public OdbcPermission (PermissionState state)
+			: base (state)
+		{
+		}
+
+		[Obsolete ("use OdbcPermission(PermissionState.None)", true)]
+		public OdbcPermission (PermissionState state, bool allowBlankPassword)
+			: base (state)
+		{
+			AllowBlankPassword = allowBlankPassword;
+		}
+
+		// required for Copy method
+		internal OdbcPermission (DBDataPermission permission)
+			: base (permission)
+		{
+		}
+
+		// easier (and common) permission creation from attribute class
+		internal OdbcPermission (DBDataPermissionAttribute attribute)
+			: base (attribute)
+		{
+		}
+
+		#endregion
+
+		#region Methods
+
+		public override IPermission Copy ()
+		{
+			return new OdbcPermission (this);
+		}
+
+		public override void Add (string connectionString, string restrictions, KeyRestrictionBehavior behavior)
+		{
+			base.Add (connectionString, restrictions, behavior);
+		}
+
+		#endregion
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data.Odbc/OdbcPermissionAttribute.cs
@@ -0,0 +1,64 @@
+//
+// System.Data.Odbc.OdbcPermissionAttribute
+//
+// Authors:
+//	Umadevi S (sumadevi@novell.com)
+//	Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Data.Common;
+using System.Security;
+using System.Security.Permissions;
+
+namespace System.Data.Odbc {
+
+	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | 
+			AttributeTargets.Struct | AttributeTargets.Constructor |
+			AttributeTargets.Method, AllowMultiple=true,
+			Inherited=false)]
+	[Serializable]
+	public sealed class OdbcPermissionAttribute : DBDataPermissionAttribute {
+
+		#region Constructors 
+
+		public OdbcPermissionAttribute (SecurityAction action) 
+			: base (action)
+		{
+		}
+
+		#endregion
+
+		#region Properties
+		#endregion
+
+		#region Methods
+
+		public override IPermission CreatePermission () 
+		{
+			return new OdbcPermission (this);
+		}
+
+		#endregion
+	}
+}
--- /dev/null
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/System.Data/KeyRestrictionBehavior.cs
@@ -0,0 +1,41 @@
+//
+// System.Data.KeyRestrictionBehavior
+//
+// Author:
+//     Tim Coleman <tim@timcoleman.com>
+//
+// Copyright (C) Tim Coleman, 2003
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Data {
+	[Serializable]
+	public enum KeyRestrictionBehavior
+	{
+		AllowOnly,
+		PreventUsage
+	}
+}
+
--- mono-4.2.1.102+dfsg2.orig/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs
@@ -500,7 +500,7 @@ namespace MonoTests.System.Data.Common {
 		{
 			NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission (PermissionState.None);
 			NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) empty.Union (empty);
-			Assert.IsNull (union, "Empty U Empty");
+			Assert.IsNotNull (union, "Empty U Empty");
 
 			NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.None);
 			dbdp1.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
--- mono-4.2.1.102+dfsg2.orig/mcs/class/System.Data/Test/System.Data.Common/DbConnectionStringBuilderTest.cs
+++ mono-4.2.1.102+dfsg2/mcs/class/System.Data/Test/System.Data.Common/DbConnectionStringBuilderTest.cs
@@ -1798,7 +1798,7 @@ namespace MonoTests.System.Data.Common
                         Assert.AreEqual (builder.GetType ().ToString (), className, "#1");
 
                         AttributeCollection collection = ictd.GetAttributes ();
-                        Assert.AreEqual (1, collection.Count, "#2");
+                        Assert.AreEqual (2, collection.Count, "#2");
                         object [] attr = builder.GetType ().GetCustomAttributes (typeof (DefaultMemberAttribute), false);
                         if (attr.Length > 0) {
                                 DefaultMemberAttribute defAtt = (DefaultMemberAttribute) attr [0];
--- mono-4.2.1.102+dfsg2.orig/mcs/class/System.ServiceModel/Makefile
+++ mono-4.2.1.102+dfsg2/mcs/class/System.ServiceModel/Makefile
@@ -32,8 +32,10 @@ ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 ifndef NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY
 activation = $(the_libdir_base)System.ServiceModel.Activation.dll
 servicemodel_deps = $(activation)
+endif
 
 ifneq (plainservice/,$(intermediate))
+ifndef NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY
 LIB_MCS_FLAGS += -define:HAS_ACTIVATION -r:System.ServiceModel.Activation.dll
 endif 
 endif # NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY
--- mono-4.2.1.102+dfsg2.orig/mcs/class/reference-assemblies/Makefile
+++ mono-4.2.1.102+dfsg2/mcs/class/reference-assemblies/Makefile
@@ -10,10 +10,7 @@ install-local:
 	$(MKINSTALLDIRS) $(PROFILE_DIR)/2.0
 	$(MKINSTALLDIRS) $(PROFILE_DIR)/3.5
 	$(MKINSTALLDIRS) $(PROFILE_DIR)/4.0
-	$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v2.0/* $(PROFILE_DIR)/2.0
-	$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v3.5/* $(PROFILE_DIR)/3.5
-	$(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(PROFILE_DIR)/4.0
 
-DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) $(wildcard ../../../external/binary-reference-assemblies/v3.5/*) $(wildcard ../../../external/binary-reference-assemblies/v2.0/*) Makefile
+DISTFILES = Makefile
 
 dist-local: dist-default
--- mono-4.2.1.102+dfsg2.orig/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
+++ mono-4.2.1.102+dfsg2/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
@@ -33,7 +33,7 @@
 		<WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
 
 		<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
-		<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
+		<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.5</TargetFrameworkVersion>
 
 		<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
 	        <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
--- mono-4.2.1.102+dfsg2.orig/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets
+++ mono-4.2.1.102+dfsg2/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets
@@ -33,7 +33,7 @@
 		<WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
 
 		<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
-		<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
+		<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.5</TargetFrameworkVersion>
 
 		<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
 	        <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
--- mono-4.2.1.102+dfsg2.orig/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets
+++ mono-4.2.1.102+dfsg2/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets
@@ -33,7 +33,7 @@
 		<WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
 
 		<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
-		<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
+		<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.5</TargetFrameworkVersion>
 
 		<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
 	        <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
--- mono-4.2.1.102+dfsg2.orig/mono/metadata/assembly.c
+++ mono-4.2.1.102+dfsg2/mono/metadata/assembly.c
@@ -105,7 +105,6 @@ static const AssemblyVersionMap framewor
 	{"Mono.Security.Win32", 0},
 	{"Mono.Xml.Ext", 0},
 	{"Novell.Directory.Ldap", 0},
-	{"Npgsql", 0},
 	{"PEAPI", 0},
 	{"System", 0},
 	{"System.ComponentModel.Composition", 2},
--- mono-4.2.1.102+dfsg2.orig/mono/mini/Makefile.am
+++ mono-4.2.1.102+dfsg2/mono/mini/Makefile.am
@@ -181,7 +181,7 @@ buildver-boehm.h: libmini-static.la $(mo
 else
 buildver-boehm.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntime-static.la
 endif
-	@echo "const char *build_date = \"`date`\";" > buildver-boehm.h
+	@echo "const char *build_date;" > buildver-boehm.h
 mono_boehm-main.$(OBJEXT): buildver-boehm.h
 endif
 
@@ -190,7 +190,7 @@ buildver-sgen.h: libmini-static.la $(mon
 else
 buildver-sgen.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntimesgen-static.la $(monodir)/mono/sgen/libmonosgen-static.la
 endif
-	@echo "const char *build_date = \"`date`\";" > buildver-sgen.h
+	@echo "const char *build_date;" > buildver-sgen.h
 mono_sgen-main-sgen.$(OBJEXT): buildver-sgen.h
 main-sgen.$(OBJEXT): buildver-sgen.h
 
@@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
 	Makefile.am.in
 
 version.h: Makefile
-	echo "#define FULL_VERSION \"Stable 4.2.1.102/6dd2d0d\"" > version.h
+	echo "#define FULL_VERSION \"Debian $$(dpkg-parsechangelog -l$(top_srcdir)/debian/changelog | grep ^Vers | cut -d\  -f2)\"" > version.h
 
 # Utility target for patching libtool to speed up linking
 patch-libtool:
--- mono-4.2.1.102+dfsg2.orig/mono/mini/cpu-ppc.md
+++ mono-4.2.1.102+dfsg2/mono/mini/cpu-ppc.md
@@ -128,6 +128,8 @@ storer8_memindex: dest:b src1:i src2:i l
 loadu4_mem: dest:i len:8
 move: dest:i src1:i len:4
 fmove: dest:f src1:f len:4
+move_f_to_i4: dest:i src1:f len:8
+move_i4_to_f: dest:f src1:i len:8
 add_imm: dest:i src1:i len:4
 sub_imm: dest:i src1:i len:4
 mul_imm: dest:i src1:i len:4
@@ -314,5 +316,5 @@ vcall2_membase: src1:b len:16 clob:c
 
 jump_table: dest:i len:8
 
-atomic_add_i4: src1:b src2:i dest:i len:20
+atomic_add_i4: src1:b src2:i dest:i len:28
 atomic_cas_i4: src1:b src2:i src3:i dest:i len:38
--- mono-4.2.1.102+dfsg2.orig/mono/mini/mini-ppc.c
+++ mono-4.2.1.102+dfsg2/mono/mini/mini-ppc.c
@@ -1091,8 +1091,10 @@ get_call_info (MonoGenericSharingContext
 					cinfo->args [n].reg = fr;
 					fr ++;
 					FP_ALSO_IN_REG (gr ++);
+#if !defined(__mono_ppc64__)
 					if (size == 8)
 						FP_ALSO_IN_REG (gr ++);
+#endif
 					ALWAYS_ON_STACK (stack_size += size);
 				} else {
 					cinfo->args [n].offset = PPC_STACK_PARAM_OFFSET + stack_size;
@@ -1695,15 +1697,27 @@ mono_arch_emit_outarg_vt (MonoCompile *c
 		} else
 #endif
 			for (i = 0; i < ainfo->vtregs; ++i) {
+	 			dreg = mono_alloc_ireg (cfg);
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 				int antipadding = 0;
 				if (ainfo->bytes) {
 					g_assert (i == 0);
 					antipadding = sizeof (gpointer) - ainfo->bytes;
 				}
-				dreg = mono_alloc_ireg (cfg);
 				MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, src->dreg, soffset);
 				if (antipadding)
 					MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHR_UN_IMM, dreg, dreg, antipadding * 8);
+#else
+				if (ainfo->bytes && mono_class_native_size (ins->klass, NULL) == 1) {
+					MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU1_MEMBASE, dreg, src->dreg, soffset);
+				} else if (ainfo->bytes && mono_class_native_size (ins->klass, NULL) == 2) {
+					MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU2_MEMBASE, dreg, src->dreg, soffset);
+				} else if (ainfo->bytes && mono_class_native_size (ins->klass, NULL) == 4) { // WDS -- Maybe <= 4?
+					MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU4_MEMBASE, dreg, src->dreg, soffset);
+				} else {
+					MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, src->dreg, soffset);
+				}
+#endif
 				mono_call_inst_add_outarg_reg (cfg, call, dreg, ainfo->reg + i, FALSE);
 				soffset += sizeof (gpointer);
 			}
@@ -2242,8 +2256,11 @@ mono_arch_decompose_opts (MonoCompile *c
 		else
 			MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHR_IMM, ins->dreg, result_shifted_reg, 32);
 		ins->opcode = OP_NOP;
+		break;
 	}
 #endif
+	default:
+		break;
 	}
 }
 
@@ -3735,6 +3752,14 @@ mono_arch_output_basic_block (MonoCompil
 			if (ins->dreg != ins->sreg1)
 				ppc_fmr (code, ins->dreg, ins->sreg1);
 			break;
+		case OP_MOVE_F_TO_I4:
+			ppc_stfs (code, ins->sreg1, -4, ppc_r1);
+			ppc_ldptr (code, ins->dreg, -4, ppc_r1);
+			break;
+		case OP_MOVE_I4_TO_F:
+			ppc_stw (code, ins->sreg1, -4, ppc_r1);
+			ppc_lfs (code, ins->dreg, -4, ppc_r1);
+			break;
 		case OP_FCONV_TO_R4:
 			ppc_frsp (code, ins->dreg, ins->sreg1);
 			break;
@@ -4417,6 +4442,22 @@ mono_arch_output_basic_block (MonoCompil
 			else
 				ppc_mr (code, ins->dreg, ins->sreg1);
 			break;
+#else
+		case OP_ICONV_TO_R4:
+		case OP_ICONV_TO_R8: {
+			if (cpu_hw_caps & PPC_ISA_64) {
+				ppc_srawi(code, ppc_r0, ins->sreg1, 31);
+				ppc_stw (code, ppc_r0, -8, ppc_r1);
+				ppc_stw (code, ins->sreg1, -4, ppc_r1);
+				ppc_lfd (code, ins->dreg, -8, ppc_r1);
+				ppc_fcfid (code, ins->dreg, ins->dreg);
+				if (ins->opcode == OP_ICONV_TO_R4)
+					ppc_frsp (code, ins->dreg, ins->dreg);
+				}
+			break;
+		}
+#endif
+
 		case OP_ATOMIC_ADD_I4:
 		CASE_PPC64 (OP_ATOMIC_ADD_I8) {
 			int location = ins->inst_basereg;
@@ -4450,21 +4491,6 @@ mono_arch_output_basic_block (MonoCompil
 			ppc_mr (code, ins->dreg, ppc_r0);
 			break;
 		}
-#else
-		case OP_ICONV_TO_R4:
-		case OP_ICONV_TO_R8: {
-			if (cpu_hw_caps & PPC_ISA_64) {
-				ppc_srawi(code, ppc_r0, ins->sreg1, 31);
-				ppc_stw (code, ppc_r0, -8, ppc_r1);
-				ppc_stw (code, ins->sreg1, -4, ppc_r1);
-				ppc_lfd (code, ins->dreg, -8, ppc_r1);
-				ppc_fcfid (code, ins->dreg, ins->dreg);
-				if (ins->opcode == OP_ICONV_TO_R4)
-					ppc_frsp (code, ins->dreg, ins->dreg);
-				}
-			break;
-		}
-#endif
 		case OP_ATOMIC_CAS_I4:
 		CASE_PPC64 (OP_ATOMIC_CAS_I8) {
 			int location = ins->sreg1;
@@ -5040,9 +5066,21 @@ mono_arch_emit_prolog (MonoCompile *cfg)
 #ifdef __mono_ppc64__
 						if (ainfo->bytes) {
 							g_assert (cur_reg == 0);
+#if G_BYTE_ORDER == G_BIG_ENDIAN
 							ppc_sldi (code, ppc_r0, ainfo->reg,
 									(sizeof (gpointer) - ainfo->bytes) * 8);
 							ppc_stptr (code, ppc_r0, doffset, inst->inst_basereg);
+#else
+							if (mono_class_native_size (inst->klass, NULL) == 1) {
+							  ppc_stb (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
+							} else if (mono_class_native_size (inst->klass, NULL) == 2) {
+								ppc_sth (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
+							} else if (mono_class_native_size (inst->klass, NULL) == 4) {  // WDS -- maybe <=4?
+								ppc_stw (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
+							} else {
+								ppc_stptr (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);  // WDS -- Better way?
+							}
+#endif
 						} else
 #endif
 						{
--- mono-4.2.1.102+dfsg2.orig/mono/mini/mini-trampolines.c
+++ mono-4.2.1.102+dfsg2/mono/mini/mini-trampolines.c
@@ -1066,7 +1066,7 @@ mono_delegate_trampoline (mgreg_t *regs,
 				}
 			}
 		}
-	} else {
+	} else if (delegate->method_ptr) {
 		ji = mono_jit_info_table_find (domain, mono_get_addr_from_ftnptr (delegate->method_ptr));
 		if (ji)
 			method = jinfo_get_method (ji);
--- mono-4.2.1.102+dfsg2.orig/mono/sgen/sgen-archdep.h
+++ mono-4.2.1.102+dfsg2/mono/sgen/sgen-archdep.h
@@ -89,7 +89,7 @@
 
 /* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some
    archs is 64k.  */
-#if defined(TARGET_POWERPC64) && _CALL_ELF == 2
+#if defined(TARGET_POWERPC64)
 #define ARCH_MIN_MS_BLOCK_SIZE	(64*1024)
 #define ARCH_MIN_MS_BLOCK_SIZE_SHIFT	16
 #endif
--- mono-4.2.1.102+dfsg2.orig/mono/tests/Makefile.am
+++ mono-4.2.1.102+dfsg2/mono/tests/Makefile.am
@@ -356,7 +356,6 @@ BASE_TEST_CS_SRC=		\
 	modules.cs	\
 	bug-81673.cs	\
 	bug-81691.cs	\
-	bug-80307.cs	\
 	bug-415577.cs	\
 	filter-stack.cs	\
 	vararg2.cs	\
@@ -387,8 +386,6 @@ BASE_TEST_CS_SRC=		\
 	bug-575941.cs	\
 	bug-599469.cs	\
 	bug-389886-3.cs \
-	monitor.cs	\
-	monitor-resurrection.cs	\
 	dynamic-method-resurrection.cs	\
 	bug-666008.cs	\
 	bug-685908.cs	\
@@ -404,7 +401,6 @@ BASE_TEST_CS_SRC=		\
 	appdomain-unload-doesnot-raise-pending-events.cs	\
 	bug-6148.cs	\
 	assembly_append_ordering.cs	\
-	bug-10127.cs	\
 	bug-18026.cs	\
 	allow-synchronous-major.cs	\
 	unload-appdomain-on-shutdown.cs	\
--- mono-4.2.1.102+dfsg2.orig/mono/utils/mono-threads-linux.c
+++ mono-4.2.1.102+dfsg2/mono/utils/mono-threads-linux.c
@@ -1,6 +1,6 @@
 #include <config.h>
 
-#if defined(__linux__) && !defined(PLATFORM_ANDROID)
+#if (defined(__linux__) && !defined(PLATFORM_ANDROID)) || defined(__FreeBSD_kernel__)
 
 #include <mono/utils/mono-threads.h>
 #include <pthread.h>
--- mono-4.2.1.102+dfsg2.orig/support/syslog.c
+++ mono-4.2.1.102+dfsg2/support/syslog.c
@@ -38,7 +38,16 @@ Mono_Posix_Syscall_closelog (void)
 int
 Mono_Posix_Syscall_syslog (int priority, const char* message)
 {
+#ifdef __GNUC__
+	#pragma GCC diagnostic push
+	#pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
 	syslog (priority, message);
+
+#ifdef __GNUC__
+	#pragma GCC diagnostic pop
+#endif
 	return 0;
 }
 
