version 1.232, 2013/08/13 18:33:08 |
version 1.233, 2013/08/28 12:34:27 |
|
|
char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; |
char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; |
int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0; |
int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0; |
int ca; |
int ca; |
|
int found_key = 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); |
|
|
} |
} |
c = (strcmp(cp2, cp) == 0); |
c = (strcmp(cp2, cp) == 0); |
if (find_host && c) { |
if (find_host && c) { |
printf("# Host %s found: " |
if (!quiet) |
"line %d type %s%s\n", name, |
printf("# Host %s found: " |
num, key_type(pub), |
"line %d type %s%s\n", name, |
ca ? " (CA key)" : ""); |
num, key_type(pub), |
|
ca ? " (CA key)" : ""); |
printhost(out, cp, pub, ca, 0); |
printhost(out, cp, pub, ca, 0); |
|
found_key = 1; |
} |
} |
if (delete_host) { |
if (delete_host) { |
if (!c && !ca) |
if (!c && !ca) |
|
|
c = (match_hostname(name, cp, |
c = (match_hostname(name, cp, |
strlen(cp)) == 1); |
strlen(cp)) == 1); |
if (find_host && c) { |
if (find_host && c) { |
printf("# Host %s found: " |
if (!quiet) |
"line %d type %s%s\n", name, |
printf("# Host %s found: " |
num, key_type(pub), |
"line %d type %s%s\n", name, |
ca ? " (CA key)" : ""); |
num, key_type(pub), |
|
ca ? " (CA key)" : ""); |
printhost(out, name, pub, |
printhost(out, name, pub, |
ca, hash_hosts && !ca); |
ca, hash_hosts && !ca); |
|
found_key = 1; |
} |
} |
if (delete_host) { |
if (delete_host) { |
if (!c && !ca) |
if (!c && !ca) |
|
|
} |
} |
} |
} |
|
|
exit(0); |
exit (find_host && !found_key); |
} |
} |
|
|
/* |
/* |