Bugzilla – Attachment 2272 Details for
Bug 1545
ssh-keygen -R removes all comments from known_hosts file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch against 6.2
avoid-comment-loss.patch (text/plain), 2.77 KB, created by
Daniel Kahn Gillmor
on 2013-05-17 03:08:01 AEST
(
hide
)
Description:
patch against 6.2
Filename:
MIME Type:
Creator:
Daniel Kahn Gillmor
Created:
2013-05-17 03:08:01 AEST
Size:
2.77 KB
patch
obsolete
>--- a/ssh-keygen.c >+++ b/ssh-keygen.c >@@ -965,7 +965,8 @@ > } > > static void >-printhost(FILE *f, const char *name, Key *public, int ca, int hash) >+printhost(FILE *f, const char *name, const char *comment, Key *public, >+ int ca, int hash) > { > if (print_fingerprint) { > enum fp_rep rep; >@@ -988,6 +989,8 @@ > fprintf(f, "%s%s%s ", ca ? CA_MARKER : "", ca ? " " : "", name); > if (!key_write(public, f)) > fatal("key_write failed"); >+ if (comment != NULL && *comment) >+ fprintf(f, " %s", comment); > fprintf(f, "\n"); > } > } >@@ -1091,7 +1094,6 @@ > continue; > } > } >- > if (*cp == HASH_DELIM) { > if (find_host || delete_host) { > cp2 = host_hash(name, cp, strlen(cp)); >@@ -1107,18 +1109,18 @@ > "line %d type %s%s\n", name, > num, key_type(pub), > ca ? " (CA key)" : ""); >- printhost(out, cp, pub, ca, 0); >+ printhost(out, cp, kp, pub, ca, 0); > } > if (delete_host) { > if (!c && !ca) >- printhost(out, cp, pub, ca, 0); >+ printhost(out, cp, kp, pub, ca, 0); > else > printf("# Host %s found: " > "line %d type %s\n", name, > num, key_type(pub)); > } > } else if (hash_hosts) >- printhost(out, cp, pub, ca, 0); >+ printhost(out, cp, kp, pub, ca, 0); > } else { > if (find_host || delete_host) { > c = (match_hostname(name, cp, >@@ -1128,12 +1130,12 @@ > "line %d type %s%s\n", name, > num, key_type(pub), > ca ? " (CA key)" : ""); >- printhost(out, name, pub, >+ printhost(out, name, kp, pub, > ca, hash_hosts && !ca); > } > if (delete_host) { > if (!c && !ca) >- printhost(out, cp, pub, ca, 0); >+ printhost(out, cp, kp, pub, ca, 0); > else > printf("# Host %s found: " > "line %d type %s\n", name, >@@ -1147,16 +1149,19 @@ > fprintf(stderr, "Warning: " > "ignoring CA key for host: " > "%.64s\n", cp2); >- printhost(out, cp2, pub, ca, 0); >+ printhost(out, cp2, kp, pub, >+ ca, 0); > } else if (strcspn(cp2, "*?!") != > strlen(cp2)) { > fprintf(stderr, "Warning: " > "ignoring host name with " > "metacharacters: %.64s\n", > cp2); >- printhost(out, cp2, pub, ca, 0); >+ printhost(out, cp2, kp, pub, >+ ca, 0); > } else >- printhost(out, cp2, pub, ca, 1); >+ printhost(out, cp2, kp, pub, >+ ca, 1); > } > has_unhashed = 1; > } >--- a/key.c >+++ b/key.c >@@ -693,6 +693,8 @@ > "actual %d", bits, BN_num_bits(ret->rsa->n)); > return -1; > } >+ while (**cpp == ' ' || **cpp == '\t') >+ (*cpp)++; > success = 1; > break; > case KEY_UNSPEC: >@@ -815,6 +817,8 @@ > cp++; > while (*cp != '\0' && *cp != ' ' && *cp != '\t') > cp++; >+ while (*cp == ' ' || *cp == '\t') >+ cp++; > *cpp = cp; > break; > default:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1545
:
1589
|
2103
| 2272