Age | Commit message (Collapse) | Author |
|
Please see previous commit by Evan Mesterhazy for details
|
|
ssh2-rs"
This reverts commit 0d316d2f734a4ee03523f6001f5a1a4bb7535bc9.
As of this commit, https://crates.io/crates/async-ssh2/0.1.2-beta is
listed as deprecated on crates.io.
I believe that the other alternative mentioned in the reverted commit,
async-ssh2-lite, has at least two serious correctness issues and should
not be recommended:
1. https://github.com/bk-rs/async-ssh2-lite/issues/9
2. https://github.com/bk-rs/async-ssh2-lite/issues/10
async-ssh2-lite is also lacking documentation and has no unit or
integration tests to give confidence in its implementation.
In my opinion, until such issues are resolved ssh2 should refrain from
recommending either of these crates to avoid misleading users into
believing that these implementations are tested and ready for
production.
|
|
* Expose libssh2_trace function and associated
constants, to allow enabling libssh2 trace
output.
* set LIBSSH2_WIN32 on windows build so that
gettimeofday replacement will be compiled.
* libssh2_trace actually returns int, even though
the documentation says it returns void. This
was causing systest to fail.
Changed the FFI to match the C function.
Co-authored-by: eharmic <michael.harris@ericsson.com>
|
|
* Handle more precise SFTP error codes
* Allow set-env in macos github action
* Bump to 0.9 since the Error interface has changed, hence this is a breaking change
|
|
|
|
the transfer to finish. Add Netconf example
Signed-off-by: Bigo <bigo@crisidev.org>
|
|
|
|
Resolves #195 (use after free, double free, segfault...)
|
|
Signed-off-by: Bigo <bigo@crisidev.org>
|
|
This method enables agent forwarding
|
|
|
|
The pointer obtained by `libssh2_session_last_error` points to the buffer
that `LIBSSH2_SESSION` holds internally, so its contents may be overwritten
by the next API call.
This patch changes the data type for storing error messages inside `Error`
from `&'static str` to `Cow<'static, str>`.
|
|
|
|
|
|
|
|
|
|
and not the last sftp error. Confusing!
|
|
@richardwhiuk requested this. While it is safe to move to another
thread, it will still lock internally, and if you are in blocking
mode that may be undesirable.
|
|
This allows Channel and Stream to be Send
|
|
Heh, I removed this by accident at the last minute before submitting
the PR to the CI... restore it!
|
|
|
|
In earlier iterations I accidentally removed Send from Session and then
later restored it in an unsafe way. This commit restructures the
bindings so that each of the objects holds a reference to the
appropriate thing to keep everything alive safely, without awkward
lifetimes to deal with.
The key to this is that the underlying Session is tracked by an
Arc<Mutex<>>, with the related objects ensuring that they lock this
before they call into the underlying API.
In order to make this work, I've had to adjust the API around iterating
both known hosts and agent identities: previously these would iterate
over internal references but with this shift there isn't a reasonable
way to make that safe. The strategy is instead to return a copy of the
host/identity data and then later look up the associated raw pointer
when needed. The purist in me feels that the copy feels slightly
wasteful, but the realist justifies this with the observation that the
cardinality of both known hosts and identities is typically small enough
that the cost of this is in the noise compared to actually doing the
crypto+network ops.
I've removed a couple of error code related helpers from some of
the objects: those were really internal APIs and were redundant
with methods exported by the Error type anyway.
Fixes: https://github.com/alexcrichton/ssh2-rs/issues/154
Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This commit exposes the `shutdown` method of `Sft` and `close` method of
`File` to free resources. Previously this was done synchronously and
therefor not usable in async wrappers.
Whith the methods exposed they can be polled until success. If
successful a flag is set to notify the destructor that no resources
need to be freed anymore.
However, if resources were not cleaned up by calling `close` or
`shutdown` the destructor will clean up synchronously.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes: https://github.com/alexcrichton/ssh2-rs/issues/141
|
|
|
|
Closes: https://github.com/alexcrichton/ssh2-rs/issues/145
|
|
|
|
Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
|
|
I think this was overlooked in c95e6ea1e74f82f1a889302978e37a7baf4073cf
|
|
Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
|
|
|
|
This fixes the CI build with nightly, as we have deny(warnings)
enabled.
|
|
Previously, this function could return None even if passed an error
result. This could happen in situations where no error had been
recorded against the session object, but where libssh2 had returned
an error condition anyway.
It was also possible for the prior implementation to return the
wrong information in a similar situation: if an error had been
recorded against the session, that error would be returned rather
than the current error code.
This commit tidies up the implementation of this function by
always returning an `Error` object that corresponds to the
provided `rc` parameter. If the last error message recorded
against the `Session` has a matching error value then that
error message will be used, otherwise we'll synthesize one
just from the error code.
|