diff --git a/docker/DockerFile b/docker/DockerFile index 7bdec7f..f0853ff 100644 --- a/docker/DockerFile +++ b/docker/DockerFile @@ -4,11 +4,14 @@ COPY --chown=root:root server/ssh /etc/ssh/ COPY --chown=root:root server/script /opt/sshnet COPY --chown=sshnet:sshnet user/sshnet /home/sshnet/.ssh -RUN apk add --no-cache syslog-ng && \ +RUN apk update && apk upgrade --no-cache && \ + apk add --no-cache syslog-ng && \ # install and configure sshd apk add --no-cache openssh && \ # install openssh-server-pam to allow for keyboard-interactive authentication apk add --no-cache openssh-server-pam && \ + # make sure scripts and keys have unix (LF) line endings + dos2unix /etc/ssh/* && \ chmod 400 /etc/ssh/ssh*key && \ sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \ sed -i 's/#LogLevel\s*INFO/LogLevel DEBUG3/' /etc/ssh/sshd_config && \ @@ -25,6 +28,7 @@ RUN apk add --no-cache syslog-ng && \ adduser -D sshnet && \ passwd -u sshnet && \ echo 'sshnet:ssh4ever' | chpasswd && \ + # make sure scripts and keys have unix (LF) line endings dos2unix /home/sshnet/.ssh/* && \ chown -R sshnet:sshnet /home/sshnet && \ chmod -R 700 /home/sshnet/.ssh && \ @@ -34,6 +38,7 @@ RUN apk add --no-cache syslog-ng && \ passwd -u sshnetadm && \ echo 'sshnetadm:ssh4ever' | chpasswd && \ addgroup sshnetadm sudo && \ + # make sure scripts and keys have unix (LF) line endings dos2unix /opt/sshnet/* && \ # install shadow package; we use chage command in this package to expire/unexpire password of the sshnet user apk add --no-cache shadow && \ diff --git a/src/SshNetBenchmarks/SshNetBenchmarks.csproj b/src/SshNetBenchmarks/SshNetBenchmarks.csproj index 81223fb..f1878dc 100644 --- a/src/SshNetBenchmarks/SshNetBenchmarks.csproj +++ b/src/SshNetBenchmarks/SshNetBenchmarks.csproj @@ -7,11 +7,12 @@ - + + diff --git a/src/SshNetTests/Common/AsyncSocketListener.cs b/src/SshNetTests/Common/AsyncSocketListener.cs index d446408..581010c 100644 --- a/src/SshNetTests/Common/AsyncSocketListener.cs +++ b/src/SshNetTests/Common/AsyncSocketListener.cs @@ -87,9 +87,14 @@ private void AcceptCallback(IAsyncResult ar) var state = new SocketStateObject(handler); handler.BeginReceive(state.Buffer, 0, state.Buffer.Length, 0, ReadCallback, state); } + catch (SocketException) + { + // when the socket is closed, an SocketException is thrown since .NET 5 + // by Socket.EndAccept(IAsyncResult) + } catch (ObjectDisposedException) { - // when the socket is closed, an ObjectDisposedException is thrown + // when the socket is closed, an ObjectDisposedException is thrown on old .NET Framework // by Socket.EndAccept(IAsyncResult) } } diff --git a/src/SshNetTests/SshNetTests.csproj b/src/SshNetTests/SshNetTests.csproj index 1fd8329..4886001 100644 --- a/src/SshNetTests/SshNetTests.csproj +++ b/src/SshNetTests/SshNetTests.csproj @@ -2,12 +2,12 @@ Library - net45;netcoreapp2.1;netcoreapp3.1 + net472;net7.0 false true - + TRACE;FEATURE_MSTEST_DATATEST;FEATURE_SOCKET_EAP;FEATURE_ENCODING_ASCII;FEATURE_THREAD_SLEEP;FEATURE_THREAD_THREADPOOL @@ -28,16 +28,17 @@ - + - + +