tomboy r1996 - in trunk: . Tomboy/Addins/SshSyncService Tomboy/Addins/WebDavSyncService Tomboy/Synchronization



Author: sharm
Date: Sun May 11 14:29:19 2008
New Revision: 1996
URL: http://svn.gnome.org/viewvc/tomboy?rev=1996&view=rev

Log:
* Tomboy/Synchronization/FuseSyncServiceAddin.cs: Add abstract method
  GetFuseMountExeArgsForDisplay for writing to stdout and tomboy.log.
* Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs,
  Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs: Override
  GetFuseMoutnExeArgsForDisplay to mask password.  Fixes bug #524707.

Modified:
   trunk/ChangeLog
   trunk/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs
   trunk/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs
   trunk/Tomboy/Synchronization/FuseSyncServiceAddin.cs

Modified: trunk/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs
==============================================================================
--- trunk/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs	(original)
+++ trunk/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs	Sun May 11 14:29:19 2008
@@ -171,6 +171,11 @@
 			               folder,
 			               mountPath);
 		}
+		
+		protected override string GetFuseMountExeArgsForDisplay (string mountPath, bool fromStoredValues)
+		{
+			return GetFuseMountExeArgs (mountPath, fromStoredValues);
+		}
 
 		protected override string FuseMountExeName
 		{

Modified: trunk/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs
==============================================================================
--- trunk/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs	(original)
+++ trunk/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs	Sun May 11 14:29:19 2008
@@ -151,6 +151,24 @@
 				GetConfigSettings (out url, out username, out password);
 			else
 				GetPrefWidgetSettings (out url, out username, out password);
+			
+			return GetFuseMountExeArgs (mountPath, url, username, password);
+		}
+		
+		protected override string GetFuseMountExeArgsForDisplay (string mountPath, bool fromStoredValues)
+		{
+			string url, username, password;
+			if (fromStoredValues)
+				GetConfigSettings (out url, out username, out password);
+			else
+				GetPrefWidgetSettings (out url, out username, out password);
+			
+			// Mask password
+			return GetFuseMountExeArgs (mountPath, url, username, "*****");
+		}
+		
+		private string GetFuseMountExeArgs (string mountPath, string url, string username, string password)
+		{
 			return string.Format ("{0} -a {1} -u {2} -p {3} -o fsname=tomboywdfs",
 			                      mountPath,
 			                      url,

Modified: trunk/Tomboy/Synchronization/FuseSyncServiceAddin.cs
==============================================================================
--- trunk/Tomboy/Synchronization/FuseSyncServiceAddin.cs	(original)
+++ trunk/Tomboy/Synchronization/FuseSyncServiceAddin.cs	Sun May 11 14:29:19 2008
@@ -163,10 +163,11 @@
 
 		protected abstract void ResetConfigurationValues ();
 
-		protected abstract string FuseMountExeName { get;
-			                                           }
+		protected abstract string FuseMountExeName { get; }
 
-			protected abstract string GetFuseMountExeArgs (string mountPath, bool fromStoredValues);
+		protected abstract string GetFuseMountExeArgs (string mountPath, bool fromStoredValues);
+		
+		protected abstract string GetFuseMountExeArgsForDisplay (string mountPath, bool fromStoredValues);
 		#endregion // Abstract Members
 
 		#region Public Virtual Members
@@ -216,7 +217,8 @@
 			Logger.Debug (string.Format (
 			                             "Mounting sync path with this command: {0} {1}",
 			                             p.StartInfo.FileName,
-			                             p.StartInfo.Arguments));
+			                             // Args could include password, so may need to mask
+			                             GetFuseMountExeArgsForDisplay (mountPath, useStoredValues)));
 			p.StartInfo.CreateNoWindow = true;
 			p.Start ();
 			int timeoutMs = GetTimeoutMs ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]