]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-files: CHASE_MUST_BE_DIRECTORY can be set with CHASE_NONEXISTENT 38390/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 28 Jul 2025 18:36:36 +0000 (03:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 28 Jul 2025 18:40:34 +0000 (03:40 +0900)
With the previous commit, now CHASE_MUST_BE_DIRECTORY can be set with
CHASE_NONEXISTENT. Let's unconditionally set the flag to chase the
directory part of the conf file.

src/basic/conf-files.c

index b1b0c746376c19b33c1071a1ab641a694d3663e3..c00325f2e4443e1ffb66637726d3780d8bd4a12a 100644 (file)
@@ -145,7 +145,9 @@ int conf_file_new_at(const char *path, int rfd, ChaseFlags chase_flags, ConfFile
                 return log_debug_errno(r, "Failed to extract directory from '%s': %m", path);
         if (r >= 0) {
                 r = chaseat(rfd, dirpath,
-                            CHASE_AT_RESOLVE_IN_ROOT | (FLAGS_SET(chase_flags, CHASE_NONEXISTENT) ? CHASE_NONEXISTENT : CHASE_MUST_BE_DIRECTORY),
+                            CHASE_AT_RESOLVE_IN_ROOT |
+                            CHASE_MUST_BE_DIRECTORY |
+                            (FLAGS_SET(chase_flags, CHASE_NONEXISTENT) ? CHASE_NONEXISTENT : 0),
                             &resolved_dirpath, /* ret_fd = */ NULL);
                 if (r < 0)
                         return log_debug_errno(r, "Failed to chase '%s%s': %m", empty_to_root(root), skip_leading_slash(dirpath));