diff options
-rw-r--r-- | ssh.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.461 2017/05/30 18:58:37 bluhm Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.462 2017/08/12 06:46:01 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -509,13 +509,13 @@ int | |||
509 | main(int ac, char **av) | 509 | main(int ac, char **av) |
510 | { | 510 | { |
511 | struct ssh *ssh = NULL; | 511 | struct ssh *ssh = NULL; |
512 | int i, r, opt, exit_status, use_syslog, direct, config_test = 0; | 512 | int i, r, opt, exit_status, use_syslog, direct, timeout_ms; |
513 | int config_test = 0, opt_terminated = 0; | ||
513 | char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; | 514 | char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; |
514 | char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; | 515 | char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; |
515 | char cname[NI_MAXHOST], uidstr[32], *conn_hash_hex; | 516 | char cname[NI_MAXHOST], uidstr[32], *conn_hash_hex; |
516 | struct stat st; | 517 | struct stat st; |
517 | struct passwd *pw; | 518 | struct passwd *pw; |
518 | int timeout_ms; | ||
519 | extern int optind, optreset; | 519 | extern int optind, optreset; |
520 | extern char *optarg; | 520 | extern char *optarg; |
521 | struct Forward fwd; | 521 | struct Forward fwd; |
@@ -917,6 +917,9 @@ main(int ac, char **av) | |||
917 | } | 917 | } |
918 | } | 918 | } |
919 | 919 | ||
920 | if (optind > 1 && strcmp(av[optind - 1], "--") == 0) | ||
921 | opt_terminated = 1; | ||
922 | |||
920 | ac -= optind; | 923 | ac -= optind; |
921 | av += optind; | 924 | av += optind; |
922 | 925 | ||
@@ -931,7 +934,7 @@ main(int ac, char **av) | |||
931 | host = xstrdup(++cp); | 934 | host = xstrdup(++cp); |
932 | } else | 935 | } else |
933 | host = xstrdup(*av); | 936 | host = xstrdup(*av); |
934 | if (ac > 1) { | 937 | if (ac > 1 && !opt_terminated) { |
935 | optind = optreset = 1; | 938 | optind = optreset = 1; |
936 | goto again; | 939 | goto again; |
937 | } | 940 | } |