diff options
author | Colin Watson <cjwatson@debian.org> | 2013-05-16 14:04:24 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2013-05-16 14:04:24 +0100 |
commit | 031d51614426a5d5ad42f971831df373f5d6e6d8 (patch) | |
tree | 6a66dc70fd3444ea8064f25256bd2fccdce6e3cd /ssh.c | |
parent | 43587d4ea4349c7b98edcde117f37e6ca2e1b674 (diff) | |
parent | 328b60656f29db6306994d7498dede386ec2d1c3 (diff) |
* New upstream release (http://www.openssh.com/txt/release-6.2p2):
- Only warn for missing identity files that were explicitly specified
(closes: #708275).
- Fix bug in contributed contrib/ssh-copy-id script that could result in
"rm *" being called on mktemp failure (closes: #708419).
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.370 2012/07/06 01:47:38 djm Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.373 2013/02/22 22:09: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 |
@@ -405,12 +405,7 @@ main(int ac, char **av) | |||
405 | strerror(errno)); | 405 | strerror(errno)); |
406 | break; | 406 | break; |
407 | } | 407 | } |
408 | if (options.num_identity_files >= | 408 | add_identity_file(&options, NULL, optarg, 1); |
409 | SSH_MAX_IDENTITY_FILES) | ||
410 | fatal("Too many identity files specified " | ||
411 | "(max %d)", SSH_MAX_IDENTITY_FILES); | ||
412 | options.identity_files[options.num_identity_files++] = | ||
413 | xstrdup(optarg); | ||
414 | break; | 409 | break; |
415 | case 'I': | 410 | case 'I': |
416 | #ifdef ENABLE_PKCS11 | 411 | #ifdef ENABLE_PKCS11 |
@@ -584,7 +579,8 @@ main(int ac, char **av) | |||
584 | dummy = 1; | 579 | dummy = 1; |
585 | line = xstrdup(optarg); | 580 | line = xstrdup(optarg); |
586 | if (process_config_line(&options, host ? host : "", | 581 | if (process_config_line(&options, host ? host : "", |
587 | line, "command-line", 0, &dummy) != 0) | 582 | line, "command-line", 0, &dummy, SSHCONF_USERCONF) |
583 | != 0) | ||
588 | exit(255); | 584 | exit(255); |
589 | xfree(line); | 585 | xfree(line); |
590 | break; | 586 | break; |
@@ -678,14 +674,15 @@ main(int ac, char **av) | |||
678 | * file if the user specifies a config file on the command line. | 674 | * file if the user specifies a config file on the command line. |
679 | */ | 675 | */ |
680 | if (config != NULL) { | 676 | if (config != NULL) { |
681 | if (!read_config_file(config, host, &options, 0)) | 677 | if (!read_config_file(config, host, &options, SSHCONF_USERCONF)) |
682 | fatal("Can't open user config file %.100s: " | 678 | fatal("Can't open user config file %.100s: " |
683 | "%.100s", config, strerror(errno)); | 679 | "%.100s", config, strerror(errno)); |
684 | } else { | 680 | } else { |
685 | r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, | 681 | r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, |
686 | _PATH_SSH_USER_CONFFILE); | 682 | _PATH_SSH_USER_CONFFILE); |
687 | if (r > 0 && (size_t)r < sizeof(buf)) | 683 | if (r > 0 && (size_t)r < sizeof(buf)) |
688 | (void)read_config_file(buf, host, &options, 1); | 684 | (void)read_config_file(buf, host, &options, |
685 | SSHCONF_CHECKPERM|SSHCONF_USERCONF); | ||
689 | 686 | ||
690 | /* Read systemwide configuration file after user config. */ | 687 | /* Read systemwide configuration file after user config. */ |
691 | (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, | 688 | (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, |
@@ -1539,7 +1536,8 @@ load_public_identity_files(void) | |||
1539 | fatal("load_public_identity_files: gethostname: %s", | 1536 | fatal("load_public_identity_files: gethostname: %s", |
1540 | strerror(errno)); | 1537 | strerror(errno)); |
1541 | for (i = 0; i < options.num_identity_files; i++) { | 1538 | for (i = 0; i < options.num_identity_files; i++) { |
1542 | if (n_ids >= SSH_MAX_IDENTITY_FILES) { | 1539 | if (n_ids >= SSH_MAX_IDENTITY_FILES || |
1540 | strcasecmp(options.identity_files[i], "none") == 0) { | ||
1543 | xfree(options.identity_files[i]); | 1541 | xfree(options.identity_files[i]); |
1544 | continue; | 1542 | continue; |
1545 | } | 1543 | } |