Expose current session socket as $ABDUCO_SOCKET

This is an absolute path to the Unix domain socket representing the
current session.
This commit is contained in:
Marc André Tanner 2018-05-15 17:05:15 +02:00
parent 4c3e2c8c70
commit c33ee37b43
2 changed files with 3 additions and 0 deletions

View File

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

View File

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