=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-add.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- src/usr.bin/ssh/ssh-add.c 2001/12/24 07:29:43 1.49 +++ src/usr.bin/ssh/ssh-add.c 2002/01/29 14:27:57 1.50 @@ -35,7 +35,7 @@ */ #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 @@ -181,7 +181,7 @@ } } -static void +static int list_identities(AuthenticationConnection *ac, int do_fp) { Key *key; @@ -209,8 +209,11 @@ xfree(comment); } } - if (!had_identities) + if (!had_identities) { printf("The agent has no identities.\n"); + return -1; + } + return 0; } static int @@ -256,13 +259,14 @@ 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':