search for: ssh_open

Displaying 7 results from an estimated 7 matches for "ssh_open".

Did you mean: sh_open
2019 Sep 23
0
Re: [PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...nbdkit_error ("timeout too large"); C17 5.2.4.2.1 requires 'long' to be at least 32 bits. Ergo, (uint32_t) timeout > LONG_MAX is always false. You could assert() rather than trying to use nbdkit_error(). > return -1; > } > } > @@ -403,9 +407,10 @@ ssh_open (int readonly) > } > } > if (timeout > 0) { > - r = ssh_options_set (h->session, SSH_OPTIONS_TIMEOUT, &timeout); > + long arg = timeout; > + r = ssh_options_set (h->session, SSH_OPTIONS_TIMEOUT, &arg); This conversion is correct. > +++ b/s...
2019 Mar 06
0
[PATCH nbdkit] Add ssh plugin using libssh.
...ethod & SSH_AUTH_METHOD_PASSWORD)) { + rc = authenticate_password (h->session, password); + if (rc == SSH_AUTH_SUCCESS) return 0; + } + + nbdkit_error ("all possible authentication methods failed"); + return -1; +} + +/* Create the per-connection handle. */ +static void * +ssh_open (int readonly) +{ + struct ssh_handle *h; + int r; + int access_type; + + h = calloc (1, sizeof *h); + if (h == NULL) { + nbdkit_error ("calloc: %m"); + return NULL; + } + + /* Set up the SSH session. */ + h->session = ssh_new (); + if (!h->session) { + nbdkit_erro...
2019 Mar 06
2
[PATCH nbdkit] Add ssh plugin using libssh.
This adds a simple plugin using libssh (not libssh2). The intended use for this is with virt-v2v when sourcing guests from VMware over SSH. We've had several years of problems getting our libssh-based driver into qemu. By putting it into nbdkit instead we can bypass that. However this also lets us combine ssh access with filters, in particular the recently written ‘rate’ filter. Rich.
2020 Apr 15
0
[PATCH nbdkit 2/9] floppy, iso, split, ssh: Use new vector type to store lists of strings.
...it_error ("realloc: %m"); return -1; } - identity = new_identity; - /* %-expanded, cannot use nbdkit_absolute_path */ - identity[nr_identities] = value; - nr_identities++; } else if (strcmp (key, "verify-remote-host") == 0) { @@ -410,11 +407,12 @@ ssh_open (int readonly) * as this file is rarely present. */ } - for (i = 0; i < nr_identities; ++i) { - r = ssh_options_set (h->session, SSH_OPTIONS_ADD_IDENTITY, identity[i]); + for (i = 0; i < identities.size; ++i) { + r = ssh_options_set (h->session, +...
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...t_parse_uint32_t ("timeout", value, &timeout) == -1) + return -1; + /* Because we have to cast it to long before calling the libssh API. */ + if (timeout > LONG_MAX) { + nbdkit_error ("timeout too large"); return -1; } } @@ -403,9 +407,10 @@ ssh_open (int readonly) } } if (timeout > 0) { - r = ssh_options_set (h->session, SSH_OPTIONS_TIMEOUT, &timeout); + long arg = timeout; + r = ssh_options_set (h->session, SSH_OPTIONS_TIMEOUT, &arg); if (r != SSH_OK) { - nbdkit_error ("failed to set timeout...
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On Mon, Sep 23, 2019 at 12:05:11PM -0500, Eric Blake wrote: > > + int nbdkit_parse_long (const char *what, const char *str, long *r); > > + int nbdkit_parse_unsigned_long (const char *what, > > + const char *str, unsigned long *r); > > Do we really want to encourage the use of parse_long and > parse_unsigned_long? Those differ between
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated! The basic purpose of the patch series is to set $nbdkit_stdio_safe to "0" or "1" in sh and eval plugin scripts. To do that, I ended up adding a nicer way to manipulate environ lists, and to do that, I ended up adding a whole generic vector implementation which is applicable in a lot of different places.