conf-files: add support for root_fd based operation

Let's make sure we can safely load configuration files based on a root
fd, including XAT_FDROOT.

(While we are at it, always pass path to root fs before fd to root fs,
following our recently updated CODING_STYLE)
This commit is contained in:
Lennart Poettering
2026-01-25 20:51:50 +01:00
parent 17ade5b2af
commit 6ecfa12af0
19 changed files with 249 additions and 100 deletions
+2 -1
View File
@@ -543,11 +543,12 @@ int transfer_read_definition(Transfer *t, const char *path, const char **dirs, H
if (r < 0)
return log_error_errno(r, "Failed to extract filename from path '%s': %m", path);
r = config_parse_many(
r = config_parse_many_full(
STRV_MAKE_CONST(path),
dirs,
strjoina(filename, ".d"),
arg_root,
/* root_fd= */ -EBADF,
"Transfer\0"
"Source\0"
"Target\0",