[Pkg-cli-apps-commits] [SCM] keepass2 branch, master, updated. debian/2.15+dfsg-1-14-g7c4912d

Julian Taylor jtaylor.debian at googlemail.com
Wed Apr 20 23:11:46 UTC 2011


The following commit has been merged in the master branch:
commit 0754583f3b8946f9e2ad18ec61a2ef0bccaccedc
Author: Julian Taylor <jtaylor.debian at googlemail.com>
Date:   Thu Apr 21 00:59:09 2011 +0200

    add new patch 12_fix-single-instance-enforcement.patch

diff --git a/debian/patches/12_fix-single-instance-enforcement.patch b/debian/patches/12_fix-single-instance-enforcement.patch
new file mode 100644
index 0000000..16a3290
--- /dev/null
+++ b/debian/patches/12_fix-single-instance-enforcement.patch
@@ -0,0 +1,89 @@
+From: Julian Taylor <jtaylor.debian at googlemail.com>
+Date: Thu, 21 Apr 2011 00:30:20 +0200
+Subject: fix single instance enforcement
+
+mono >= 2.6.7-5 disables interprocess communication of named mutex
+workaround checks if there is a Remoting server running already
+---
+ KeePass/Forms/MainForm.cs    |    2 +-
+ KeePass/Program.cs           |    8 +++++++-
+ KeePass/Util/IpcBroadcast.cs |   22 +++++++++++++++-------
+ 3 files changed, 23 insertions(+), 9 deletions(-)
+
+diff --git a/KeePass/Forms/MainForm.cs b/KeePass/Forms/MainForm.cs
+index e0e1bcb..f4b27ac 100644
+--- a/KeePass/Forms/MainForm.cs
++++ b/KeePass/Forms/MainForm.cs
+@@ -310,7 +310,7 @@ namespace KeePass.Forms
+ #endif
+ 
+ 			m_sessionLockNotifier.Install(this.OnSessionLock);
+-			IpcBroadcast.StartServer();
++			//IpcBroadcast.StartServer();
+ 
+ 			int nInitColProvCount = Program.ColumnProviderPool.Count;
+ 
+diff --git a/KeePass/Program.cs b/KeePass/Program.cs
+index 6008908..63743fb 100644
+--- a/KeePass/Program.cs
++++ b/KeePass/Program.cs
+@@ -382,8 +382,14 @@ namespace KeePass
+ 				return;
+ 			}
+ 
++			bool activate_prev = false;
+ 			Mutex mSingleLock = TrySingleInstanceLock(AppDefs.MutexName, true);
+-			if((mSingleLock == null)) // && m_appConfig.Integration.LimitToSingleInstance)
++			if (KeePassLib.Native.NativeLib.IsUnix())
++				activate_prev = IpcBroadcast.StartServer();
++			else
++				activate_prev = (mSingleLock == null);
++
++			if((activate_prev == false)) // && m_appConfig.Integration.LimitToSingleInstance)
+ 			{
+ 				ActivatePreviousInstance(args);
+ 				MainCleanUp();
+diff --git a/KeePass/Util/IpcBroadcast.cs b/KeePass/Util/IpcBroadcast.cs
+index 20f0522..f42fc72 100644
+--- a/KeePass/Util/IpcBroadcast.cs
++++ b/KeePass/Util/IpcBroadcast.cs
+@@ -98,23 +98,31 @@ namespace KeePass.Util
+ 			return m_strPortName;
+ 		}
+ 
+-		public static void StartServer()
++		public static bool StartServer()
+ 		{
+ 			StopServer();
+ 
+-			if(!KeePassLib.Native.NativeLib.IsUnix()) return; // Windows
++			if(!KeePassLib.Native.NativeLib.IsUnix()) return true; // Windows
+ 
+ 			IDictionary dOpt = new Hashtable();
+ 			dOpt["portName"] = GetPortName();
+ 			dOpt["exclusiveAddressUse"] = false;
+ 			dOpt["secure"] = false;
+ 
+-			m_chServer = new IpcServerChannel(dOpt, null);
+-			ChannelServices.RegisterChannel(m_chServer, false);
++			try {
++				m_chServer = new IpcServerChannel(dOpt, null);
++				ChannelServices.RegisterChannel(m_chServer, false);
+ 
+-			RemotingConfiguration.RegisterWellKnownServiceType(typeof(
+-				IpcBroadcastSingleton), IpcObjectName,
+-				WellKnownObjectMode.SingleCall);
++				RemotingConfiguration.RegisterWellKnownServiceType(typeof(
++					IpcBroadcastSingleton), IpcObjectName,
++					WellKnownObjectMode.SingleCall);
++				return true;
++			}
++			catch (System.Reflection.TargetInvocationException e) {
++				if (e.GetBaseException() is System.InvalidOperationException)
++					return false;
++				throw;
++			}
+ 		}
+ 
+ 		public static void StopServer()
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 23940c7..d06428a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
 09_do-not-strip-leading-slash-from-command-line.patch
 10_fix-single-instance-ipc-in-mono.patch
 11_disable-multiple-instance-support.patch
+12_fix-single-instance-enforcement.patch

-- 
keepass2



More information about the Pkg-cli-apps-commits mailing list