version 1.5, 1999/09/29 18:16:21 |
version 1.6, 1999/09/29 21:14:16 |
|
|
char portstring[100]; |
char portstring[100]; |
|
|
/* Convert the port number into a string. */ |
/* Convert the port number into a string. */ |
sprintf(portstring, "%d", port); |
snprintf(portstring, sizeof portstring, "%d", port); |
|
|
/* Build the final command string in the buffer by making the appropriate |
/* Build the final command string in the buffer by making the appropriate |
substitutions to the given proxy command. */ |
substitutions to the given proxy command. */ |
|
|
this work even if stdin has been redirected. If running in |
this work even if stdin has been redirected. If running in |
batch mode, we just use the empty passphrase, which will fail and |
batch mode, we just use the empty passphrase, which will fail and |
return. */ |
return. */ |
sprintf(buf, "Enter passphrase for RSA key '%.100s': ", comment); |
snprintf(buf, sizeof buf, |
|
"Enter passphrase for RSA key '%.100s': ", comment); |
if (may_ask_passphrase) |
if (may_ask_passphrase) |
passphrase = read_passphrase(buf, 0); |
passphrase = read_passphrase(buf, 0); |
else |
else |
|
|
server_cell = p; |
server_cell = p; |
|
|
/* Flesh out our credentials. */ |
/* Flesh out our credentials. */ |
strcpy(creds.service, "afs"); |
strlcpy(creds.service, "afs", sizeof creds.service); |
creds.instance[0] = '\0'; |
creds.instance[0] = '\0'; |
strncpy(creds.realm, server_cell, REALM_SZ); |
strlcpy(creds.realm, server_cell, REALM_SZ); |
memcpy(creds.session, ct.HandShakeKey, DES_KEY_SZ); |
memcpy(creds.session, ct.HandShakeKey, DES_KEY_SZ); |
creds.issue_date = ct.BeginTimestamp; |
creds.issue_date = ct.BeginTimestamp; |
creds.lifetime = krb_time_to_life(creds.issue_date, ct.EndTimestamp); |
creds.lifetime = krb_time_to_life(creds.issue_date, ct.EndTimestamp); |
|
|
fatal("Remote machine has too old SSH software version."); |
fatal("Remote machine has too old SSH software version."); |
|
|
/* Send our own protocol version identification. */ |
/* Send our own protocol version identification. */ |
sprintf(buf, "SSH-%d.%d-%.100s\n", |
snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", |
PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION); |
PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION); |
if (write(connection_out, buf, strlen(buf)) != strlen(buf)) |
if (write(connection_out, buf, strlen(buf)) != strlen(buf)) |
fatal("write: %.100s", strerror(errno)); |
fatal("write: %.100s", strerror(errno)); |
|
|
{ |
{ |
/* Print a newline (the prompt probably didn\'t have one). */ |
/* Print a newline (the prompt probably didn\'t have one). */ |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
strcpy(buf, "no"); |
strlcpy(buf, "no", sizeof buf); |
} |
} |
/* Remove newline from response. */ |
/* Remove newline from response. */ |
if (strchr(buf, '\n')) |
if (strchr(buf, '\n')) |