abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit c33ee37b435bcdabe9022d10a56da97e531bbad3
parent 4c3e2c8c70cf42f15c922a4038bea63c1ab3dfa2
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 15 May 2018 17:05:15 +0200

Expose current session socket as $ABDUCO_SOCKET

This is an absolute path to the Unix domain socket representing the
current session.

Diffstat:
abduco.1 | 2++
abduco.c | 1+
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git 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 @@ -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; }