Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0885-Change-default-unspecified-ssh-line-ending...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0885-Change-default-unspecified-ssh-line-ending-to-CRLF.patch of Package erlang
From d5fd98c8fb0e925fd34976c78de719166dab6b3d Mon Sep 17 00:00:00 2001 From: Frank Hunleth <fhunleth@troodon-software.com> Date: Thu, 18 Nov 2021 00:49:42 -0500 Subject: [PATCH] Change default unspecified ssh line ending to CRLF If an SSH client does not specify what line endings to use, use CRLF. This fixes the built-in Windows ssh client that currently reports as "OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2". The reason for changing the default rather than adding another special case is that OpenSSH defaults to sending CR characters when unspecified. See the use of ONLCR at [1]. This mirrors that behavior. Interestingly, I found ONLCR is normally on with my testing with OpenSSH SSH to connect between MacOS and Linux, so this may not be an unusual setting anyway for non-Windows computers. Verification was done by capturing output and checking `stty -a | grep onlcr`. Tested on Windows (Putty and commandline ssh in Powershell), Linux and MacOS. [1] https://github.com/openssh/openssh-portable/blob/2dc328023f60212cd29504fc05d849133ae47355/openbsd-compat/bsd-openpty.c#L194 --- lib/ssh/src/ssh_connection.erl | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl index 03a5d31f99..aa35426123 100644 --- a/lib/ssh/src/ssh_connection.erl +++ b/lib/ssh/src/ssh_connection.erl @@ -811,26 +811,20 @@ handle_msg(#ssh_msg_channel_request{recipient_channel = ChannelId, request_type = "pty-req", want_reply = WantReply, data = Data}, - Connection, server, SSH) -> + Connection, server, _SSH) -> <<?DEC_BIN(BTermName,_TermLen), ?UINT32(Width),?UINT32(Height), ?UINT32(PixWidth), ?UINT32(PixHeight), Modes/binary>> = Data, TermName = binary_to_list(BTermName), PtyOpts0 = decode_pty_opts(Modes), - PtyOpts = case SSH#ssh.c_version of - "SSH-2.0-PuTTY"++_ -> - %% If - peer client is PuTTY - %% - it asked for pty + PtyOpts = case proplists:get_value(onlcr, PtyOpts0, undefined) of + undefined -> + %% If - peer client asked for pty %% - did not tell if LF->CRLF expansion is wanted %% then %% - do LF->CRLF expansion - case proplists:get_value(onlcr, PtyOpts0, undefined) of - undefined -> - [{onlcr,1} | PtyOpts0]; - _ -> - PtyOpts0 - end; + [{onlcr,1} | PtyOpts0]; _ -> PtyOpts0 end, -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor