tomboy r1980 - in branches/gnome-2-22: . Tomboy/Addins/SshSyncService Tomboy/Addins/WebDavSyncService Tomboy/Synchronization



Author: sharm
Date: Mon Apr  7 18:02:51 2008
New Revision: 1980
URL: http://svn.gnome.org/viewvc/tomboy?rev=1980&view=rev

Log:
* Tomboy/Synchronization/FuseSyncServiceAddin.cs: Add abstract method
  GetFuseMountExeArgsForDisplay for writing to stdout and tomboy.log.
* Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs: Override
  GetFuseMountExeArgsForDisplay to mask password.

Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs
   branches/gnome-2-22/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs
   branches/gnome-2-22/Tomboy/Synchronization/FuseSyncServiceAddin.cs

Modified: branches/gnome-2-22/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs
==============================================================================
--- branches/gnome-2-22/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs	(original)
+++ branches/gnome-2-22/Tomboy/Addins/SshSyncService/SshSyncServiceAddin.cs	Mon Apr  7 18:02:51 2008
@@ -171,6 +171,11 @@
 			               folder,
 			               mountPath);
 		}
+		
+		protected override string GetFuseMountExeArgsForDisplay (string mountPath, bool fromStoredValues)
+		{
+			return GetFuseMountExeArgs (mountPath, fromStoredValues);
+		}
 
 		protected override string FuseMountExeName
 		{

Modified: branches/gnome-2-22/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs
==============================================================================
--- branches/gnome-2-22/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs	(original)
+++ branches/gnome-2-22/Tomboy/Addins/WebDavSyncService/WebDavSyncServiceAddin.cs	Mon Apr  7 18:02:51 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: branches/gnome-2-22/Tomboy/Synchronization/FuseSyncServiceAddin.cs
==============================================================================
--- branches/gnome-2-22/Tomboy/Synchronization/FuseSyncServiceAddin.cs	(original)
+++ branches/gnome-2-22/Tomboy/Synchronization/FuseSyncServiceAddin.cs	Mon Apr  7 18:02:51 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]