SSH File Server Doesn't default to a sane terminal width if a 0 width terminal is requested

0 votes
asked May 7, 2020 by walljm (520 points)

The issue is in the pty-req handling in FileServer/Ssh/Channel.cs around line 618.

When a 0 width terminal is requested, Rebex just sends a new line after every character. Here is the code with my fix below:

if (_columns == 0)
    _columns = 80;

1 Answer

0 votes
answered May 7, 2020 by Lukas Pokorny (128,290 points)

Thanks for catching and reporting this! I would guess that even very short values might lead to all kinds of strange issues, so we'll see how common SSH servers behave and try to follow the common approach. But using a default value such as 80 instead of 0 looks like a good idea.

(However, please don't post parts of Rebex source code on public forums.)

commented May 7, 2020 by walljm (520 points)
ah, roger that.  thanks!
commented May 26, 2020 by Lukas Pokorny (128,290 points)
Our latest release, 2020 R2, attempts to fix this issue by rejecting requests with wrong values. We hope this would be a better solution that defaulting to a fixed number of columns or rows. However, if you encounter any problem with that solution, please let us know.