+/*
+ * Rlogin backend.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
{
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, 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));
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;
}
-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)
rlogin_size,
rlogin_special,
rlogin_get_specials,
- rlogin_socket,
+ rlogin_connected,
rlogin_exitcode,
rlogin_sendok,
rlogin_ldisc,
rlogin_provide_logctx,
rlogin_unthrottle,
rlogin_cfg_info,
- 1
+ "rlogin",
+ PROT_RLOGIN,
+ 513
};