- stevesk@cvs.openbsd.org 2002/01/27 18:08:17
[ssh.c]
handle simple case to identify FamilyLocal display; ok markus@
+ - markus@cvs.openbsd.org 2002/01/29 14:27:57
+ [ssh-add.c]
+ exit 2 if no agent, exit 1 if list fails; debian#61078; ok djm@
20020130
- (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-add.c,v 1.49 2001/12/24 07:29:43 deraadt Exp $");
+RCSID("$OpenBSD: ssh-add.c,v 1.50 2002/01/29 14:27:57 markus Exp $");
#include <openssl/evp.h>
}
}
-static void
+static int
list_identities(AuthenticationConnection *ac, int do_fp)
{
Key *key;
xfree(comment);
}
}
- if (!had_identities)
+ if (!had_identities) {
printf("The agent has no identities.\n");
+ return -1;
+ }
+ return 0;
}
static int
ac = ssh_get_authentication_connection();
if (ac == NULL) {
fprintf(stderr, "Could not open a connection to your authentication agent.\n");
- exit(1);
+ exit(2);
}
while ((ch = getopt(argc, argv, "lLdDe:s:")) != -1) {
switch (ch) {
case 'l':
case 'L':
- list_identities(ac, ch == 'l' ? 1 : 0);
+ if (list_identities(ac, ch == 'l' ? 1 : 0) == -1)
+ ret = 1;
goto done;
break;
case 'd':