This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository libx2goclient. from 0497101 src/x2goclient-network-ssh.c: allow colons in alias/FQDN specs. new 1e8775f src/x2goclient-network.c: fix compile warnings. new d674d5b src/x2goclient-network-ssh.c: actually spawn an SSH process. new 0226771 src/x2goclient-network-ssh.{c,h}: implement x2goclient_network_options_ssh_to_array () as a stub to add custom OpenSSH client options. new 6c70ae1 src/x2goclient-network-ssh.c: optionally use x2goclient_network_options_ssh_to_array () to fetch options as a string array if an options object is set. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: src/x2goclient-network-ssh.c | 87 ++++++++++++++++++++++++++++++++++++++++++++ src/x2goclient-network-ssh.h | 5 +++ src/x2goclient-network.c | 4 +- 3 files changed, 95 insertions(+), 1 deletion(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1e8775f8323ea23fb8d6b8ddb0665b5550374ebd Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 11 16:39:26 2019 +0100 src/x2goclient-network.c: fix compile warnings. Split out pointer initialization. --- src/x2goclient-network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 801a0d4..20662fa 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -122,7 +122,9 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass *klass) { static void x2goclient_network_init (X2GoClientNetwork *self) { X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); - priv->socket = priv->options = priv->session_path = NULL; + priv->socket = NULL; + priv->options = NULL; + priv->session_path = NULL; } static void x2goclient_network_dispose (GObject *object) { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit d674d5b6c43f5ef24fa04c6666c9b35e06fc56e5 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 11 17:38:26 2019 +0100 src/x2goclient-network-ssh.c: actually spawn an SSH process. Weirdly, g_spawn_sync () seems to not notice processes detaching (like ssh -f) and will just hang forever. That's weird, because the process itself is exiting correctly (after spawning a new child, naturally). We'll probably want to use something like GSubProcess later on anyway, so that's probably not a huge issue, but I wasn't able to find out why it's behaving like that for now. --- src/x2goclient-network-ssh.c | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 41abff7..3b26cfd 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -680,12 +680,70 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent sock_addr = NULL; } + if (ret) { + /* Add control path options. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ("ControlMaster=\"yes\"")); + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ("ControlPersist=\"yes\"")); + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup_printf ("ControlPath=\"%s\"", self->control_path)); + + /* Force ssh process to background. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-f")); + + /* Do not execute commands, we just want to have a master connection. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-N")); + + /* We do not need a pseudo terminal. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-T")); + + /* Let process terminate if it wasn't able to connect or set up sockets. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ("ExitOnForwardFailure=\"yes\"")); + + /* Try to call uptime. */ + g_ptr_array_add (ssh_cmd, g_strdup ("uptime")); + + /* + * Quite importantly, zero-terminate the array, as it will be used as + * argv! + */ + g_ptr_array_add (ssh_cmd, NULL); + } + if (ret) { g_printf ("Would try to connect via:"); for (gsize i = 0; i < ssh_cmd->len; ++i) { g_printf (" [%s]", (gchar *)g_ptr_array_index (ssh_cmd, i)); } g_printf ("\n"); + + g_printf ("Launching!\n"); + gint ssh_exit = -1; + gchar *ssh_stdout = NULL, *ssh_stderr = NULL; + GError *ssh_err = NULL; + ret = g_spawn_sync (NULL, (gchar**)(ssh_cmd->pdata), NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &ssh_stdout, &ssh_stderr, &ssh_exit, &ssh_err); + + if (ret) { + g_printf ("Process executed successfully!\nReturn value: %d\nStdout:\n>>>%s<<<\nStderr:\n>>>%s<<<\n", ssh_exit, ssh_stdout, ssh_stderr); + + if (ssh_err) { + g_printf ("Successful execution, but ssh_err set? Weird, here's the message: %s", ssh_err->message); + } + } + else { + g_printf ("Process didn't execute successfully!\nError:\n>>>%s<<<\n", ssh_err->message); + } + + g_free (ssh_stdout); + ssh_stdout = NULL; + + g_free (ssh_stderr); + ssh_stderr = NULL; + + g_free (ssh_err); + ssh_err = NULL; } g_free (session_path); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 6c70ae18c457b67cdb6caa11fb621a5976c713b8 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jan 13 23:07:02 2020 +0100 src/x2goclient-network-ssh.c: optionally use x2goclient_network_options_ssh_to_array () to fetch options as a string array if an options object is set. --- src/x2goclient-network-ssh.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index fb3406d..0056ed7 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -689,6 +689,23 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent } if (ret) { + /* Fetch options object. */ + X2GoClientNetworkOptionsSSH *options = NULL; + g_object_get (G_OBJECT (self), "options", &options, NULL); + + if (options) { + /* Get string-array representation. */ + GPtrArray *options_arr = x2goclient_network_options_ssh_to_array (options); + + /* Add each element to command. */ + for (size_t i = 0; i < options_arr->len; ++i) { + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ((gchar *)g_ptr_array_index (options_arr, i))); + } + + g_ptr_array_unref (options_arr); + } + /* Add control path options. */ g_ptr_array_add (ssh_cmd, g_strdup ("-o")); g_ptr_array_add (ssh_cmd, g_strdup ("ControlMaster=\"yes\"")); @@ -718,6 +735,10 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork *parent * argv! */ g_ptr_array_add (ssh_cmd, NULL); + + if (options) { + g_object_unref (options); + } } if (ret) { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 022677128af693ac05a3bb35a220a3310546076f Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jan 13 23:06:03 2020 +0100 src/x2goclient-network-ssh.{c,h}: implement x2goclient_network_options_ssh_to_array () as a stub to add custom OpenSSH client options. --- src/x2goclient-network-ssh.c | 8 ++++++++ src/x2goclient-network-ssh.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 3b26cfd..fb3406d 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -64,6 +64,14 @@ static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsS static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH *self) { } +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH *self) { + GPtrArray *ret = g_ptr_array_new_with_free_func (&x2goclient_clear_strings); + + /* Implement actual options fetching here. */ + + return (ret); +} + /* * Custom sockaddr structure used to represent socket endpoints based on a FQDN diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index dcb83f8..636cb79 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -26,6 +26,7 @@ #define x2goclient_network_ssh_h #include <glib-object.h> +#include <gmodule.h> #include "x2goclient-network.h" @@ -36,6 +37,10 @@ G_DECLARE_FINAL_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ss X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void); + +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH *self); + + #define X2GOCLIENT_TYPE_NETWORK_SSH (x2goclient_network_ssh_get_type ()) G_DECLARE_FINAL_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT, NETWORK_SSH, X2GoClientNetwork) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git