Skip to content

Commit 90f1515

Browse files
mattsu2020sylvestre
authored andcommitted
utmpx: read validated Linux files with bounded lock waits
1 parent ed6eb51 commit 90f1515

3 files changed

Lines changed: 470 additions & 82 deletions

File tree

‎docs/src/platforms.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Platform support
22

33
<!-- markdownlint-disable MD033 MD060 -->
4+
<!-- spell-checker:ignore logind -->
45

56
uutils aims to be as "universal" as possible, meaning that we try to support
67
many platforms. However, it is infeasible for us to guarantee that every
@@ -45,3 +46,16 @@ Note that for some utilities, not all functionality is supported on each
4546
platform. This is documented per utility.
4647

4748
{{ #include platform_table.md }}
49+
50+
## Linux traditional login records
51+
52+
The traditional Linux reader opens utmp without waiting for FIFO writers,
53+
checks that the opened file is regular, and reads from that same file descriptor.
54+
Replacing the path with a FIFO after opening therefore cannot redirect its reads.
55+
Waiting for record locks has a shared ten-second budget per iterator. Exhausting
56+
that budget ends iteration without reading unlocked data. As with other utmp
57+
read errors, the iterator does not report an error separately from end of file.
58+
The selected path is retained across successive iterators.
59+
With the `systemd_logind` feature enabled, the default path selects systemd;
60+
custom paths select traditional files, including for subsequent iterators.
61+
Selecting the default path explicitly switches back to systemd.

0 commit comments

Comments
 (0)