| ︙ | | | ︙ | |
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
|
crStop(0);
}
logevent("Successfully started encryption");
fflush(stdout); /* FIXME eh? */
{
if (!*ssh->cfg.username) {
int ret; /* need not be kept over crReturn */
s->cur_prompt = new_prompts(ssh->frontend);
s->cur_prompt->to_server = TRUE;
s->cur_prompt->name = dupstr("SSH login name");
add_prompt(s->cur_prompt, dupstr("login as: "), TRUE,
lenof(s->username));
ret = get_userpass_input(s->cur_prompt, NULL, 0);
|
>
|
|
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
|
crStop(0);
}
logevent("Successfully started encryption");
fflush(stdout); /* FIXME eh? */
{
if (!get_remote_username(&ssh->cfg, s->username,
sizeof(s->username))) {
int ret; /* need not be kept over crReturn */
s->cur_prompt = new_prompts(ssh->frontend);
s->cur_prompt->to_server = TRUE;
s->cur_prompt->name = dupstr("SSH login name");
add_prompt(s->cur_prompt, dupstr("login as: "), TRUE,
lenof(s->username));
ret = get_userpass_input(s->cur_prompt, NULL, 0);
|
| ︙ | | | ︙ | |
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
|
free_prompts(s->cur_prompt);
ssh_disconnect(ssh, "No username provided", NULL, 0, TRUE);
crStop(0);
}
memcpy(s->username, s->cur_prompt->prompts[0]->result,
lenof(s->username));
free_prompts(s->cur_prompt);
} else {
strncpy(s->username, ssh->cfg.username, sizeof(s->username));
s->username[sizeof(s->username)-1] = '\0';
}
send_packet(ssh, SSH1_CMSG_USER, PKT_STR, s->username, PKT_END);
{
char *userlog = dupprintf("Sent username \"%s\"", s->username);
logevent(userlog);
if (flags & FLAG_INTERACTIVE &&
|
<
<
<
|
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
|
free_prompts(s->cur_prompt);
ssh_disconnect(ssh, "No username provided", NULL, 0, TRUE);
crStop(0);
}
memcpy(s->username, s->cur_prompt->prompts[0]->result,
lenof(s->username));
free_prompts(s->cur_prompt);
}
send_packet(ssh, SSH1_CMSG_USER, PKT_STR, s->username, PKT_END);
{
char *userlog = dupprintf("Sent username \"%s\"", s->username);
logevent(userlog);
if (flags & FLAG_INTERACTIVE &&
|
| ︙ | | | ︙ | |
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
|
*/
if (s->got_username && !ssh->cfg.change_username) {
/*
* We got a username last time round this loop, and
* with change_username turned off we don't try to get
* it again.
*/
} else if (!*ssh->cfg.username) {
int ret; /* need not be kept over crReturn */
s->cur_prompt = new_prompts(ssh->frontend);
s->cur_prompt->to_server = TRUE;
s->cur_prompt->name = dupstr("SSH login name");
add_prompt(s->cur_prompt, dupstr("login as: "), TRUE,
lenof(s->username));
ret = get_userpass_input(s->cur_prompt, NULL, 0);
|
>
|
|
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
|
*/
if (s->got_username && !ssh->cfg.change_username) {
/*
* We got a username last time round this loop, and
* with change_username turned off we don't try to get
* it again.
*/
} else if (!get_remote_username(&ssh->cfg, s->username,
sizeof(s->username))) {
int ret; /* need not be kept over crReturn */
s->cur_prompt = new_prompts(ssh->frontend);
s->cur_prompt->to_server = TRUE;
s->cur_prompt->name = dupstr("SSH login name");
add_prompt(s->cur_prompt, dupstr("login as: "), TRUE,
lenof(s->username));
ret = get_userpass_input(s->cur_prompt, NULL, 0);
|
| ︙ | | | ︙ | |
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
|
crStopV;
}
memcpy(s->username, s->cur_prompt->prompts[0]->result,
lenof(s->username));
free_prompts(s->cur_prompt);
} else {
char *stuff;
strncpy(s->username, ssh->cfg.username, sizeof(s->username));
s->username[sizeof(s->username)-1] = '\0';
if ((flags & FLAG_VERBOSE) || (flags & FLAG_INTERACTIVE)) {
stuff = dupprintf("Using username \"%s\".\r\n", s->username);
c_write_str(ssh, stuff);
sfree(stuff);
}
}
s->got_username = TRUE;
|
<
<
|
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
|
crStopV;
}
memcpy(s->username, s->cur_prompt->prompts[0]->result,
lenof(s->username));
free_prompts(s->cur_prompt);
} else {
char *stuff;
if ((flags & FLAG_VERBOSE) || (flags & FLAG_INTERACTIVE)) {
stuff = dupprintf("Using username \"%s\".\r\n", s->username);
c_write_str(ssh, stuff);
sfree(stuff);
}
}
s->got_username = TRUE;
|
| ︙ | | | ︙ | |