summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/ssh.c b/ssh.c
index 58c04f88f..19732cb4d 100644
--- a/ssh.c
+++ b/ssh.c
@@ -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 }