tmpfiles: allow major or minor 0 in b and c entries

An entry for a device with a 0 in its number was skipped:

    c /dev/tty 0666 root tty - 5:0

parse_mm() took 0 to mean atoi() could not read the number.

Use atonum(), which tells the two apart.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 18:03:31 +01:00
1 parent adf7080fca
commit 777ecd77c8
3 files changed
+11 -19

No files matched your search

+2
View File
@@ -272,6 +272,8 @@ All relevant changes are documented in this file.
- Fix mode and owner of tmpfiles entries that ignored them: an `f` entry for
a file that exists, the owner of `p`, `b`, and `c` entries, and both for
`C`, `z`, and `Z` entries
- Fix tmpfiles `b` and `c` entries for a device with major or minor 0,
like `5:0` for `/dev/tty`, they were skipped as invalid
- Fix age `0` in a tmpfiles entry, it was read as no age. As in
tmpfiles.d(5), `tmpfiles --clean` now empties the directory of such an
entry