version 1.45.2.4, 2002/06/26 18:22:34 |
version 1.45.2.5, 2002/10/11 14:53:06 |
|
|
#include "log.h" |
#include "log.h" |
#include "atomicio.h" |
#include "atomicio.h" |
|
|
|
static int agent_present = 0; |
|
|
/* helper */ |
/* helper */ |
int decode_reply(int type); |
int decode_reply(int type); |
|
|
|
|
((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE) || \ |
((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE) || \ |
(x == SSH2_AGENT_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. */ |
/* Returns the number of the authentication fd, or -1 if there is none. */ |
|
|
int |
int |
|
|
close(sock); |
close(sock); |
return -1; |
return -1; |
} |
} |
|
agent_present = 1; |
return sock; |
return sock; |
} |
} |
|
|