summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/authfd.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-10-29 10:16:02 +0000
committerdes <des@FreeBSD.org>2002-10-29 10:16:02 +0000
commit279b0fa809e30e3a007bbc4b2adb1ccbd4d4a87a (patch)
tree404fa392fc6f2560e3c459fa20228c7031d0289d /crypto/openssh/authfd.c
parentce26c10eda4d687d476e9bbac51ccd26564af8da (diff)
downloadFreeBSD-src-279b0fa809e30e3a007bbc4b2adb1ccbd4d4a87a.zip
FreeBSD-src-279b0fa809e30e3a007bbc4b2adb1ccbd4d4a87a.tar.gz
Resolve conflicts.
Diffstat (limited to 'crypto/openssh/authfd.c')
-rw-r--r--crypto/openssh/authfd.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/crypto/openssh/authfd.c b/crypto/openssh/authfd.c
index 1b689ea..5af92af 100644
--- a/crypto/openssh/authfd.c
+++ b/crypto/openssh/authfd.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfd.c,v 1.56 2002/06/25 16:22:42 markus Exp $");
+RCSID("$OpenBSD: authfd.c,v 1.57 2002/09/11 18:27:26 stevesk Exp $");
RCSID("$FreeBSD$");
#include <openssl/evp.h>
@@ -54,6 +54,8 @@ RCSID("$FreeBSD$");
#include "log.h"
#include "atomicio.h"
+static int agent_present = 0;
+
/* helper */
int decode_reply(int type);
@@ -62,6 +64,21 @@ int decode_reply(int type);
((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE) || \
(x == SSH2_AGENT_FAILURE))
+int
+ssh_agent_present(void)
+{
+ int authfd;
+
+ if (agent_present)
+ return 1;
+ if ((authfd = ssh_get_authentication_socket()) == -1)
+ return 0;
+ else {
+ ssh_close_authentication_socket(authfd);
+ return 1;
+ }
+}
+
/* Returns the number of the authentication fd, or -1 if there is none. */
int
@@ -91,6 +108,7 @@ ssh_get_authentication_socket(void)
close(sock);
return -1;
}
+ agent_present = 1;
return sock;
}
OpenPOWER on IntegriCloud