From c33ee37b435bcdabe9022d10a56da97e531bbad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 15 May 2018 17:05:15 +0200 Subject: [PATCH] Expose current session socket as $ABDUCO_SOCKET This is an absolute path to the Unix domain socket representing the current session. --- abduco.1 | 2 ++ abduco.c | 1 + 2 files changed, 3 insertions(+) diff --git a/abduco.1 b/abduco.1 index f29801d..73382fb 100644 --- a/abduco.1 +++ b/abduco.1 @@ -144,6 +144,8 @@ is examined, if it is not set is executed. .It Ev ABDUCO_SESSION The current session name available to the supervised command. +.It Ev ABDUCO_SOCKET +The absolute path of the session socket available to the supervised command. .El .Pp See the diff --git a/abduco.c b/abduco.c index 1f53bfc..d553eb0 100644 --- a/abduco.c +++ b/abduco.c @@ -385,6 +385,7 @@ static bool set_socket_name(struct sockaddr_un *sockaddr, const char *name) { session_name = basename(buf); } setenv("ABDUCO_SESSION", session_name, 1); + setenv("ABDUCO_SOCKET", sockaddr->sun_path, 1); return true; }