From 6579bfb92a32641ea97ec0e0ee0e68a64c3cc2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sj=C3=B6lund?= Date: Fri, 25 Oct 2024 19:01:15 +0200 Subject: [PATCH] writer: Add O_DIRECTORY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Erik Sjölund --- libcomposefs/lcfs-writer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcomposefs/lcfs-writer.c b/libcomposefs/lcfs-writer.c index e5e89ed..726eba4 100644 --- a/libcomposefs/lcfs-writer.c +++ b/libcomposefs/lcfs-writer.c @@ -1508,7 +1508,7 @@ struct lcfs_node_s *lcfs_build(int dirfd, const char *fname, int buildflags, return node; } - dfd = openat(dirfd, fname, O_RDONLY | O_NOFOLLOW | O_CLOEXEC, 0); + dfd = openat(dirfd, fname, O_DIRECTORY, O_RDONLY | O_NOFOLLOW | O_CLOEXEC, 0); if (dfd < 0) { errsv = errno; goto fail;