Compare commits

..
364 Commits
Author SHA1 Message Date
Pekka Paalanen 737d3ca4e6 libseat/seatd: call _exit() in the child
exit() will run all atexit registered functions and flush the standard
streams. When a process fork()s but does not exec(), doing so in the
child can clean up something the parent process does not expect, hence
_exit() is usually used instead.

This patch fixes duplicated prints to stdout, which broke the Weston
test suite. The test suite prints a TAP report to stdout in parts. The
child process in libseat gets a copy of the buffered stdout on fork().
Closing the libseat session flushed stdout with a partial TAP report in
the child, corrupting the final TAP report.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-07-05 20:17:20 +02:00
Quentin THÉBAULT 4bcdc81972 seatd: restore VT_AUTO mode in vt_close
vt_close is the cleanup counterpart to vt_open. vt_open correctly
sets VT_PROCESS mode so that seatd can manage VT switching via signals.
However, vt_close was also setting VT_PROCESS (passing true to
terminal_set_process_switching), leaving the VT controlled by seatd for
no reason.

Pass false to restore VT_AUTO mode, letting the kernel manage VT
switching again after seatd releases it.

Signed-off-by: Quentin THÉBAULT <quentin.thebault@defenso.fr>
2026-04-20 14:27:49 +02:00
Quentin THÉBAULT 9d1f83e282 seatd: use client->session instead of seat->cur_vt in seat_remove_client
When a client is removed while a VT switch is in progress,
seat->cur_vt may be -1 (set by seat_vt_release before the client
acknowledges the disable request). If the client crashes or is
killed in this window, seat_remove_client calls vt_close(-1),
which fails to open the terminal and skips all cleanup. On
FreeBSD, this leaves the keyboard in K_RAW mode permanently,
as the kernel does not reset vw_kbdmode when the owning process
dies.

Use client->session instead, which always holds the correct VT
number for the departing client regardless of the seat's
transient state.

Signed-off-by: Quentin THÉBAULT <quentin.thebault@defenso.fr>
2026-04-20 14:27:49 +02:00
Kenny Levinsen daa8196e10 Bump version to 0.9.3 2026-02-28 22:04:33 +01:00
Kenny Levinsen f60a86ee72 seatd: Fix some typos 2026-02-14 16:50:02 +01:00
Kenny Levinsen 4cef6e6eaf seatd: Improve error handling for failed seat open
If the seat opening failed at the end because we could not send the
enable message, we would still leave the state as activated. Reorganize
things a bit so that the activation is rolled back.
2026-02-14 16:48:20 +01:00
Kenny Levinsen d023c7c3d5 seatd: Reuse session numbers for non-VT-bound
Previously, session numbers would increase forever until wraparound,
which is highly inconvenient for session switching and may technically
lead to issues if the system runs for very, very long.

Switch to allocating the lowest available session ID.
2026-02-14 16:46:43 +01:00
Kenny Levinsen cf4b4666c0 seatd: Return the correct device on duplicate open
If the same device is attempted opened twice, we increase the refcount
of the old device. However, we were accidentally returning new and
uninitialized device instead of the old one.

Return the right value and move the device declaration down to the point
of allocation for clarity.
2026-02-14 16:44:47 +01:00
Kenny Levinsen 6c4ce62195 libseat: Remove bogus NULL check 2026-02-14 16:34:28 +01:00
Kenny Levinsen 90e0912bd3 libseat/logind: Handle strdup allocation errors 2026-02-14 16:33:56 +01:00
Kenny Levinsen df9e50a357 libseat/logind: Avoid shadowing ret
If the inner decoding loop in handle_properties_changed failed, the
shadowed ret would lead to the error not being logged. Remove
unnecessary shadowing declaration.
2026-02-14 16:31:02 +01:00
Kenny Levinsen 1c6d66027a libseat/logind: Do not record PauseDeviceComplete reply
Instead of overwriting the incoming message pointer, just pass NULL to
indicate that we do not care about the reply.
2026-02-14 16:29:14 +01:00
Kenny Levinsen 37aef8aa9e seatd: Check the right variable for accept failure 2026-02-14 16:27:25 +01:00
Kenny Levinsen 1a57fde305 libseat/seatd: Retain errno in set_error for convenience
The first time set_error is called it will perform cleanup that could
clobber errno. As this is often called in error paths, retain errno for
convenience.
2026-02-06 15:27:59 +01:00
Kenny Levinsen 03f7644fd8 libseat/seatd: Ensure errno is not clobbered
Most of the user-facing functions now contain some last-minute
housekeeping. These calls may have internal errors that do not bubble
up, clobbering the errno we return to our caller.

Record the errno we want to return at the time of failure, and set errno
at the end of the function.
2026-02-06 15:25:39 +01:00
Kenny Levinsen 4bb5afa3f0 libseat/seatd: Do not attempt destroy on alloc error
If we cannot allocate the backend struct, we have nothing to destroy.
Attempting to do so would lead to NULL-pointer dereferences.

Just close the fd and return immediately.
2026-02-06 15:24:35 +01:00
Kenny Levinsen f7cfc2e0b6 logind: Minor error simplification 2026-02-06 15:22:16 +01:00
Kenny Levinsen 2d5fded816 logind: Ensure errno is set from sd_bus error
sd_bus calls return errno-style errors as negative return values, which
must be converted to errno to match with the rest of our error handling.

A few places were missing this conversion, so add it.
2026-02-06 15:22:16 +01:00
Kenny Levinsen e22b261c33 seatd: Explicitly set ENOMEM in seat_open_device
If strdup and close both failed, errno would contain the wrong error.
Copy the calloc case above and set errno to ENOMEM.
2026-02-06 13:23:21 +01:00
Kenny Levinsen 3fef70018d seatd: Remove silly goto error handling
Using goto's for error handling with incremental cleanup is preferred,
but here there is nothing to clean up and at most two such failure paths
from a single opcode handler.

Just do the error handling inline.
2026-02-06 13:19:36 +01:00
Kenny Levinsen bad7fa569e seatd: Ensure seat_close_device cannot clobber errno
seat_close_device cannot fail, and might be called in error handling
paths. Ensure that it does not clobber errno even if some of its
housekeeping fails.
2026-02-06 13:16:15 +01:00
Kenny Levinsen 35fdb4c98a seatd: Clarify that seat_close_device cannot fail
The signature still returned an int even though there is no failure
path. Change it to void and remove unnecessary failure checks.
2026-02-06 10:38:40 +01:00
Kenny Levinsen a3c56c324c Bump version to 0.9.2 2026-01-05 10:44:28 +01:00
Hongfei Shang 99b8e39faf logind: Use a constant for the "Active" field when log
In the property change handler, the variable `s` is read using:

    ret = sd_bus_message_read_basic(msg, 's', &s);

However, after further calls like:

    ret = sd_bus_message_read_basic(msg, 'b', &value);

the contents of `s` may become invalid or corrupted. This is because
string-like values returned by sd_bus_message_read_basic() point to
internal memory owned by the message and are only valid until the
next read or until the message is released.

To ensure correctness, this patch copies the string into a local
buffer immediately after reading. This avoids referencing stale or
invalid memory when logging or comparing the property key.

Reference:
https://www.freedesktop.org/software/systemd/man/sd_bus_message_read_basic.html

Signed-off-by: Hongfei Shang <shanghongfei@kylinos.cn>
Signed-off-by: Hongfei Shang <shanghongfei@zohomail.com>
2025-11-30 01:46:49 +01:00
Kenny Levinsen 2945a62044 libseat: shutdown instead of close fd on error
Shutting down the socket allows the fd to remain valid for all future
operations, cleanly returning an error.
2025-08-08 12:32:43 +02:00
Kenny Levinsen a562580075 libseat: Improve seatd error logging slightly 2025-08-08 12:32:24 +02:00
Kenny Levinsen 900e359f99 meson: Remove _FORTIFY_SOURCE
Distributions want to override _FORTIFY_SOURCE, and various libc
implementations support different versions of it. This is causing us
some headaches, and supporting major platforms unfortunately need to
take priority.

Remove _FORTIFY_SOURCE and instead try to set -fhardened, which we can
easily detect support for.

Reference: https://github.com/mesonbuild/meson/issues/13024
Reference: https://github.com/ossf/wg-best-practices-os-developers/issues/659
2025-02-24 22:41:27 +01:00
Kenny Levinsen 4f51fcf226 ci: Use meson setup in all CI scripts
The implicit setup is deprecated, so switch to the newer explicit mode.
2025-02-24 22:10:16 +01:00
Daniel Golle d571092855 evdev: cast ioctl request to int
Compile on PPC64 fails with error:
../common/evdev.c: In function 'evdev_revoke':
../common/evdev.c:26:26: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2147763601' to '-2147203695' [-Werror=overflow]
   26 |         return ioctl(fd, EVIOCREVOKE, NULL);

Prevent overflow warning by using explicit cast to int.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-12-05 16:04:06 +01:00
Kenny Levinsen 479220a2c5 readme: Minor rewording 2024-12-05 16:03:57 +01:00
Kenny Levinsen 566ffeb032 Bump version to 0.9.1 2024-10-30 20:43:26 +01:00
Martin Michaelis 396e81dbfa seatd: Add strict message size comparison
Some messages were allowed to contain trailing data.
This converts all comparisions to equal, thereby disallowing unexpected
trailing data after the message.
2024-10-30 20:05:52 +01:00
Martin Michaelis 22312c75c8 seatd: Add validation of device path libseat/seatd: Add validation of seat_name
The seat_name and device path are supposed to be null termiated strings.
This adds validation that the strings actually end in a null byte and
contain no interior null byte.

seatd did send the seat_name without a null byte.
libseat/seatd handles this gracefully by appending the missing null byte
if required.
2024-10-30 19:37:59 +01:00
Kenny Levinsen 4c196eaa63 libseat/seatd: Set backend error if poll fails 2024-10-29 22:44:43 +01:00
Kenny Levinsen 410862df4c libseat/seatd: Set EINVAL if target session is invalid 2024-10-29 22:44:43 +01:00
Kenny Levinsen 28a23a9ff3 libseat/seatd: Cleanup of request error handling
An overuse of goto's had lead to some code duplication. Rely on a
variable containing the return value instead of distinct branches, and
avoid checking pending events on protocol errors.
2024-10-29 22:42:59 +01:00
Kenny Levinsen 30353e42be libseat/seatd: Read remaining events after processing responses
When sending a request and awaiting a response, the client will read
data into the ringbuffer and queue events until the response is found.
Normally we would not have received any events, but if we did, we issue
a ping request to seatd so that the libseat caller will be woken up for
a dedicated dispatch.

If an event is received immediately after the response such that we will
read both into ringbuffer at the same time, but we stop reading the
ringubffer to queue events once we hit the response. As such, the event
will not be queued and we will not attempt a ping to ensure an explicit
dispatch occurs. At this point we are deadlocked, as the libseat caller
is unaware that an explicit dispatch is needed to process events already
read from the socket.

Before checking if any events are queued, read any remaining events and
queue them so that we do not leave full messages in the ring buffer.
This should fix an issue where when switching session, the libseat
client sometimes fails to see the disable_seat event.
2024-10-29 22:42:55 +01:00
Kenny Levinsen a7e12402a5 libseat/seatd: Remove read_and_execute
By having read_and_queue error out on its own if it sees non-background
opcode when the opcode pointer is NULL, we can reasonably do away with
read_and_exeecute, which was one read_* function too many.
2024-10-29 21:37:25 +01:00
Kenny Levinsen 2a4d7f3386 Bump version to 0.9.0 2024-10-29 16:36:56 +01:00
Kenny Levinsen 5d2b3e95d8 seatd: Minor evdev ifdef cleanup 2024-10-14 20:30:00 +02:00
Kenny Levinsen fc205e50cf seatd: Add support for hidraw devices
Linux 6.12 adds support for revocation of hidraw devices, making room
for seatd-mediated access. Add support for opening hidraw devices when
the revocation ioctl is present.

References: https://lore.kernel.org/all/20240812052753.GA478917@quokka/
2024-10-14 20:30:00 +02:00
Kenny Levinsen 167d215a93 ci: Disable logind smoketest for now
The smoketest was fragile, relying on private systemd state - they
technically only set that we should not parse it, not that we should not
write it - and is now broken. Get rid of it to let CI pass for now.
2024-10-14 20:15:36 +02:00
Kenny Levinsen 5b69753926 logind: Remove drm device tracking
Tying the session state to active drm devices is fragile and does not
make sense. Instead, rely mainly on PropertiesChanged for the session
state. The session is also suspended on the first gentle device pause as
these must be acked.

This also removes the need for listening to device resume, as the
PropertiesChanged handler takes care of re-activation.
2024-10-03 01:21:23 +02:00
Kenny Levinsen 649a948e5e logind: Iterate through entire PropertiesChanged
Instead of stopping when we see the first Active value, iterate through
the entire PropertiesChanged message. This is not expected to cause any
functional differences, as logind only sets Active once, and only in
argument 2.
2024-10-03 00:20:12 +02:00
Kenny Levinsen 8151540c6e logind: Remove match signal on seat object
While we were listening for changes on the seat object, our logic did
not look for properties that would be present on the seat object.

As the signal has no effect, and as we know everything we need to know
from our session object, remove the seat object listener.
2024-10-03 00:16:19 +02:00
Morose f5f55a8984 logind: Condition is always true
Signed-off-by: Morose <chenlinxiang@kylinos.cn>
2024-04-29 13:46:14 +02:00
Kenny Levinsen 0822984ece libseat/logind: Move session_get_type up to its family 2024-03-12 23:20:30 +01:00
Kenny Levinsen 9e50b8d3ae libseat/logind: Better naming and signatures 2024-03-12 23:20:30 +01:00
Kenny Levinsen 7cd7e3fc50 libseat/logind: Check initial active state
When the logic to activate the current session was removed, the logic to
check the current state of the session was lost with it. This meant that
the libseat seat was never activated.

Check the session state after we find the path to the session.
2024-03-12 22:43:00 +01:00
Simon Ser cbe34aba39 build: show whether man pages are enabled in summary 2024-03-08 11:29:20 +01:00
Kenny Levinsen 8f6318ef86 seat: Add a bit of documentation
Not all function names are equally obvious, and some caveats details and
caveats are worth documenting.

I would normally put this documentation in a header, but some important
functions are static and so I placed it together with the implementation
for consistency.
2024-03-03 18:11:59 +01:00
Kenny Levinsen fdf4d0252c seat: Minor cleanup in device reuse, error logging 2024-03-03 18:11:27 +01:00
Kenny Levinsen c070b5a6fb seat: Merge close_client with remove_client
The only user of seat_close_client was seat_remove_client. Merge the two
into a single seat_remove_client. To fix dependencies, move
seat_activate up above seat_remove_client.

Convert seat_remove_client to void while we're at it as it cannot fail.
2024-03-03 18:08:36 +01:00
Kenny Levinsen 0a86b9785a logind: Skip session activation
The original logind implementation in wlroots performed an activation
followed by a check whether the session became active.

This does not appear to be necessary. Skipping activation also mean that
users that have a systemd built for polkit support, but without polkit
installed, can open a seat with logind at the time of writing.

Other functionality like SwitchTo will still fail, and no guarantees as
to whether open seat will continue to work in the future can be made. If
a user does not want polkit installed, they should build systemd without
polkit support.
2024-02-17 17:51:29 +01:00
Kenny Levinsen 2d2ab14d7b libseat/seatd: Fix wrong dispatch reference
The dispatch implementation for the seatd backend had not been correctly
adjusted. Local builds might erroneously have resolved this to the
logind implementation so that it did not lead to a compilation error.
2024-01-28 19:54:26 +01:00
Kenny Levinsen a8a0e39fdf seatd: Init client link after removal
When linked_list entries are removed they become uninitialized, and
further removal will fail on an assert. client_destroy may currently end
up removing a client link twice: once directly, and once in
seat_remove_client.

Instead, make seat_remove_client re-init the link so client_destroy can
call remove afterwards. This is necessary as the client might still be
in the original idle list.
2024-01-15 21:16:21 +01:00
Kenny Levinsen c958c1a506 common: Allow inserting inited linked list elem
linked_list_insert originally asserted two things:

1. That the list that is being inserted into is initialized, which
   indicated that the list is active.

2. That the element that was inserted was *not* initialized which
   indicated that it was not intended to be a list, and that it was
   instead a fresh or removed element.

Initializing a list element allows it to later be safely, blindly
removed without knowing if it would still be a member of a list. Change
the element assert to just check that the element isn't a member of a
list already.
2024-01-15 21:16:21 +01:00
Kenny Levinsen 2293dea814 seatd: Add responses for switch and disable
Session switch and disable seat did not have a return value, and so the
client did not dispatch anything. They could still, however, still
trigger an error response.

The libseat seatd backend would not dispatch error responses in the
background, allowing the connection buffer to fill up until further
reads failed on the buffer being full.
2024-01-14 19:29:34 +01:00
Kenny Levinsen 5be64d6376 libseat/seatd: Dispatch utility cleanup
The various dispatch utility functions were named in a confusing manner.
Make "dispatch" the implementation of libseat_dispatch, and use "read"
for the functions that do not dispatch background events.
2024-01-14 19:00:30 +01:00
Kenny Levinsen 436c650293 libseat/seatd: Error on unexpected response
Responses are read immediately by functions sending the respective
request, so we only ever expect to see events during dispatch. Error out
if an unexpected response is received.
2024-01-14 18:59:43 +01:00
Kenny Levinsen 78c927d0bf connection: Add overflow edge-case test 2024-01-14 18:36:17 +01:00
Kelvin C 546022237c systemd: restrict access to devices
- Restrict access to block devices to the service process by creating a
  whitelist.

- As a result, the service will only have write access to what it
  needs--drm, input, tty, console and /dev/null.
2023-12-31 01:09:57 +01:00
Kelvin C 9ab62edfad systemd: protect hostname
- Prevent service process from changing the system hostname or domain
  name.
2023-12-31 01:09:54 +01:00
Kelvin C 01d058387b systemd: protect system clock
- Deny writes to the hardware clock or system clock for the service
  process.
2023-12-31 01:09:52 +01:00
Kelvin C 1940fefc53 systemd: restrict capabilities
- Restrict the capabilities of the service process by creating a
  whitelist of caps and sockets.

- Also, further restrict it by denying realtime scheduling and the
  ability to change memory mappings.
2023-12-31 01:09:48 +01:00
Kelvin C c101dcad78 systemd: restrict namespace functionality
- Restrict namespace for the service process by preventing access to
  namespace creation and switching.
2023-12-31 01:09:47 +01:00
Kelvin C 9693a2c370 systemd: limit access to kernel
- Deny access to the kernel log ring buffer and ability to load kernel
  modules for the service process.

- Also, prevent the kernel execution domain from being changed or a
  personality from being selected.
2023-12-31 01:09:44 +01:00
Kelvin C 86be0c1478 systemd: limit sys calls and arch
- Whitelist system calls to systemd's recommended predefined set and
  limit the CPU architectures of the service process to the system's
  native ABI.

- In effect, the service will only have access to system calls that
  require super-user capabilities via the @privileged set and will only
  be able invoke native system calls.
2023-12-31 01:09:40 +01:00
Kelvin C 022486f01b systemd: disable network access
- Ensure that network devices are hidden from the service process by
  setting up a new network namespace.
2023-12-31 01:09:38 +01:00
Kelvin C 05421b7de2 systemd: ensure no new privileges
- Ensure that the service process and all its children can never gain
  new privileges.
2023-12-31 01:09:36 +01:00
Kelvin C 2a81228dab systemd: lockdown the filesystem
- Protect /home and mount the entire filesystem hierarchy as read-only
  with the exception of /dev for the service process.

- In addition, give the service its own private /tmp, make processes
  owned by other users invisible and make all files created accessible
  only to the service's user.
2023-12-31 01:09:31 +01:00
Kenny Levinsen 7d22f81a08 seatd: Avoid unnecessary asserts
These were just noise. Move the client list management from client to
seat to make things a bit clearer.
2023-12-15 22:46:02 +01:00
Jack Mitchell e9c01603a6 seatd: fix double close of file handle
terminal_current_vt closes the file handle passed to it which is
incosistent with the other terminal functions and was actually hiding a
double close bug in seat_update_vt. Remove the calls to close and leave
the responsibility to the caller.

Signed-off-by: Jack Mitchell <ml@embed.me.uk>
2023-12-11 14:37:41 +01:00
Adrien Demarez 0746edbeae seatd: fix small bug in assert 2023-10-24 11:59:51 +02:00
Kenny Levinsen 3e9ef69f14 Bump version to 0.8.0 2023-07-19 11:18:33 +02:00
Jessica Clarke 1bd042e5b0 drm: Support drm-subtree drivers on FreeBSD
The drm-kmod drivers use linuxkpi and end up with /dev/drm being the
canonical path for the devices, but the drm-subtree drivers use drmkpi
which has them appear under /dev/dri like Linux. Thus, adapt path_is_drm
to recognise both on FreeBSD.
2023-05-24 16:43:21 +02:00
Anna (navi) Figueiredo Gomes 56720a6275 noop: Additional open flags for open(2)
Matching the functionallity by the seatd open call. O_NONBLOCK is
specially important for libseat, otherwise it hangs while trying to
drain all events from an input device fd.

Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-04-01 15:34:53 +02:00
Anna (navi) Figueiredo Gomes e5b018def8 noop: Return seat0 as the seat name
wlroots' libinput backend expects the name of the seat to either match
ID_SEAT from udev, or in case ID_SEAT returns nothing, match seat0. As
noop has no seat switching, always returning seat0 as the session name
fixes that.

Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-04-01 15:34:53 +02:00
Alyssa Ross 3e0d510b2c meson: fix seatdpath with absolute bindir
Quoting the Meson documentation:

