diff --git a/Duplicati/GUI/Wizard pages/Backends/FTP/FTPOptions.cs b/Duplicati/GUI/Wizard pages/Backends/FTP/FTPOptions.cs index a0ed22560..be068e13b 100644 --- a/Duplicati/GUI/Wizard pages/Backends/FTP/FTPOptions.cs +++ b/Duplicati/GUI/Wizard pages/Backends/FTP/FTPOptions.cs @@ -172,8 +172,10 @@ namespace Duplicati.GUI.Wizard_pages.Backends.FTP { if (ValidateForm()) { + Cursor c = this.Cursor; try { + this.Cursor = Cursors.WaitCursor; System.Data.LightDatamodel.IDataFetcherCached con = new System.Data.LightDatamodel.DataFetcherNested(Program.DataConnection); Datamodel.Backends.FTP ftp = new Duplicati.Datamodel.Backends.FTP(con.Add()); @@ -196,6 +198,7 @@ namespace Duplicati.GUI.Wizard_pages.Backends.FTP { MessageBox.Show(this, "Connection Failed: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } + this.Cursor = c; } } diff --git a/Duplicati/GUI/Wizard pages/Backends/S3/S3Options.cs b/Duplicati/GUI/Wizard pages/Backends/S3/S3Options.cs index db8e166d1..b5b3d272a 100644 --- a/Duplicati/GUI/Wizard pages/Backends/S3/S3Options.cs +++ b/Duplicati/GUI/Wizard pages/Backends/S3/S3Options.cs @@ -185,8 +185,10 @@ namespace Duplicati.GUI.Wizard_pages.Backends.S3 { if (ValidateForm()) { + Cursor c = this.Cursor; try { + this.Cursor = Cursors.WaitCursor; System.Data.LightDatamodel.IDataFetcherCached con = new System.Data.LightDatamodel.DataFetcherNested(Program.DataConnection); Datamodel.Backends.S3 s3 = new Duplicati.Datamodel.Backends.S3(con.Add()); @@ -219,6 +221,7 @@ namespace Duplicati.GUI.Wizard_pages.Backends.S3 MessageBox.Show(this, "Connection Failed: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } + this.Cursor = c; } } diff --git a/Duplicati/GUI/Wizard pages/Backends/SSH/SSHOptions.cs b/Duplicati/GUI/Wizard pages/Backends/SSH/SSHOptions.cs index f6a5879a3..afa1aced3 100644 --- a/Duplicati/GUI/Wizard pages/Backends/SSH/SSHOptions.cs +++ b/Duplicati/GUI/Wizard pages/Backends/SSH/SSHOptions.cs @@ -122,8 +122,10 @@ namespace Duplicati.GUI.Wizard_pages.Backends.SSH { if (ValidateForm()) { + Cursor c = this.Cursor; try { + this.Cursor = Cursors.WaitCursor; System.Data.LightDatamodel.IDataFetcherCached con = new System.Data.LightDatamodel.DataFetcherNested(Program.DataConnection); Datamodel.Backends.SSH ssh = new Duplicati.Datamodel.Backends.SSH(con.Add()); @@ -139,6 +141,9 @@ namespace Duplicati.GUI.Wizard_pages.Backends.SSH Dictionary options = new Dictionary(); ssh.GetOptions(options); + //Make sure that "testing" always produce a log + options.Add("debug-to-console", ""); + string[] files = Duplicati.Library.Main.Interface.List(target, options); MessageBox.Show(this, "Connection succeeded!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -149,6 +154,7 @@ namespace Duplicati.GUI.Wizard_pages.Backends.SSH MessageBox.Show(this, "Connection Failed: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } + this.Cursor = c; } } diff --git a/Duplicati/GUI/Wizard pages/Backends/WebDAV/WebDAVOptions.cs b/Duplicati/GUI/Wizard pages/Backends/WebDAV/WebDAVOptions.cs index cde6d104d..7c42856a2 100644 --- a/Duplicati/GUI/Wizard pages/Backends/WebDAV/WebDAVOptions.cs +++ b/Duplicati/GUI/Wizard pages/Backends/WebDAV/WebDAVOptions.cs @@ -185,8 +185,10 @@ namespace Duplicati.GUI.Wizard_pages.Backends.WebDAV { if (ValidateForm()) { + Cursor c = this.Cursor; try { + this.Cursor = Cursors.WaitCursor; System.Data.LightDatamodel.IDataFetcherCached con = new System.Data.LightDatamodel.DataFetcherNested(Program.DataConnection); Datamodel.Backends.WEBDAV webdav = new Duplicati.Datamodel.Backends.WEBDAV(con.Add()); @@ -210,6 +212,7 @@ namespace Duplicati.GUI.Wizard_pages.Backends.WebDAV { MessageBox.Show(this, "Connection Failed: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } + this.Cursor = c; } } diff --git a/Duplicati/Library/Backend/SSH/SSHBackend.cs b/Duplicati/Library/Backend/SSH/SSHBackend.cs index 69f96fb2a..e1c1e85b2 100644 --- a/Duplicati/Library/Backend/SSH/SSHBackend.cs +++ b/Duplicati/Library/Backend/SSH/SSHBackend.cs @@ -71,7 +71,20 @@ namespace Duplicati.Library.Backend } } - m_path = u.AbsolutePath.Substring(1); + m_path = u.AbsolutePath; + + if (m_isLinux) + { + //HACK: "AbsolutePath" strips extra slashes under mono, so we re-add them here + int ix = url.IndexOf(m_path); + if (ix > 0 && url[ix - 1] == '/') + m_path = "/" + m_path; + } + + //Remove 1 leading slash so server/path is mapped to "path", + // and server//path is mapped to "/path" + m_path = m_path.Substring(1); + if (!m_path.EndsWith("/")) m_path += "/"; @@ -81,7 +94,7 @@ namespace Duplicati.Library.Backend m_sftp = options["sftp-command"]; else { - if (System.Environment.OSVersion.Platform == PlatformID.Unix || System.Environment.OSVersion.Platform == PlatformID.MacOSX) + if (m_isLinux) m_sftp = "sftp"; else m_sftp = "psftp.exe"; @@ -250,7 +263,7 @@ namespace Duplicati.Library.Backend { get { - return "This backend can read and write data to an SSH based backend, using SCP and SFTP. Allowed formats are \"ssh://hostname/folder\" or \"ssh://username:password@hostname/folder\". NOTE: This backend does not support throttling uploads or downloads, and requires that sftp and scp are installed (using putty for windows)."; + return "This backend can read and write data to an SSH based backend, using SFTP. Allowed formats are \"ssh://hostname/folder\" or \"ssh://username:password@hostname/folder\". NOTE: This backend does not support throttling uploads or downloads, and requires that sftp is installed (using putty for windows)."; } } @@ -307,11 +320,11 @@ namespace Duplicati.Library.Backend //we wrap the command with expect, which allows us to use stdin/stdout p.StartInfo.FileName = "expect"; - p.StartInfo.Arguments = @"-c ""set timeout 30"" -c ""spawn \""" + m_sftp + @"\"" " + server + " " + m_ssh_options + @""" -c ""interact {~~}"""; + p.StartInfo.Arguments = @"-c ""set timeout 30"" -c ""spawn \""" + System.Environment.ExpandEnvironmentVariables(m_sftp) + @"\"" " + server + " " + m_ssh_options + @""" -c ""interact {~~}"""; } else { - p.StartInfo.FileName = m_sftp; + p.StartInfo.FileName = System.Environment.ExpandEnvironmentVariables(m_sftp); p.StartInfo.Arguments = server + " " + m_ssh_options; }