pid1,vconsole-setup: lock /dev/console instead of the tty device

As requested in https://github.com/systemd/systemd/pull/27867#pullrequestreview-1567161854.
/dev/console, /dev/tty0, and /dev/ttyN are "different" device nodes
that may point to a single underlying device. We want to use a single
lock so that we don't get a race if different writers are using a different
device path, so let's just always lock around /dev/console.
This effectively makes the locking less granular.

Fixup for a0043bfa51.
Fixes https://github.com/systemd/systemd/issues/28721.
Maybe fixes https://github.com/systemd/systemd/issues/28778 and
https://github.com/systemd/systemd/issues/28634.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-10-19 18:03:21 +01:00
committed by Luca Boccassi
parent a2dd592002
commit af189d7b50
4 changed files with 47 additions and 21 deletions
+2
View File
@@ -3,6 +3,8 @@
#include <sys/types.h>
int lock_dev_console(void);
int dev_setup(const char *prefix, uid_t uid, gid_t gid);
int make_inaccessible_nodes(const char *parent_dir, uid_t uid, gid_t gid);