> Note that the value returned for built-in options that end in `dir`
> such as `bindir` and `libdir` is usually a path relative to (and
> inside) the `prefix` but you should not rely on that, as it can also
> be an absolute path [in some cases](Builtin-options.md#universal-options).
> [`install_dir` arguments](Installing.md) handle that as expected
> but if you need an absolute path, e.g. to use in a define etc.,
> you should use the path concatenation operator like this:
> `get_option('prefix') / get_option('localstatedir')`.
> Never manually join paths as if they were strings.

The concatenation of two absolute paths caused seatd-launch in Nixpkgs
to try to launch e.g.
/nix/store/43wyk9s2l2z8cparnshbf24d39vm5272-seatd-0.7.0//nix/store/j9a7k4qqwc3byyfmpqwg46shmh6g82yf-seatd-0.7.0-bin/bin/seatd.
2023-03-13 17:06:31 +01:00
Simon Ser 207e2a5936 man: add missing arg in -n syntax 2023-01-28 23:10:29 +01:00
Chia-I Wu 9b8b6e0bf8 noop: initialize initial_setup
Otherwise the enable_seat callback is never called.
2023-01-16 13:13:52 +01:00
Simon Ser 14355639f8 man: document SEATD_VTBOUND 2022-11-30 18:38:50 +01:00
Kenny Levinsen a803ba0502 seatd-launch: Avoid argv[0] in help text 2022-05-23 22:03:38 +02:00
Kenny Levinsen 6888653a8d wscons: Fix STRLEN 2022-03-30 00:39:35 +02:00
Simon Ser 2842f0e2b1 seatd: refuse to compile with missing get_peer impl
Instead of using a stub, error out when get_peer isn't implemented
for the target platform. client_create relies on it.
2022-03-29 20:08:00 +02:00
Simon Ser 85d0bf5943 seatd: handle client_create failure
Failure to create the client causes a null pointer dereference.
2022-03-29 20:07:47 +02:00
Kenny Levinsen 8f8c9558e6 drm: Make dev_is_drm local to logind backend
This function is only used for logind, which is Linux-specific, but the
presence in common/drm.c suggested that it had to be portable.

Move it to the logind backend for now.
2022-03-29 10:54:27 +02:00
Kenny Levinsen 0462e9331d wscons: Move to its own device type
This reduces ifdefs and avoids overloading evdev as something it is not.
2022-03-29 10:54:27 +02:00
Kenny Levinsen 684dd61945 terminal: Revert FreeBSD behavior in set_keyboard
4ad48cb305 introduced support for NetBSD,
which modified a number of our ifdefs. In that process, FreeBSD was
accidentally excluded from an important code path that controls keyboard
usage on the kernel console.

Revert part of that change to restore FreeBSD behavior.
2022-03-29 10:03:30 +02:00
Kenny Levinsen d5539dead8 meson: library soversion arg should be string
muon, a meson implementation in C, is more strict with its types and
revealed this discrepancy between meson behavior and documentation.
2022-03-28 16:28:00 +02:00
Kenny Levinsen 845256009b readme: Mention NetBSD 2022-03-23 20:29:09 +01:00
illiliti a5f9a2a2c8 ci: Add NetBSD 2022-03-16 21:39:46 +01:00
illiliti 4ad48cb305 Initial netbsd support 2022-03-16 21:39:46 +01:00
Kenny Levinsen 1990f9b034 ci: Set loglevel argument to debug 2022-03-16 21:27:05 +01:00
Kenny Levinsen bb0efb65b3 Bump version to 0.7.0 2022-03-03 17:52:50 +01:00
Kenny Levinsen ce6a6b7d2e meson: Fix meson warnings 2022-03-03 17:52:26 +01:00
Kenny Levinsen 8dc6a50d88 builtin: Remove deathsig and log start/stop
Proper handling of client disconnect mean that we no longer need
deathsig handling.
2022-03-03 17:52:21 +01:00
Kenny Levinsen 795cf169e7 seatd: Shut down on client disconnect in builtin
If we're part of the libseat builtin backend, then we only have one
client. Shut down the server when this client disconnects.
2022-03-03 14:44:56 +01:00
Kenny Levinsen 46c83972fe builtin: Close other end of socketpair after fork
We will not get a socket hangup if we have duplicates socket fds in the
parent or child, so make sure we clean this up properly after fork.
2022-03-03 14:44:49 +01:00
Kenny Levinsen abcecbb53b meson: Only set libseat defines for libseat itself
This allows us to distinguish between when we build seatd as part of the
builtin libseat backend, or when we build seatd on its own.
2022-03-03 14:40:40 +01:00
Kenny Levinsen ae42d05513 seatd: Change default log-level to info 2022-02-26 22:56:42 +01:00
Kenny Levinsen 0d6bdf4f01 seatd: Remove runtime socket path configuration
Configurable socket paths exist mainly to facilitate multiple parallel
seatd instances. However, the only valid use-case for running multiple
instances of seatd is testing during development, which can just as well
be done by changing SEATD_DEFAULTPATH at compile-time for test builds.

Remove the command-line argument in seatd for runtime configuration of
socket path, hardcode the socket path in seatd-launch, and change seatd
unlink/chmod/chown code to not run when started by seatd-launch.

This means that seatd-launch will now fail to start seatd if another
seatd instance is already running. The unlink code still runs when seatd
is started normally to assist in system crash recovery, but this may be
removed later if we deem it unnecessary.
2022-02-26 22:25:27 +01:00
Kenny Levinsen 466efea49b seatd: Handle socket unlink errors
This ensures early failure and better error messages.
2022-02-26 19:37:49 +01:00
Kenny Levinsen 9bbdf0f0b8 seatd: Command-line argument for loglevel
SEATD_LOGLEVEL was used to set the loglevel despite already having
getopt in place. Remove the environment variable and make a command-line
argument for it instead.
2022-02-26 19:17:26 +01:00
Kenny Levinsen 3eb0db57bb seatd-launch: Minor readability improvements 2022-02-21 21:33:06 +01:00
Kenny Levinsen ed90ed62cd seatd-launch: Use snprintf for socket path
We also reduce the size of the buffer from 256 bytes to a much more
reasonable 32 bytes.
2022-02-21 21:27:14 +01:00
Kenny Levinsen a44476ce65 seatd: Fix usage rendering 2022-02-21 12:04:09 +01:00
Kenny Levinsen 10658dc543 seatd-launch: Remove socket path command line arg
This should not need to be configured, so remove the argument. If
downstream prefers a different folder, the location can be made
compile-time configurable like for seatd itself.
2022-02-21 12:02:31 +01:00
Kenny Levinsen 32d06482d3 seatd-launch: Do not unlink socket path
seatd cleans up after itself and takes care of stale sockets when
applicable, so seatd-launch should not replicate this functionality.
2022-02-21 12:02:31 +01:00
Kenny Levinsen 0864f6a3ac seatd: Ensure socket gets unlinked on error 2022-02-21 12:02:31 +01:00
Kenny Levinsen 157ce68565 seatd: Remove SOCK_PATH and improve cleanup
SOCK_PATH is made redundant by the -s command-line argument added in
a98e0c4ce9. Support was originally left
behind for short-term compatibility, but it should be fine to remove.

Previous socket cleanup is changed to run unconditionally. The cleanup
now fails if the existing file is not a socket.
2022-02-21 12:02:31 +01:00
Kenny Levinsen f128359332 logind: Always send ping if data is queued
sd_bus_call_method may have read and queued our ping response, so we
cannot assume that a previous ping will make the socket readable.

Instead, always send a ping if read or write queues are not empty, even
if a ping has already been sent.
2022-02-15 13:51:49 +01:00
Kenny Levinsen b47c79d731 libseat: Use SOCK_CLOEXEC and SOCK_NONBLOCK
This both simplifies our code and fixes an exec fd leak when using
builtin or noop backends.
2022-02-09 23:22:29 +01:00
Simon Ser 96a5de8859 readme: add irc:// link
This allows users to just click the link to join the IRC channel.
2021-12-16 10:40:53 +01:00
Simon Ser 936ff9dbea build: use meson.override_dependency
This allows downstream users to write:

    dependency('libseat', fallback: 'seatd')

instead of having to rely on the seatd/meson.build's variable name:

    dependency('libseat', fallback: ['seatd', 'libseat'])
2021-12-16 10:40:32 +01:00
Simon Ser f381e22955 build: don't use sh for scdoc
Just use the built-in feed/capture Meson options instead.
2021-11-28 15:41:53 +01:00
Simon Ser d92fa01f88 build: use list for logind dep
This reduces the boilerplate a bit. Use logind.name() instead of
having a separate source of truth. Requires adapting the checks a
bit because the dep name has a "lib" prefix.
2021-11-28 15:40:56 +01:00
Simon Ser 69cf5c36e0 build: don't use cc.get_supported_arguments for defines
If the compiler errors out on some -DXXX flag, then we're in
trouble. Avoid using cc.get_supported_arguments for defines we
require. Only use it for detecting support for warning flags.
2021-10-28 16:31:17 +02:00
Simon Ser 88529f0856 seatd: don't log errno on EVENT_ERROR
errno won't be set when poll returns EVENT_ERROR.
2021-10-24 00:55:32 +02:00
Simon Ser cb7a94378b seatd: avoid overwriting errno in set_nonblock error handling
If close fails, it'll mess up errno, and log_errorf will print a
non-sensical value.
2021-10-24 00:52:08 +02:00
Kenny Levinsen 88db55f606 Bump version to 0.6.3 2021-10-19 21:39:17 +02:00
Kenny Levinsen e35c9cd02e logind: Set userdata for ping_handler 2021-10-05 10:05:25 +02:00
Kenny Levinsen ec0d6565bb ci: Add logind smoketest to arch 2021-09-22 23:06:59 +02:00
Kenny Levinsen 8e5c00e7c8 logind: Improve error handling in open_seat
errno was not being set by open_seat in most cases, leading to
simpletest possibly failing with "libseat_open_seat() failed: Success".
2021-09-22 23:04:40 +02:00
Simon Ser d2193b45ff examples/simpletest: check for libseat_dispatch failures 2021-09-22 21:59:41 +02:00
Simon Ser 262ccef84e logind: check if session is active on startup
Up until now we assumed the session was always active on startup.
This might not be the case. Instead, read the current value of the
Active property.
2021-09-22 21:55:49 +02:00
Kenny Levinsen 1c376ca9b1 ci: Inline smoketest into build scripts
The smoketest script has gotten significantly simpler, and can simply be
inlined into the build scripts if we don't care about running the tests
twice.

This should fix CI for mailing list patches.
2021-09-21 13:11:55 +02:00
Kenny Levinsen e2baadc230 clang-format: Fix alignment 2021-09-21 12:48:24 +02:00
Kenny Levinsen db08fb921f logind: Send ping to wake us up later
sd_bus_call drains received messages into the receive queue, and peeks
for its own return value. It does not dispatch the receive queue.

As the socket is drained, the caller will not wake from a poll and have
no reason to dispatch libseat. This has gone unnoticed largely due to
logind sending an event for every device, making it unlikely that no
unread message will be left on the socket.

Like we have done for seatd, we fix this by sending a "ping" request to
logind if anything is left in our receive queue as reported by
sd_bus_get_events. The response to this will wake us up and ensure that
dispatch is called.
2021-09-21 11:18:18 +02:00
Kenny Levinsen 2eee9aa445 seatd: Implement ping request to wake up later
When device open or close messages are sent to seatd, libseat must read
messages from the socket until it sees the associated response message.
This means that it may drain enable/disable seat events from the socket,
queueing them internally for deferred processing.

As the socket is drained, the caller will not wake from a poll and have
no reason to dispatch libseat. To ensure that these messages would not
be left in the queue, 6fa82930d0 made it
so that open/close calls would execute all queued events just before
returning.

Unfortunately, this had the side-effect of having events fire from the
stack of libseat_open_device or libseat_close_device, which we now see
cause problems in compositors. Specifically, an issue has been observed
where libinput end up calling libseat_close_device, which in turn
dispatch a disable seat event that calls libinput_suspend. libinput does
not like this.

Instead, remove the execution from libseat_open_device and
libseat_close_device, and instead make a "ping" request to seatd if
events have been queued. The response to this will wake us up and ensure
that dispatch is called.
2021-09-21 11:18:18 +02:00
Kenny Levinsen 0f20175752 Bump version to 0.6.2 2021-09-16 01:07:42 +02:00
Kenny Levinsen ebf512c2bf seatd-launch: Specify exact environment to seatd
The parent environment might contain nasty things. Create a new
environment for the seatd process containing only the environment
variables we care about. For now, that's only SEATD_LOGLEVEL.
2021-09-16 00:55:43 +02:00
Kenny Levinsen 907b75de1a seatd-launch: Use absolute path for seatd
We previously used execlp to execute seatd, which had the effect of
searching PATH for the executable. This allowed the caller to control
what executable was run, which is bad if SUID has been set.

Instead, expose the absolute install path for seatd from meason as a
define, and use that in a call to execv.
2021-09-16 00:46:49 +02:00
Kenny Levinsen 4091ba2c07 ci: Install seatd instead of manipulating PATH 2021-09-16 00:46:42 +02:00
Kenny Levinsen 66becee6da Bump version to 0.6.1 2021-09-14 11:58:56 +02:00
Simon Ser 4e3b7b3bb6 seatd-launch: print unlink/kill errors
Makes it easier to find out that something went wrong.
2021-09-13 13:40:00 +02:00
Simon Ser fe600eac2b seatd-launch: exit with status >128 if child is signalled
Mimick shells and exit with a status >128 if our child has been
signalled. Exiting with 128 + signal number is what most shells do
(POSIX only requires them to exit with >128).
2021-09-13 13:39:20 +02:00
Kenny Levinsen 8c85c46d2d man/seatd-launch: Make mssage about root clearer 2021-09-12 12:06:05 +02:00
Kenny Levinsen 483dbf76fa seatd-launch: Use optind to find the command
The command indexing had not been updated afer the introduction of
getopt, so combining a command with flags would fail.

Add error handling for if no command was specified while we're at it.
2021-09-12 12:06:05 +02:00
Jan Beich d5c1a7811b seatd-launch: respect PATH when looking for command
$ seatd-launch sway -c /dev/null
Could not start target: No such file or directory
2021-09-12 12:06:05 +02:00
Kenny Levinsen da59bea775 man: Add seatd-launch(1) to SEE ALSO of seatd(1) 2021-09-11 15:55:26 +02:00
Kenny Levinsen 3ad9164a89 Bump version to 0.6.0 2021-09-11 14:02:44 +02:00
Kenny Levinsen d1c6bb9a15 seatd-launch: Fix chmod error goto 2021-09-08 20:54:18 +02:00
Kenny Levinsen e7343ca96f man: Add simple seatd-launch(1) page 2021-09-08 20:45:42 +02:00
Kenny Levinsen 17cdbe0ad2 seatd-launch: Set socket permissions directly
Instead of relying on seatd's user/group arguments, which require
turning our UID back into a username, just chmod/chown the socket
ourselves once seatd is ready.

We also reduce the permissions to just user access, instead of user and
group like seatd specifies.
2021-09-08 20:40:09 +02:00
Kenny Levinsen 60c370d4ec seat: Allow new clients when active is pending ack
New clients could only be added to a VT bound seat if there were no
"active" client, regardless of its actual state. This meant that if one
switched from an "active" VT to an "inactive" VT, the seat would be
blocked while the "active" client was in CLIENT_PENDING_DISABLE, causing
new clients to possibly fail should the old client take its time with
the ack.

Instead, allow new clients to also be added if there is an active client
whose state is CLIENT_PENDING_DISABLE, and there is no client with the
new VT as its session ID.
2021-09-07 22:24:24 +02:00
Simon Ser 29a6832ca0 Add .editorconfig
Allows text editor auto-configuration.
2021-09-02 20:41:47 +02:00
Kenny Levinsen df3f307b8e seat: Avoid holding a tty fd
The kernel Secure Attention Key killer, triggered by SysRq+k, kills all
processes that hold an fd referencing the tty.

To avoid its attention, we stop storing the fd for the currently active
VT in seat state. This has the added benefit of simplifying state a bit.
2021-09-02 20:02:55 +02:00
Fabrice Fontaine 15b0972bd3 meson.build: fix build with gcc < 7
Test if arguments (e.g. -Wimplicit-fallthrough) is available before
using it as -Wimplicit-fallthrough has been added only since gcc 7.1 and
https://github.com/gcc-mirror/gcc/commit/81fea426da8c4687bb32e6894dc26f00ae211822
and so it will raise the following build failure with gcc < 7:

arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Wimplicit-fallthrough'

Fixes:
 - http://autobuild.buildroot.org/results/0ee6816a7cceebdafd07612677a594bdf68e0790

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-09-02 20:00:03 +02:00
Kenny Levinsen 038c30f9b1 libseat: Fix build of builtin backend
This was regressed by 166feaea33 which
missed the builtin backend when changing struct libseat_seat_listener to
being passed around as const.
2021-08-15 14:32:05 +02:00
Greg Depoire--Ferrer d78859bc9a libseat: Update builtin backend root requirement documentation
The builtin backend no longer requires root, setuid or CAP_SYS_ADMIN.
This commit updates the documentation accordingly.
2021-08-15 14:03:23 +02:00
Greg Depoire--Ferrer d9ae4c3010 Revert "libseat: Check euid before using builtin"
This reverts commit 1ae6c3b3dd.

A user might want to run the builtin server as non root, if they have
permission to use the devices.

The check was originally copied from wlroots's direct backend. It was reverted
in fa05d3cde68d with a detailed explanation of why root priviledges are not
always necessary to use the DRM device.
2021-08-15 14:03:23 +02:00
Kenny Levinsen 6e7a1db32d logind: Remove redundant null check 2021-08-15 13:34:26 +02:00
Simon Ser 166feaea33 Make libseat_seat_listener const
libseat will never write to that struct. Let's allow callers to
make it read-only.
2021-08-15 13:33:30 +02:00
Kenny Levinsen 309650aa4d seatd: Use path in chmod/chown operations
c8b3a22d4e snuck in a change which
converts chown/chmod to fchown/fchmod using the socket fd. This appears
to succeed under Linux, but fails with EINVAL on FreeBSD. As the error
handling in this area was flawed, CI failed to catch the regression.

Partially revert c8b3a22d4e to fix the
regression on FreeBSD.
2021-08-08 18:22:17 +02:00
Kenny Levinsen 2cfc56d5ed seatd: Improve socket permission error handling
chmod/chown errors were logged, but did not result in failure opening
the seatd socket. This meant that errors would not get caught by CI.
2021-08-08 18:21:28 +02:00
Kenny Levinsen 48727a0b6b seatd-launch: Command line argument support 2021-08-06 23:00:05 +02:00
Simon Ser 369af8f9e4 seatd-launch: check for getpwuid errors 2021-08-06 22:27:42 +02:00
Simon Ser 3a843745c2 seatd-launch: don't use gotos in child processes
While forked (child pid is zero), don't use gotos. These will
execute atexit functions and potentially mess up the stdlib.
Instead, use _exit.
2021-08-06 22:27:42 +02:00
Simon Ser f2a614dcd3 seatd-launch: propagate child exit status
When the child process exits with a non-zero code or is killed,
return with a non-zero code as well.
2021-08-06 22:27:42 +02:00
Kenny Levinsen 7d06b34ee2 ci: Fix meson flags 2021-08-06 01:29:52 +02:00
Kenny Levinsen 978dec42b0 ci: Use seatd-launch 2021-08-06 01:29:52 +02:00
Kenny Levinsen 1e98727ae9 seatd-launch: Add seatd launch wrapper
This launch wrapper is used to conveniently start a new seatd instance,
wait for it to be ready, and launch a target application.
2021-08-06 01:29:52 +02:00
Kenny Levinsen c8b3a22d4e seatd: Only set UID/GID when specified
The UID/GID defaulted to 0, which results in trying to chown to root
when a UID or GID isn't requested. Instead, deafult to -1 so that the
unspecified values are left intact.
2021-08-06 01:15:55 +02:00
Kenny Levinsen 312d6906ae seatd: s6-style readiness notification support
This adds the ability to specify the number of an fd that is inherited
by the process as open. Once seatd is read to serve requests, it will
write a single newline and close the fd.
2021-08-06 01:15:55 +02:00
Kenny Levinsen d03e9d1c35 seatd: We shouldn't poll if predispatch > 0
This condition was accidentally botched as part of
5923e0edc9
2021-08-06 01:15:55 +02:00
Kenny Levinsen 6444da6093 libseat: Rename dispatch_background in backends
This name never made much sense. dispatch_and_execute is more
meaningful, especially when compared to the non-executing dispatch
function.
2021-07-09 00:16:10 +02:00
Kenny Levinsen 5923e0edc9 libseat/seatd: Add dispatch_pending_and_execute
This handler returns the number of dispatched or executed events, or -1
if dispatch_pending failed.

This helper is used to clean up dispatch_background, which now ensures
that all events are executed before we read or poll the connection, and
have improved error handling in the corner case where the second
dispatch_pending failed.
2021-07-09 00:09:14 +02:00
Kenny Levinsen 7a6d12ff7a libseat/seatd: Return executed events
Dispatch needs to report if something has happened, which includes
events executed from the queue as these could have lead to additional
dispatch and queuing.
2021-07-08 23:48:30 +02:00
Simon Ser 2204db5531 build: add prefix to libseat options
The option names are a little bit confusing, because it's not clear
which ones toggle libseat features, and which ones toggle seatd
features.

Add a "libseat-" prefix to libseat-specific features, to make it
more obvious that they only are about the library.
2021-07-06 22:11:43 +02:00
Simeon Schaub bff09d8859 link with rt
Since seatd uses `clock_gettime`, this is needed when cross-compiling.
This came up in https://github.com/JuliaPackaging/Yggdrasil/pull/3193.
2021-06-20 22:36:33 +02:00
Kenny Levinsen fc97206df9 readme: Update discuss section 2021-05-19 17:48:12 +02:00
Kenny Levinsen 355cc9c944 meson: Support building builtin without seatd
The builtin backend relies on the seatd backend implementation. When
builtin was enabled without seatd, compilation would fail due to the
implementation not being included.

Include the implementation if either seatd or builtin is enabled.
2021-04-25 20:20:52 +02:00
Simon Ser 36f54adc2c libseat/seatd: downgrade ENOENT log to info
The socket is expected not to be found if seatd is not running.
In general other backends will be attempted after seatd. There is
already an error message in case no backend can be started.
2021-04-25 19:15:24 +02:00
Kenny Levinsen 5535c2c3b1 contrib/systemd: Use a different group
"video" was used for convenience in the example, but a dedicated group
is preferable so that a user does not gain the ability to bypass the
seat manager and open devices directly.
2021-04-17 17:09:45 +02:00
Simon Ser 81ff0a09a9 build: set pkgconfig/dependency variables for features
This allows libseat users to e.g. advise people to chmod a+s the
executable if libseat is built with the builtin backend.

While bumping the Meson version, adjust the scdoc logic to avoid
the following warnings:

    WARNING: Project targeting '>=0.56.0' but tried to use feature deprecated since '0.56.0': Dependency.get_pkgconfig_variable. use Dependency.get_variable(pkgconfig : ...) instead
    WARNING: Project targeting '>=0.56.0' but tried to use feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead
2021-04-10 15:16:40 +02:00
Simon Ser 5884a6003a build: disable logind on -Dauto_features=disabled -Dlogind=auto
Setting auto_features=disabled is supposed to disable all optional
dependencies. Since we aren't using a feature option here, we need
to manually add logic to disable logind in this case.
2021-04-10 15:16:26 +02:00
Simon Ser 753c5276cf build: don't allow "auto" for seatd, builtin, server and examples
These features don't have any dependencies, so "auto" doesn't make
sense.
2021-04-08 23:07:35 +02:00
Simon Ser ee40913810 build: don't explicitly search for sh
This removes the "Program sh found" line in the build logs, and
should not change anything else.
2021-04-08 23:07:35 +02:00
Simon Ser 392da918e6 build: fix logind feature summary when auto-detected
If -Dlogind=auto but systemd/elogind isn't available,
logind_provider would get set to the last item of the foreach loop.
This would incorrectly report "systemd: YES".
2021-04-08 23:07:35 +02:00
Simon Ser 385cc0039d build: add explicit logind provider option, auto-detect by default
Allow package maintainers to explicitly select a logind provider
by passing -Dlogind=systemd or -Dlogind=elogind. In case both are
available (e.g. for distributions which support both), this makes
it possible to gte deterministic behavior.

By default, auto-detect the logind provider. That way, users which
have systemd or elogind installed get the backend built by default.
2021-04-08 23:07:35 +02:00
Kenny Levinsen 3ce4c57814 meson: make 'logind' var always available 2021-04-08 23:07:35 +02:00
Kenny Levinsen 50da164ddc ci: Use 'auto' for arch linux logind 2021-04-08 23:07:35 +02:00
Kenny Levinsen f9ba8b57bc Avoid a clang-format quirk
clang-format wants to put the terminating NULLs on the same line as the
noop backend when it doens't have any immediate non-NULL neighbors.

Add a newline to stop it.
2021-03-26 11:34:13 +01:00
Simon Ser fa2700126f meson: declare libseat dependency
This can be used by parent projects when seatd is a subproject:

    libseat = dependency('libseat', fallback: ['seatd', 'libseat'])
2021-03-26 11:21:05 +01:00
Simon Ser 9a7824b7c3 Add no-op session
This is useful for headless testing, for instance with VKMS:

    modprobe vkms
    export WLR_DRM_DEVICES=/dev/dri/card1
    export WLR_BACKENDS=drm
    export LIBSEAT_BACKEND=noop
    sway

We don't need any of the VT handling in this case.
2021-03-26 11:11:26 +01:00
Jan Beich 5ad91ae9da client: enable cr_pid on FreeBSD >= 12.3
https://cgit.freebsd.org/src/commit/?id=925f44f33862908f9a2e72520a17af148c7d0db5
https://cgit.freebsd.org/src/commit/?id=2b61bda2c75f30f6eadd18fb891fd885e4c8d19d
2021-03-21 16:27:21 +01:00
Kenny Levinsen 0d855a28f2 readme: Remove alpha label 2021-03-18 15:45:40 +01:00
Kenny Levinsen 34f55a3e24 contrib: Add Documentation to systemd unit 2021-03-16 14:27:45 +01:00
Kenny Levinsen a9865adb5f ci: Remove unnecessary env vars 2021-03-16 13:36:26 +01:00
Kenny Levinsen 745d662920 ci: Reduce test runs from 5 to 2 2021-03-16 13:36:26 +01:00
Kenny Levinsen 1f457b1df8 meson: Disable examples by default 2021-03-16 13:36:26 +01:00
Kenny Levinsen 4e65e1bf47 Correct minor misspellings 2021-03-16 13:03:57 +01:00
Kenny Levinsen 75cb20e891 meson: Minor cleanup 2021-03-16 13:03:57 +01:00
Kenny Levinsen e802d381a1 meson: Fix logind backend auto mode 2021-03-16 13:03:57 +01:00
Kenny Levinsen e303e11334 Bump version to 0.5.0 2021-03-15 20:32:27 +01:00
Kenny Levinsen 9492054920 ci: Add clang-extra-tools to alpine
Needed for the clang-format target.
2021-03-15 20:31:51 +01:00
Kenny Levinsen c53c94985e meson: Fix indentation 2021-03-15 20:26:06 +01:00
Kenny Levinsen a9b2079319 meson: Make summary prettier 2021-03-15 20:23:09 +01:00
Kenny Levinsen 951c1790fa meson: Clean up test declarations a bit 2021-03-15 20:22:55 +01:00
Kenny Levinsen d8ddf590fa log: Include debug logs in release builds 2021-03-02 00:27:38 +01:00
Kenny Levinsen e4c28227ec Normalize log texts a bit 2021-03-02 00:27:38 +01:00
Kenny Levinsen 79b90788bd log: Remove function name from log 2021-03-01 01:11:37 +01:00
Kenny Levinsen 3a6a7e6b4c clang-format 2021-02-27 21:48:03 +01:00
Kenny Levinsen e173691cfd seatd: Close cur_ttyfd in seat_destroy
This fd would only still be set after closing clients if no clients were
active on the current VT.
2021-02-27 21:46:38 +01:00
Kenny Levinsen cedd64c283 client: Remove link if seat_add_client succeeds
Removing the link before before means that we can return without a link,
resulting in a double-remove.
2021-02-27 21:46:38 +01:00
Kenny Levinsen ffd6f039f8 seatd: Clean up debug logs a bit 2021-02-27 21:46:38 +01:00
Kenny Levinsen 456d08dc83 Convert a few debug logs to error logs 2021-02-27 19:57:20 +01:00
Kenny Levinsen ff38ea595a seatd: Set errno in seat_add_client 2021-02-27 19:35:15 +01:00
Kenny Levinsen 6cf751af2b logind: Fix return values from close_device/get_fd 2021-02-27 19:35:01 +01:00
Kenny Levinsen da3cbcc943 libseat: Fix typo in doc string 2021-02-27 19:28:32 +01:00
Aleksei Bavshin 152ee5102a meson: ignore 'man-pages' if 'server' is disabled
`seatd.1` is the only man page, so it's not necessary to install it or
require scdoc when the server is not built.
2021-02-27 17:45:07 +01:00
Kenny Levinsen 65d91351ab seatd: Tear down VT when disabled client closes
If a client closed while it was disabled, the VT would not be torn down.
If the user navigated back to the VT it belonged to, they would be
stuck.

When a client is disabled, open the fd for the VT it belonged to and
perform regular teardown on it.
2021-02-27 16:58:44 +01:00
Kenny Levinsen 45bab8b258 client: Replace pending_disable with state enum
This simplifies logic in seat handling.
2021-02-27 15:51:13 +01:00
Kenny Levinsen b1f7ec1c4d seat: Remove unused arg from seat_deactive_device 2021-02-02 21:03:42 +01:00
Kenny Levinsen 61b086511f logind: Send ReleaseControl when closing seat
This is not strictly speaking necessary as detaching from the bus should
trigger this automatically, but elogind apparently has issues with this.

Doing this explicitly does no harm, so let's just do that.
2020-12-23 00:34:02 +01:00
Kenny Levinsen 1ececbbf36 simpletest: Close fd after closing device 2020-12-14 23:41:17 +01:00
Kenny Levinsen 3755eea668 client: Fix typo in cr_pid usage 2020-12-10 10:07:43 +01:00
Kenny Levinsen 9b3bdcb12d client: Use cr_pid if available
This is only available on FreeBSD 13, so test for that version.
2020-12-08 16:42:13 +01:00
Kenny Levinsen e99e7d71f7 client: Do not use SOL_SOCKET for LOCAL_PEERCRED
This is wrong, and leads to LOCAL_PEERCRED being interpreted as
SO_DEBUG. 0 should be used instead.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189.
2020-12-08 16:38:17 +01:00
Simon Ser e3a357bade libseat/backend/logind: stop waiting for CanGraphical
Upstream says compositors should wait for DRM nodes using udev instead.
2020-12-04 23:39:39 +01:00
Kenny Levinsen 1dbf100205 logind: switch_session should return 0 on success
It currently returned -1 on failure and 1 on success. The API is
intended to return -1 on failure and 0 on success, so fix that.
2020-11-24 13:12:31 +01:00
Kenny Levinsen 0d5f48f433 terminal: Improve logging 2020-11-23 17:56:55 +01:00
Kenny Levinsen e0782a825e client: More robust handling of client links 2020-11-23 17:56:55 +01:00
Kenny Levinsen df8494af61 poller: Retry poll immediately on EINTR
There is nothing for us to dispatch unless we wake on an fd, so just
retry poll if it fails with EINTR instead of doing a full dispatch loop.
2020-11-23 16:48:18 +01:00
Isaac Freund 3c80a9db96 libseat: log error when failing to open socket
The most common pain point I've seen with people trying out seat is
forgetting to add themselves to whatever group the distro has chosen
to own the socket.

Logging this error and path of the socket should make it easier to tell
why things aren't working.
2020-11-21 21:03:55 +01:00
Kenny Levinsen 2185e8f180 ci: Clean up build manifests 2020-11-03 15:42:09 +01:00
Kenny Levinsen 271305a15f Bump version to 0.4.0 2020-10-19 23:11:07 +02:00
Kenny Levinsen 26eff322d4 readme: Update mailing list link 2020-10-16 21:38:32 +02:00
Kenny Levinsen e0945eb840 connection: Add unittest 2020-10-12 18:02:00 +02:00
Kenny Levinsen 29ba210958 libseat: Better error reporting from open_seat 2020-10-11 23:31:07 +02:00
Kenny Levinsen 7d785ea993 logind: clang-format 2020-10-11 01:41:34 +02:00
Kenny Levinsen daffed0955 logind: Use seat_path for SwitchTo 2020-10-10 19:39:28 +02:00
Kenny Levinsen 7bf91a5f9f logind: close_device should not close fd 2020-09-28 18:53:38 +02:00
Kenny Levinsen ca6478716d seat: Only close VT if no new session was found 2020-09-22 01:33:45 +02:00
Kenny Levinsen be45c480ec terminal: Ack both release and acquire
Linux only requires acking release and ignores ack of acquire, but
FreeBSD is more stringent and will patiently wait for both to be acked.

Implement proper acking for both events.
2020-09-22 01:14:24 +02:00
Kenny Levinsen ba4c422659 seat: Use current VT for switch and ack 2020-09-22 01:14:24 +02:00
Kenny Levinsen 521d95349f terminal: Fix VT numbering on FreeBSD
FreeBSD adds one to the VT number returned by the GET_ACTIVE ioctl, so
to match things up, the wrapper here subtracted by one. This lead to
ttyv0 being named VT 0. This had the side-effect of VT numbering not
matching expectations, and switching not behaving as intended.

Align numbers with expectations, and move the required subtraction to
terminal_open, so that VT 1 matches ttyv0.
2020-09-22 01:14:24 +02:00
Kenny Levinsen 0132841987 libseat/seatd: Fix socket path bounds 2020-09-22 01:14:24 +02:00
Kenny Levinsen 884c1416b3 meson: Make default seatd socket path configurable
FreeBSD and Linux have different preferred socket locations. Expose an
option to set the location, and implement simple auto-logic for
linux/freebsd.
2020-09-22 01:14:20 +02:00
Kenny Levinsen a763e16f26 drm: Relax drm file detection, support FreeBSD
Path check was done on /dev/dri/card and /dev/dri/renderD. However,
/dev/dri/by-path is a thing, and on FreeBSD, /dev/dri/ symlinks to
/dev/drm/.

Relax Linux check to /dev/dri/, and add FreeBSD check for /dev/drm/.
2020-09-22 01:01:46 +02:00
Kenny Levinsen 6da52fff23 poller: Add unittest 2020-09-22 01:01:46 +02:00
Kenny Levinsen 6fa82930d0 libseat: Execute bg events after IPC calls
If a background event was queued during call dispatch, and no unread
data was left on the socket, there would be no incentive for the user to
call dispatch, and as a result, the events would never be executed.

Execute events at the end of IPC calls that read from the socket to
avoid stalls.
2020-09-22 01:01:46 +02:00
Kenny Levinsen 4c22c7b004 libseat: Dispatch all non-bg events on IPC call
Dispatch on IPC call only dispatched until the first message was
successfully processed. This could lead to premature dispatch
termination if a background event was received during an IPC call.

Instead, continue dispatching until a non-bg opcode is reported or an
error is received.
2020-09-22 01:01:46 +02:00
Kenny Levinsen 9c6682a831 seatd: Log on exit 2020-09-22 01:01:46 +02:00
Kenny Levinsen 695a86aaa8 seat: Reuse deactivate logic, more logging 2020-09-22 01:01:46 +02:00
Kenny Levinsen 8cb076d0a4 seat: Plug leak of deactivated fds
Only if a device had an fd and was active would an fd be closed. As
devices are deactivated early on session switch, this lead to fd
leakage.

Close fds regardless of active state.
2020-09-22 01:01:46 +02:00
Kenny Levinsen 51c7467516 seat: Rework seat activation/switch logic
The seat activation logic did not correctly handle VT switching and
switching between multiple sessions.

Session switching on VT-bound seats is now performed using a VT switch,
taking advantage of VT signals to perform the actual switch. This
simplifies switching logic and makes it more robust.
2020-09-22 01:01:46 +02:00
Kenny Levinsen d16122e98a client: Remove unnecessary active_client check 2020-09-22 01:01:46 +02:00
Kenny Levinsen 6747c5f3f8 poller: Raise signals through self-pipe
Signal handling relied on poll(2) being interrupted by signals, followed
by a check for signal handlers flagging a signal as received. This only
allowed signals that were received during poll(2) to be handled
correctly.

Implement the usual self-pipe implementation, where signal handlers
write an arbitrary byte to a polled file descriptor to ensure proper
level-triggered signal handling.
2020-09-22 01:01:46 +02:00
Kenny Levinsen fb5743971c Bump version to 0.3.0 2020-09-08 00:03:59 +02:00
Kenny Levinsen d4b1f4d449 libseat: Version the .so file 2020-09-08 00:00:48 +02:00
Kenny Levinsen 8813671486 man: Mention assistance from other contributors 2020-09-07 23:54:52 +02:00
Kenny Levinsen 047d8b284c libseat: Handle SERVER_ERROR correctly
The connection buffer position was erroneously rewinded before reading
the protocol message when the message was a SERVER_ERROR.
2020-09-07 23:35:24 +02:00
Isaac Freund 1867f29d42 meson: fix manpage generation for cross builds
We want to use the scdoc of the host system not the target system, so
pass the `native: true` parameter to meson.
2020-09-01 21:32:36 +02:00
Kenny Levinsen ad214dc3fe client: Only unlink if on the idle list 2020-09-01 02:47:03 +02:00
Kenny Levinsen 34d0c87ea8 ci: ASan smoketest on FreeBSD 2020-09-01 02:27:05 +02:00
Kenny Levinsen d53b3a87ec ci: ASan all build steps on arch 2020-09-01 02:26:53 +02:00
Kenny Levinsen 5d4036e9bd Move list removal to seat/client destroy 2020-09-01 00:33:20 +02:00
Kenny Levinsen 5b8117f3d4 client: Do not leak idle clients on exit 2020-08-31 23:13:16 +02:00
Kenny Levinsen c9ce7c71aa poller: Remember to remove sources from list 2020-08-31 22:08:59 +02:00
Kenny Levinsen 704d1ccd0b server: Remember to remove seat from list 2020-08-31 22:04:32 +02:00
Kenny Levinsen aef19fe383 test: Add test_run and test_assert macros
test_run and test_assert replaces regular assert with better logging
which include the currently running test name. The tests can now also be
built without DEBUG.
2020-08-31 14:40:58 +02:00
Kenny Levinsen 8610ec4aac Remove unused list implementation 2020-08-31 14:14:39 +02:00
Kenny Levinsen d17632fadd poller: Convert to linked_list 2020-08-31 14:09:59 +02:00
Kenny Levinsen bbfb770c73 linked_list: linked_list_take should concat lists 2020-08-31 14:09:59 +02:00
Kenny Levinsen d75b617faf server: Convert seat list to linked_list 2020-08-31 14:09:59 +02:00
Kenny Levinsen 7d88315fea poller: Make event sources opaque 2020-08-31 01:33:41 +02:00
Kenny Levinsen 8e1bf10d9d seatd: Explicit cast -1 to unsigned gid_t
Silences a warning on some architectures.
2020-08-30 23:16:47 +02:00
Kenny Levinsen c9503ef35d seatd: Slight error handling cleanup 2020-08-30 03:26:52 +02:00
Kenny Levinsen e86c9ec2b7 seatd: Remove unused device_closed msg body 2020-08-30 03:26:32 +02:00
Kenny Levinsen c36cc962e6 linked_list: Implement linked_list_take 2020-08-30 00:05:19 +02:00
Kenny Levinsen 5470c48113 seat: Destroy all clients on teardown 2020-08-29 23:49:22 +02:00
Kenny Levinsen b7b28f0628 protocol: Add note to remove device_closed msg
The content of this message is unused, so it should be converted to a
content-less message.
2020-08-29 23:12:18 +02:00
Kenny Levinsen 1ae6c3b3dd libseat: Check euid before using builtin 2020-08-29 23:01:56 +02:00
Kenny Levinsen 52fe75d5a4 libseat: Remove pointless check 2020-08-29 22:55:17 +02:00
Kenny Levinsen 98506d2ba4 libseat: Keep track of error state
Store if an error has occurred and return -1 with ENOTCONN from all
future calls, avoiding attempts to use a broken connection.
2020-08-29 22:45:01 +02:00
Kenny Levinsen 8b4d139873 libseat: Improve logging with seatd conn helpers
Add helpers around connection access to have all logging centralized and
reduce code duplication. Improve existing helpers to further reduce code
duplication.

The seatd backend should have much better logging after this.
2020-08-29 20:56:42 +02:00
Kenny Levinsen 69d57aaf33 libseat: Assert that listener is non-NULL 2020-08-29 20:29:35 +02:00
Kenny Levinsen de96b3938b Bump version to 0.2.0 2020-08-28 23:09:14 +02:00
Kenny Levinsen 6e6903829e logind: Merge PropertiesChanged handlers 2020-08-28 22:55:25 +02:00
Kenny Levinsen 74eee486fa libseat: Expand logging in all backends 2020-08-28 22:55:10 +02:00
Kenny Levinsen 1e6d4f451f libseat: Only print backend attempts for matches 2020-08-28 22:40:10 +02:00
Kenny Levinsen 27c1914625 terminal: Explain FreeBSD current_vt behavior 2020-08-28 17:46:13 +02:00
Kenny Levinsen dbdce8a54b terminal: Construct TTY paths correctly on FreeBSD
FreeBSD TTY paths are contructed in the kernel using the %r formatter,
which in this case ends up being a base 32 encoding.

The base 32 implementation is taken more or less directly from wlroots
commit fc6c0ca12e94.
2020-08-28 17:46:13 +02:00
Kenny Levinsen 60a8e809b2 terminal: FreeBSD VT num is 1 higher than tty num
This was causing all VT and TTY changes to be applied to the wrong TTY.
2020-08-28 02:54:14 +02:00
Kenny Levinsen 8e0b58f90d terminal: Set K_RAW and term raw mode on FreeBSD
Taken from X11, weston and consolekit2 ports for FreeBSD.

Setting just K_CODE as done before makes input seemingly have no ill
effects, but it is still buffered and possibly send to the terminal
after application exit if stdin is never drained. Setting raw mode
appears to be needed to solve that issue.

A K_OFF-like VT keyboard setting like Linux has would seem more
appropriate, but that is not currently available to us on FreeBSD.
2020-08-28 02:54:14 +02:00
Kenny Levinsen 4ae4793b25 simpletest: Set log level to debug 2020-08-28 01:26:39 +02:00
Simon Ser 07ceeeebe0 Introduce libseat_set_log_level
The default level is SILENT. log_init no longer takes an initial log
level (so that calls to libseat_set_log_level prior to log_init work
correctly).
2020-08-28 01:21:57 +02:00
Simon Ser 48b9bf4707 Nuke LIBSEAT_LOGLEVEL
This will be replaced with a libseat API to set the log level.
2020-08-28 01:21:57 +02:00
Simon Ser 47d4b43f1a Introduce libseat_set_log_handler
This allows libseat users to register a custom logging function.
2020-08-28 01:21:57 +02:00
Simon Ser a254fe3692 Rename enum log_level to libseat_log_level
This is preparatory work for exposing a public function to set libseat's
log handler.
2020-08-28 01:21:57 +02:00
Kenny Levinsen ab4b961492 libseat: Remove useless logind fallbacks
The logind code is based on the wlroots implementation, which in turn
contained copy-paste code from Mutter that serves no purpose here.
2020-08-24 02:55:14 +02:00
Kenny Levinsen 26aff21058 logind: Set session type from env 2020-08-23 20:13:05 +02:00
Kenny Levinsen 8ab3fc03aa logind: Remove session type check 2020-08-23 20:12:51 +02:00
Kenny Levinsen 24c66d8c08 logind: Remove useless check 2020-08-23 20:12:29 +02:00
Kenny Levinsen ff44c56ef9 meson: Set license to MIT 2020-08-22 21:47:00 +02:00
Kenny Levinsen f5bc8ab12b seatd: Use path-based chmod/chown
The fd variants do not seem to work for sockets
2020-08-08 15:27:43 +02:00
Kenny Levinsen 24e2fc7861 ci: Install scdoc for alpine and archlinux 2020-08-08 14:59:50 +02:00
Kenny Levinsen b312fbfb5e man: Add simple seatd(1) page 2020-08-08 14:54:25 +02:00
Isaac Freund 48e712ffd9 build: check for libelogind before libsystemd
elogind provides a libsystemd wrapper which is packaged by some distros.
For whatever reason using this wrapper instead of libelogind directly
causes compiler warnings to pop up. Checking for libelogind first
ensures that this wrapper is not used.
2020-08-08 14:46:14 +02:00
Kenny Levinsen e57e3e22b9 contrib: Add example systemd service 2020-08-07 16:06:00 +02:00
Kenny Levinsen a98e0c4ce9 seatd: Add command-line arguments 2020-08-07 15:50:27 +02:00
Kenny Levinsen 420f973004 ci: Run unittests on all platforms 2020-08-06 13:25:00 +02:00
Kenny Levinsen b496efa2f9 linked_list: Add unittest 2020-08-06 13:23:51 +02:00
Kenny Levinsen 7d2668e360 logind: Allow SwitchTo for all seats 2020-08-06 02:25:24 +02:00
Kenny Levinsen 0fd525e85e logind: close_device always returned error
Error handling was broken in close_device, always returning -1.

Use the return value, and add a few errno assignments while we're at it.
2020-08-06 02:25:24 +02:00
Kenny Levinsen 304489c30d libseat: Fix doc typo 2020-08-05 23:41:55 +02:00
Kenny Levinsen 3586530d81 libseat: Rename libseat_impl to seat_impl 2020-08-05 23:41:55 +02:00
Kenny Levinsen 493cc2a97d log: Remove libseat prefixes 2020-08-05 23:41:55 +02:00
Kenny Levinsen 563a932659 Remove pointless compiler.h 2020-08-05 23:20:50 +02:00
Kenny Levinsen 86efc98a5e linked_list: Assert initialized list in linked_list_empty 2020-08-04 14:25:07 +02:00
Kenny Levinsen a844d77c21 seat: Fix device double-remove 2020-08-04 02:38:05 +02:00
Kenny Levinsen 68d95e66b3 seatd: Unlink default seatd socket on startup 2020-08-04 01:44:27 +02:00
Kenny Levinsen 55cbe043e2 server: Gracefully shut down on error 2020-08-04 01:43:55 +02:00
Kenny Levinsen db36f0dfe8 client: Sanitize shutdown/kill mechanism 2020-08-04 01:43:24 +02:00
Kenny Levinsen a8204ebcea client: Tidying 2020-08-03 21:22:59 +02:00
Kenny Levinsen afc3fa4b11 seat: Enable VT process switching when switching away 2020-08-03 21:21:34 +02:00
Kenny Levinsen 98a4a4ff67 seat: Add VT cleanup on switch to empty VT
VTs were being cleaned up the active client of a VT went away, or if we
were acking a kernel VT switch request. However, no cleanup was done if
the user had reqested a session switch to a different VT.

Duplicate the VT cleanup to the VT switch condition.
2020-08-03 02:55:07 +02:00
Kenny Levinsen 250adee852 libseat: Use LIBSEAT_LOGLEVEL instead of SEATD_LOGLEVEL 2020-08-03 02:49:07 +02:00
Kenny Levinsen e25688fed6 libseat: Convert clients to linked_list 2020-08-03 02:49:04 +02:00
Kenny Levinsen fc7116ffad seat: Convert client list to linked list 2020-08-03 02:48:39 +02:00
Kenny Levinsen 9b7a12d90a seat: Convert device list to linked list 2020-08-03 02:16:21 +02:00
Kenny Levinsen 4afe674e54 linked_list: Initial implementation 2020-08-03 02:13:47 +02:00
Kenny Levinsen c35b2d2d88 server: Stack-allocate the server 2020-08-03 02:13:47 +02:00
Kenny Levinsen d68c5feaee poller: Inline the poller into the server struct 2020-08-03 02:13:22 +02:00
Kenny Levinsen 3f3bdd41dd poller: Remove unnecessary poll_impl abstraction 2020-08-03 01:15:20 +02:00
Kenny Levinsen 4f4a17a2bd libseat: Remove unused stdarg.h import 2020-08-03 00:57:34 +02:00
Kenny Levinsen 3a5c17f911 compiler: Rename erroneous header-guard 2020-08-03 00:57:20 +02:00
Kenny Levinsen 9d2e63d090 terminal: Remove unused prototypes 2020-08-03 00:56:38 +02:00
Kenny Levinsen 6d031426aa list: Make list_concat argument const 2020-08-03 00:56:27 +02:00
Kenny Levinsen a003e92600 client: Prefix notification methods with 'send' 2020-08-03 00:56:10 +02:00
Kenny Levinsen 3e301b8e70 libseat: Use symbol file instead of -fvisibility 2020-08-03 00:54:55 +02:00
Kenny Levinsen b2cbe576d1 seat: Deactivate devices before sending disable
Previously, seatd would not deactivate devices until the client had
acked the disable. In once instance, this lead to libinput spending
significant time checking and closing each input device.

As a workaround, mimick logind's behavior of deactivating devices first.
The original behavior can be reintroduced if the client-side problem is
fixed.

Closes: https://todo.sr.ht/~kennylevinsen/seatd/5
2020-08-02 21:46:13 +02:00
Kenny Levinsen 5b4d00d6cf list: Add list_pop_back 2020-08-02 21:46:13 +02:00
Kenny Levinsen b751481e5c seat: Open/close tty on activation/deactivation
The VT and KD ioctl's are picky about the tty fd used. In order to
satisfy these, and to improve state cleanup, we now only and store the
current tty when opening a client, and use this fd to perform teardown
later. The presence of the fd is also used to signal that teardown is
needed.
2020-08-02 21:46:10 +02:00
Kenny Levinsen b731b18e0a terminal: Correctly set K_ON on keyboard enable 2020-08-02 17:47:34 +02:00
Kenny Levinsen eace556aa8 log: Fix inverted loglevel check 2020-08-02 17:46:46 +02:00
Kenny Levinsen ce6ab30d5a seat: Fix seat_device->fd assert 2020-08-01 23:13:54 +02:00
Kenny Levinsen d26466bf3b Remove ALWAYS_INLINE
Didn't do what I wanted it to anyway.
2020-08-01 23:13:54 +02:00
Kenny Levinsen 2be0826959 connection: Shrink buffers from 1KB to 256B each 2020-08-01 23:13:44 +02:00
Kenny Levinsen 7252558689 Add platform support note to README 2020-08-01 17:18:53 +02:00
Kenny Levinsen 6f6f5de154 seatd: Perform clean server shutdown 2020-08-01 17:02:28 +02:00
Kenny Levinsen 957483fde5 ci: Add completion print to smoketest 2020-08-01 17:02:28 +02:00
Kenny Levinsen 9f5fcec874 ci: Add Alpine/FreeBSD builtin smoketest 2020-08-01 16:53:44 +02:00
Kenny Levinsen 509e64a341 simpletest: Take file to open as argument 2020-08-01 16:53:44 +02:00
Kenny Levinsen 2462284dc5 ci: Add FreeBSD 2020-08-01 16:53:44 +02:00
Kenny Levinsen 56947d530e FreeBSD compiler warning fix 2020-08-01 16:53:44 +02:00
Kenny Levinsen 2f54beb5fe client: Implement get_peer for FreeBSD 2020-08-01 16:53:44 +02:00
Kenny Levinsen e129536a08 devices: Use path to check device type
FreeBSD device numbers cannot be used to check the type of a device, as
they are merely unique filesystem IDs.

As the paths we use have been sanitized with realpath, we can simply use
the path to check if a requested file is an evdev or drm device. This
also allows us to make the check before the file is opened.
2020-08-01 16:53:44 +02:00
Kenny Levinsen dc9c7bff71 devices: FreeBSD support in drm and evdev code 2020-08-01 16:53:44 +02:00
Kenny Levinsen 956a378adb log: Avoid unnecessary GNU extension 2020-08-01 16:53:44 +02:00
Kenny Levinsen c5c036531c terminal: FreeBSD VT and KD handling 2020-08-01 16:53:44 +02:00
Kenny Levinsen f754198c5b meson: FreeBSD options 2020-08-01 02:37:26 +02:00
Kenny Levinsen 554898e6b3 meson: Set _FORTIFY_SOURCE=2 for optimized builds 2020-07-31 16:03:49 +02:00
Kenny Levinsen 85860e4e7c seat: Use PATH_MAX long array for realpath 2020-07-31 15:58:19 +02:00
Kenny Levinsen 9d08511da4 meson: Add summary printout 2020-07-31 14:19:41 +02:00
Kenny Levinsen 1d188d2f09 seat: remove_client return value was inverted 2020-07-31 13:29:05 +02:00
Kenny Levinsen 6a01725294 Add LICENSE 2020-07-31 01:34:04 +02:00
Kenny Levinsen 8656607b92 Update README 2020-07-31 01:32:29 +02:00
Kenny Levinsen 1dbd920307 ci: Initial CI 2020-07-31 00:23:15 +02:00
Kenny Levinsen 3b32bd539b Add clang format specification 2020-07-31 00:23:03 +02:00
Kenny Levinsen 61716a2c77 Initial implementation of seatd and libseat 2020-07-31 00:22:18 +02:00
Kenny Levinsen f85434de66 Initial commit 2020-06-26 01:50:30 +02:00

Diff Content Not Available