You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defoptions_get(self, Optionoption):
"""Get option value. This function can only be used for string options. For numeric or other options use the individual functions. """cdefchar*_valuecdefchar**value=NULLcdefintrccdefbytesb_valuewithnogil:
rc=c_ssh.ssh_options_get(
self._session, option._option, value)
ifrc<0:
raiseOptionError_value=value[0]
b_value=_valuec_ssh.ssh_string_free_char(_value)
returnto_str(b_value)
The exception is therefore thrown because the rc was less than 0.
Testing the underlying c code does not showed any problem. As the following code snippet executes without a problem for libssh found via cmake with libssh version 0.9.6. Where SSH_OK is equal to 0.
looking deeper into the repository in found the definition of ssh_option_get which supports SSH_OPTIONS_HOST as a valid argument.
Also there are unittests for the libssh and especially for ssh_option_get in torture_options_get_host. But all of them are passing:
$ ./build/tests/unittests/torture_options
[==========] Running 24 test(s).
[ RUN ] torture_options_set_host
[ OK ] torture_options_set_host
[ RUN ] torture_options_get_host
[ OK ] torture_options_get_host
[ RUN ] torture_options_set_port
[ OK ] torture_options_set_port
[ RUN ] torture_options_get_port
[ OK ] torture_options_get_port
[ RUN ] torture_options_set_fd
[ OK ] torture_options_set_fd
[ RUN ] torture_options_set_user
[ OK ] torture_options_set_user
[ RUN ] torture_options_get_user
[ OK ] torture_options_get_user
[ RUN ] torture_options_set_identity
[ OK ] torture_options_set_identity
[ RUN ] torture_options_get_identity
[ OK ] torture_options_get_identity
[ RUN ] torture_options_set_global_knownhosts
[ OK ] torture_options_set_global_knownhosts
[ RUN ] torture_options_get_global_knownhosts
[ OK ] torture_options_get_global_knownhosts
[ RUN ] torture_options_set_knownhosts
[ OK ] torture_options_set_knownhosts
[ RUN ] torture_options_get_knownhosts
[ OK ] torture_options_get_knownhosts
[ RUN ] torture_options_proxycommand
[ OK ] torture_options_proxycommand
[ RUN ] torture_options_set_ciphers
[ OK ] torture_options_set_ciphers
[ RUN ] torture_options_set_key_exchange
[ OK ] torture_options_set_key_exchange
[ RUN ] torture_options_set_hostkey
[ OK ] torture_options_set_hostkey
[ RUN ] torture_options_set_pubkey_accepted_types
[ OK ] torture_options_set_pubkey_accepted_types
[ RUN ] torture_options_set_macs
[ OK ] torture_options_set_macs
[ RUN ] torture_options_copy
[ OK ] torture_options_copy
[ RUN ] torture_options_config_host
[ OK ] torture_options_config_host
[ RUN ] torture_options_config_match
[ OK ] torture_options_config_match
[ RUN ] torture_options_config_match_multi
[ OK ] torture_options_config_match_multi
[ RUN ] torture_options_getopt
[ OK ] torture_options_getopt
[==========] 24 test(s) run.
[ PASSED ] 24 test(s).
[==========] Running 17 test(s).
[ RUN ] torture_bind_options_import_key
Changed directory to: temp_dir_6m8feI
[ OK ] torture_bind_options_import_key
[ RUN ] torture_bind_options_hostkey
Changed directory to: temp_dir_zOa06C
[ OK ] torture_bind_options_hostkey
[ RUN ] torture_bind_options_bindaddr
Changed directory to: temp_dir_P9JiyE
[ OK ] torture_bind_options_bindaddr
[ RUN ] torture_bind_options_bindport
Changed directory to: temp_dir_rVKRtu
[ OK ] torture_bind_options_bindport
[ RUN ] torture_bind_options_bindport_str
Changed directory to: temp_dir_LBM3Ng
[ OK ] torture_bind_options_bindport_str
[ RUN ] torture_bind_options_log_verbosity
Changed directory to: temp_dir_KY2Gn4
[ OK ] torture_bind_options_log_verbosity
[ RUN ] torture_bind_options_log_verbosity_str
Changed directory to: temp_dir_3abnsb
[ OK ] torture_bind_options_log_verbosity_str
[ RUN ] torture_bind_options_rsakey
Changed directory to: temp_dir_i4JMEP
[ OK ] torture_bind_options_rsakey
[ RUN ] torture_bind_options_ecdsakey
Changed directory to: temp_dir_vCiinR
[ OK ] torture_bind_options_ecdsakey
[ RUN ] torture_bind_options_banner
Changed directory to: temp_dir_MhjchD
[ OK ] torture_bind_options_banner
[ RUN ] torture_bind_options_set_ciphers
Changed directory to: temp_dir_h8cvKn
[ OK ] torture_bind_options_set_ciphers
[ RUN ] torture_bind_options_set_key_exchange
Changed directory to: temp_dir_NC2lFF
[ OK ] torture_bind_options_set_key_exchange
[ RUN ] torture_bind_options_set_macs
Changed directory to: temp_dir_667NhP
[ OK ] torture_bind_options_set_macs
[ RUN ] torture_bind_options_parse_config
Changed directory to: temp_dir_veocnN
[ OK ] torture_bind_options_parse_config
[ RUN ] torture_bind_options_config_dir
Changed directory to: temp_dir_t03DKj
[ OK ] torture_bind_options_config_dir
[ RUN ] torture_bind_options_set_pubkey_accepted_key_types
Changed directory to: temp_dir_X6HGwg
[ OK ] torture_bind_options_set_pubkey_accepted_key_types
[ RUN ] torture_bind_options_set_hostkey_algorithms
Changed directory to: temp_dir_SmofOs
[ OK ] torture_bind_options_set_hostkey_algorithms
[==========] 17 test(s) run.
[ PASSED ] 17 test(s).
Unfortunately, I have no experience with c bindings in python and therefore cannot analyse the problem any further.
The text was updated successfully, but these errors were encountered:
Running the following code snippet raises an exception:
The installed version is:
$ pip list | grep ssh-python ssh-python 1.0.0
This should work because HOST option is a string and should therefore be usable as arg.
Tested with: ssh-python version 1.0.0
Analysis
Function definition
The exception is therefore thrown because the rc was less than 0.
Testing the underlying c code does not showed any problem. As the following code snippet executes without a problem for libssh found via cmake with libssh version 0.9.6. Where
SSH_OK
is equal to 0.The installed libs are:
$ apt list | grep libssh- libssh-4/jammy-updates,jammy-security,now 0.9.6-2ubuntu0.22.04.3 amd64 [installed,automatic] libssh-dev/jammy-updates,jammy-security,now 0.9.6-2ubuntu0.22.04.3 amd64 [installed] libssh-doc/jammy-updates,jammy-security 0.9.6-2ubuntu0.22.04.3 all libssh-gcrypt-4/jammy-updates,jammy-security 0.9.6-2ubuntu0.22.04.3 amd64 libssh-gcrypt-dev/jammy-updates,jammy-security 0.9.6-2ubuntu0.22.04.3 amd64
looking deeper into the repository in found the definition of
ssh_option_get
which supportsSSH_OPTIONS_HOST
as a valid argument.Also there are unittests for the libssh and especially for
ssh_option_get
intorture_options_get_host
. But all of them are passing:Unfortunately, I have no experience with c bindings in python and therefore cannot analyse the problem any further.
The text was updated successfully, but these errors were encountered: