conf: fix block-device based rootfs mounting

Fixes: #3598 Cc: stable-4.0 Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent af9dd246
...@@ -3134,6 +3134,10 @@ int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, const char *name, ...@@ -3134,6 +3134,10 @@ int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, const char *name,
if (ret < 0) if (ret < 0)
return log_error(-1, "Failed to bind mount container / onto itself"); 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"); return log_trace(0, "Bind mounted container / onto itself");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment