mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-09-11 13:30:43 +03:00
feat: implement proxy jump using libssh
tests: modify proxyjump tests to check for ssh_jump_info_struct tests: add proxyjump functionality test feat: add SSH_OPTIONS_PROXYJUMP tests: proxyjump, check authentication fix: ssh_socket_connect_proxyjump add exit label to exit on error feat: implement io forwarding using pthread feat: proxyjump: use threading instead of forking feat: proxyjump: cancel forwarding threads on ssh_disconnect fix: proxyjump remove ProxyJump bool and put pthread ifdefs feat: use ssh_event for io forwarding instead of threads reformat: tests to use assert_int_not_equal fix: link to pthread refactor: make function to free proxy jump list docs: add comment for proxy jump channel feat: add env variable to enable libssh proxy jump feat: open channel for proxyjump like OpenSSH feat: add more tests for proxy jump fix: use a global variable to close io forwarding, this prevents segfaults fix: handle proxy list in thread without creating copy Signed-off-by: Gauravsingh Sisodia <xaerru@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
committed by
Sahana Prasad
parent
fe53cdfabd
commit
6d1ed76c7a
16
src/client.c
16
src/client.c
@@ -589,6 +589,13 @@ int ssh_connect(ssh_session session)
|
||||
session->session_state = SSH_SESSION_STATE_SOCKET_CONNECTED;
|
||||
ssh_socket_set_fd(session->socket, session->opts.fd);
|
||||
ret = SSH_OK;
|
||||
#ifndef _WIN32
|
||||
#ifdef HAVE_PTHREAD
|
||||
} else if (ssh_libssh_proxy_jumps() &&
|
||||
ssh_list_count(session->opts.proxy_jumps) != 0) {
|
||||
ret = ssh_socket_connect_proxyjump(session->socket);
|
||||
#endif /* HAVE_PTHREAD */
|
||||
#endif /* _WIN32 */
|
||||
} else if (session->opts.ProxyCommand != NULL) {
|
||||
#ifdef WITH_EXEC
|
||||
ret = ssh_socket_connect_proxycommand(session->socket,
|
||||
@@ -758,6 +765,7 @@ ssh_session_set_disconnect_message(ssh_session session, const char *message)
|
||||
return SSH_OK;
|
||||
}
|
||||
|
||||
extern int proxy_disconnect;
|
||||
|
||||
/**
|
||||
* @brief Disconnect from a session (client or server).
|
||||
@@ -780,6 +788,14 @@ ssh_disconnect(ssh_session session)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
/* Only send the disconnect to all other threads when the root session calls
|
||||
* ssh_disconnect() */
|
||||
if (session->proxy_root) {
|
||||
proxy_disconnect = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (session->disconnect_message == NULL) {
|
||||
session->disconnect_message = strdup("Bye Bye") ;
|
||||
if (session->disconnect_message == NULL) {
|
||||
|
Reference in New Issue
Block a user