X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/eaf1e20af0294d79a176d2ac3b35fd4143163051..f160b7b8908cac4a7ca37b49928b7855fe0a11fe:/rlogin.c diff --git a/rlogin.c b/rlogin.c index 1b9a8069..c9e7c5ec 100644 --- a/rlogin.c +++ b/rlogin.c @@ -197,6 +197,22 @@ static const char *rlogin_init(void *frontend_handle, void **backend_handle, rlogin->bufsize = sk_write(rlogin->s, &z, 1); } + if (*cfg->loghost) { + char *colon; + + sfree(*realhost); + *realhost = dupstr(cfg->loghost); + colon = strrchr(*realhost, ':'); + if (colon) { + /* + * FIXME: if we ever update this aspect of ssh.c for + * IPv6 literal management, this should change in line + * with it. + */ + *colon++ = '\0'; + } + } + return NULL; } @@ -280,10 +296,10 @@ static const struct telnet_special *rlogin_get_specials(void *handle) return NULL; } -static Socket rlogin_socket(void *handle) +static int rlogin_connected(void *handle) { Rlogin rlogin = (Rlogin) handle; - return rlogin->s; + return rlogin->s != NULL; } static int rlogin_sendok(void *handle) @@ -341,7 +357,7 @@ Backend rlogin_backend = { rlogin_size, rlogin_special, rlogin_get_specials, - rlogin_socket, + rlogin_connected, rlogin_exitcode, rlogin_sendok, rlogin_ldisc, @@ -349,5 +365,7 @@ Backend rlogin_backend = { rlogin_provide_logctx, rlogin_unthrottle, rlogin_cfg_info, - 1 + "rlogin", + PROT_RLOGIN, + 513 };