Skip to content

Commit 1ee6063

Browse files
Remove old target frameworks (#10)
* Remove old target frameworks * Add comments
1 parent 3f5a7d7 commit 1ee6063

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

docker/DockerFile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ COPY --chown=root:root server/ssh /etc/ssh/
44
COPY --chown=root:root server/script /opt/sshnet
55
COPY --chown=sshnet:sshnet user/sshnet /home/sshnet/.ssh
66

7-
RUN apk add --no-cache syslog-ng && \
7+
RUN apk update && apk upgrade --no-cache && \
8+
apk add --no-cache syslog-ng && \
89
# install and configure sshd
910
apk add --no-cache openssh && \
1011
# install openssh-server-pam to allow for keyboard-interactive authentication
1112
apk add --no-cache openssh-server-pam && \
13+
# make sure scripts and keys have unix (LF) line endings
14+
dos2unix /etc/ssh/* && \
1215
chmod 400 /etc/ssh/ssh*key && \
1316
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
1417
sed -i 's/#LogLevel\s*INFO/LogLevel DEBUG3/' /etc/ssh/sshd_config && \
@@ -25,6 +28,7 @@ RUN apk add --no-cache syslog-ng && \
2528
adduser -D sshnet && \
2629
passwd -u sshnet && \
2730
echo 'sshnet:ssh4ever' | chpasswd && \
31+
# make sure scripts and keys have unix (LF) line endings
2832
dos2unix /home/sshnet/.ssh/* && \
2933
chown -R sshnet:sshnet /home/sshnet && \
3034
chmod -R 700 /home/sshnet/.ssh && \
@@ -34,6 +38,7 @@ RUN apk add --no-cache syslog-ng && \
3438
passwd -u sshnetadm && \
3539
echo 'sshnetadm:ssh4ever' | chpasswd && \
3640
addgroup sshnetadm sudo && \
41+
# make sure scripts and keys have unix (LF) line endings
3742
dos2unix /opt/sshnet/* && \
3843
# install shadow package; we use chage command in this package to expire/unexpire password of the sshnet user
3944
apk add --no-cache shadow && \

src/SshNetBenchmarks/SshNetBenchmarks.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77

88
<ItemGroup>
99
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
10-
<PackageReference Include="SSH.NET" Version="2020.0.1" />
10+
<PackageReference Include="SSH.NET" Version="2020.0.2" />
1111
</ItemGroup>
1212

1313
<ItemGroup>
1414
<ProjectReference Include="..\SshNetTests\SshNetTests.csproj" />
15+
<!-- <ProjectReference Include="..\..\..\SSH.NET\src\Renci.SshNet\Renci.SshNet.csproj" /> -->
1516
</ItemGroup>
1617

1718
</Project>

src/SshNetTests/Common/AsyncSocketListener.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ private void AcceptCallback(IAsyncResult ar)
8787
var state = new SocketStateObject(handler);
8888
handler.BeginReceive(state.Buffer, 0, state.Buffer.Length, 0, ReadCallback, state);
8989
}
90+
catch (SocketException)
91+
{
92+
// when the socket is closed, an SocketException is thrown since .NET 5
93+
// by Socket.EndAccept(IAsyncResult)
94+
}
9095
catch (ObjectDisposedException)
9196
{
92-
// when the socket is closed, an ObjectDisposedException is thrown
97+
// when the socket is closed, an ObjectDisposedException is thrown on old .NET Framework
9398
// by Socket.EndAccept(IAsyncResult)
9499
}
95100
}

src/SshNetTests/SshNetTests.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>net45;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks>net472;net7.0</TargetFrameworks>
66
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
77
<IsTestProject>true</IsTestProject>
88
</PropertyGroup>
99

10-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' or '$(TargetFramework)' == 'netcoreapp3.1' ">
10+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
1111
<DefineConstants>TRACE;FEATURE_MSTEST_DATATEST;FEATURE_SOCKET_EAP;FEATURE_ENCODING_ASCII;FEATURE_THREAD_SLEEP;FEATURE_THREAD_THREADPOOL</DefineConstants>
1212
</PropertyGroup>
1313

@@ -28,16 +28,17 @@
2828
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
2929
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
3030
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
31-
<PackageReference Include="SSH.NET" Version="2020.0.1" />
31+
<PackageReference Include="SSH.NET" Version="2020.0.2" />
3232
<PackageReference Include="System.Management" Version="4.7.0" />
3333
</ItemGroup>
3434

35-
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45' ">
35+
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
3636
<PackageReference Include="Tamir.SharpSSH" Version="1.1.1.13" />
3737
</ItemGroup>
3838

3939
<ItemGroup>
4040
<ProjectReference Include="..\..\..\SSH.NET-TestTools\src\SshNet.TestTools.OpenSSH\SshNet.TestTools.OpenSSH.csproj" />
41+
<!-- <ProjectReference Include="..\..\..\SSH.NET\src\Renci.SshNet\Renci.SshNet.csproj" /> -->
4142
</ItemGroup>
4243

4344
<ItemGroup>

0 commit comments

Comments
 (0)