projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add some hard-coded textual literal-IP representations of localhost to
[u/mdw/putty]
/
rlogin.c
diff --git
a/rlogin.c
b/rlogin.c
index
e40f159
..
c392fa0
100644
(file)
--- a/
rlogin.c
+++ b/
rlogin.c
@@
-182,12
+182,14
@@
static const char *rlogin_init(void *frontend_handle, void **backend_handle,
{
char z = 0;
char *p;
{
char z = 0;
char *p;
+ char ruser[sizeof(cfg->username)];
+ (void) get_remote_username(cfg, ruser, sizeof(ruser));
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, cfg->localusername,
strlen(cfg->localusername));
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, cfg->localusername,
strlen(cfg->localusername));
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s,
cfg->username
,
- strlen(
cfg->username
));
+ sk_write(rlogin->s,
ruser
,
+ strlen(
ruser
));
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, cfg->termtype,
strlen(cfg->termtype));
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, cfg->termtype,
strlen(cfg->termtype));
@@
-197,6
+199,22
@@
static const char *rlogin_init(void *frontend_handle, void **backend_handle,
rlogin->bufsize = sk_write(rlogin->s, &z, 1);
}
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;
}
return NULL;
}