xfce4-session issueshttps://gitlab.xfce.org/xfce/xfce4-session/-/issues2023-04-26T11:38:33Zhttps://gitlab.xfce.org/xfce/xfce4-session/-/issues/23allow specifying socket path for ssh-agent2023-04-26T11:38:33ZBugzilla Migrationallow specifying socket path for ssh-agent## Submitted by Petr Cerny [:hrosik]
Assigned to **Xfce Bug Triage**
**[Link to original bug (#10880)](https://bugzilla.xfce.org/show_bug.cgi?id=10880)**
## Description
Created attachment 5485
patch enabling passing the -a option ...## Submitted by Petr Cerny [:hrosik]
Assigned to **Xfce Bug Triage**
**[Link to original bug (#10880)](https://bugzilla.xfce.org/show_bug.cgi?id=10880)**
## Description
Created attachment 5485
patch enabling passing the -a option to ssh-agent
Sometimes it is useful to specify a path to ssh-agent socket (using the -a option) - for example if one is running terminal multiplexer session(s) and the ssh-agent quits (or dies) for some reason, respawning it with the same socket path allows reuse in the terminal multiplexer session, because the $SSH_AUTH_SOCK environment variable still points to a valid socket.
The attached patch introduces new string property /startup/ssh-agent/socket in the xfconf channel which - if present - is interpreted as a path to the socket to be created.
This patch does not address the case in which there already is a running agent listening on that socket - since then ssh-agent doesn't return any environment variables to be set.
~~**Patch 5485**~~, "patch enabling passing the -a option to ssh-agent":
[xfce4-session-4.10.1-ssh_agent_socket_path.patch](/uploads/2d37a0b167db2be1609cbbbaf38f8342/xfce4-session-4.10.1-ssh_agent_socket_path.patch)
Version: 4.10.1https://gitlab.xfce.org/xfce/xfce4-session/-/issues/14Use g_child_watch_add instead of waitpid2023-04-26T10:47:49ZBugzilla MigrationUse g_child_watch_add instead of waitpid## Submitted by Natanael Copa `@ncopa`
Assigned to **Xfce Bug Triage**
**[Link to original bug (#10046)](https://bugzilla.xfce.org/show_bug.cgi?id=10046)**
## Description
Created attachment 5014
0001-Use-g_child_watch_add-instead-...## Submitted by Natanael Copa `@ncopa`
Assigned to **Xfce Bug Triage**
**[Link to original bug (#10046)](https://bugzilla.xfce.org/show_bug.cgi?id=10046)**
## Description
Created attachment 5014
0001-Use-g_child_watch_add-instead-of-waitpid.patch
```
From 0e4d3c7d084d77e9d429e40622619c6dc0f5c2a8 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 10 Apr 2013 20:48:40 +0200
Subject: [PATCH] Use g_child_watch_add instead of waitpid
This reduces code size.
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
xfce4-session/xfsm-compat-kde.c | 27 +++++----------------------
1 file changed, 5 insertions(+), 22 deletions(-)
diff --git a/xfce4-session/xfsm-compat-kde.c b/xfce4-session/xfsm-compat-kde.c
index b51387e..ce4b134 100644
--- a/xfce4-session/xfsm-compat-kde.c
+++ b/xfce4-session/xfsm-compat-kde.c
@@ -51,27 +51,11 @@
static gboolean kde_compat_started = FALSE;
-static gboolean
-run_timeout (gpointer user_data)
+static void
+run_watcher (GPid pid, gint status, gpointer user_data)
{
- int status;
- int result;
- pid_t pid = *((pid_t *) user_data);
-
- result = waitpid (pid, &status, WNOHANG);
-
- if (result == pid)
- {
- gtk_main_quit ();
- }
- else if (result == -1)
- {
- g_warning ("Failed to wait for process %d: %s",
- (int)pid, g_strerror (errno));
- gtk_main_quit ();
- }
-
- return TRUE;
+ g_spawn_close_pid(pid);
+ gtk_main_quit ();
}
@@ -98,9 +82,8 @@ run (const gchar *command)
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
NULL, NULL, &pid, &error))
{
- guint id = g_timeout_add (300, run_timeout, &pid);
+ g_child_watch_add (pid, run_watcher, NULL);
gtk_main ();
- g_source_remove (id);
}
else
{
--
1.8.2.1
```
**Patch 5014**, "0001-Use-g_child_watch_add-instead-of-waitpid.patch":
[0001-Use-g_child_watch_add-instead-of-waitpid.patch](/uploads/16a6b8500fc50e47dd192f0818a6c240/0001-Use-g_child_watch_add-instead-of-waitpid.patch)
Version: Unspecified