|
Lines 1235-1253
main(int ac, char **av)
Link Here
|
| 1235 |
/* Fill configuration defaults. */ |
1235 |
/* Fill configuration defaults. */ |
| 1236 |
fill_default_options(&options); |
1236 |
fill_default_options(&options); |
| 1237 |
|
1237 |
|
|
|
1238 |
if (options.user == NULL) |
| 1239 |
options.user = xstrdup(pw->pw_name); |
| 1240 |
|
| 1238 |
/* |
1241 |
/* |
| 1239 |
* If ProxyJump option specified, then construct a ProxyCommand now. |
1242 |
* If ProxyJump option specified, then construct a ProxyCommand now. |
| 1240 |
*/ |
1243 |
*/ |
| 1241 |
if (options.jump_host != NULL) { |
1244 |
if (options.jump_host != NULL) { |
| 1242 |
char port_s[8]; |
1245 |
char port_s[8]; |
| 1243 |
const char *sshbin = argv0; |
1246 |
const char *jumpuser = options.jump_user, *sshbin = argv0; |
| 1244 |
int port = options.port, jumpport = options.jump_port; |
1247 |
int port = options.port, jumpport = options.jump_port; |
| 1245 |
|
1248 |
|
| 1246 |
if (port <= 0) |
1249 |
if (port <= 0) |
| 1247 |
port = default_ssh_port(); |
1250 |
port = default_ssh_port(); |
| 1248 |
if (jumpport <= 0) |
1251 |
if (jumpport <= 0) |
| 1249 |
jumpport = default_ssh_port(); |
1252 |
jumpport = default_ssh_port(); |
| 1250 |
if (strcmp(options.jump_host, host) == 0 && port == jumpport) |
1253 |
if (jumpuser == NULL) |
|
|
1254 |
jumpuser = options.user; |
| 1255 |
if (strcmp(options.jump_host, host) == 0 && port == jumpport && |
| 1256 |
strcmp(options.user, jumpuser) == 0) |
| 1251 |
fatal("jumphost loop via %s", options.jump_host); |
1257 |
fatal("jumphost loop via %s", options.jump_host); |
| 1252 |
|
1258 |
|
| 1253 |
/* |
1259 |
/* |
|
Lines 1349-1357
main(int ac, char **av)
Link Here
|
| 1349 |
"stdin is not a terminal."); |
1355 |
"stdin is not a terminal."); |
| 1350 |
tty_flag = 0; |
1356 |
tty_flag = 0; |
| 1351 |
} |
1357 |
} |
| 1352 |
|
|
|
| 1353 |
if (options.user == NULL) |
| 1354 |
options.user = xstrdup(pw->pw_name); |
| 1355 |
|
1358 |
|
| 1356 |
/* Set up strings used to percent_expand() arguments */ |
1359 |
/* Set up strings used to percent_expand() arguments */ |
| 1357 |
if (gethostname(thishost, sizeof(thishost)) == -1) |
1360 |
if (gethostname(thishost, sizeof(thishost)) == -1) |