Skip to content

Commit cec1901

Browse files
leefine02leefine02
authored andcommitted
1 parent b3b215e commit cec1901

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

RemoteFile/RemoteHandlers/SSHHandler.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,10 @@ public override void UploadCertificateFile(string path, string fileName, byte[]
166166

167167
string uploadPath = path+fileName;
168168

169-
if (!string.IsNullOrEmpty(ApplicationSettings.SeparateUploadFilePath))
169+
if (!string.IsNullOrEmpty(ApplicationSettings.SeparateUploadFilePath) && IsStoreServerLinux)
170170
{
171171
uploadPath = ApplicationSettings.SeparateUploadFilePath + fileName;
172+
_logger.LogDebug($"uploadPath: {uploadPath}");
172173
}
173174

174175
bool scpError = false;
@@ -365,7 +366,7 @@ public override bool DoesFileExist(string path)
365366
try
366367
{
367368
client.Connect();
368-
string existsPath = FormatFTPPath(path, false);
369+
string existsPath = FormatFTPPath(path, !IsStoreServerLinux);
369370
bool exists = client.Exists(existsPath);
370371
_logger.LogDebug(existsPath);
371372

@@ -437,11 +438,14 @@ private string ConvertToPKCS1(string privateKey)
437438
private string FormatFTPPath(string path, bool addLeadingSlashForWindows)
438439
{
439440
_logger.MethodEntry(LogLevel.Debug);
440-
_logger.MethodExit(LogLevel.Debug);
441441

442442
string rtnPath = IsStoreServerLinux ? path : path.Replace("\\", "/");
443+
rtnPath = addLeadingSlashForWindows ? "/" + rtnPath : rtnPath;
444+
443445
_logger.LogTrace($"Formatted path: {rtnPath}");
444-
return addLeadingSlashForWindows ? rtnPath : "/" + rtnPath;
446+
_logger.MethodExit(LogLevel.Debug);
447+
448+
return rtnPath;
445449
}
446450
}
447451
}

0 commit comments

Comments
 (0)