tmpfiles: add the : and ~ prefixes for mode, user, and group

A mode with a prefix was not read as a number, so the entry was taken
to have no mode, and a user with one was looked up with the colon in
the name, which skipped the entry:

    d /var/lib/app :0750 :app :app

With : the mode, user, or group is only set on a path the entry
creates, an existing one keeps what it has.  With ~ the mode loses
read, write, or execute when no one has that on the existing path,
and setuid, setgid, and sticky when it is not a directory.

Mode and owner now go through perm_set() in tmpfiles, which knows the
entry created the path or not.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 18:02:37 +01:00
1 parent a726aff30b
commit ec67ecc805
4 files changed
+132 -32

No files matched your search

+3
View File
@@ -15,6 +15,9 @@ All relevant changes are documented in this file.
skipped unless the new `--boot` option is given. Finit gives it at
boot, and now also `--remove`, so `r`, `R`, and `D` entries take effect
at boot and no longer need a separate call
- tmpfiles: add the `:` prefix for mode, user, and group, to set them only
on a path the entry creates, and the `~` prefix for the mode, to drop
read, write, or execute where the existing path has it for no one
- tmpfiles: the `x` and `X` entries now keep paths from being cleaned by
`tmpfiles --clean`, before they were read and ignored
- tmpfiles: add the `a`, `a+`, `A`, and `A+` entries for POSIX ACLs, used