- 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@
This commit is contained in:
parent
35b13d633b
commit
43cba34b64
|
@ -28,6 +28,9 @@
|
||||||
- stevesk@cvs.openbsd.org 2002/01/27 18:08:17
|
- stevesk@cvs.openbsd.org 2002/01/27 18:08:17
|
||||||
[ssh.c]
|
[ssh.c]
|
||||||
handle simple case to identify FamilyLocal display; ok markus@
|
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
|
20020130
|
||||||
- (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
|
- (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
|
||||||
|
@ -7430,4 +7433,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1806 2002/02/05 01:12:09 djm Exp $
|
$Id: ChangeLog,v 1.1807 2002/02/05 01:12:49 djm Exp $
|
||||||
|
|
14
ssh-add.c
14
ssh-add.c
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#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>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ update_card(AuthenticationConnection *ac, int add, const char *id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
list_identities(AuthenticationConnection *ac, int do_fp)
|
list_identities(AuthenticationConnection *ac, int do_fp)
|
||||||
{
|
{
|
||||||
Key *key;
|
Key *key;
|
||||||
|
@ -215,8 +215,11 @@ list_identities(AuthenticationConnection *ac, int do_fp)
|
||||||
xfree(comment);
|
xfree(comment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!had_identities)
|
if (!had_identities) {
|
||||||
printf("The agent has no identities.\n");
|
printf("The agent has no identities.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -266,13 +269,14 @@ main(int argc, char **argv)
|
||||||
ac = ssh_get_authentication_connection();
|
ac = ssh_get_authentication_connection();
|
||||||
if (ac == NULL) {
|
if (ac == NULL) {
|
||||||
fprintf(stderr, "Could not open a connection to your authentication agent.\n");
|
fprintf(stderr, "Could not open a connection to your authentication agent.\n");
|
||||||
exit(1);
|
exit(2);
|
||||||
}
|
}
|
||||||
while ((ch = getopt(argc, argv, "lLdDe:s:")) != -1) {
|
while ((ch = getopt(argc, argv, "lLdDe:s:")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'l':
|
case 'l':
|
||||||
case 'L':
|
case 'L':
|
||||||
list_identities(ac, ch == 'l' ? 1 : 0);
|
if (list_identities(ac, ch == 'l' ? 1 : 0) == -1)
|
||||||
|
ret = 1;
|
||||||
goto done;
|
goto done;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
|
|
Loading…
Reference in New Issue