diff options
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: ssh-add.c,v 1.49 2001/12/24 07:29:43 deraadt Exp $"); | 38 | RCSID("$OpenBSD: ssh-add.c,v 1.50 2002/01/29 14:27:57 markus Exp $"); |
39 | 39 | ||
40 | #include <openssl/evp.h> | 40 | #include <openssl/evp.h> |
41 | 41 | ||
@@ -187,7 +187,7 @@ update_card(AuthenticationConnection *ac, int add, const char *id) | |||
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | static void | 190 | static int |
191 | list_identities(AuthenticationConnection *ac, int do_fp) | 191 | list_identities(AuthenticationConnection *ac, int do_fp) |
192 | { | 192 | { |
193 | Key *key; | 193 | Key *key; |
@@ -215,8 +215,11 @@ list_identities(AuthenticationConnection *ac, int do_fp) | |||
215 | xfree(comment); | 215 | xfree(comment); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | if (!had_identities) | 218 | if (!had_identities) { |
219 | printf("The agent has no identities.\n"); | 219 | printf("The agent has no identities.\n"); |
220 | return -1; | ||
221 | } | ||
222 | return 0; | ||
220 | } | 223 | } |
221 | 224 | ||
222 | static int | 225 | static int |
@@ -266,13 +269,14 @@ main(int argc, char **argv) | |||
266 | ac = ssh_get_authentication_connection(); | 269 | ac = ssh_get_authentication_connection(); |
267 | if (ac == NULL) { | 270 | if (ac == NULL) { |
268 | fprintf(stderr, "Could not open a connection to your authentication agent.\n"); | 271 | fprintf(stderr, "Could not open a connection to your authentication agent.\n"); |
269 | exit(1); | 272 | exit(2); |
270 | } | 273 | } |
271 | while ((ch = getopt(argc, argv, "lLdDe:s:")) != -1) { | 274 | while ((ch = getopt(argc, argv, "lLdDe:s:")) != -1) { |
272 | switch (ch) { | 275 | switch (ch) { |
273 | case 'l': | 276 | case 'l': |
274 | case 'L': | 277 | case 'L': |
275 | list_identities(ac, ch == 'l' ? 1 : 0); | 278 | if (list_identities(ac, ch == 'l' ? 1 : 0) == -1) |
279 | ret = 1; | ||
276 | goto done; | 280 | goto done; |
277 | break; | 281 | break; |
278 | case 'd': | 282 | case 'd': |