From 56e33e234eeddc693893768ca1e526b59a560186 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcomposefs/lcfs-writer.c b/libcomposefs/lcfs-writer.c index e5e89ed..e7bf1eb 100644 --- a/libcomposefs/lcfs-writer.c +++ b/libcomposefs/lcfs-writer.c @@ -1508,7 +1508,8 @@ 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;