[lxc-devel] [lxc/master] start: pin rootfs when privileged

brauner on Github lxc-bot at linuxcontainers.org
Mon May 15 22:43:21 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170515/9f85dde3/attachment.bin>
-------------- next part --------------
From 0ee3505984e5f7b63fa8ee6351af8b6638f5ff36 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 16 May 2017 00:42:30 +0200
Subject: [PATCH] start: pin rootfs when privileged

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/start.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index 3963a40..f1b3f8e 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1153,7 +1153,7 @@ static int lxc_spawn(struct lxc_handler *handler)
 	 * it readonly.
 	 * If the container is unprivileged then skip rootfs pinning.
 	 */
-	if (wants_to_map_ids) {
+	if (!wants_to_map_ids) {
 		handler->pinfd = pin_rootfs(handler->conf->rootfs.path);
 		if (handler->pinfd == -1)
 			INFO("Failed to pin the rootfs for container \"%s\".", handler->name);


More information about the lxc-devel mailing list