summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-05 12:12:49 +1100
committerDamien Miller <djm@mindrot.org>2002-02-05 12:12:49 +1100
commit43cba34b649a2df8c170e17a5655d060830a386e (patch)
tree03dc88912275602b19053499ff0939854e383896
parent35b13d633b542b38645f476440829cbabe6a3102 (diff)
- 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@
-rw-r--r--ChangeLog5
-rw-r--r--ssh-add.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b31c8063..ad3371601 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,9 @@
28 - stevesk@cvs.openbsd.org 2002/01/27 18:08:17 28 - stevesk@cvs.openbsd.org 2002/01/27 18:08:17
29 [ssh.c] 29 [ssh.c]
30 handle simple case to identify FamilyLocal display; ok markus@ 30 handle simple case to identify FamilyLocal display; ok markus@
31 - markus@cvs.openbsd.org 2002/01/29 14:27:57
32 [ssh-add.c]
33 exit 2 if no agent, exit 1 if list fails; debian#61078; ok djm@
31 34
3220020130 3520020130
33 - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@ 36 - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
@@ -7430,4 +7433,4 @@
7430 - Wrote replacements for strlcpy and mkdtemp 7433 - Wrote replacements for strlcpy and mkdtemp
7431 - Released 1.0pre1 7434 - Released 1.0pre1
7432 7435
7433$Id: ChangeLog,v 1.1806 2002/02/05 01:12:09 djm Exp $ 7436$Id: ChangeLog,v 1.1807 2002/02/05 01:12:49 djm Exp $
diff --git a/ssh-add.c b/ssh-add.c
index 6d79357cc..b057a0892 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: ssh-add.c,v 1.49 2001/12/24 07:29:43 deraadt Exp $"); 38RCSID("$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
190static void 190static int
191list_identities(AuthenticationConnection *ac, int do_fp) 191list_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
222static int 225static 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':