1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-07 08:02:56 +03:00

Add agent functions libssh2_agent_get_identity_path() and libssh2_agent_set_identity_path() (#308)

File : agent.c

Notes : 
Libssh2 uses the SSH_AUTH_SOCK env variable to read the system agent location. However, when using a custom agent path you have to set this value using setenv which is not thread-safe. The new functions allow for a way to set a custom agent socket path in a thread safe manor.
This commit is contained in:
Will Cosgrove
2019-04-11 10:11:38 -07:00
committed by GitHub
parent ff1b155731
commit dce4d8c742
6 changed files with 116 additions and 4 deletions

View File

@@ -38,8 +38,10 @@ set(MAN_PAGES
libssh2_agent_disconnect.3
libssh2_agent_free.3
libssh2_agent_get_identity.3
libssh2_agent_get_identity_path.3
libssh2_agent_init.3
libssh2_agent_list_identities.3
libssh2_agent_set_identity_path.3
libssh2_agent_userauth.3
libssh2_banner_set.3
libssh2_base64_decode.3

View File

@@ -8,8 +8,10 @@ dist_man_MANS = \
libssh2_agent_disconnect.3 \
libssh2_agent_free.3 \
libssh2_agent_get_identity.3 \
libssh2_agent_get_identity_path.3 \
libssh2_agent_init.3 \
libssh2_agent_list_identities.3 \
libssh2_agent_set_identity_path.3 \
libssh2_agent_userauth.3 \
libssh2_banner_set.3 \
libssh2_base64_decode.3 \

View File

@@ -0,0 +1,22 @@
.\"
.\" Copyright (c) 2019 by Will Cosgrove
.\"
.TH libssh2_agent_get_identity_path 3 "6 Mar 2019" "libssh2 1.9" "libssh2 manual"
.SH NAME
libssh2_agent_get_identity_path - gets the custom ssh-agent socket path
.SH SYNOPSIS
#include <libssh2.h>
const char *
libssh2_agent_get_identity_path(LIBSSH2_AGENT *agent);
.SH DESCRIPTION
Returns the custom agent identity socket path if set using libssh2_agent_set_identity_path()
.SH RETURN VALUE
Returns the socket path on disk.
.SH AVAILABILITY
Added in libssh2 1.9
.SH SEE ALSO
.BR libssh2_agent_init(3)
.BR libssh2_agent_set_identity_path(3)

View File

@@ -0,0 +1,22 @@
.\"
.\" Copyright (c) 2019 by Will Cosgrove
.\"
.TH libssh2_agent_set_identity_path 3 "6 Mar 2019" "libssh2 1.9" "libssh2 manual"
.SH NAME
libssh2_agent_set_identity_path - set an ssh-agent socket path on disk
.SH SYNOPSIS
#include <libssh2.h>
void
libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent, const char *path);
.SH DESCRIPTION
Allows a custom agent identity socket path instead of the default SSH_AUTH_SOCK env value
.SH RETURN VALUE
Returns void
.SH AVAILABILITY
Added in libssh2 1.9
.SH SEE ALSO
.BR libssh2_agent_init(3)
.BR libssh2_agent_get_identity_path(3)