static struct termios orig_termios;
-void fatalbox(char *p, ...)
+void fatalbox(const char *p, ...)
{
struct termios cf;
va_list ap;
}
cleanup_exit(1);
}
-void modalfatalbox(char *p, ...)
+void modalfatalbox(const char *p, ...)
{
struct termios cf;
va_list ap;
}
cleanup_exit(1);
}
-void nonfatal(char *p, ...)
+void nonfatal(const char *p, ...)
{
struct termios cf;
va_list ap;
fputc('\n', stderr);
postmsg(&cf);
}
-void connection_fatal(void *frontend, char *p, ...)
+void connection_fatal(void *frontend, const char *p, ...)
{
struct termios cf;
va_list ap;
}
cleanup_exit(1);
}
-void cmdline_error(char *p, ...)
+void cmdline_error(const char *p, ...)
{
struct termios cf;
va_list ap;
{
if (!strcmp(name, "TermType"))
return dupstr(getenv("TERM"));
- if (!strcmp(name, "UserName"))
- return get_username();
if (!strcmp(name, "SerialLine"))
return dupstr("/dev/ttyS0");
return NULL;
return FALSE; /* do not respond to incoming EOF with outgoing */
}
-int get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
+int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen)
{
int ret;
ret = cmdline_get_passwd_input(p, in, inlen);
*/
cmdline_run_saved(conf);
+ /*
+ * If we have no better ideas for the remote username, use the local
+ * one, as 'ssh' does.
+ */
+ if (conf_get_str(conf, CONF_username)[0] == '\0') {
+ char *user = get_username();
+ if (user) {
+ conf_set_str(conf, CONF_username, user);
+ sfree(user);
+ }
+ }
+
/*
* Apply subsystem status.
*/