From becd5538e66a5437a661ca1c77580c8c1766b733 Mon Sep 17 00:00:00 2001 From: Alexander Mikhalitsyn Date: Wed, 2 Apr 2025 10:52:16 +0200 Subject: [PATCH] lxc/conf: handle rootfs open_at error in lxc_mount_rootfs If LXC build is misconfigured, for instance, --prefix=/ and /lib is a symlink to /usr/lib then open_at always fails to open rootfs. Let's add error print to make it easier to figure out this. Signed-off-by: Alexander Mikhalitsyn --- src/lxc/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 1410ebe54..f711d95b7 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1247,7 +1247,7 @@ static int lxc_mount_rootfs(struct lxc_rootfs *rootfs) rootfs->dfd_mnt = open_at(-EBADF, rootfs->mount, PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (rootfs->dfd_mnt < 0) - return -errno; + return log_error_errno(-1, errno, "Failed to open rootfs \"%s\"", rootfs->mount); return log_trace(0, "Container uses separate rootfs. Opened container's rootfs"); } -- 2.47.2