mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: do not truncate the file of a w entry
A w entry empties the file before it writes the argument. With a file
that holds "abcdef":
w /tmp/file - - - - XY
leaves "XY". With systemd-tmpfiles the file holds "XYcdef", it writes
over the start of what is there. For a file in /proc or /sys there is
no difference.
Open the file without O_TRUNC.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+26
-7
No files matched your search
@@ -39,7 +39,4 @@ Missing options: `--root`, `--replace`, `--purge`, `--graceful`, and
|
||||
by that age, the age is not read
|
||||
* The `%T` and `%V` specifiers are always `/tmp` and `/var/tmp`, they
|
||||
do not look at `$TMPDIR`
|
||||
* A `w` entry truncates the file, systemd writes over the start of
|
||||
what is there. It only matters for a regular file, not in `/proc`
|
||||
or `/sys`
|
||||
* `mksubsys()` in `src/util.c` is unused
|
||||
Reference in new issue
Block a user