From c67abc9c43d2761af9f58df57eeee96b0f045f98 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 16 Jan 2026 17:55:47 +0100 Subject: [PATCH] chase: extend coverage of the root fd shortcut Let's use dir_fd_is_root() to check if we are looking at the real root fs. --- src/basic/chase.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/basic/chase.c b/src/basic/chase.c index 323e462375..f360cc26a3 100644 --- a/src/basic/chase.c +++ b/src/basic/chase.c @@ -220,7 +220,10 @@ int chaseat(int dir_fd, const char *path, ChaseFlags flags, char **ret_path, int */ _cleanup_close_ int _dir_fd = -EBADF; - if (dir_fd == XAT_FDROOT) { + r = dir_fd_is_root(dir_fd); + if (r < 0) + return r; + if (r > 0) { /* Shortcut the common case where no root dir is specified, and no special flags are given to * a regular open() */