[X2Go-Commits] [libx2goclient] 04/04: 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.

git-admin at x2go.org git-admin at x2go.org
Mon Jan 13 23:58:50 CET 2020


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 at 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


More information about the x2go-commits mailing list