Skip to content

Commit d745beb

Browse files
vthiebaut10wyunchi-msdingmeng-xue
authored
[Az.Ssh] Bug fixes before release (#19747)
* Add quotes around path on keygen * Remove print statement use for debugging * fix 2 issues Co-authored-by: Yunchi Wang <[email protected]> Co-authored-by: [email protected] <[email protected]>
1 parent bf15464 commit d745beb

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContextInitializer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static AzAssemblyLoadContextInitializer()
3636
{"Microsoft.Bcl.AsyncInterfaces", new Version("1.1.1.0")},
3737
{"Microsoft.Identity.Client", new Version("4.46.2.0") },
3838
{"Microsoft.Identity.Client.Extensions.Msal", new Version("2.23.0.0") },
39+
{"Microsoft.IdentityModel.Abstractions", new Version("6.22.1.0") },
3940
{"System.Memory.Data", new Version("1.0.2.0")},
4041
{"System.Text.Json", new Version("4.0.1.2")},
4142
};

src/Ssh/Ssh.Helpers/Ssh.Helpers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
<PropertyGroup>
1010
<TargetFramework>netstandard2.0</TargetFramework>
11-
<AssemblyName>Microsoft.Azure.PowerShell.Ssh.Helpers</AssemblyName>
12-
<RootNamespace>Microsoft.Azure.PowerShell.Ssh.Helpers</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.PowerShell.Cmdlets.Ssh.Helpers</AssemblyName>
12+
<RootNamespace>Microsoft.Azure.PowerShell.Cmdlets.Ssh.Helpers</RootNamespace>
1313
<NoWarn>$(NoWarn);CS0108;CS1573</NoWarn>
1414
</PropertyGroup>
1515

src/Ssh/Ssh/Az.Ssh.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DotNetFrameworkVersion = '4.7.2'
5454
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.9.1'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = 'Microsoft.Azure.PowerShell.Ssh.Helpers.dll'
57+
RequiredAssemblies = 'Microsoft.Azure.PowerShell.Cmdlets.Ssh.Helpers.dll'
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6060
# ScriptsToProcess = @()

src/Ssh/Ssh/Common/SshBaseCmdlet.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ protected internal void ValidateParameters()
303303
if (CertificateFile != null)
304304
{
305305
if (LocalUser == null)
306-
WriteWarning("To authenticate with a cartificate you must provide a LocalUser. The certificate will be ignored.");
306+
WriteWarning("To authenticate with a certificate you must provide a LocalUser. The certificate will be ignored.");
307307
else
308308
CertificateFile = GetResolvedPath(CertificateFile, nameof(CertificateFile));
309309
}
@@ -447,7 +447,6 @@ protected internal string GetClientSideProxy()
447447
if (!File.Exists(proxyPath))
448448
{
449449
string proxyDir = Path.GetDirectoryName(proxyPath);
450-
Console.WriteLine(proxyDir);
451450

452451
if (!Directory.Exists(proxyDir))
453452
{
@@ -629,7 +628,7 @@ private List<string> GetSSHCertPrincipals(string certFile)
629628
private string[] GetSSHCertInfo(string certFile)
630629
{
631630
string sshKeygenPath = GetSSHClientPath("ssh-keygen");
632-
string args = "-L -f " + certFile;
631+
string args = $"-L -f \"{certFile}\"";
633632
WriteDebug("Runnung ssh-keygen command: " + sshKeygenPath + " " + args);
634633
Process keygen = new Process();
635634
keygen.StartInfo.FileName = sshKeygenPath;
@@ -694,7 +693,7 @@ private bool CheckOrCreatePublicAndPrivateKeyFile(string credentialFolder=null)
694693

695694
private void CreateSSHKeyfile(string privateKeyFile)
696695
{
697-
string args = "-f " + privateKeyFile + " -t rsa -q -N \"\"";
696+
string args = $"-f \"{privateKeyFile}\" -t rsa -q -N \"\"";
698697
Process keygen = Process.Start(GetSSHClientPath("ssh-keygen"), args);
699698
keygen.WaitForExit();
700699
}

src/Ssh/Ssh/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using System;
1616
using System.Reflection;
17-
using System.Runtime.CompilerServices;
1817
using System.Runtime.InteropServices;
1918

2019
[assembly: AssemblyTitle("Microsoft Azure Powershell - SSH")]
Binary file not shown.

0 commit comments

Comments
 (0)