tmpfiles: fix crash with NULL in arg_root and other fixes and tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Dec 2018 22:05:48 +0000 (23:05 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Dec 2018 08:56:51 +0000 (09:56 +0100)
commit082bb1c59bd4300bcdc08488c94109680cfadf57
tree5d0acf2bdc803e23c2389751ce676db655e7d648
parentfcfb1f775ed0e9d282607bb118ba788b98952855
tmpfiles: fix crash with NULL in arg_root and other fixes and tests

The function to replacement paths into the configuration file list was borked.
Apart from the crash with empty root prefix, it would incorrectly handle the
case where root *was* set, and the replacement file was supposed to override
an existing file.

prefix_root is used instead of path_join because prefix_root removes duplicate
slashes (when --root=dir/ is used).

A test is added.

Fixes #11124.
src/basic/conf-files.c
src/test/test-conf-files.c