[lxc-devel] [lxd/master] Fix unix device removal (bad cgroup.deny entry)

stgraber on Github lxc-bot at linuxcontainers.org
Fri Mar 24 02:50:59 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 490 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170324/108f1d85/attachment.bin>
-------------- next part --------------
From 18c72551a2dcbd75756a83e78d1c09dcbefc6858 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 23 Mar 2017 22:50:03 -0400
Subject: [PATCH] Fix unix device removal (bad cgroup.deny entry)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This got fixed in the insert function a little while back, but the
matching code in the remove function was missed.

Closes #3107

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/container_lxc.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 5267c1a..565c0fe 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -5464,8 +5464,10 @@ func (c *containerLXC) removeUnixDevice(m types.Device) error {
 	}
 
 	dType := ""
-	if m["type"] != "" {
-		dType = m["type"]
+	if m["type"] == "unix-char" {
+		dType = "c"
+	} else if m["type"] == "unix-block" {
+		dType = "b"
 	}
 
 	if dType == "" || dMajor < 0 || dMinor < 0 {


More information about the lxc-devel mailing list