mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-05 20:55:47 +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:
@@ -1265,6 +1265,24 @@ libssh2_agent_disconnect(LIBSSH2_AGENT *agent);
|
||||
LIBSSH2_API void
|
||||
libssh2_agent_free(LIBSSH2_AGENT *agent);
|
||||
|
||||
/*
|
||||
* libssh2_agent_set_identity_path()
|
||||
*
|
||||
* Allows a custom agent identity socket path beyond SSH_AUTH_SOCK env
|
||||
*
|
||||
*/
|
||||
LIBSSH2_API void
|
||||
libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent,
|
||||
const char *path);
|
||||
|
||||
/*
|
||||
* libssh2_agent_get_identity_path()
|
||||
*
|
||||
* Returns the custom agent identity socket path if set
|
||||
*
|
||||
*/
|
||||
LIBSSH2_API const char *
|
||||
libssh2_agent_get_identity_path(LIBSSH2_AGENT *agent);
|
||||
|
||||
/*
|
||||
* libssh2_keepalive_config()
|
||||
|
Reference in New Issue
Block a user