Closed emersion closed 3 years ago
bswapN
things are in sys/endian.h
instead of byteswap.h
alloca
is just in stdlib.h
instead of alloca.h
struct ucred
's equivalent is struct xucred
with different fields and a different getsockopt
instantiation, so a little more work is needed there. Maybe this will be useful: https://git.sr.ht/~kennylevinsen/seatd/tree/9b3bdcb12d0dea1cc5b96eefbc083114556df565/seatd/client.c#L26managed to accumulate enough hacks for compile to pass: https://builds.sr.ht/~emersion/job/364759
I am very very interested to make it working on FreeBSD as replacement for elogind or alternative implementation of logind in order to make Enlightenment + EFL + Wayland work. I did already make it compile but some logind like implementations are mandatory for E+W to run :-)
Anyways maybe it is better to push open standard https://git.sr.ht/~kennylevinsen/seatd instead fighting with linuxisms ? :-)
I did already make it compile but some logind like implementations are mandatory for E+W to run :-)
Anyways maybe it is better to push open standard https://git.sr.ht/~kennylevinsen/seatd instead fighting with linuxisms ? :-)
As you already found, seatd is the minimal logind-like solution, while basu covers the sd-bus dbus client usage that was commonly piggy-backed off elogind.
seatd does require your compositor/display server to have libseat support though - wlroots has official support, covering all wlroots compositors. There is also Weston fork that I have yet to make an MR out of, but similar work is likely needed for the enlightenment compositor.
(And yes, it would be better to not fight linuxisms and just write a new, clean dbus library like we did with seatd, but I'm not volunteering at the current time. :) )
I believe the problem lies in this area of dbus-daemon: https://github.com/freedesktop/dbus/blob/669e3c0acabd58ac0c86146fe77022a54558966c/dbus/dbus-sysdeps-unix.c#L2190
Specifically, on platforms where SO_PEERCRED is available, the dbus server will try to use that. FreeBSD does not. Instead, it's trying to read credentials off the socket in the form of an SCM_CREDS message.
... basu never sends such a message, because sd-bus never supported this use-case. We'll have to add this ourselves.
Inspiration available here: https://github.com/freedesktop/dbus/blob/669e3c0acabd58ac0c86146fe77022a54558966c/dbus/dbus-sysdeps-unix.c#L1852, where needs to be changed: https://github.com/emersion/basu/blob/d8dc86662de875ba2a4b2454898db84f0f1ea8a3/src/libsystemd/sd-bus/bus-socket.c#L598.
basu currently sends "\0AUTH EXTERNAL
Superseded by https://github.com/emersion/basu/pull/32.
Closes: https://github.com/emersion/basu/issues/6