summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-02-10 22:24:55 +1100
committerDamien Miller <djm@mindrot.org>2008-02-10 22:24:55 +1100
commitcb2fbb240718d7ca861f4d283711d6a54bc7a714 (patch)
treef4449c0919424dfccc625abf6b86ef80a01ad640 /ssh-keygen.c
parenta8796f3fcc8584ad01ba0132a0ae1d7d1131febd (diff)
- djm@cvs.openbsd.org 2008/01/19 22:37:19
[ssh-keygen.c] unbreak line numbering (broken in revision 1.164), fix error message
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 6a2c52017..adacbff0b 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.164 2008/01/19 22:22:58 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.165 2008/01/19 22:37:19 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -504,7 +504,7 @@ do_fingerprint(struct passwd *pw)
504 FILE *f; 504 FILE *f;
505 Key *public; 505 Key *public;
506 char *comment = NULL, *cp, *ep, line[16*1024], *fp; 506 char *comment = NULL, *cp, *ep, line[16*1024], *fp;
507 int i, skip = 0, num = 1, invalid = 1; 507 int i, skip = 0, num = 0, invalid = 1;
508 enum fp_rep rep; 508 enum fp_rep rep;
509 enum fp_type fptype; 509 enum fp_type fptype;
510 struct stat st; 510 struct stat st;
@@ -536,7 +536,8 @@ do_fingerprint(struct passwd *pw)
536 if (f != NULL) { 536 if (f != NULL) {
537 while (fgets(line, sizeof(line), f)) { 537 while (fgets(line, sizeof(line), f)) {
538 if ((cp = strchr(line, '\n')) == NULL) { 538 if ((cp = strchr(line, '\n')) == NULL) {
539 error("line %d too long: %.40s...", num, line); 539 error("line %d too long: %.40s...",
540 num + 1, line);
540 skip = 1; 541 skip = 1;
541 continue; 542 continue;
542 } 543 }
@@ -613,7 +614,7 @@ do_known_hosts(struct passwd *pw, const char *name)
613 Key *public; 614 Key *public;
614 char *cp, *cp2, *kp, *kp2; 615 char *cp, *cp2, *kp, *kp2;
615 char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; 616 char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN];
616 int c, skip = 0, inplace = 0, num = 1, invalid = 0, has_unhashed = 0; 617 int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0;
617 618
618 if (!have_identity) { 619 if (!have_identity) {
619 cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid); 620 cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid);
@@ -649,7 +650,7 @@ do_known_hosts(struct passwd *pw, const char *name)
649 650
650 while (fgets(line, sizeof(line), in)) { 651 while (fgets(line, sizeof(line), in)) {
651 if ((cp = strchr(line, '\n')) == NULL) { 652 if ((cp = strchr(line, '\n')) == NULL) {
652 error("line %d too long: %.40s...", num, line); 653 error("line %d too long: %.40s...", num + 1, line);
653 skip = 1; 654 skip = 1;
654 invalid = 1; 655 invalid = 1;
655 continue; 656 continue;
@@ -748,7 +749,7 @@ do_known_hosts(struct passwd *pw, const char *name)
748 fclose(in); 749 fclose(in);
749 750
750 if (invalid) { 751 if (invalid) {
751 fprintf(stderr, "%s is not a valid known_host file.\n", 752 fprintf(stderr, "%s is not a valid known_hosts file.\n",
752 identity_file); 753 identity_file);
753 if (inplace) { 754 if (inplace) {
754 fprintf(stderr, "Not replacing existing known_hosts " 755 fprintf(stderr, "Not replacing existing known_hosts "