2
0
mirror of git://github.com/lxc/lxc synced 2025-09-05 04:49:33 +00:00

conf: fix block-device based rootfs mounting

Fixes: #3598
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2020-12-14 17:52:44 +01:00
parent af9dd246df
commit 6e8b98aaf8

View File

@@ -3134,6 +3134,10 @@ int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, const char *name,
if (ret < 0)
return log_error(-1, "Failed to bind mount container / onto itself");
conf->rootfs.mntpt_fd = openat(-EBADF, path, O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_PATH | O_NOCTTY);
if (conf->rootfs.mntpt_fd < 0)
return log_error_errno(-errno, errno, "Failed to open file descriptor for container rootfs");
return log_trace(0, "Bind mounted container / onto itself");
}