From 82947017bf235cef0d939346f72580cfecd3878a Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 2 Nov 2026 16:08:23 +0100 Subject: [PATCH] repart: open the populated tree via xopenat() The manifest generation from f4bff983b267 ("repart: optionally write UAPI.16 manifests of populated partitions and of the partition table") was merged after the move to the xopenat() family. It opens the populated tree with a direct open() call. Let's use xopenat() like the rest of repart. --- src/repart/repart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/repart/repart.c b/src/repart/repart.c index d28125db58b..3b2588454ba 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -7601,9 +7601,9 @@ static int partition_manifest_write(Context *context, Partition *p, const char * log_info("Generating manifest of %s filesystem.", p->format); - _cleanup_close_ int dir_fd = open(root, O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW); + _cleanup_close_ int dir_fd = xopenat(AT_FDCWD, root, O_DIRECTORY|O_NOFOLLOW); if (dir_fd < 0) - return log_error_errno(errno, "Failed to open populated tree '%s': %m", root); + return log_error_errno(dir_fd, "Failed to open populated tree '%s': %m", root); _cleanup_close_ int dup_fd = fcntl(p->manifest_fd, F_DUPFD_CLOEXEC, 3); if (dup_fd < 0)