summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-12-03 17:06:06 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-02-09 17:57:41 +0100
commitec3917d2825a32ac14eec209e53c6c6d6cd2b0da (patch)
tree4cb864ec587e8b03d221a6de6daba4225fb2102b /src/tmpfiles
parentsysusers: convert to conf_file_read() (diff)
downloadsystemd-ec3917d2825a32ac14eec209e53c6c6d6cd2b0da.tar.xz
systemd-ec3917d2825a32ac14eec209e53c6c6d6cd2b0da.zip
tmpfiles,sysusers: rework path argument handling
Previously, if given an absolute path, we would open the file, but when given a relative path, we'd attempt to search the directories. If the user wants to open a file from the search path, allowing paths is very confusing. E.g. with a path like 'sysusers/foo.conf', we'd try to open '/etc/sysusers.d/sysusers/foo.conf', '/run/sysusers.d/sysusers/foo.conf', …, and with '../foo.conf', we'd try to open '/etc/sysusers.d/../foo.conf', '/run/sysusers.d/../foo.conf', …. This just isn't useful, and in fact for a scheme like sysusers.d and tmpfiles.d where there we have a flat directory with config files, only searching for plain names can result in success. When a user specifies a relative path, it's more likely that they wanted to open some local file. OTOH, to correctly open a local file, e.g. one that they're just writing, this interface is also awkward, because something like '$PWD/file.conf' has to be used to open a file with a relative path. This patch changes the interface so that any path (i.e. an argument with "/") is used to open a file directly, and only plain basenames are used for searching. (Note that tpmfiles and sysusers are somewhat special here: their "config files" make sense without the other config and users are likely to want to test them without the other config. I was trying to do just that when writing a spec file for a package and attempting to convert the existing scripts to sysusers and tmpfiles. The same logic wouldn't apply for example to units or udev rules, because they generally can only be interpreted with the whole rest of config also available.)
Diffstat (limited to 'src/tmpfiles')
0 files changed, 0 insertions, 0 deletions