Skip to content

Forking session backend

Simon Ser requested to merge github/fork/ascent12/forking into master

Created by: ascent12

Updated the 'direct' backend to now fork, so that the child (with privileges) can call drmSetMaster/drmDropMaster. It's up to the library user to drop any extra privileges after they initialise wlroots. It also initialises the TTY properly and handles VT switching.

Libcap was added as an optional dependency, so we can have processes with CAP_SYS_ADMIN instead of needing to seteuid as root. If logind is being used, there is no need to do this.

There are a couple of outstanding issues:

  • Just like the logind code, it still makes a lot of assumptions about there being a single GPU per session.
  • It's very Linux specific. I know that WLC had some things to get their TTY code to work with FreeBSD, but I'm not going to blindly copy that code if I can't test it. Someone else can take a look at fixing this if they want to.
  • The examples haven't been updated to use setcap/seteuid. You must do it manually.

If you're going to run this code, make sure you have permissions for /dev/input/event* (be part of the input group) or run as root, otherwise you'll run into #24 (closed).

Merge request reports