Blame SOURCES/0187-mount-point-honour-AT_SYMLINK_FOLLOW-correctly.patch

a3e2b5
From 24e6a5d1deac8aae11a6a3a22fb9b71cb77fdb33 Mon Sep 17 00:00:00 2001
a3e2b5
From: Lennart Poettering <lennart@poettering.net>
a3e2b5
Date: Sat, 8 Dec 2018 20:21:43 +0100
a3e2b5
Subject: [PATCH] mount-point: honour AT_SYMLINK_FOLLOW correctly
a3e2b5
a3e2b5
Fixes: #11092
a3e2b5
(cherry picked from commit be24321f3dae91a166166b239954032727439942)
a3e2b5
a3e2b5
Resolves: #1683319
a3e2b5
---
a3e2b5
 src/basic/mount-util.c | 2 +-
a3e2b5
 1 file changed, 1 insertion(+), 1 deletion(-)
a3e2b5
a3e2b5
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
a3e2b5
index ebe41a4c6c..3670b7f591 100644
a3e2b5
--- a/src/basic/mount-util.c
a3e2b5
+++ b/src/basic/mount-util.c
a3e2b5
@@ -109,7 +109,7 @@ static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id
a3e2b5
         if ((flags & AT_EMPTY_PATH) && isempty(filename))
a3e2b5
                 xsprintf(path, "/proc/self/fdinfo/%i", fd);
a3e2b5
         else {
a3e2b5
-                subfd = openat(fd, filename, O_CLOEXEC|O_PATH);
a3e2b5
+                subfd = openat(fd, filename, O_CLOEXEC|O_PATH|(flags & AT_SYMLINK_FOLLOW ? 0 : O_NOFOLLOW));
a3e2b5
                 if (subfd < 0)
a3e2b5
                         return -errno;
a3e2b5