]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/portable/portable.c
portabled: create temp file for unit, not directory
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 23 Jun 2020 14:56:33 +0000 (15:56 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Jun 2020 16:40:19 +0000 (18:40 +0200)
commit6d88513e6b4fe36f59d3c5702a22ab796dea7852
treea9b2bc5344dd6add6dd646e95ec7fb81c4d3de75
parent823e917f13ea813635b0f9f14e2cc8aabc6d6a75
portabled: create temp file for unit, not directory

open_tmpfile_linkable is used to create a temporary file in the same
directory as the target, but portabled uses the name of the parent
directory instead of the file it intends to create.
In other words, it creats a tmp for /etc/systemd/system.attached instead
of /etc/systemd/system.attached/foo.service.
It still works because it's later moved in the right place.
But as a side effect, it tries the create the file in the parent directory
which is /etc/systemd, and it case of read-only filesystems it fails.
src/portable/portable.c