This commit is contained in:
Tony Garnock-Jones 2021-06-19 15:15:18 +02:00
parent 60af9eae09
commit 10e5e2cf91
1 changed files with 9 additions and 12 deletions

View File

@ -52,18 +52,15 @@
(at conn-ds (at conn-ds
(once (once
[(message (ssh-identification-line $remote-identification)) [(message (ssh-identification-line $remote-identification))
(if (not (regexp-match #rx"^SSH-2\\.0-.*" remote-identification)) (cond
(begin [(regexp-match #rx"^SSH-2\\.0-.*" remote-identification)
(log-error "Invalid peer identification string ~v" remote-identification) (send! (inbound-credit 1))
(stop-actor-system)) (spawn
(begin #:name 'session
(send! (inbound-credit 1)) (ssh-session conn-ds ground-ds local-identification remote-identification 'server))]
(spawn #:name 'session [else
(ssh-session conn-ds (log-error "Invalid peer identification string ~v" remote-identification)
ground-ds (stop-actor-system)])])
local-identification
remote-identification
'server))))])
(during (SshAuthenticatedUser $user-name #"ssh-connection") (during (SshAuthenticatedUser $user-name #"ssh-connection")
(run-repl-instance conn-ds user-name)) (run-repl-instance conn-ds user-name))