[Xfce4-commits] [xfce/xfce4-session] 01/02: Export the SSH_AUTH_SOCK when spawning client (Bug #13486)

noreply at xfce.org noreply at xfce.org
Tue Jul 18 17:19:11 CEST 2017


This is an automated email from the git hooks/post-receive script.

e   r   i   c       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-session.

commit 2cf63e66c0285aaeee76155f463c85d04da6addc
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Tue Jul 18 15:00:28 2017 +0300

    Export the SSH_AUTH_SOCK when spawning client (Bug #13486)
    
    Credit goes to Jamin Collins, I just made it not use --systemd
    on non-logind systems and an error message.
---
 xfce4-session/xfsm-startup.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c
index 76eef86..e487bcd 100644
--- a/xfce4-session/xfsm-startup.c
+++ b/xfce4-session/xfsm-startup.c
@@ -63,6 +63,7 @@
 #include <xfce4-session/xfsm-global.h>
 #include <xfce4-session/xfsm-manager.h>
 #include <xfce4-session/xfsm-splash-screen.h>
+#include <xfce4-session/xfsm-systemd.h>
 
 #include <xfce4-session/xfsm-startup.h>
 
@@ -201,6 +202,8 @@ xfsm_startup_init (XfconfChannel *channel)
   gchar       *ssh_agent_path = NULL;
   gchar       *gpg_agent_path = NULL;
   gchar       *cmd;
+  gchar       *cmdoutput = NULL;
+  GError      *error = NULL;
   pid_t        agentpid;
   gboolean     gnome_keyring_found;
 
@@ -281,8 +284,27 @@ xfsm_startup_init (XfconfChannel *channel)
           cmd = g_strdup_printf ("%s -s", ssh_agent_path);
           /* keep this around for shutdown */
           running_sshagent = xfsm_startup_init_agent (cmd, "ssh-agent");
+          /* update dbus environment */
+          if (LOGIND_RUNNING())
+            {
+              cmd = g_strdup_printf ("%s", "dbus-update-activation-environment --systemd SSH_AUTH_SOCK");
+            }
+          else
+            {
+              cmd = g_strdup_printf ("%s", "dbus-update-activation-environment SSH_AUTH_SOCK");
+            }
+          g_spawn_command_line_sync (cmd, &cmdoutput, NULL, NULL, &error);
+
+          if (error)
+            {
+              g_warning ("failed to call dbus-update-activation-environment. Output was %s, error was %s",
+                         cmdoutput, error->message);
+            }
+
           g_free (cmd);
           g_free (ssh_agent_path);
+          g_clear_pointer (&cmdoutput, g_free);
+          g_clear_error (&error);
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list