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
I noticed that withSSH2User doesn't error when known_hosts doesn't have the hosts key. I tested in GHCi and checkHost returned FAILURE instead of NOTFOUND or MATCH. I tested with a host which is in known_hosts and a host which was not in known_hosts. I would expect checkHost to return NOTFOUND and MATCH instead of FAILURE for the two cases.
I am running Arch Linux and version 1.8.2 of libssh2 and version 0.2.0.7 of libssh2-hs library.
Is the intention for withSSH2User to only fail if MISMATCH is found? I would also expect NOTFOUND to cause an error too.
The text was updated successfully, but these errors were encountered:
As far as I see, there are actually two questions.
Why does checkKnownHost return FAILURE and not NOTFOUND in this case? This I do not know; checkKnownHost is a trivial wrapper around libssh2's function; I assume this is expected behaivour of that function. You can consult libssh2 documentation.
Why does withSSH2User (and other withSSH2* functions) check for MISMATCH only and not for other types of errors? It seems that I've seen only this type of errors while testing bindings, so I've checked only for it. I can add check for NOTFOUND and FAILURE easily. I hope noone will say this is unexpected behaivour...
I don't think FAILURE is the expected behavior. I think FAILURE is returned when something has gone wrong. I've looked at the documentation but I'll need to do more testing to determine how to get the other results. https://www.libssh2.org/libssh2_knownhost_check.html
I noticed that
withSSH2User
doesn't error whenknown_hosts
doesn't have the hosts key. I tested in GHCi andcheckHost
returnedFAILURE
instead ofNOTFOUND
orMATCH
. I tested with a host which is inknown_hosts
and a host which was not inknown_hosts
. I would expectcheckHost
to returnNOTFOUND
andMATCH
instead ofFAILURE
for the two cases.I am running Arch Linux and version
1.8.2
of libssh2 and version0.2.0.7
of libssh2-hs library.Is the intention for
withSSH2User
to only fail ifMISMATCH
is found? I would also expectNOTFOUND
to cause an error too.The text was updated successfully, but these errors were encountered: