summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ssh.c b/ssh.c
index 36416fa28..df7274f4c 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.411 2015/01/08 10:15:45 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.412 2015/01/14 20:05:27 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -107,6 +107,7 @@
107#include "uidswap.h" 107#include "uidswap.h"
108#include "roaming.h" 108#include "roaming.h"
109#include "version.h" 109#include "version.h"
110#include "ssherr.h"
110 111
111#ifdef ENABLE_PKCS11 112#ifdef ENABLE_PKCS11
112#include "ssh-pkcs11.h" 113#include "ssh-pkcs11.h"
@@ -1502,10 +1503,16 @@ ssh_init_forwarding(void)
1502static void 1503static void
1503check_agent_present(void) 1504check_agent_present(void)
1504{ 1505{
1506 int r;
1507
1505 if (options.forward_agent) { 1508 if (options.forward_agent) {
1506 /* Clear agent forwarding if we don't have an agent. */ 1509 /* Clear agent forwarding if we don't have an agent. */
1507 if (!ssh_agent_present()) 1510 if ((r = ssh_get_authentication_socket(NULL)) != 0) {
1508 options.forward_agent = 0; 1511 options.forward_agent = 0;
1512 if (r != SSH_ERR_AGENT_NOT_PRESENT)
1513 debug("ssh_get_authentication_socket: %s",
1514 ssh_err(r));
1515 }
1509 } 1516 }
1510} 1517}
1511 1518