simon-git: putty (pre-0.77): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri Apr 29 16:52:49 BST 2022


TL;DR:
  1cf4f509 sshproxy.c: remember to call prepare_session().

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: pre-0.77
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-04-29 16:52:49

commit 1cf4f509817b3c33cc75df3972cf553f2d939868
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=1cf4f509817b3c33cc75df3972cf553f2d939868;hp=38a5f59c7535538cf4e546bcfc99e436d15cedb1
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri Apr 29 16:41:18 2022 +0100

    sshproxy.c: remember to call prepare_session().
    
    prepare_session() is the function that takes a Conf in the form it was
    loaded from the configuration, and normalises it into the form that
    backends can make sense of easily. In particular, if CONF_host
    contains something like "user at hostname", this is the place where the
    "user@" is stripped off the hostname field and moved into
    CONF_username where the backend will expect to find it.
    
    Therefore, you're _always_ supposed to call prepare_session() before
    launching a backend from a Conf you (potentially) got from a saved
    session. But the SSH proxy code forgot to.
    
    As a result, if you had a saved session with "user at hostname" in the
    hostname field, it would work fine to launch that session directly in
    PuTTY, but trying to use the same saved session as an SSH proxy would
    fail mysteriously after trying to pass "user at hostname" to
    getaddrinfo() and getting nothing useful back.
    
    (On Windows, the error message is especially opaque: an invalid string
    of that kind generates an error code that we weren't even tranlsating.
    And even if we _do_ translate it, it wouldn't be very meaningful,
    because the error in question is WSANO_RECOVERY, which FormatMessage
    renders as "A non-recoverable error occurred during a database
    lookup." I guess the error in question was that Windows couldn't even
    figure out how to translate that string into the format of a DNS
    request message!)

 proxy/sshproxy.c | 6 ++++++
 1 file changed, 6 insertions(+)



More information about the tartarus-commits mailing list