]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/conf-parser: use chase() in config_parse_many_files()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Feb 2024 21:29:56 +0000 (22:29 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 7 Mar 2024 17:49:44 +0000 (18:49 +0100)
commitd8a91c6b9f64017abfefbbf7da0daed590de372a
treede505554b6565bba9cea4bd4b69aa2503181da38
parent9bc7493098a9b2cfc044e07be6d2690a2be99e13
shared/conf-parser: use chase() in config_parse_many_files()

The function was partially implementing chroot lookups. It would be given
file names that were prefixed with the chroot, so it would mostly work.
But if any of those files were symlinks, fopen() would do the wrong thing.

Also we don't need locking.

So give 'root' as the argument and use chase_and_fopen_unlocked() to get
proper chroot-aware lookups.

The only place where config_parse_many() is called with root is is repart.c.
So this is a follow-up for e594a3b154bd06c535a934a1cc7231b1ef76df73 and
34f2fd5096cdb26ef57998740b1b876332d968fc.
src/shared/conf-parser.c
src/shared/conf-parser.h