version 1.164, 2008/01/19 22:22:58 |
version 1.165, 2008/01/19 22:37:19 |
|
|
FILE *f; |
FILE *f; |
Key *public; |
Key *public; |
char *comment = NULL, *cp, *ep, line[16*1024], *fp; |
char *comment = NULL, *cp, *ep, line[16*1024], *fp; |
int i, skip = 0, num = 1, invalid = 1; |
int i, skip = 0, num = 0, invalid = 1; |
enum fp_rep rep; |
enum fp_rep rep; |
enum fp_type fptype; |
enum fp_type fptype; |
struct stat st; |
struct stat st; |
|
|
if (f != NULL) { |
if (f != NULL) { |
while (fgets(line, sizeof(line), f)) { |
while (fgets(line, sizeof(line), f)) { |
if ((cp = strchr(line, '\n')) == NULL) { |
if ((cp = strchr(line, '\n')) == NULL) { |
error("line %d too long: %.40s...", num, line); |
error("line %d too long: %.40s...", |
|
num + 1, line); |
skip = 1; |
skip = 1; |
continue; |
continue; |
} |
} |
|
|
Key *public; |
Key *public; |
char *cp, *cp2, *kp, *kp2; |
char *cp, *cp2, *kp, *kp2; |
char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; |
char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; |
int c, skip = 0, inplace = 0, num = 1, invalid = 0, has_unhashed = 0; |
int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0; |
|
|
if (!have_identity) { |
if (!have_identity) { |
cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid); |
cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid); |
|
|
|
|
while (fgets(line, sizeof(line), in)) { |
while (fgets(line, sizeof(line), in)) { |
if ((cp = strchr(line, '\n')) == NULL) { |
if ((cp = strchr(line, '\n')) == NULL) { |
error("line %d too long: %.40s...", num, line); |
error("line %d too long: %.40s...", num + 1, line); |
skip = 1; |
skip = 1; |
invalid = 1; |
invalid = 1; |
continue; |
continue; |
|
|
fclose(in); |
fclose(in); |
|
|
if (invalid) { |
if (invalid) { |
fprintf(stderr, "%s is not a valid known_host file.\n", |
fprintf(stderr, "%s is not a valid known_hosts file.\n", |
identity_file); |
identity_file); |
if (inplace) { |
if (inplace) { |
fprintf(stderr, "Not replacing existing known_hosts " |
fprintf(stderr, "Not replacing existing known_hosts " |