Have something like WAYLAND_SOCKET
In libwayland WAYLAND_DISPLAY
names a listening socket like LIBEI_SOCKET
, WAYLAND_SOCKET
refers to an fd number of an already opened socket. It would be nice for libei to have a similar mechanism.
Motivation and Background:
A compositor might want to allow a specific client to always connect without having to expose a listening socket. We want to do this for Xwayland as xdg-desktop-portal
does not provide any info that the process that wants to connect is Xwayland. Doing it this it's possible to know that Xwayland wants to connect to EIS and the eis_client
name provides info about the X client.
I am looking at a workaround/HACK
const char *socketName = "/an/absolute/path";
eis_setup_backend_socket(eis, socketName);
int fd = open(socketName, O_PATH | O_CLOEXEC)
unlink(socketName);
[...]
setenv("LIBEI_SOCKET", "/proc/self/fd/fd");
// remove cloexec after fork
this is ugly and opens a listening socket that is publically accessible for a short amount of time