Revert "chase: invert CHASE_NO_AUTOFS and only set it where needed"

This reverts commit 490aa05ca1.

As commented https://github.com/systemd/systemd/pull/38569#discussion_r2284978273,
the commit makes autofs check bypassed. Before the commit, when
CHASE_NO_AUTOFS is set, we did not shortcut chasing paths, and refused
any autofs mount points in the path. However, with the commit, the flag
was swapped but even when CHASE_AUTOFS is unset, the autofs check may be
skipped.

To fix the issue, rather than swapping the flag, we should introduce
another flag, say CHASE_TRIGGER_AUTOFS. This revert the commit, and in a
later commit, the new flag will be introduced.
This commit is contained in:
Yu Watanabe
2025-08-20 02:15:36 +09:00
parent 1441f2e992
commit 2e7d7e929e
19 changed files with 59 additions and 75 deletions
+3 -3
View File
@@ -3079,7 +3079,7 @@ static int setup_exec_directory(
* since they all support the private/ symlink logic at least in some
* configurations, see above. */
r = chase(target, NULL, CHASE_AUTOFS, &target_resolved, NULL);
r = chase(target, NULL, 0, &target_resolved, NULL);
if (r < 0)
goto fail;
@@ -3090,7 +3090,7 @@ static int setup_exec_directory(
}
/* /var/lib or friends may be symlinks. So, let's chase them also. */
r = chase(q, NULL, CHASE_NONEXISTENT|CHASE_AUTOFS, &q_resolved, NULL);
r = chase(q, NULL, CHASE_NONEXISTENT, &q_resolved, NULL);
if (r < 0)
goto fail;
@@ -3985,7 +3985,7 @@ static int apply_working_directory(
r = chase(wd,
runtime->ephemeral_copy ?: context->root_directory,
CHASE_PREFIX_ROOT|CHASE_AT_RESOLVE_IN_ROOT|CHASE_AUTOFS,
CHASE_PREFIX_ROOT|CHASE_AT_RESOLVE_IN_ROOT,
/* ret_path= */ NULL,
&dfd);
if (r >= 0)