ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
ac3a84
From 2bd9f97275480842c99117123daab69cbb8f45f4 Mon Sep 17 00:00:00 2001
ac3a84
From: Lennart Poettering <lennart@poettering.net>
ac3a84
Date: Fri, 2 Dec 2022 23:50:57 +0100
ac3a84
Subject: [PATCH] chase-symlink: when converting directory O_PATH fd to real
ac3a84
 fd, don't bother with /proc/
ac3a84
ac3a84
Replaces: #25581
ac3a84
(cherry picked from commit 2075b6dd394e09a0f203b9cc7e3253908397f933)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 src/basic/chase-symlinks.c | 2 +-
ac3a84
 1 file changed, 1 insertion(+), 1 deletion(-)
ac3a84
ac3a84
diff --git a/src/basic/chase-symlinks.c b/src/basic/chase-symlinks.c
ac3a84
index afab54f067..ac55311f4d 100644
ac3a84
--- a/src/basic/chase-symlinks.c
ac3a84
+++ b/src/basic/chase-symlinks.c
ac3a84
@@ -471,7 +471,7 @@ int chase_symlinks_and_opendir(
ac3a84
                 return r;
ac3a84
         assert(path_fd >= 0);
ac3a84
 
ac3a84
-        d = opendir(FORMAT_PROC_FD_PATH(path_fd));
ac3a84
+        d = xopendirat(path_fd, ".", O_NOFOLLOW);
ac3a84
         if (!d)
ac3a84
                 return -errno;
ac3a84